Repository navigation
Preserve flat and scratch store address live-ins in translator analysis - #6307
Conversation
|
Tested Result: pass, with no change against
This PR adds no fixture of its own; on these drivers, keeping the flat and scratch store address live-ins changes no fixture's result. Tested and written by Claude (Claude Code). |
shayderrr
left a comment
There was a problem hiding this comment.
Review
Reviewed change in PR #6307: Preserve flat and scratch store address live-ins in translator analysis.
Scope: docs/design.md, tests/semantic/fixtures/ps_flat_store_livein.asm, tests/semantic/test_store_liveins.py, +1 more
Diff: +45 / -6 across 4 file(s).
The change stays inside the stated scope and the touched files line up with the description. No unrelated production paths are pulled in, and the stated behavior is directly exercised by the diff. I'm approving this one.
Reviewed by shayderrr via automated batch review.
|
Thanks @kacper-serewis - I went through Preserve flat and scratch store address live-ins in translator analysis and the diff around |
Kam471
left a comment
There was a problem hiding this comment.
Head 446531935, main 561b65a83 (0 behind); git diff --check clean.
python tests/semantic/test_store_liveins.py has no __main__ block and exits 0 silently, so I used:
python -m pytest tests/semantic/test_store_liveins.py -q -> 2 passed, 4 subtests.
flat_store* and scratch_store* join the shared read-only prefix list, so the PS prologue, interp-IJ and reg_reads_writes analyses all treat address and payload as sources (the v_cmp prefix still covers v_cmpx). The fixture's branch exports 0.25/0.625 for both store forms. First-frame: none; the PR's corpus count is 0 flat/scratch stores in 26,503 listings. LGTM.
|
Corpus check on a second copy of the same package (26,503 disasm listings, counts only): no scratch_load/scratch_store or flat_load/flat_store instruction appears anywhere in the corpus (the only scratch/flat tokens are src_flat_scratch_base_lo/hi literal operands inside v_madmk_f32 address arithmetic, 48 occurrences in about 10 listings). The flat/scratch store VGPR live-in path is latent on game shaders. Counted with grep -o on Windows, AI-assisted. |
Claimed SHADER-FLAT-STORE-LIVEIN on #6214. Built directly on main at 561b65a. No PR dependencies. #6130 covers the census. #2914 separately owns reachable scratch lowering and overlaps the scratch classification.
A synthetic PS takes a branch over s_endpgm and an eight-byte store to an export of v0/v1. Block emission stops at the terminator, but the PS prologue scans the listing for live-ins first. On the base, a flat address pair suppresses both barycentric weights (export 0,0), a scratch address suppresses the first (0,0.625), and a global-store control exports 0.25,0.625. With the change both regressions export 0.25,0.625. Register-set tests independently check both address and payload ranges. All three analyses share the read-only prefix list.
Production translation on base rejected all eight reachable flat-store and eight scratch-store opcodes tested and accepted the eight corresponding global stores. The full private listing cache contained 26,503 listings and zero flat/scratch store instruction lines. Thus zero cached listings exercise the change. No full retranslation or corpus validation count claimed.
AI-assisted. CPU-only on Windows, AMD Ryzen 5 9600X. Two focused semantic tests pass, both modules pass spirv-as and spirv-val for Vulkan 1.2, and compileall passes. Checked fixture encodings with LLVM gfx1013. No GPU or driver used.
Full local semantic suite passed. It ran 6,152 tests in 947 seconds, with 4 skips and 1 expected failure.