test(semantic): align computed-I/J f16 interp oracle with toward-zero p2 narrow (TEST-INTERP-COMPUTED-IJ-FALLBACK-RTZ carry) #2633
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2633"
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 ubiquitarianism/leonida. Originally posted by aegish-zagi on 2026-11-29T20:22:43Z.
Claimed in the coordination issue as: TEST-INTERP-COMPUTED-IJ-FALLBACK-RTZ-CARRY — https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7261990077 (carry of zmasi's TEST-INTERP-COMPUTED-IJ-FALLBACK-RTZ, claimed at https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7256168778, offered for carry at https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7258235920 because zmasi is at the open-PR cap)
What and why
Carries zmasi's verified one-commit fix (
3e478dcef, author unchanged — Zack/zmasi; aegish-zagi is committer only), cherry-picked onto currentmainc2a726196. #2239 and #1181 (SHADER-468, toward-zerov_interp_p2_f16narrowing) merged back-to-back;tools/rdna2spirv.pyalready narrows toward zero, but two assertions intests/semantic/test_interp_computed_ij_fallback.pystill expected nearest-even, leavingsemantic-testsred onmain. The commit aligns the test oracle with toward-zero (f16_rtz/f16_rtz_bits). Test-only change; no translator code touched.Tested
MEASURED on Linux, Python 3.12.3, this machine:
mainc2a726196:tests/semantic/test_interp_computed_ij_fallback.py= 2 failed, 7 passed (the two toward-zero f16 assertions)test_*interp*.py= 270 passed;test_*f16*.py= 591 passed (45 skipped)python -I scripts/check_no_game_data.py tests/semantic/test_interp_computed_ij_fallback.py= passGPUs tested: n/a (Profile Z: no free GPU)
AI-assisted: yes (Muse Wonder, Muse by Meta)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a — no new translator rule; test oracle only)Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-11-29T20:27:12Z.
Static review: no blocker found.
v_interp_p2_f16behavior from SHADER-468.f16_rtz_bitshandles NaN, infinity, overflow-to-finite, and positive finite values consistently with truncation toward zero.I did not execute the suite in this review. AI-assisted: yes.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T20:28:28Z.
Independent full-suite A/B for
71db4c40on CachyOS, Python 3.14.10 and SPIRV-Tools 2026.4, CPU only. Base was currentmainedf0ff5dwith #2626 atfcc044cdapplied (efa3de8d). The other tree (69926466) adds this PR's exact test file as its only change.LEONIDA_REQUIRE_SPIRV_TOOLS=1 python -I scripts/run_semantic_tests.py tests/semantic -v -j 6. Both trees discovered 6,526 tests in 529 files. The base had two assertion failures intest_interp_computed_ij_fallback.py. With this PR, zero files failed. Both trees reported the same two skips and one expected failure.v_interp_p2_f16to nearest-even. The same two cases turned red with their expected and actual values reversed, including0x4400versus0x43ff. The suite above used the original translator.Synthetic inputs only. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-29T20:32:53Z.
Independent verification, since this is the one job still red on
main(semantic-tests (ubuntu-latest)).Cherry-picked onto
origin/mainedf0ff5d0- one file,+32 -6, no conflicts:So it does what the title says, on the current tree. It is also the same change I derived independently (and which rides inside my three open pull requests), so there is nothing
of mine to add to it - and my queued entry for
TEST-INTERP-COMPUTED-IJ-FALLBACK-RTZis now redundant with this pull request.One note for the merge order: if this lands first, the interp commit inside #1923, #1937 and #2145 becomes a duplicate and those branches can drop it; if one of them lands first,
this one becomes a no-op. Either order ends with the same tree, which is why I am not pushing one over the other.
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T05:56:07Z.
Verified on this machine (Windows 11, Python 3.13.14), and the negative control bites - which matters more than usual here, because this is the commit several of my branches carry to turn
semantic-testsgreen.1. It applies.
merge-treeclean;71db4c405cherry-picks ontomain1d22590b9without a conflict. One file:tests/semantic/test_interp_computed_ij_fallback.py.2. With the change:
3. Without it - the same test file against
main:So
main's oracle is one ulp off on the toward-zero narrowing (17407instead of17408, and0.07745361328125instead of0.0775146484375= the next f16 step), and this commit is what makes the test pass. That is a real red->green, not a test agreeing with itself.A note for whoever merges: this commit is also carried inside several other open pull requests (mine among them) because
semantic-testsis red onmainand every branch cut from it inherits that. Whichever lands first makes the others' copies redundant - they are the same edit, a parameter namedxversusval, so a rebase drops them cleanly and a conflict on this file resolves by taking either side.What I did not test: the translator that consumes the oracle. The test computes expected f16 bits in Python and compares them against the recorded expectation; whether
v_interp_p2_f16in the real pipeline matches this rounding needs a shader run, which this machine cannot do without the game'sshaders.rpf.Written with an AI assistant.