Shaders: a scalar a per-lane branch writes is the wave's after the join (#3562) #3593

Open
ColorMeBoom wants to merge 2 commits from upstream-pr/3593 into main
ColorMeBoom commented 2026-11-27 19:41:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ColorMeBoom on 2026-11-27T19:41:03Z.


Fixes #3562.

What was wrong

On the console a scalar register is one value per wave. Where some lanes of a wave take a branch and the rest skip it (s_and_saveexec_b64 + s_cbranch_execz), the wave runs the branch, and every lane reads what the branch left after the join (s_or_b64 exec). The per-lane form gives each lane the value along its own edge, so the lanes that skipped the branch kept the old value. A v_readlane, a whole-wave reduction's result (s_or_saveexec_b64 -1 … v_readlane_b32 sN, v, 0) or any scalar written under a lane branch was lost to them.

The change (emit/lower/joins.rs, hooked in after a block's phis)

At a per-lane join (!uniform_join(b)), each SGPR phi takes, in every lane, the value of a lane that came from the latest predecessor (in code order) that any lane came from. That's the path the console's wave ran last. Per lane: the predecessor's rank (an i32 phi), WaveActiveMax of it, WaveActiveMin of the lane index among the lanes with that rank, then WaveReadLaneAt for each scalar phi.

It applies only:

  • with the console's lanes (console_lanes: WaveSize at the console's width, so one host wave holds one console wave). Mesh programs and programs translated without console lanes are unchanged;
  • not at loop headers, and not when a loop lies between the branch and the join. There the per-lane form's scalars are each lane's own (a round count), so no single lane holds the console's value. break_loop got worse without this guard, and is unchanged with it;
  • not to masks (st.masks / st.highs) or EXEC.

lower.rs grows by 789 bytes (521,352, under the policy limit).

Measured

@Lyrnc's 151 hand-written GFX10 wave64 cases (gist), each compared lane by lane with the same code run natively on a gfx1036. RX 5700 XT (RDNA1), native WaveSize(64):

case kind main exact this PR exact
red_branch (reduction in a branch) 8 / 40 40 / 40
red_earlyout 1 / 6 6 / 6
red_nested 0 / 6 6 / 6
readlane_branch 4 / 20 10 / 20
everything else unchanged unchanged
all 59 / 151 108 / 151

No case is worse, and wrong output words go from 5,025 to 2,712. Still open:

  • firstlane_branch: that program has no console lanes, so the host's wave may group lanes differently and the change leaves it alone;
  • the other readlane_branch cases: they also differ inside the branch (a lane read of a lane outside EXEC), which this change doesn't cover;
  • the loop cases.

Test

synthetic_tests::a_scalar_a_lane_branch_writes_is_the_waves_after_the_join (through run_permute_cs, wave64): s38 = 0x5555, lanes 40-63 run v_readlane_b32 s38, v0, 45, then every lane stores s38.

  • With the fix (RX 5700 XT): all 64 lanes store 45. With no lane in the branch, all 64 keep 0x5555.
  • On main: lanes 0-39 store 0x5555.
  • WARP refuses WaveSize(64) there and is skipped, as in the other wave64 permute tests.

