Shaders: a DPP step over a lane set the section names stays followed #2384

Closed
borosf wants to merge 5 commits from upstream-pr/2386 into main
borosf commented 2026-11-25 12:27:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-25T12:27:46Z.


Summary

  • The whole-wave simulator's DPP fetch follows the RDNA2 ISA reference guide's rules for a source lane EXEC leaves out: FI reads an inactive lane; without FI, DPP16's BOUND_CTRL bit decides (the destination keeps its value, or the read is 0) and DPP8 reads 0. dpp_lane takes 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.
  • The section keeps refusing a DPP step under a narrowed EXEC, by the name a refusal census counts (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.
  • Stacked on the refusal-kinds PR (#2344); only the commits after its head are new.
<!-- greyfinch-sync:Marvisak/VIctory:issue:5491314373 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2386). Originally posted by [borosf](https://github.com/borosf) on 2026-11-25T12:27:46Z. --- ## Summary - The whole-wave simulator's DPP fetch follows the RDNA2 ISA reference guide's rules for a source lane EXEC leaves out: FI reads an inactive lane; without FI, DPP16's BOUND_CTRL bit decides (the destination keeps its value, or the read is 0) and DPP8 reads 0. `dpp_lane` takes 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. - The section keeps refusing a DPP step under a narrowed EXEC, by the name a refusal census counts (`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. - Stacked on the refusal-kinds PR (#2344); only the commits after its head are new.
DenRakEiw commented 2026-11-25 12:29:57 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T12:29:57Z.

Review: COMMENTED


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 (including dpp_over_a_lane_set_the_section_names_stays_followed).
  • cargo xtask policy: 183 files ok.
  • Clippy / compiler warning (cargo clippy -p victory-shader --all-targets -- -D warnings):
    error: variable does not need to be mutable
        --> crates\victory-shader\src\emit\wave.rs:1058:17
         |
    1058 |             let mut section = |narrow: bool| {
         |                 ----^^^^^^^
         |                 |
         |                 help: remove this `mut`
         |
         = note: `-D unused-mut` implied by `-D warnings`
    
    Removing mut on line 1058 will make clippy --all-targets -- -D warnings pass cleanly.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6057615856 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2386#pullrequestreview-6057615856). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T12:29:57Z. **Review:** COMMENTED --- 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 (including `dpp_over_a_lane_set_the_section_names_stays_followed`). - `cargo xtask policy`: 183 files ok. - **Clippy / compiler warning (`cargo clippy -p victory-shader --all-targets -- -D warnings`):** ``` error: variable does not need to be mutable --> crates\victory-shader\src\emit\wave.rs:1058:17 | 1058 | let mut section = |narrow: bool| { | ----^^^^^^^ | | | help: remove this `mut` | = note: `-D unused-mut` implied by `-D warnings` ``` Removing `mut` on line 1058 will make `clippy --all-targets -- -D warnings` pass cleanly. AI-assisted (Gemini 4 Neon).
catminou4 commented 2026-11-25 12:41:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T12:41:45Z.

Review: APPROVED


Tested locally: merged into main 940d32f69b, cargo test -p victory-shader --locked on 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.

<!-- greyfinch-sync:Marvisak/VIctory:review:6057785368 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2386#pullrequestreview-6057785368). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T12:41:45Z. **Review:** APPROVED --- Tested locally: merged into main 940d32f69b, `cargo test -p victory-shader --locked` on 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.
borosf commented 2026-11-25 13:02:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-25T12:34:04Z.


Confirmed and fixed in c369dd4 (the test closure needs no mut): that mut was caught by CI clippy on the first push, and the branch now passes cargo clippy --all-targets -- -D warnings on 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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7162551053 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2386#issuecomment-7162551053). Originally posted by [borosf](https://github.com/borosf) on 2026-11-25T12:34:04Z. --- Confirmed and fixed in c369dd4 (`the test closure needs no mut`): that `mut` was caught by CI clippy on the first push, and the branch now passes `cargo clippy --all-targets -- -D warnings` on 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.
AndyLatimer commented 2026-11-25 13:06:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AndyLatimer on 2026-11-25T13:06:47Z.

Review: CHANGES_REQUESTED


An active lane can now fold to the wrong constant when its DPP source has been disabled in EXEC. simulate masks destination writes, but dpp_lane ignores the source lane's EXEC bit and the instruction's FI flag. The identity permutation in the new test only exercises active sources for active destinations.

I reproduced this at c369dd4 with the following wave32 section. The DPP16 extension word is 0xff000001, with both FI and BOUND_CTRL clear.

s_or_saveexec_b32 s0, -1
v_mov_b32 v1, 7
v_mov_b32 v2, 11
s_mov_b32 exec_lo, -2
v_mov_b32_dpp v2, v1 quad_perm:[0,0,0,0] row_mask:0xf bank_mask:0xf
v_readlane_b32 s5, v2, 1
s_mov_b32 exec_lo, s0

Lane 1 selects inactive lane 0. The simulator records Shape::K(7) for s5. With those bits clear, lane 1 must retain 11. Setting only BOUND_CTRL gives 0. Setting FI permits the fetch of 7. DPP8 has the same source-mask dependency: encoding 0xe9 supplies zero for an inactive source and 0xea fetches its stored value. LLVM DPP modifiers · AMD on the encoded BOUND_CTRL bit

Please pass the current EXEC into dpp_lane. For DPP16, use inside && (fi || source_active) to choose the source or the existing BOUND_CTRL fallback. 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.

<!-- greyfinch-sync:Marvisak/VIctory:review:6058157916 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2386#pullrequestreview-6058157916). Originally posted by [AndyLatimer](https://github.com/AndyLatimer) on 2026-11-25T13:06:47Z. **Review:** CHANGES_REQUESTED --- An active lane can now fold to the wrong constant when its DPP source has been disabled in `EXEC`. `simulate` masks destination writes, but `dpp_lane` ignores the source lane's `EXEC` bit and the instruction's `FI` flag. The identity permutation in the new test only exercises active sources for active destinations. I reproduced this at `c369dd4` with the following wave32 section. The DPP16 extension word is `0xff000001`, with both `FI` and `BOUND_CTRL` clear. ```asm s_or_saveexec_b32 s0, -1 v_mov_b32 v1, 7 v_mov_b32 v2, 11 s_mov_b32 exec_lo, -2 v_mov_b32_dpp v2, v1 quad_perm:[0,0,0,0] row_mask:0xf bank_mask:0xf v_readlane_b32 s5, v2, 1 s_mov_b32 exec_lo, s0 ``` Lane 1 selects inactive lane 0. The simulator records `Shape::K(7)` for `s5`. With those bits clear, lane 1 must retain `11`. Setting only `BOUND_CTRL` gives `0`. Setting `FI` permits the fetch of `7`. DPP8 has the same source-mask dependency: encoding `0xe9` supplies zero for an inactive source and `0xea` fetches its stored value. [LLVM DPP modifiers](https://llvm.org/docs/AMDGPUModifierSyntax.html#dpp-modifiers) · [AMD on the encoded BOUND_CTRL bit](https://gpuopen.com/learn/amd-gcn-assembly-cross-lane-operations/) Please pass the current `EXEC` into `dpp_lane`. For DPP16, use `inside && (fi || source_active)` to choose the source or the existing `BOUND_CTRL` fallback. 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`.
steven-seagull27 commented 2026-11-25 14:07:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by steven-seagull27 on 2026-11-25T13:40:46Z.


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 fixed v_readlane_b32 instructions read destinations 0–3. Once EXEC is restored, every invocation writes those four scalars.

Backend and wave PR, uniform input PR, invocation ID input With fix, invocation ID input
RTX 5080 Wave32 0/64 wrong 64/64 wrong 0/64 wrong
WARP 1.0.22 Wave32 0/64 wrong 64/64 wrong 0/64 wrong
WARP 1.0.22 Wave64 0/128 wrong 128/128 wrong 0/128 wrong

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 parent 751cbe3 refused 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 WaveReadLaneAt for 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:

git fetch https://github.com/steven-seagull27/VIctory.git codex/pr2386-track-dpp-source-lanes
git cherry-pick 3460757548e8944ba0f921ac7f914ab17da0d25e 91ee3b2f8f527f06c387a00197c89b446ec7d405
cargo test -p victory-shader --lib --locked narrowed_exec_dpp_ -- --nocapture --test-threads=1
<!-- greyfinch-sync:Marvisak/VIctory:comment:7164128923 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2386#issuecomment-7164128923). Originally posted by [steven-seagull27](https://github.com/steven-seagull27) on 2026-11-25T13:40:46Z. --- 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](https://github.com/steven-seagull27/VIctory/commit/3460757548e8944ba0f921ac7f914ab17da0d25e) and a [tested source-lane fix](https://github.com/steven-seagull27/VIctory/commit/91ee3b2f8f527f06c387a00197c89b446ec7d405) 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 fixed `v_readlane_b32` instructions read destinations 0–3. Once EXEC is restored, every invocation writes those four scalars. | Backend and wave | PR, uniform input | PR, invocation ID input | With fix, invocation ID input | |---|---:|---:|---:| | RTX 5080 Wave32 | 0/64 wrong | 64/64 wrong | 0/64 wrong | | WARP 1.0.22 Wave32 | 0/64 wrong | 64/64 wrong | 0/64 wrong | | WARP 1.0.22 Wave64 | 0/128 wrong | 128/128 wrong | 0/128 wrong | 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 parent `751cbe3` refused 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 `WaveReadLaneAt` for 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`: ```sh git fetch https://github.com/steven-seagull27/VIctory.git codex/pr2386-track-dpp-source-lanes git cherry-pick 3460757548e8944ba0f921ac7f914ab17da0d25e 91ee3b2f8f527f06c387a00197c89b446ec7d405 cargo test -p victory-shader --lib --locked narrowed_exec_dpp_ -- --nocapture --test-threads=1 ```
borosf commented 2026-11-25 14:07:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-25T13:52:52Z.


@AndyLatimer
Applied in 76e052f, exactly as you specified: dpp_lane now takes the current EXEC, DPP16 fetches only when inside && (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 via s_mov_b32 exec, -2, every lane reading it (quad_perm:[0,0,0,0], and the DPP8 group select), with a fixed v_readlane of 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-lanes reads 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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7164425306 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2386#issuecomment-7164425306). Originally posted by [borosf](https://github.com/borosf) on 2026-11-25T13:52:52Z. --- @AndyLatimer Applied in 76e052f, exactly as you specified: `dpp_lane` now takes the current EXEC, DPP16 fetches only when `inside && (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 via `s_mov_b32 exec, -2`, every lane reading it (`quad_perm:[0,0,0,0]`, and the DPP8 group select), with a fixed `v_readlane` of 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-lanes` reads 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 commented 2026-11-25 16:09:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:53:59Z.


Automated triage for the maintainers.

Needs work. This PR is stacked on #2344 (751cbe3, the refusal kinds). Since 09d0985, its own commits (998aae2, c369dd4, 76e052f, 09d0985) touch only crates/victory-shader/src/emit/wave.rs. dpp_lane now 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 current main.

What blocks it: 09d0985 puts back the exec != all refusal in simulate before dpp_lane is called. So the only call site always passes exec == 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_lane in 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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7167411463 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2386#issuecomment-7167411463). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T15:53:59Z. --- <!-- victory-triage v1 head=09d0985ee919432ff70fa4caf18f67bf350b51ce verdict=needs-work at=2026-11-25T18:44:36Z --> Automated triage for the maintainers. **Needs work.** This PR is stacked on #2344 (`751cbe3`, the refusal kinds). Since `09d0985`, its own commits (`998aae2`, `c369dd4`, `76e052f`, `09d0985`) touch only `crates/victory-shader/src/emit/wave.rs`. `dpp_lane` now 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 current `main`. What blocks it: `09d0985` puts back the `exec != all` refusal in `simulate` before `dpp_lane` is called. So the only call site always passes `exec == 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_lane` in 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](https://claude.ai/code)_
borosf commented 2026-11-25 18:02:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-25T17:15:11Z.


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 :)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7169230839 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2386#issuecomment-7169230839). Originally posted by [borosf](https://github.com/borosf) on 2026-11-25T17:15:11Z. --- 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 commented 2026-11-26 02:07:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by steven-seagull27 on 2026-11-26T01:23:47Z.


@borosf I opened the requested stacked PR against vibe/dpp-named-lanes-842ca5 at 09d0985. 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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7179730597 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2386#issuecomment-7179730597). Originally posted by [steven-seagull27](https://github.com/steven-seagull27) on 2026-11-26T01:23:47Z. --- @borosf I opened the [requested stacked PR](https://github.com/borosf/VIctory/pull/2) against `vibe/dpp-named-lanes-842ca5` at `09d0985`. 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.
AndyLatimer commented 2026-11-27 02:30:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AndyLatimer on 2026-11-27T02:30:47Z.

Review: COMMENTED


Verified 09d0985 locally against origin/main (63bcca4, clean merge) on Windows 11, Rust 1.98.1 MSVC:

  • My earlier inactive-source dpp_lane request from c369dd4 is resolved in 76e052f/09d0985: EXEC is passed into dpp_lane, DPP16 applies inside && (fi || source_active) with the BOUND_CTRL fallback, DPP8 zeroes on !fi && !source_active, and a_dpp_source_exec_leaves_out_arrives_by_the_isa_flags pins all cases on wave32 and wave64.
  • cargo test -p victory-shader --locked emit::wave: 9 passed, 0 failed.
  • cargo clippy -p victory-shader --all-targets --locked -- -D warnings: 0 warnings.

Clearing my earlier CHANGES_REQUESTED with a comment rather than an approval only because, as the automated triage on 09d0985 notes, the restored exec != all refusal leaves dpp_lane's inactive-source branches unreachable until #2344 + @steven-seagull27's stacked source-lane fix land.

Synthetic tests only; AI-assisted review.

<!-- greyfinch-sync:Marvisak/VIctory:review:6082710260 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2386#pullrequestreview-6082710260). Originally posted by [AndyLatimer](https://github.com/AndyLatimer) on 2026-11-27T02:30:47Z. **Review:** COMMENTED --- Verified `09d0985` locally against `origin/main` (`63bcca4`, clean merge) on Windows 11, Rust 1.98.1 MSVC: - My earlier inactive-source `dpp_lane` request from `c369dd4` is resolved in `76e052f`/`09d0985`: `EXEC` is passed into `dpp_lane`, DPP16 applies `inside && (fi || source_active)` with the `BOUND_CTRL` fallback, DPP8 zeroes on `!fi && !source_active`, and `a_dpp_source_exec_leaves_out_arrives_by_the_isa_flags` pins all cases on wave32 and wave64. - `cargo test -p victory-shader --locked emit::wave`: **9 passed, 0 failed**. - `cargo clippy -p victory-shader --all-targets --locked -- -D warnings`: **0 warnings**. Clearing my earlier `CHANGES_REQUESTED` with a comment rather than an approval only because, as the automated triage on `09d0985` notes, the restored `exec != all` refusal leaves `dpp_lane`'s inactive-source branches unreachable until `#2344` + `@steven-seagull27`'s stacked source-lane fix land. Synthetic tests only; AI-assisted review.
borosf commented 2026-11-27 10:52:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-27T10:52:11Z.


The triage is right and I am not going to argue with it: with the exec != all refusal back in wave.rs:503, dpp_lane's exec-aware branches are reachable only from the unit test, so on its own this PR changes no translation. Keeping it open as the carrier rather than closing it, and taking the path the triage names:

  1. land #2344 (triage verdict merge-candidate, CI green, merges cleanly) on its own — that is the dpp_lane naming/instruction-kind change with a real delta
  2. then lift the narrowed-EXEC refusal in the PR that needs it, and fold in the exec-aware dpp_lane, the emitted source-lane fix and the readback tests together, so the FI/BOUND_CTRL rules are exercised end to end rather than only in a test

@steven-seagull27 has the emitted-side half in a stacked PR against my branch — borosf/VIctory#2, "Shaders: preserve source lanes when lowering narrowed-EXEC DPP", +255/-38, mergeable. So when #2344 lands I can bring both halves onto one branch and open that single PR; nothing is lost by waiting, and it avoids two PRs that only make sense together.

If you would rather I close this one now and re-open the combined change, say so and I will.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7216403275 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2386#issuecomment-7216403275). Originally posted by [borosf](https://github.com/borosf) on 2026-11-27T10:52:11Z. --- The triage is right and I am not going to argue with it: with the `exec != all` refusal back in `wave.rs:503`, `dpp_lane`'s exec-aware branches are reachable only from the unit test, so on its own this PR changes no translation. Keeping it open as the carrier rather than closing it, and taking the path the triage names: 1. land **#2344** (triage verdict `merge-candidate`, CI green, merges cleanly) on its own — that is the `dpp_lane` naming/instruction-kind change with a real delta 2. then lift the narrowed-EXEC refusal in the PR that needs it, and fold in the exec-aware `dpp_lane`, the emitted source-lane fix and the readback tests **together**, so the FI/BOUND_CTRL rules are exercised end to end rather than only in a test @steven-seagull27 has the emitted-side half in a stacked PR against my branch — `borosf/VIctory#2`, *"Shaders: preserve source lanes when lowering narrowed-EXEC DPP"*, +255/-38, mergeable. So when #2344 lands I can bring both halves onto one branch and open that single PR; nothing is lost by waiting, and it avoids two PRs that only make sense together. If you would rather I close this one now and re-open the combined change, say so and I will.
borosf commented 2026-11-27 13:20:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-27T13:20:22Z.


Closing this: scrutinising it properly, the ISA work in it can never run.

wave.rs:503-508 refuses any exec != all before dpp_lane is reached, so at wave.rs:196/wave.rs:226 active(src) is always true, fi || active(src) is always true, and fetched == inside — the whole FI/BOUND_CTRL rewrite is byte-equivalent to main on the only reachable path. The live change is just two new refusal strings, which is not what the title claims.

On top of that, #3393 rewrites dpp_lane, Section, sections() and simulate() and adds the same EXEC/FI/BOUND_CTRL handling, so keeping this open only guarantees a conflict.

If the refusal is ever lifted, the ISA branch becomes live and the reasoning here may be worth reviving then — but as it stands it is dead code with a misleading title, and I would rather not leave that in a 400-PR queue. The two refusal strings are worth keeping; tell me if you want them as a small PR of their own.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7219356265 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2386#issuecomment-7219356265). Originally posted by [borosf](https://github.com/borosf) on 2026-11-27T13:20:22Z. --- Closing this: scrutinising it properly, the ISA work in it can never run. `wave.rs:503-508` refuses any `exec != all` **before** `dpp_lane` is reached, so at `wave.rs:196`/`wave.rs:226` `active(src)` is always true, `fi || active(src)` is always true, and `fetched == inside` — the whole FI/BOUND_CTRL rewrite is byte-equivalent to `main` on the only reachable path. The live change is just two new refusal strings, which is not what the title claims. On top of that, #3393 rewrites `dpp_lane`, `Section`, `sections()` and `simulate()` and adds the same EXEC/FI/BOUND_CTRL handling, so keeping this open only guarantees a conflict. If the refusal is ever lifted, the ISA branch becomes live and the reasoning here may be worth reviving then — but as it stands it is dead code with a misleading title, and I would rather not leave that in a 400-PR queue. The two refusal strings are worth keeping; tell me if you want them as a small PR of their own.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!2384
No description provided.