Commit Graph

2 Commits

Author SHA1 Message Date
691a63f521 tests: pin f16 NaN canonicalization in tests/spirv_interp.py across Python versions (TEST-661) 2026-11-22 21:43:16 +01:00
bad14edbef tests/spirv_interp.py: OpBitcast keeps signalling-NaN bits (#509, as #533)
u2f()/f2u() went through struct's binary32 <-> double conversion, which
quiets a signalling NaN (sets bit 22), so a word in 0x7f800001..
0x7fbfffff / 0xff800001..0xffbfffff that passed through an OpBitcast
came back changed: 0xffa3a095 became 0xffe3a095. This is the second
interpreter (test_values, test_f16_op_sel_values, test_f16_hw_words,
test_interp_p1_p2); #533 fixed the same bug in spirv_mini_interp.

Same fix: u2f() returns a float subclass that keeps the pattern and
f2u() returns it; copies, selects, composites and stores pass it on,
and arithmetic gives a plain float. New test_spirv_interp_bits.py
checks four sNaN words through every pass-through path, OpIsNan, and
that arithmetic still gives a NaN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:08:48 +01:00