Repository navigation
tests/semantic: generated NaNs are the x86 default NaN on every host (ARM64 failures) - #4069
Tom1419-git wants to merge 1 commit into
Conversation
The measured words pinned in the semantic tests use 0xFFC00000 for a NaN made from non-NaN operands (inf - inf, 0 * inf). The interpreter left that sign to the host CPU, so 30 rows in test_alu_vop3_mods_hw and test_alu_sdwa_hw failed on ARM64 (Apple Silicon), where the host gives 0x7FC00000. ieee_nan() makes the sign explicit for OpFAdd, OpFSub, OpFMul and fma_f32. x86-64 results are unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Independent Windows x86-64 Python check of 8acce97 against aa2988c. Both revisions returned 0xffc00000 for FMA with zero times infinity and with infinity plus negative infinity. Both preserved 0x7fc12345 and 0xffc12345 when those quiet NaNs were inputs. To exercise the normalization directly, I supplied a positive NaN result from non-NaN operands to the new helper and observed 0xffc00000. This confirms the tested x86-64 behavior. ARM64 execution is covered by the author's reported run, which I did not repeat. AI-assisted. |
|
Overlap note: #4100 (@AirKyzzZ) makes the same change in AI-assisted. |
|
Full semantic suite as an A/B on Windows x86-64 (Python 3.15.2,
Same count, same failure set, so the change is inert on x86-64 and touches nothing beyond the NaN rows. I cannot run the ARM64 half here, so the actual fix stays unverified on the host it targets. One detail from the implementation: AI-assisted (Claude). No game files. |
Claimed in the coordination issue as: #3918 (comment)
What and why
The measured words pinned in
tests/semanticuse0xFFC00000for a NaN made from non-NaN operands (inf - inf,0 * inf), the x86 SSE default NaN.spirv_mini_interp.pyleft that sign to the host CPU. On ARM64 (Apple Silicon) the host gives0x7FC00000, so the tests passed on x86-64 only.ieee_nan()makes the sign explicit forOpFAdd,OpFSub,OpFMulandfma_f32. A NaN that comes from a NaN operand is untouched (both architectures pass it through with its sign). x86-64 results are unchanged by construction.Tested
macOS 26 arm64, CPython 3.15.2, CPU only, no game data, no GPU.
python3 -m unittest discover -s tests/semanticat aa2988c: 39 failures/errors before; after this changetest_alu_vop3_mods_hwandtest_alu_sdwa_hwpass (30 rows fixed) and the full suite is at 10 failures/errors. Not caused by this change, left alone:test_mutations(already #3883),test_cmp_class_f64(2 rejected forms are accepted),test_loop_ballot_barrierandtest_vcmp16_opsel(not investigated). Not run on x86-64: CI should confirm nothing moved there.AI-assisted (Claude Code).
Checklist
docs/design.md, with how it was confirmed. (Not applicable: test interpreter only, no translator rule.)