rdna2spirv: the exact re-anchor keeps a signed-byte dot's stored op_sel_hi (SHADER-DOT4-SEL-EXACT-ANCHOR) #1662
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!1662
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1662/head"
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?
@Tyrannys on GitHub · 2026-11-25 07:29 UTC · original
Tyrannys:dot4-sel-exact-anchor→main· +108 −2 · 3 files · 1 commits · merged 2026-11-26 01:57 UTCClaimed in the coordination issue as: SHADER-DOT4-SEL-EXACT-ANCHOR (#1608)
What and why
translate()re-anchors a listing that reports rejected words. When llvm-mc's messages give one offset per rejected word, it re-anchors exactly, from those offsets (invalid_at). That exact path triedmix_literalandmix_inline_literal, but notrestore_dot4_inline_sel. The forward search andcheck_printed_encodingsalready try that repair. So av_dot4_i32_i8with an inline-integer S1 and a stored op_sel_hi of 5 (llvm-mc prints it as the default, 7) got marked normalized, and its whole program was refused with "reachable instruction with normalized encoding".One of the FidelityFX DLL's programs has this form, plus rejected words. Without it, the title's slot-67 pipeline creation fails. In a retail boot, the upscaler then crashes on a null read a few seconds later.
The fix: the exact path tries
restore_dot4_inline_selfirst, in the same order as the forward search. Other mismatches are refused as before. The change is one line. It doesn't touch #1301's lines inrestore_dot4_inline_selitself.docs/design.md(the "Code-embedded data" row) records the rule and the count.Tested
No game files in the test. Windows 11, CPU only for the suite.
tests/semantic/test_reanchor_dot4_inline_sel.py, hand-built encodings:python -I scripts/run_semantic_tests.py tests/semantic: 488 files, 6,282 tests, 0 failed (292 s, 16 jobs).--wave64-emulate), the FidelityFX DLL's 29 programs:main: 22 translated;spirv-val;LEONIDA_SKIP_INT3=1 LEONIDA_TITLE_WATCHDOG=0, plus #1631): the upscaler crash that ended the runs before is gone, and the run lasted its full 485 s. A device loss on a library compute dispatch came late in the run. That's a separate matter.AI-assisted (Claude Code).
GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 621.01, Windows 11 (retail boot only; the translator tests need no GPU)
AI-assisted: yes (Claude Code)
🤖 Generated with Claude Code
A listing that reports rejected words with llvm-mc's own offsets is re-anchored exactly, and that path never tried restore_dot4_inline_sel, which the forward search and check_printed_encodings already use. A v_dot4_i32_i8 with an inline-integer S1 and stored op_sel_hi 5 (printed as the default 7) was marked normalized and its whole program refused ("reachable instruction with normalized encoding"). One FidelityFX DLL program has that form; without it the title's slot 67 fails and the run crashes inside the upscaler. Co-Authored-By: Claude Opus 5.5 <[email protected]>@GeorgiyDemo on GitHub · 2026-11-25 07:51 UTC · original
Tested
b3ce84b33on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), againstmain3f81d46ac(translator-only PR; binaries from the build at66d4f5aa3):tests/semantic/test_reanchor_dot4_inline_sel.py: OK at this head; copied ontomainit errors 2 — the exact re-anchor path withoutrestore_dot4_inline_selfails as described.v_dot4GPU fixture exists, so the GPU smoke is on the neighbouring integer VALU set:--filter ps_vint5/5 PASS on MoltenVK 1.4.2 (ps_vint_bits,ps_vint_logic3,ps_vint_minmax,ps_vint_minmax3,ps_vint_mul24).AI-assisted; synthetic fixtures only, no game data.
@whoalin1 on GitHub · 2026-11-25 08:31 UTC · original
Independent verification (native Windows): minimal one-condition fix in the exact re-anchor path (
restore_dot4_inline_seltried before marking normalized), mirrors the forward-search path at rdna2spirv.py:17783; contract row extended; newtest_reanchor_dot4_inline_sel.py3/3 OK, neighbor reanchor/fma-mix tests all OK; FULL semantic suite 488 files / 6,282 tests / 0 failed. Game-file claims unverifiable, fix itself is clean. AI-assisted verification.@kawaii-shakal on GitHub · 2026-11-25 10:15 UTC · original · reviewed
Independent confirmation on the full shaders stage of current main (
c7e82e26e). The disassembly comes frommake_game's own stage, so the LLVM differs from your 21.1.8 run. The two FidelityFX DLL programs that fail are exactly the ones this PR is about:amd_fidelityfx_upscaler_xbox_03and_18are refused asreachable instruction with normalized encoding, and 27 of 29 translate.v_dot4_i32_i8with an inline-integer S1 (10 and -6). The stored op_sel_hi is[1,0,1]and the printed one[1,1,1]: the stored word has bit 60 clear and the printed word has it set (0x0cvs0x1cin byte 7), both in listings with llvm-mc offsets, so the exact path.restore_dot4_inline_selon the exact path before marking the word), both translate and passspirv-val: 29 of 29.So with this PR the FSPX set is complete on main. I made the same change locally before I found this PR and dropped mine in its favour. The code change matches; I did not run your new test.
Tested on Windows 11 Pro 26300, Python 3.13,
rdna2spirv.py --no-asm --wave64-emulateon the stage's own listings.AI-assisted review (Claude Code, Claude Opus 5.5).
@Tyrannys on GitHub · 2026-11-25 18:12 UTC · original · edited 2026-11-25 18:55 UTC
Test report from a combined build on a second NVIDIA machine. Counts only.
Machine: Windows 11, RTX 4070 SUPER, NVIDIA 621.01, 64 GB, own 1.0.2.1 copy.
Build:
mainfe1553456(already contains #1827 and #1893), plus #674, #1662, #1851, #1849, #1905, #1957, #1950, #1886 and #1894. All of them merged without conflicts.Shaders: translated on
3de22a190+ #674 + #1662 with--wave64-emulate. 29,279 of 29,280 translated, and all 29,279 passspirv-val. That is 2,683 library programs and 29 of 29 FSPX.main's translator changes since then are correctness fixes only.Pipeline cache: warm and complete, 26,503 of 26,503 (9.6 GB).
ActivateRays,ActivateProbesandActivateProbesTargetprograms of indirect diffuse lighting.Recipe:
scripts/windows-boot/boot.ps1 -Seconds 480,LEONIDA_KEYBOARD_PAD=1 LEONIDA_SKIP_INT3=1 LEONIDA_TITLE_WINDOWS_MB=1024 LEONIDA_MAP_READBACK=1,LEONIDA_PIPELINE_CACHE_DIRpointing at the offline cache. Host image copy:off (auto: NVIDIA)from #1851. One run per row.LEONIDA_TITLE_WATCHDOG=0)game_scarlett_master.exe+0x23cf683)main42537e7b6+ #1631; my run table of 07:54 in #1608).AI-assisted (Claude Code).
@aslan2142 on GitHub · 2026-11-26 01:57 UTC · original
Merged, thanks! The exact re-anchor's window check now tries the same repair as the normal pass and the forward search: a signed-byte dot's stored
op_sel_hiwith a replicated inline integer is restored there too, instead of the instruction being refused as normalized.llvm-mc23 naming undecodable words at known offsets, a listing reaches that check, and an FSPXv_dot4_i32_i8was refused there while the same instruction was repaired everywhere else.mainef3493186+b3ce84b33: the semantic suite passes (496 files, 6,336 tests, 0 files failed); the 15 docs and writer tests pass;check_no_game_data.pyis clean on the 3 changed files.AI-assisted (Claude Code, Claude Opus 5.5).