Checks

  • cargo test -p victory-shader --lib --features host, RX 5700 XT: 303 passed, 0 failed, 3 ignored.
  • VICTORY_WARP=1: 299 passed, 4 failed. Those are the same 4 synthetic_tests that fail on main alone with this machine's system WARP.
  • cargo clippy -p victory-shader --all-targets --all-features -- -D warnings: clean.
  • cargo xtask policy: ok.
  • No new rustfmt sites (the crate's existing 127 are unchanged).

Not tested: NVIDIA. On main this code path needs WaveSize(64), which 32-lane hosts refuse; on them it matters through #2633-style halves. Also not tested: other AMD generations, and the title.

AI use: Claude Code (Claude Opus 5.5).

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:5532191400 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3593). Originally posted by [ColorMeBoom](https://github.com/ColorMeBoom) on 2026-11-27T19:41:03Z. --- Fixes #3562. ## What was wrong On the console a scalar register is one value per wave. Where some lanes of a wave take a branch and the rest skip it (`s_and_saveexec_b64` + `s_cbranch_execz`), the wave runs the branch, and every lane reads what the branch left after the join (`s_or_b64 exec`). The per-lane form gives each lane the value along its own edge, so the lanes that skipped the branch kept the old value. A `v_readlane`, a whole-wave reduction's result (`s_or_saveexec_b64 -1` … `v_readlane_b32 sN, v, 0`) or any scalar written under a lane branch was lost to them. ## The change (`emit/lower/joins.rs`, hooked in after a block's phis) At a per-lane join (`!uniform_join(b)`), each SGPR phi takes, in every lane, the value of a lane that came from the latest predecessor (in code order) that any lane came from. That's the path the console's wave ran last. Per lane: the predecessor's rank (an `i32` phi), `WaveActiveMax` of it, `WaveActiveMin` of the lane index among the lanes with that rank, then `WaveReadLaneAt` for each scalar phi. It applies only: - with the console's lanes (`console_lanes`: `WaveSize` at the console's width, so one host wave holds one console wave). Mesh programs and programs translated without console lanes are unchanged; - not at loop headers, and not when a loop lies between the branch and the join. There the per-lane form's scalars are each lane's own (a round count), so no single lane holds the console's value. `break_loop` got worse without this guard, and is unchanged with it; - not to masks (`st.masks` / `st.highs`) or EXEC. `lower.rs` grows by 789 bytes (521,352, under the policy limit). ## Measured @Lyrnc's 151 hand-written GFX10 wave64 cases ([gist](https://gist.github.com/Lyrnc/00c6589f26930d5d07c077f8c4a30131)), each compared lane by lane with the same code run natively on a gfx1036. RX 5700 XT (RDNA1), native `WaveSize(64)`: | case kind | `main` exact | this PR exact | | --- | --- | --- | | `red_branch` (reduction in a branch) | 8 / 40 | **40 / 40** | | `red_earlyout` | 1 / 6 | **6 / 6** | | `red_nested` | 0 / 6 | **6 / 6** | | `readlane_branch` | 4 / 20 | **10 / 20** | | everything else | unchanged | unchanged | | **all** | **59 / 151** | **108 / 151** | No case is worse, and wrong output words go from 5,025 to 2,712. Still open: - `firstlane_branch`: that program has no console lanes, so the host's wave may group lanes differently and the change leaves it alone; - the other `readlane_branch` cases: they also differ inside the branch (a lane read of a lane outside EXEC), which this change doesn't cover; - the loop cases. ## Test `synthetic_tests::a_scalar_a_lane_branch_writes_is_the_waves_after_the_join` (through `run_permute_cs`, wave64): `s38 = 0x5555`, lanes 40-63 run `v_readlane_b32 s38, v0, 45`, then every lane stores `s38`. - With the fix (RX 5700 XT): all 64 lanes store 45. With no lane in the branch, all 64 keep `0x5555`. - On `main`: lanes 0-39 store `0x5555`. - WARP refuses `WaveSize(64)` there and is skipped, as in the other wave64 permute tests. ## Checks - `cargo test -p victory-shader --lib --features host`, RX 5700 XT: **303 passed, 0 failed, 3 ignored**. - `VICTORY_WARP=1`: 299 passed, 4 failed. Those are the same 4 `synthetic_tests` that fail on `main` alone with this machine's system WARP. - `cargo clippy -p victory-shader --all-targets --all-features -- -D warnings`: clean. - `cargo xtask policy`: ok. - No new rustfmt sites (the crate's existing 127 are unchanged). Not tested: NVIDIA. On `main` this code path needs `WaveSize(64)`, which 32-lane hosts refuse; on them it matters through #2633-style halves. Also not tested: other AMD generations, and the title. AI use: Claude Code (Claude Opus 5.5). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
andrewpozdnakov7-jpg commented 2026-11-28 13:11:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T13:11:30Z.


I replayed your #3562 regression on app-local WARP 1.0.22 with D3D12 Agility 1.620.2. This WARP version created the WaveSize(64) pipeline and executed the dispatches. Results matched with the D3D12 debug layer off and on.

  • At main 63bcca4, with only your test copied over, lanes 0-39 still wrote 0x5555 and lanes 40-63 wrote 45.
  • At the exact PR head 86630f4, all 64 lanes wrote 45 when the branch ran. All 64 kept 0x5555 in the empty-branch control. Neither run skipped the pipeline.

The full shader suite on 86630f4 had 299 passes, four failures, and three ignored in both debug settings. The same four tests also failed on main: the gather, two permute tests, and the edge-flagged triangle test. Main without the debug layer had one additional permute failure that did not recur in the focused synthetic suite.

This verifies the synthetic wave64 case on WARP. The RX 5700 XT results above remain the hardware evidence. AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7239758908 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3593#issuecomment-7239758908). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T13:11:30Z. --- I replayed your #3562 regression on app-local WARP 1.0.22 with D3D12 Agility 1.620.2. This WARP version created the WaveSize(64) pipeline and executed the dispatches. Results matched with the D3D12 debug layer off and on. - At main `63bcca4`, with only your test copied over, lanes 0-39 still wrote `0x5555` and lanes 40-63 wrote `45`. - At the exact PR head `86630f4`, all 64 lanes wrote `45` when the branch ran. All 64 kept `0x5555` in the empty-branch control. Neither run skipped the pipeline. The full shader suite on `86630f4` had 299 passes, four failures, and three ignored in both debug settings. The same four tests also failed on main: the gather, two permute tests, and the edge-flagged triangle test. Main without the debug layer had one additional permute failure that did not recur in the focused synthetic suite. This verifies the synthetic wave64 case on WARP. The RX 5700 XT results above remain the hardware evidence. AI-assisted with OpenAI Codex.
kilolimaVI commented 2026-11-28 15:59:24 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kilolimaVI on 2026-11-28T15:59:24Z.


First RDNA3 run: AMD Radeon 780M (RDNA3, gfx1103), Windows 11, head 86630f4.

  • Before (main 63bcca4 + this PR's test): fails on the hardware adapter. Lanes 0-39 read 21845, lanes 40-63 read 45; expected 45 in every lane.
  • After: passes, 5 of 5 runs.
  • WARP: "no pipeline for a wave of 64; skipped", as on other hosts.
  • Full suite (victory-shader + victory-gpu --features diagnostics): 552 passed.

So the defect reproduces on RDNA3 as on RDNA1.

AI-assisted (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7241888507 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3593#issuecomment-7241888507). Originally posted by [kilolimaVI](https://github.com/kilolimaVI) on 2026-11-28T15:59:24Z. --- First RDNA3 run: AMD Radeon 780M (RDNA3, gfx1103), Windows 11, head `86630f4`. - **Before** (main `63bcca4` + this PR's test): fails on the hardware adapter. Lanes 0-39 read 21845, lanes 40-63 read 45; expected 45 in every lane. - **After:** passes, 5 of 5 runs. - WARP: "no pipeline for a wave of 64; skipped", as on other hosts. - Full suite (`victory-shader` + `victory-gpu --features diagnostics`): 552 passed. So the defect reproduces on RDNA3 as on RDNA1. AI-assisted (Claude).
upipibi commented 2026-11-28 16:38:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-28T16:38:11Z.


NVIDIA row for this PR: on a 32-lane card the PR's test runs nothing. The RTX 3070 and this machine's WARP both refuse the WaveSize(64) pipeline, so the test passes with main's code too. A temporary wave32 copy of the same case does run on the 3070. It reproduces the defect on main, and the PR fixes it.

RTX 3070 (desktop), driver 616.56, Windows 11 Pro 10.0.26100, debug. Head 86630f4 on main 63bcca4 (one commit, clean).

  • cargo test --locked -p victory-shader --lib -- a_scalar_a_lane_branch_writes_is_the_waves_after_the_join --nocapture: 1 passed, 0 failed, 0 ignored, in 3 of 3 runs, and again in 3 of 3 runs with VICTORY_WARP=1, where every device is WARP. But nothing ran: for both iterations of every run, the test printed hardware: no pipeline for a wave of 64; skipped and warp: no pipeline for a wave of 64; skipped. The v_readlane_b32 sets console lanes, so the shader asks for the console's 64 lanes. This driver refuses that at pipeline creation, and so does this machine's system WARP. That matches the description's note on 32-lane hosts.

  • Negative control: main's emit/lower.rs, with emit/lower/joins.rs removed. git diff --stat HEAD: 2 files, 126 deletions. git diff --stat 63bcca4: only synthetic_tests.rs, 24 insertions. Result: 1 passed, 0 failed, in 3 of 3 runs on hardware and 3 of 3 with VICTORY_WARP=1, with the same two skip lines. The control passes on this card. On NVIDIA the PR's test cannot tell main from the fix.

  • To exercise the change on this card anyway, I made a temporary wave32 copy of the case. It uses s_and_saveexec_b32 s34, vcc_lo and s_or_b32 exec_lo, exec_lo, s34, and lanes 20-31 run v_readlane_b32 s38, v0, 25. A second iteration with from 31 puts no lane in the branch. I also added one temporary eprintln! of the readback in run_permute_cs, then restored the file. Command: cargo test --locked -p victory-shader --lib -- temp_wave32_scalar_a_lane_branch_writes a_scalar_a_lane_branch_writes_is_the_waves_after_the_join --nocapture --test-threads=1.

    • With the PR, hardware, in 3 of 3 runs: all 32 lanes read 25, and with no lane in the branch all 32 keep 0x5555. It passed.
    • With main's code, hardware, in 3 of 3 runs: lanes 0-19 read 0x5555 (21845) and lanes 20-31 read 25, where 25 is expected in every lane. That is the same pattern as the description's wave64 result on main (lanes 0-39 0x5555) and kilolimaVI's 780M (lanes 0-39 21845).
    • WARP refuses WaveSize(32) (warp: no pipeline for a wave of 32; skipped), so the wave32 copy has no WARP result. Under VICTORY_WARP=1 the copy hits run_permute_cs's assert!(warp || wave64) (hardware: no pipeline for a wave of 32) with both the PR's and main's code. That comes from the test helper, not from the PR.

    So a 32-lane host does take the new path through wave32 console programs, and not only through #2633-style halves: wave_scalars needs only console_lanes, not wave64. A wave32 copy of the test would give 32-lane hardware a check that fails on main.

  • cargo test --locked -p victory-shader --lib -- --skip heap_direct_texture_reads_mark_their_heap_index:

    • this PR: 299 passed, 3 failed, 3 ignored;
    • main 63bcca4: 298 passed, 3 failed, 3 ignored.

    The 3 failures are the same on both: stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride, stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros and synthetic_tests::gathers_at_a_level_match_the_hardware. The skipped test crashes the binary on this card (open issue #2571).

  • The PR does not touch victory-gpu, so I did not run its lib suite.

NVIDIA-specific: no wave64 at all, so the PR's own test is a no-op on NVIDIA. With the console's 32 lanes, the 3070 shows the defect on main and the fix with the PR.

Not tested:

  • wave64 on this card or on app-local WARP. andrewpozdnakov7-jpg's WARP 1.0.22 with Agility 1.620.2 does create the WaveSize(64) pipeline; this machine's system WARP does not.
  • #2633-style halves;
  • the loop guard (break_loop), nested and early-out reductions, and Lyrnc's 151 cases;
  • clippy, a title run.

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7242394843 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3593#issuecomment-7242394843). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-28T16:38:11Z. --- NVIDIA row for this PR: on a 32-lane card the PR's test runs nothing. The RTX 3070 and this machine's WARP both refuse the `WaveSize(64)` pipeline, so the test passes with main's code too. A temporary wave32 copy of the same case does run on the 3070. It reproduces the defect on main, and the PR fixes it. RTX 3070 (desktop), driver 616.56, Windows 11 Pro 10.0.26100, debug. Head `86630f4` on main `63bcca4` (one commit, clean). - `cargo test --locked -p victory-shader --lib -- a_scalar_a_lane_branch_writes_is_the_waves_after_the_join --nocapture`: 1 passed, 0 failed, 0 ignored, in 3 of 3 runs, and again in 3 of 3 runs with `VICTORY_WARP=1`, where every device is WARP. But nothing ran: for both iterations of every run, the test printed `hardware: no pipeline for a wave of 64; skipped` and `warp: no pipeline for a wave of 64; skipped`. The `v_readlane_b32` sets console lanes, so the shader asks for the console's 64 lanes. This driver refuses that at pipeline creation, and so does this machine's system WARP. That matches the description's note on 32-lane hosts. - Negative control: main's `emit/lower.rs`, with `emit/lower/joins.rs` removed. `git diff --stat HEAD`: 2 files, 126 deletions. `git diff --stat 63bcca4`: only `synthetic_tests.rs`, 24 insertions. Result: 1 passed, 0 failed, in 3 of 3 runs on hardware and 3 of 3 with `VICTORY_WARP=1`, with the same two skip lines. **The control passes on this card.** On NVIDIA the PR's test cannot tell main from the fix. - To exercise the change on this card anyway, I made a temporary wave32 copy of the case. It uses `s_and_saveexec_b32 s34, vcc_lo` and `s_or_b32 exec_lo, exec_lo, s34`, and lanes 20-31 run `v_readlane_b32 s38, v0, 25`. A second iteration with `from` 31 puts no lane in the branch. I also added one temporary `eprintln!` of the readback in `run_permute_cs`, then restored the file. Command: `cargo test --locked -p victory-shader --lib -- temp_wave32_scalar_a_lane_branch_writes a_scalar_a_lane_branch_writes_is_the_waves_after_the_join --nocapture --test-threads=1`. - With the PR, hardware, in 3 of 3 runs: all 32 lanes read 25, and with no lane in the branch all 32 keep `0x5555`. It passed. - With main's code, hardware, in 3 of 3 runs: lanes 0-19 read `0x5555` (21845) and lanes 20-31 read 25, where 25 is expected in every lane. That is the same pattern as the description's wave64 result on main (lanes 0-39 `0x5555`) and kilolimaVI's 780M (lanes 0-39 21845). - WARP refuses `WaveSize(32)` (`warp: no pipeline for a wave of 32; skipped`), so the wave32 copy has no WARP result. Under `VICTORY_WARP=1` the copy hits `run_permute_cs`'s `assert!(warp || wave64)` (`hardware: no pipeline for a wave of 32`) with both the PR's and main's code. That comes from the test helper, not from the PR. So a 32-lane host does take the new path through wave32 console programs, and not only through #2633-style halves: `wave_scalars` needs only `console_lanes`, not wave64. A wave32 copy of the test would give 32-lane hardware a check that fails on main. - `cargo test --locked -p victory-shader --lib -- --skip heap_direct_texture_reads_mark_their_heap_index`: - this PR: 299 passed, 3 failed, 3 ignored; - main `63bcca4`: 298 passed, 3 failed, 3 ignored. The 3 failures are the same on both: `stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride`, `stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros` and `synthetic_tests::gathers_at_a_level_match_the_hardware`. The skipped test crashes the binary on this card (open issue #2571). - The PR does not touch `victory-gpu`, so I did not run its lib suite. NVIDIA-specific: no wave64 at all, so the PR's own test is a no-op on NVIDIA. With the console's 32 lanes, the 3070 shows the defect on main and the fix with the PR. Not tested: - wave64 on this card or on app-local WARP. andrewpozdnakov7-jpg's WARP 1.0.22 with Agility 1.620.2 does create the `WaveSize(64)` pipeline; this machine's system WARP does not. - #2633-style halves; - the loop guard (`break_loop`), nested and early-out reductions, and Lyrnc's 151 cases; - clippy, a title run. AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
andrewpozdnakov7-jpg commented 2026-11-28 16:55:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T16:55:11Z.


I added a wave32 regression on top of 86630f4, following @upipibi's RTX 3070 report. It is available as test commit 1dbf4f4.

On app-local WARP 1.0.22 with Agility 1.620.2, main 63bcca4 with the same test left 0x5555 in lanes 0–19. At the PR head plus the test, all 32 lanes received 25 when the branch ran, and all 32 kept 0x5555 when no lane took it. The original wave64 case also passed. Both sizes executed with the D3D12 debug layer off and on. Strict shader Clippy in both configurations and the asset policy passed.

The test helper now treats explicitly forced WARP as software when a fixed-wave pipeline is unavailable. @kilolimaVI, the commit is ready to cherry-pick. @upipibi, the filter on the RTX 3070 is wave32_shares_the_scalar_written_by_a_lane_branch.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding it into another commit. AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7242613999 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3593#issuecomment-7242613999). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T16:55:11Z. --- I added a wave32 regression on top of `86630f4`, following @upipibi's RTX 3070 report. It is available as [test commit `1dbf4f4`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/1dbf4f46c5b2569caf3bf5122302c3f1c695dd0b). On app-local WARP 1.0.22 with Agility 1.620.2, main `63bcca4` with the same test left `0x5555` in lanes 0–19. At the PR head plus the test, all 32 lanes received 25 when the branch ran, and all 32 kept `0x5555` when no lane took it. The original wave64 case also passed. Both sizes executed with the D3D12 debug layer off and on. Strict shader Clippy in both configurations and the asset policy passed. The test helper now treats explicitly forced WARP as software when a fixed-wave pipeline is unavailable. @kilolimaVI, the commit is ready to cherry-pick. @upipibi, the filter on the RTX 3070 is `wave32_shares_the_scalar_written_by_a_lane_branch`. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding it into another commit. AI-assisted with OpenAI Codex.
upipibi commented 2026-11-28 16:59:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-28T16:59:51Z.


@andrewpozdnakov7-jpg your wave32 test 1dbf4f4 runs on the RTX 3070 (616.56, debug), and it tells the PR from main:

cargo test --locked -p victory-shader --lib -- wave32_shares_the_scalar_written_by_a_lane_branch --nocapture, 3 runs each:

  • 86630f4 + 1dbf4f4, hardware: 1 passed, 0 failed, 0 ignored. The 3070 runs both iterations. This machine's system WARP refuses WaveSize(32) (warp: no pipeline for a wave of 32; skipped).
  • The same with main's emit/lower.rs and without emit/lower/joins.rs (git diff --stat 63bcca4: only synthetic_tests.rs): 0 passed, 1 failed. hardware, left lanes 0-19 21845 and lanes 20-31 25, right all 25.
  • VICTORY_WARP=1, on both trees: 1 passed, but with the system WARP both legs print no pipeline for a wave of 32; skipped, so nothing runs there. Your forced_warp change does stop the assert! that used to fire.

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7242672853 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3593#issuecomment-7242672853). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-28T16:59:51Z. --- @andrewpozdnakov7-jpg your wave32 test [`1dbf4f4`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/1dbf4f46c5b2569caf3bf5122302c3f1c695dd0b) runs on the RTX 3070 (616.56, debug), and it tells the PR from main: `cargo test --locked -p victory-shader --lib -- wave32_shares_the_scalar_written_by_a_lane_branch --nocapture`, 3 runs each: - **`86630f4` + `1dbf4f4`, hardware:** 1 passed, 0 failed, 0 ignored. The 3070 runs both iterations. This machine's system WARP refuses `WaveSize(32)` (`warp: no pipeline for a wave of 32; skipped`). - **The same with main's `emit/lower.rs` and without `emit/lower/joins.rs`** (`git diff --stat 63bcca4`: only `synthetic_tests.rs`): 0 passed, 1 failed. `hardware`, left lanes 0-19 `21845` and lanes 20-31 `25`, right all `25`. - **`VICTORY_WARP=1`, on both trees:** 1 passed, but with the system WARP both legs print `no pipeline for a wave of 32; skipped`, so nothing runs there. Your `forced_warp` change does stop the `assert!` that used to fire. AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this.
ColorMeBoom commented 2026-11-28 17:11:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ColorMeBoom on 2026-11-28T17:11:47Z.


@andrewpozdnakov7-jpg @upipibi Thanks. I added the wave32 test 1dbf4f4 to this branch as-is, a fast-forward that keeps andrew's authorship. The head is now 1dbf4f4.

RX 5700 XT (Navi 10, RDNA1, 32 and 64 lanes, driver 32.0.21045.29003, Windows 11 26200), 3 runs each. This card runs both wave sizes, so both cases ran on hardware. System WARP refuses both (no pipeline for a wave of 32/64; skipped).

tree wave32_shares_the_scalar_written_by_a_lane_branch a_scalar_a_lane_branch_writes_is_the_waves_after_the_join (wave64)
before (1dbf4f4 with main's emit/lower.rs, without emit/lower/joins.rs) fails 3/3: lanes 0-19 21845, lanes 20-31 25 fails 3/3: lanes 0-39 21845, lanes 40-63 45
after (1dbf4f4) passes 3/3 passes 3/3

Full victory-shader --lib --features host at 1dbf4f4: 304 passed, 0 failed, 3 ignored.

With the 780M (RDNA3), the RTX 3070 and WARP 1.0.22, the defect now reproduces and is fixed on RDNA1, RDNA3 and NVIDIA, at both wave sizes.

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7242828285 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3593#issuecomment-7242828285). Originally posted by [ColorMeBoom](https://github.com/ColorMeBoom) on 2026-11-28T17:11:47Z. --- @andrewpozdnakov7-jpg @upipibi Thanks. I added the wave32 test [`1dbf4f4`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/1dbf4f46c5b2569caf3bf5122302c3f1c695dd0b) to this branch as-is, a fast-forward that keeps andrew's authorship. The head is now `1dbf4f4`. RX 5700 XT (Navi 10, RDNA1, 32 and 64 lanes, driver 32.0.21045.29003, Windows 11 26200), 3 runs each. This card runs both wave sizes, so both cases ran on hardware. System WARP refuses both (`no pipeline for a wave of 32/64; skipped`). | tree | `wave32_shares_the_scalar_written_by_a_lane_branch` | `a_scalar_a_lane_branch_writes_is_the_waves_after_the_join` (wave64) | |---|---|---| | **before** (`1dbf4f4` with main's `emit/lower.rs`, without `emit/lower/joins.rs`) | fails 3/3: lanes 0-19 `21845`, lanes 20-31 `25` | fails 3/3: lanes 0-39 `21845`, lanes 40-63 `45` | | **after** (`1dbf4f4`) | passes 3/3 | passes 3/3 | Full `victory-shader --lib --features host` at `1dbf4f4`: 304 passed, 0 failed, 3 ignored. With the 780M (RDNA3), the RTX 3070 and WARP 1.0.22, the defect now reproduces and is fixed on RDNA1, RDNA3 and NVIDIA, at both wave sizes. AI use: Claude Code (Claude Opus 5.5).
kilolimaVI commented 2026-11-28 19:40:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kilolimaVI on 2026-11-28T19:40:58Z.


@andrewpozdnakov7-jpg RDNA3 wave32 row for 1dbf4f4: Radeon 780M (gfx1103, runs both wave sizes), Windows 11.

tree wave32_shares_the_scalar_written_by_a_lane_branch a_scalar_a_lane_branch_writes_is_the_waves_after_the_join (wave64)
main's lower.rs, without joins.rs fails: lanes 0-19 21845, lanes 20-31 25 fails: lanes 0-39 21845, lanes 40-63 45
1dbf4f4 passes, 5 of 5 runs passes, 5 of 5 runs

System WARP skips both sizes, as for the others. Full suite (victory-shader + victory-gpu --features diagnostics): 553 passed.

Same lanes as the RTX 3070 and RDNA1, so with ColorMeBoom's table every wave size on every family here reproduces it on main and passes with the PR.

AI-assisted (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7244726798 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3593#issuecomment-7244726798). Originally posted by [kilolimaVI](https://github.com/kilolimaVI) on 2026-11-28T19:40:58Z. --- @andrewpozdnakov7-jpg RDNA3 wave32 row for `1dbf4f4`: Radeon 780M (gfx1103, runs both wave sizes), Windows 11. | tree | `wave32_shares_the_scalar_written_by_a_lane_branch` | `a_scalar_a_lane_branch_writes_is_the_waves_after_the_join` (wave64) | |---|---|---| | main's `lower.rs`, without `joins.rs` | fails: lanes 0-19 21845, lanes 20-31 25 | fails: lanes 0-39 21845, lanes 40-63 45 | | `1dbf4f4` | passes, 5 of 5 runs | passes, 5 of 5 runs | System WARP skips both sizes, as for the others. Full suite (`victory-shader` + `victory-gpu --features diagnostics`): 553 passed. Same lanes as the RTX 3070 and RDNA1, so with ColorMeBoom's table every wave size on every family here reproduces it on main and passes with the PR. AI-assisted (Claude).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3593:upstream-pr/3593'
git switch 'upstream-pr/3593'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3593'
git switch 'upstream-pr/3593'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3593'
git switch 'upstream-pr/3593'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3593'
git switch 'main'
git merge --squash 'upstream-pr/3593'
git switch 'main'
git merge --ff-only 'upstream-pr/3593'
git switch 'main'
git merge 'upstream-pr/3593'
git push origin 'main'
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!3593
No description provided.