Repository navigation
rdna2spirv: the exact re-anchor keeps a signed-byte dot's stored op_sel_hi (SHADER-DOT4-SEL-EXACT-ANCHOR) - #1662
Conversation
…el_hi (SHADER-DOT4-SEL-EXACT-ANCHOR)
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 <noreply@anthropic.com>
|
Tested
AI-assisted; synthetic fixtures only, no game data. |
|
Independent verification (native Windows): minimal one-condition fix in the exact re-anchor path ( |
kawaii-shakal
left a comment
There was a problem hiding this comment.
Independent confirmation on the full shaders stage of current main (c7e82e2). The disassembly comes from make_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:
- Without the change,
amd_fidelityfx_upscaler_xbox_03and_18are refused asreachable instruction with normalized encoding, and 27 of 29 translate. - The refused words are a
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. - With the same one-line change (try
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-emulate on the stage's own listings.
AI-assisted review (Claude Code, Claude Opus 5.5).
|
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: Shaders: translated on Pipeline cache: warm and complete, 26,503 of 26,503 (9.6 GB).
Recipe:
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
AI-assisted (Claude Code, Claude Opus 5.5). |
Conflict in runtime/shims/d3d12_xs_device.cpp, proxy_copy_descriptors_simple: keep this branch's copy_null_rtv_marks call and main's fsdraw::enabled() gate for the descriptor-copy diagnostic. tools/rdna2spirv.py merged without a textual conflict, but #1662 on main calls restore_dot4_inline_sel in the exact re-anchoring path, which this branch had deleted. The merge puts main's function back so that call resolves; the next commits reconcile it with the dot4 op_sel rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…re_dot4_inline_sel The general rule from #1495 (dot4_op_sel_fields / restore_dot4_op_sel, ported from luizwidmer/palmetto) took the stored op_sel/op_sel_hi of any v_dot4_i32_i8 that llvm-mc printed with the defaults. That translated op_sel 0 / op_sel_hi 5 with a VGPR second source, a word #1317's test_fspx_dot4_op_sel_disasm.py (case (0, 5)) requires to stay refused: only op_sel 2 / op_sel_hi 5 was measured on gfx1036. The translator suite failed there. Resolve it on the measured side: - drop dot4_op_sel_fields and restore_dot4_op_sel; - keep main's restore_dot4_inline_sel (#984) and its three call sites: the clean-listing check, the forward re-anchor search, and the exact re-anchor window #1662 added today. The general rule does not cover only those cases, so it cannot replace them; - tests/semantic/test_dot4_printed_op_sel.py now checks that the inline-integer form is restored in a clean listing and on re-anchoring, and that op_sel_hi 5 with a VGPR S1, op_sel 1 / op_sel_hi 6, op_sel_hi 4 and a non-default S2 half stay refused; - docs/design.md "Signed-byte dot products" states how each form was confirmed (hardware for op_sel 2 / op_sel_hi 5, a corpus count for the inline-integer form, refused otherwise); docs/fspx.md follows. This also settles the #1662 / #1862 overlap: #1662's call site stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 upstream commits after ad41fd5, all taken: ProjectLeonida#2123 (D16S8 as D24S8: castable widening only for format 118, CreatePlacedResource takes its clear value, the depth-UAV copy path in vulkan_replay.h reworked, with its xbox_depth_storage tests), ProjectLeonida#1662 (rdna2spirv: the backward re-anchor also restores a signed-byte dot4's stored op_sel_hi, as the forward search does), ProjectLeonida#2160 and ProjectLeonida#2177 (typed image-load and texture-array test models), ProjectLeonida#2159 (gameinput test reads the pad before expecting a scripted press to end). No conflict; every line the merge removes from our side is one of upstream's own (checked against the merge base, D:\GTA6\analysis\lostlines.sh). The corpus is to be translated again with this rdna2spirv. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claimed in the coordination issue as: SHADER-DOT4-SEL-EXACT-ANCHOR (#1608 (comment))
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 d3d12: test that a view past the title-window cap is never the raw VA (RT-TITLE-WINDOW-OVERFLOW) #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