fix: bits_float quiets signalling NaNs on every Python version (3.14 keeps them) #238
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/238"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from LooperSalty/AnyXboxX. Originally posted by lcg007xd-c on 2026-11-25T20:46:16Z.
Change
The reference interpreter relies on CPython quieting a signalling f32 NaN when
struct.unpack("<f")widens it to a double (_first_naninemu/rdna2_exec_ops.py: "déjà rendu silencieux par la conversion en double"). CPython 3.14 no longer does: it keeps the signalling bit throughstruct. Measured with the same one-liner (struct.unpack("<f", struct.pack("<I", 0x7F800001)), thenstruct.pack("<f", …)):So on Python 3.14,
main(4f2cf5c) fails 4 FMA tests: the FMA returns the signalling NaN instead of the quiet one.Now
bits_floatsets bit 22 itself when the pattern is a NaN, so every Python version follows the rule that the 3.12 CI already checks against the GPU. Infinities, quiet NaNs and ordinary values are unchanged. Nothing changes on 3.12 or 3.13.Linked issue: none.
Verification
Linux (Arch), no C++ runtime, no GPU (the runtime and GPU tests skip):
The 2 remaining failures are
tests/test_jour_j.py(manifest name case on Linux, fixed separately in #237), the same on both versions.Not run: the Windows CI job and the GPU/WARP parity tests (no HLSL change).
Oracle and test data
test_signalling_nan_operands_come_back_quiet_on_every_python(tests/test_rdna2_exec_fma.py): signalling NaNs of both signs and the largest payload come back with bit 22 set; a quiet NaN, ±infinity and 1.0 are unchanged.tests/test_rdna2_exec_fma.pyhas 7 failures (the 4 above and 3 of the new cases). On 3.12 the new test also passes without the change, because 3.12 already quiets.Checklist
E_NOTIMPL), never a fake success.test_readme_sync.pychecks it). (No README change; still1300+.)Made with AI assistance (Claude Code).
🤖 Generated with Claude Code