Shaders: a DPP step over a lane set the section names stays followed #2386
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2386
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2386"
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?
@borosf on GitHub · 2026-11-25 12:27 UTC · original
borosf:vibe/dpp-named-lanes-842ca5→main· +248 −25 · 2 files · 5 commits · openSummary
dpp_lanetakes the current EXEC and the flags, and a unit test asserts the full table (active source, FI, BOUND_CTRL both ways, DPP8) on the lane a narrowed set leaves out, in wave32 and wave64.a DPP step over lanes it has not named): the lanes are defined at such a point, but what the translated fixed-lane reads make of them is not proven — the hardware report in this thread dispatched the wrong lanes once this shape was accepted. It stays a refusal until the emitted source-lane reads land as their own change; this PR then re-census counts the family and can take the admission back with that fix's verification behind it.@borosf on GitHub · 2026-11-25 12:34 UTC · original
Confirmed and fixed in
c369dd4(the test closure needs no mut): thatmutwas caught by CI clippy on the first push, and the branch now passescargo clippy --all-targets -- -D warningson windows-latest (run 45614355604, green in 2m13s).Thanks for the RTX 5090 / WARP run - 8/8 on both, including
dpp_over_a_lane_set_the_section_names_stays_followed, is exactly the coverage that matters here since the change is in the wave simulator.@steven-seagull27 on GitHub · 2026-11-25 13:40 UTC · original
On head
c369dd4, I found a narrowed-EXEC DPP case that translates and dispatches but reads the wrong VGPR lane on an RTX 5080 (driver 621.40) and Microsoft WARP 1.0.22. I’ve put the two synthetic regressions and a tested source-lane fix on my fork.The shader initializes the destination to 37, sets source lane 1 to a root constant, disables destination lane 0 and swaps lanes 1 and 2 with
quad_perm:[0,2,1,3]. Both exchanged source lanes are active. Four fixedv_readlane_b32instructions read destinations 0–3. Once EXEC is restored, every invocation writes those four scalars.Each denominator counts four-word records across two input sets. With lane 1 set to 19, every writer should store
[37, 2, 19, 3]. On the PR, writers 0 and 1 stored[37, 0, 19, 0]and[37, 1, 19, 1]. The inactive destination survived, but two fixed reads returned the writer's invocation ID. With the fix, both input variants matched in every executed mode. Stacked parent751cbe3refused the Wave32 witness before dispatch. This RTX supports only Wave32, and built-in Windows WARP (4..4) skipped both wave sizes.The fix keeps the source lane with each incoming VGPR, preserves the identity case, and emits
WaveReadLaneAtfor a known fixed lane in full compute waves in the entry block. It conservatively refuses that read where convergence or a complete wave is unproven. All 9 whole-wave tests and 22 lowering tests passed, including a partial-group refusal, and strict shader Clippy passed. These were synthetic readbacks.To try both commits on
c369dd4:@borosf on GitHub · 2026-11-25 13:52 UTC · original
@AndyLatimer
Applied in
76e052f, exactly as you specified:dpp_lanenow takes the current EXEC, DPP16 fetches only wheninside && (fi || source_active)(falling back to the existing BOUND_CTRL behavior otherwise), and DPP8 zeroes when!fi && !source_active. Destination write masks unchanged.Your witness is the regression
an_inactive_dpp_source_is_kept_zeroed_or_fetched_by_the_flags: lane 0 out vias_mov_b32 exec, -2, every lane reading it (quad_perm:[0,0,0,0], and the DPP8 group select), with a fixedv_readlaneof lane 1 asserting the full table — keep (11) with both flags clear, fetch (7) with FI either way, zero with BOUND_CTRL alone, and the 0xE9/0xEA pair — in wave32 and wave64. All nine whole-wave tests pass; CI green. Thank you — the fuzzing asserted range structure, not fetch semantics, so the fold-to-constant was invisible to it.@steven-seagull27
Thank you — that's a hardware-level catch of a distinct bug from AndyLatimer's: the emitted source-lane reads, not the simulator's fetch semantics. To keep authorship where the work is and avoid two parallel implementations, could you open your fix (with the two regressions and the WaveReadLaneAt-with-fixed-lane path plus the conservative refusals) as a PR stacked on this one? Your cherry-pick pair on
codex/pr2386-track-dpp-source-lanesreads like it's already PR-shaped, and your 5080/WARP matrix (uniform input vs invocation-ID, both wave sizes) is the verification a reviewer would want to see on it directly.If you'd rather it live in this PR instead, say so and we'll pull the two commits in with you credited — either way I'll hold off touching the source-lane area so we don't collide.
@Marvisak on GitHub · 2026-11-25 15:53 UTC · original · edited 2026-11-25 18:44 UTC
Automated triage for the maintainers.
Needs work. This PR is stacked on #2344 (
751cbe3, the refusal kinds). Since09d0985, its own commits (998aae2,c369dd4,76e052f,09d0985) touch onlycrates/victory-shader/src/emit/wave.rs.dpp_lanenow takes EXEC and applies the FI/BOUND_CTRL rules for a source lane that EXEC leaves out, citing the RDNA2 ISA reference guide. A new test pins that table, and a comment explains why the narrowed-EXEC refusal stays. CI (check) passes, and the branch merges cleanly with currentmain.What blocks it:
09d0985puts back theexec != allrefusal insimulatebeforedpp_laneis called. So the only call site always passesexec == all, and the new inactive-source branches can't be reached. Apart from #2344, this PR now changes nothing in what gets translated. It adds a code path that runs only in its unit test, plus a comment that points to this thread. That fixes the wrong-lane result from the earlier head, but the PR no longer has a change of its own to merge.What would change the verdict: land #2344 on its own. Then carry the exec-aware
dpp_lanein the PR that lifts the narrowed-EXEC refusal, together with the emitted source-lane fix from the hardware report (steven-seagull27's commits) and its readback tests. There the FI/BOUND_CTRL rules are reachable and tested end to end.On your reply: the three points from the earlier triage are handled (the refusal is back, the ISA source is cited, the internal tags are gone). What's left is that this leaves the PR with nothing reachable of its own.
Generated by Claude Code
@borosf on GitHub · 2026-11-25 17:15 UTC · original
All three points of the triage are addressed in
09d0985: the narrowed-EXEC DPP step is refused again by the census-visible name (with the reasoning in a comment pointing at the hardware report), so this PR no longer turns that shape into wrong output — it now only contributes the ISA-correct fetch semantics, pinned by direct dpp_lane assertions. The inactive-lane rules cite the RDNA2 ISA reference guide's DPP16/DPP8 description, and the description and test comments speak plainly (no internal tags). CI green on the new head.@Marvisak Please check it out when you can :)
@steven-seagull27 on GitHub · 2026-11-26 01:23 UTC · original
@borosf I opened the requested stacked PR against
vibe/dpp-named-lanes-842ca5at09d0985. It keeps the source-lane fix and both original readbacks, then lifts the narrowed-EXEC refusal alongside an end-to-end test for your DPP16 FI/BOUND_CTRL and DPP8 FI behavior. The new test reads an inactive invocation-ID source and distinguishes keeping the destination (37), zeroing it (0), and fetching the source (2).On the current parent all three fixtures refuse before dispatch. The stack returned 0/512 wrong four-word records on the RTX 5080 at Wave32, 0/512 on WARP 1.0.22 at Wave32 and 0/1,024 on WARP 1.0.22 at Wave64. Built-in WARP skipped both widths. The stock shader suite added five passing tests and had the same three unrelated failures on both revisions. The PR contains the test commands and full comparison.
AI-assisted with Codex.
@DenRakEiw on GitHub · 2026-11-25 12:29 UTC · original · reviewed
Tested against
origin/main(940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:cargo test -p victory-shader emit::wave: 8/8 passed on RTX 5090 and 8/8 on WARP (includingdpp_over_a_lane_set_the_section_names_stays_followed).cargo xtask policy: 183 files ok.cargo clippy -p victory-shader --all-targets -- -D warnings): Removingmuton line 1058 will makeclippy --all-targets -- -D warningspass cleanly.AI-assisted (Gemini 4 Neon).
@catminou4 on GitHub · 2026-11-25 12:41 UTC · original · approved these changes
Tested locally: merged into main
940d32f69b,cargo test -p victory-shader --lockedon macOS arm64 — 146 passed, 0 failed, 2 ignored (Windows-gated hardware execution tests not run here). Approving — DPP step over a lane set the section names stays folded, +1 test.@AndyLatimer on GitHub · 2026-11-25 13:06 UTC · original · requested changes
An active lane can now fold to the wrong constant when its DPP source has been disabled in
EXEC.simulatemasks destination writes, butdpp_laneignores the source lane'sEXECbit and the instruction'sFIflag. The identity permutation in the new test only exercises active sources for active destinations.I reproduced this at
c369dd4with the following wave32 section. The DPP16 extension word is0xff000001, with bothFIandBOUND_CTRLclear.Lane 1 selects inactive lane 0. The simulator records
Shape::K(7)fors5. With those bits clear, lane 1 must retain11. Setting onlyBOUND_CTRLgives0. SettingFIpermits the fetch of7. DPP8 has the same source-mask dependency: encoding0xe9supplies zero for an inactive source and0xeafetches its stored value. LLVM DPP modifiers · AMD on the encoded BOUND_CTRL bitPlease pass the current
EXECintodpp_lane. For DPP16, useinside && (fi || source_active)to choose the source or the existingBOUND_CTRLfallback. For DPP8, use zero when!fi && !source_active. Keep the destination write masks in effect.I tested that change locally with all six encodings, disabling lane 0 in wave32 and lane 32 in wave64. The regression also checks that the disabled destination retains its value and an active source still supplies
7. All nine whole-wave tests pass, and shader Clippy passes with-D warnings.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.