Repository navigation
Conversation
6a760ae to
661f7fd
Compare
Melow-code
left a comment
There was a problem hiding this comment.
No clear bug in the dominance proof or the WREXEC exit. Four points:
dominatesassumes block 0 is the entry — the loop stops onb == 0. If the entry has another index, the loop does not end. Testself.idom[b] == binstead.- Irreducible cycles:
bodyholds natural loops only. A write in a cycle without a single header is in nobody, so the check passes vacuously. Is an irreducible CFG refused before this point? - The mixed-mask SCC op list has ANDN1 but not ORN1. If
opcan come fromS_ORN1_SAVEEXEC_B32, that form keeps the old uniform SCC. - The 111 new programs need a per-lane DXIL vs HLSL comparison with random inputs before merge. The GPU tests cover synthetic programs only.
Hardware test report — commit
|
|
Independent check of 661f7fd on an RTX 3080 Ti (621.35), Windows 11 build 26300, Rust 1.99.1 MSVC debug, DXC 1.8.2502.11. I ran the loop fixtures through the production console shader translator with With the loop analysis from the stacked parent, the latch case refused per-lane translation. AI-assisted. Codex (GPT-6 family, exact variant unavailable) extended and ran the check and drafted this report. |
|
@ruipedro-pinheiro thanks for the careful read. On the four points:
We'll reply here with the new heads. AI use: Claude Code (Claude Opus 5.5) wrote this. |
661f7fd to
177785a
Compare
|
@ruipedro-pinheiro the review fixes are pushed. This PR is now
AI use: OpenAI Codex (GPT-6.2) wrote the fixes and the tests and ran them; Claude Code (Claude Opus 5.5) wrote this. |
177785a to
5d0c1f0
Compare
|
Correction to the head above: #1866 was merged at AI use: Claude Code (Claude Opus 5.5) wrote this. |
|
On #1912 at The first differing word in each of the six runs was a texture W component. HLSL stored In The HLSL path gives DXC an ordinary @eizispark, could you run the 67 native-wave64 rows on your RX 9070 XT with the default seeds and post the summary from AI use: Claude Code (Claude Opus 5.5) and Codex helpers built the replay harness, ran the readbacks and the DXC check on our machine, and wrote this comment. |
|
Verification on RTX 3060 Ti (Windows 11): merge conflict with current |
Arc A770 verification for PR #1912PR #1912 was open at Tested
Not tested
AI use
|
5d0c1f0 to
c4f00e5
Compare
ANDN1 and ORN1 only occur in EXEC forms, which record lane SCC before the plain bitwise path. Remove the unreachable ANDN1 plain case and exercise both real encodings across an EXEC restore.
A lane can use a dominating definition while it remains in every loop containing the write. A native wave32 loop header can also read its sole latch's definition on the back edge if no enclosing loop can carry an earlier value to the entry. Preserve the final zero SCC and mask on the sole empty-EXEC exit of a WREXEC self-loop. Check the reads in nested arms, lanes leaving a loop at different iterations and a read of the counter after exit. Compare both shrinking-loop kernels with HLSL on the GPU.
Use the same root and unreachable checks when constructing loop bodies and proving stale reads. Test a nonzero entry. The existing two-entry cycle test exercises the irreducibility refusal before a summary reaches the lowering.
c4f00e5 to
c4093f4
Compare
Melow-code
left a comment
There was a problem hiding this comment.
I read the dominance proof, the WREXEC exit and the mixed-mask SCC change from #1866. I found no clear bug. I have four points:
dominatesassumes that block 0 is the entry. The loop stops onb == 0. If the entry has another index and itsidomis itself, the loop does not end. A test onself.idom[b] == bdoes not depend on the index.- Irreducible cycles.
bodyholds natural loops only. A write in a cycle without a single header is in nobody. Then the check "every loop that holds the write holds the read" has no loop to check, and it passes. Is an irreducible CFG refused before this point? If it is not,passedshould return false there. - The op list for the mixed-mask SCC has
ANDN1but notORN1. Ifopcan come fromS_ORN1_SAVEEXEC_B32, that form keeps the old uniform SCC. - The 111 new programs. This relaxation lets programs through that the stale check refused before. So a wrong proof gives wrong values with no refusal. The GPU tests cover synthetic programs only. Please compare the per-lane DXIL with the HLSL path on these 111 programs, with random inputs. That shows if the proof holds on real code.
The WREXEC exit case agrees with the ISA. After the last S_*_WREXEC_B32 before a not-taken S_CBRANCH_EXECNZ, EXEC, the destination and SCC are all 0 for the wave. The r != 125 check skips the null SGPR.
|
Thanks for reading it again. All four points were raised on the earlier head, and at
AI use: Claude Code (Claude Opus 5.5) checked each point against |
Part of #1269. Builds on #1866 (merged). Four commits, rebased onto
maincbfc67bc: a test for SCC from the complemented SAVEEXEC forms (review point 3; it was meant for #1866, which merged first), this change, the dominance-walk fix from review point 1, and a fix for an interaction with #1888.What is in it
A per-lane read can use a dominating write when the reader stays inside every loop containing that write. For a native wave32 loop header, the first iteration sees the entry value and every returning lane has passed its sole latch. The proof excludes enclosing loops that could carry an earlier write back to the entry. On the sole empty-EXEC exit of a WREXEC self-loop, the final SCC and saved mask are both zero for the entire wave.
crates/xcl/src/gpu/recomp/lower.rs,lane_masks.rs: the dominance proof for reads inside loops and the WREXEC exit case.crates/xcl/src/gpu/recomp/lower_dxil.rs: GPU and CPU tests.README.md: one line on the new per-lane loop case.c4093f4, after Per-lane: unsound whole-wave predicate checks (uniform_over ignores inactive lanes, S_CBRANCH_VCCZ/NZ ANDs with EXEC, SRC_SCC 253 unchecked) #1888 merged: its SCC check rejected the shrinking wave32 loop, because the analysis lost the fact that EXEC is empty on the loop's exit. The analysis and the lowering now share one check for aWREXEC_B32self-loop ending inS_CBRANCH_EXECNZ. On its sole fallthrough exit the copied mask is zero and SCC is uniformly false, so a later scalar read is safe.ANDN1arm in the mixed-mask list is removed, with a CPU test ofS_ANDN1_SAVEEXEC_B32andS_ORN1_SAVEEXEC_B32SCC.Tested
33b1b33e,6a760ae4raises native per-lane translation from 316 to 427 of 2,689 compute programs using four switch-selected memory windows. All 111 new admissions were previously refused for a stale value. Stale-first refusals fell from 154 to 43. The 316 previously accepted programs retained their DXIL byte counts. The 19 slowest remain refused by the whole-wave branch check, so none has per-lane DXIL to time.c4093f4, after the rebase ontocbfc67bc:cargo test --workspace -- --test-threads=4(debug): 1187 passed, 1 failed, 46 ignored.xcllibrary tests (four threads, nothing filtered): 1131 passed, 1 failed, 26 ignored.hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa, which fails onmainitself since D3D12.X: global shader-visible sampler heap, typed UAV validation, and occlusion/query VA fixes #1991 (see the note there).lower.rs:wave_brancheskeeps recomp: enable whole-wave branches and dead-SCC elision in split wave64 #2203'sir.can_wave_branch()and SCC liveness, andanalyze_brancheskeeps this PR's fifth argument.5d0c1f0:cargo test --release --workspace -- --test-threads=4reported 963 passed, 0 failed and 43 ignored. Twelve tests printed 22 runtime skip messages for unsupported hardware or unimplemented paths. The new GPU fixtures ran with DXC 1.9 and no skip.Regression run
scripts/smoke.ps1, the same retail title for 60 s each, one after the other on the machine under Tested, release builds from clean trees.maincbfc67b(this PR's base):this PR,
c4093f4:PR vs
main: 1298 / 1312 frames (99 %), peak commit 27446 / 26713 MB (103 %); device removals 0 and crashes 0 on both runs.Both runs use default settings, nothing else running.
Not tested
5d0c1f0).AI use
OpenAI Codex (GPT-6.2) wrote the change and the tests and ran the suite and the pack count. Claude Code (Claude Opus 5.5) edited this description and opened the PR.
🤖 Generated with Claude Code