question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support floating point differences between .NET Framework and Core

See original GitHub issue

Tangentially related to #27688 we might consider some solution to use separate recordings for .NET Framework and .NET (Core) in cases e.g., floats are serialized differently. Pavel and I had looked into other solutions including what a .NET team themselves was doing, but the only viable solution (without refactoring a bunch of production code) wasn’t exactly rock solid (JSON decoder that heuristically assumes a certain rounding and precision of floats). @m-nash had an idea to use separate files, though.

As one idea, we could add a property to RecordedTestBase to support this somehow. Most simplistically is just a bool to pivot on .NET Framework vs. .NET but perhaps we can go a little further and support other pivots. What we would ideally have to figure out is how to handle which platforms need to record tests. Currently, I believe this is done manually by the SDK dev. For example, when I re-record tests I only do so for the latest target e.g., net6.0. Using the pivot, could we just let SDK devs run all (in record mode) and figure out for which platforms we actually need to run / record?

/cc @JoshLove-msft @christothes

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:20 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
JoshLove-msftcommented, Jan 4, 2023

Mitigated sure, but I don’t think it means we should record all targets by default. We could have an attribute that can be applied as needed.

0reactions
heathscommented, Jan 5, 2023

That said, this wasn’t even about parallelism. Floating point de/serialization differs across .NET Framework and .NET nee, “Core”. Recording separate files was one way, but I probably shouldn’t have made the title suggest it was the only way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

float handling differences between .NET Core and ...
Computer floating-point (including but not limited to float , double , and even decimal ) math does not work like normal math.
Read more >
net core 3 yields different floating point results from version ...
Here is a sample piece of code with outputs from .net core 2.2 and 3.1. It shows different computational results for a basic...
Read more >
Floating-Point Parsing and Formatting improvements in . ...
NET Core 2.1 release, we were making iterative improvements to the floating-point parsing and formatting code in .NET Core. Now, in .
Read more >
Floating-point numeric types - C# reference
All floating-point numeric types support arithmetic, comparison, and equality operators. Characteristics of the floating-point types. C# ...
Read more >
Core .NET libraries breaking changes in .NET Core 1.0-3.0
The following figure illustrates the difference in version ... NET Core 3.0, floating-point parsing and formatting operations are IEEE ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found