rdna2spirv: the exact re-anchor keeps a signed-byte dot's stored op_sel_hi (SHADER-DOT4-SEL-EXACT-ANCHOR) #1662
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!1662
Loading…
Reference in a new issue
No description provided.
Delete branch "dot4-sel-exact-anchor"
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?
Pull request successfully merged and closed
Claimed in the coordination issue as: SHADER-DOT4-SEL-EXACT-ANCHOR (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7155365083)
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
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.
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.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).
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).