I am using a debug build and obtaining different results on the same machine whether I run under the debugger or not. I am using the excellent TestDriven.Net to run the unit tests.
- "run" with TestDriven.Net or the external NUnit runner produces the same result
- "run with debugger" with TestDriven.Net produces different results
The code is
- A complex iterative mesh deformation routine involving significant computation at the limits of floating point precision
- C#, VS2012 targeting .Net 3.5.
- Single threaded
- Only debug build, no release version has been built
- Same machine, no powersaving\speedstep or other feature I am aware of
- Vanilla C# - No unsafe code, unmanaged libraries, platform invoke etc.
- No debugger checks in code or strange third-party libraries
I have not tracked back to the first difference (tricky without a debugger!) but given how iterative the code is, its input sensitive and the tiniest difference will grow to significant proportions given enough time.
I am aware of how fragile fp reproducibility is across compilers, platforms and architectures but disappointed to find the debugger is one of the factors to throw this off.
Do I have just have to accept this as a fact of life or is there any advice you can offer?