Stop optimizing under the assumption of default denormal behavior
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.2k
- PR merge metrics
- PR metrics pending
Description
On some platforms (QNX on Arm comes to mind, but there are probably others) flush-to-zero and denormals-are-zero are turned on by default and cannot be disabled. Furthermore, PipeWire turns on FTZ and DAZ because it is the only way to get realtime behavior (otherwise, denormals are handled by microcode assists or traps that are far too slow).
Right now, this means that one cannot use Rust for realtime code that performs floating point operations, which I think is silly. Instead, I think Rust should treat compile-time operations on floating-point numbers as partial functions. When a denormal or NaN is hit, Rust should defer the operation until runtime, when the actual behavior is known.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file, test, or entry point is named. Start by clarifying how Rust currently handles compile-time floating-point operations and the proposed denormal/NaN deferral, then define tests covering the requested behavior on affected platforms; done means the behavior is specified and validated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100