Shaders: console wave64 compute on 32-lane hosts (split waves) #1888

Open
beamdotdev wants to merge 4 commits from upstream-pr/1890 into main
beamdotdev commented 2026-11-25 00:11:53 +00:00 (Migrated from github.com)

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


Problem

A compute program that depends on its lane layout (cross-lane reads, lane masks read as numbers, LDS shared within one wave) declares the console's wave size. On a device without 64-lane waves (NVIDIA: WaveLaneCountMin = Max = 32), every wave64 one is refused by CreateComputePipelineState with E_INVALIDARG ("Shader wants wave lane count of 64 but maximum wave lane count for device is 32"), and its dispatches are dropped.

What this does

Such a program now runs split: it declares WaveSize(32), and each console wave runs as two host waves, its low and high half (console lanes 0-31 and 32-63). Thread ids, lane numbers and masks stay the console's.

  • Within a half, nothing extra: DPP, ds_swizzle and v_permlanex16 stay within 32 lanes; v_mbcnt, v_writelane and lane bits of masks use the console lane.
  • Exact where the group runs together: ballots of masks read as data, v_readlane, v_readfirstlane of a varying value, and whole-wave reductions and prefix sums combine the two halves' parts through a few group-shared dwords between two thread-group barriers. A barrier needs the whole group, so this happens only in blocks no lane branch decides whether (or how often) a lane reaches (emit::split::convergent, a post-dominator pass): with one console wave per group, outside any lane branch's region; with several waves, before the first branch.
  • Per half elsewhere: in divergent code each half works over its own 32 lanes, as pixel and vertex programs already do over the host's wave (MaskData::Host). This is right for what that code mostly does (wave-aggregated atomics, scalarization loops) and wrong where the code needs one value for all 64 lanes; it is marked shortcut: in lower.rs.
  • v_readfirstlane of a value that is the same in every lane (scalar arithmetic in VGPRs) needs no exchange, so it works in divergent code too.
  • One-wave groups get the LDS barriers the console compiler leaves out (after writes, and at joins after divergent code).
  • Refused when split: 16-bit wave reductions and ds_bpermute_b32 (both would need the other half's lanes), and programs whose LDS leaves no room for the exchange dwords in 32 KiB.

The device's width reaches the translator when victory-gpu creates the device (a run now creates it before its first translation), and when the offline victory translate --pipelines and the warm-up translate --cache do (both print host waves up to N lanes first). The shader cache keys on it and now opens on its first translation, after the device: before, it opened at start-up with the width still unset, so its key always said 64, and the warm-up cached WaveSize(64) translations that a run on a 32-lane host then took from the cache (found by a second session testing the warm-up: 395 pipelines still refused). VICTORY_HOST_WAVE_MAX=32 translates split on any device. Devices with 64-lane waves translate exactly as before.

Measured

Windows 11, RTX 3070 (32-lane waves only), Series X 1.0.2.1 files, victory translate --pipelines (before the port onto current main; the shader code is the same):

translated host pipelines created
compute 1,439 of 2,582 1,439
vertex/pixel 12,243 of 14,039 12,243
mesh 8,214 of 8,713 8,214

Every compute program that translates gets a pipeline. The same files on a 64-lane host translate 1,441 compute programs; the 2 not translated split are vfx_triangleClip programs with no group-shared memory left for the exchange. Without this change, all ~320 programs that need 64-lane waves are refused on the 3070.

The title ran with it on the 3070 to the first mission's title card ("Vice City, two years ago") at about 1 fps, then the host device was removed after a 7 s submission (the world hang the README describes, also seen on AMD). That submission held about 8 split programs among 69 pipelines, so this run does not show whether they are involved; a run with them skipped is the next check.

Tests

  • emit::split_tests (new, GPU): a wave64 program of one console wave checking per lane a mask count across both halves (s_bcnt1_i32_b64), the lane index (v_mbcnt), a read of high-half lane 45 (v_readlane), v_readfirstlane, and s_ff1_i32_b64 of a high-lanes-only mask, built for 64-lane and for 32-lane hosts; and a v_readlane inside a lane branch, which reads within its half. Both pass on the RTX 3070 (the 64-lane build is skipped there, and WARP, at 4 lanes, skips both).
  • emit::split::tests: post-dominators of an if and a loop.
  • cargo clippy --workspace --all-targets --locked -- -D warnings and with --all-features: clean.
  • cargo test --workspace --locked --no-fail-fast: 474 passed, 5 failed, 7 ignored. The 5 failures (dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views, two stride_tests, gathers_at_a_level_match_the_hardware) fail on main without this change on the same machine.

Relation to #189 / #1589 / #1638

#189 (bundled in #1589 and #1638) solves the same problem with the same layout (two 32-lane waves per console wave, group-shared memory between barriers) and more besides: a barrier-free path for groups of 32 threads or fewer, an Emulate mode without a declared wave size, which also covers WARP, and SGPR spills to lanes 32 and up. Those bundles are stacked on other open pull requests. This is a smaller change written against current main; if #189 is taken instead, the GPU tests here can check it.

The wave-wide loop exit (Atom::WaveAny) is not on main; when it lands, a split program needs it exchanged as well.

AI-assisted (Claude Code); no game data is used or committed.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:5482579445 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1890). Originally posted by [beamdotdev](https://github.com/beamdotdev) on 2026-11-25T00:11:53Z. --- ### Problem A compute program that depends on its lane layout (cross-lane reads, lane masks read as numbers, LDS shared within one wave) declares the console's wave size. On a device without 64-lane waves (NVIDIA: `WaveLaneCountMin = Max = 32`), every wave64 one is refused by `CreateComputePipelineState` with `E_INVALIDARG` ("Shader wants wave lane count of 64 but maximum wave lane count for device is 32"), and its dispatches are dropped. ### What this does Such a program now runs **split**: it declares `WaveSize(32)`, and each console wave runs as two host waves, its low and high half (console lanes 0-31 and 32-63). Thread ids, lane numbers and masks stay the console's. - **Within a half, nothing extra:** DPP, `ds_swizzle` and `v_permlanex16` stay within 32 lanes; `v_mbcnt`, `v_writelane` and lane bits of masks use the console lane. - **Exact where the group runs together:** ballots of masks read as data, `v_readlane`, `v_readfirstlane` of a varying value, and whole-wave reductions and prefix sums combine the two halves' parts through a few group-shared dwords between two thread-group barriers. A barrier needs the whole group, so this happens only in blocks no lane branch decides whether (or how often) a lane reaches (`emit::split::convergent`, a post-dominator pass): with one console wave per group, outside any lane branch's region; with several waves, before the first branch. - **Per half elsewhere:** in divergent code each half works over its own 32 lanes, as pixel and vertex programs already do over the host's wave (`MaskData::Host`). This is right for what that code mostly does (wave-aggregated atomics, scalarization loops) and wrong where the code needs one value for all 64 lanes; it is marked `shortcut:` in `lower.rs`. - `v_readfirstlane` of a value that is the same in every lane (scalar arithmetic in VGPRs) needs no exchange, so it works in divergent code too. - One-wave groups get the LDS barriers the console compiler leaves out (after writes, and at joins after divergent code). - **Refused when split:** 16-bit wave reductions and `ds_bpermute_b32` (both would need the other half's lanes), and programs whose LDS leaves no room for the exchange dwords in 32 KiB. The device's width reaches the translator when `victory-gpu` creates the device (a run now creates it before its first translation), and when the offline `victory translate --pipelines` and the warm-up `translate --cache` do (both print `host waves up to N lanes` first). The shader cache keys on it and now opens on its first translation, after the device: before, it opened at start-up with the width still unset, so its key always said 64, and the warm-up cached WaveSize(64) translations that a run on a 32-lane host then took from the cache (found by a second session testing the warm-up: 395 pipelines still refused). `VICTORY_HOST_WAVE_MAX=32` translates split on any device. Devices with 64-lane waves translate exactly as before. ### Measured Windows 11, **RTX 3070** (32-lane waves only), Series X 1.0.2.1 files, `victory translate --pipelines` (before the port onto current `main`; the shader code is the same): | | translated | host pipelines created | |---|---|---| | compute | 1,439 of 2,582 | 1,439 | | vertex/pixel | 12,243 of 14,039 | 12,243 | | mesh | 8,214 of 8,713 | 8,214 | Every compute program that translates gets a pipeline. The same files on a 64-lane host translate 1,441 compute programs; the 2 not translated split are `vfx_triangleClip` programs with no group-shared memory left for the exchange. Without this change, all ~320 programs that need 64-lane waves are refused on the 3070. The title ran with it on the 3070 to the first mission's title card ("Vice City, two years ago") at about 1 fps, then the host device was removed after a 7 s submission (the world hang the README describes, also seen on AMD). That submission held about 8 split programs among 69 pipelines, so this run does not show whether they are involved; a run with them skipped is the next check. ### Tests - `emit::split_tests` (new, GPU): a wave64 program of one console wave checking per lane a mask count across both halves (`s_bcnt1_i32_b64`), the lane index (`v_mbcnt`), a read of high-half lane 45 (`v_readlane`), `v_readfirstlane`, and `s_ff1_i32_b64` of a high-lanes-only mask, built for 64-lane and for 32-lane hosts; and a `v_readlane` inside a lane branch, which reads within its half. Both pass on the RTX 3070 (the 64-lane build is skipped there, and WARP, at 4 lanes, skips both). - `emit::split::tests`: post-dominators of an if and a loop. - `cargo clippy --workspace --all-targets --locked -- -D warnings` and with `--all-features`: clean. - `cargo test --workspace --locked --no-fail-fast`: 474 passed, 5 failed, 7 ignored. The 5 failures (`dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views`, two `stride_tests`, `gathers_at_a_level_match_the_hardware`) fail on `main` without this change on the same machine. ### Relation to #189 / #1589 / #1638 #189 (bundled in #1589 and #1638) solves the same problem with the same layout (two 32-lane waves per console wave, group-shared memory between barriers) and more besides: a barrier-free path for groups of 32 threads or fewer, an `Emulate` mode without a declared wave size, which also covers WARP, and SGPR spills to lanes 32 and up. Those bundles are stacked on other open pull requests. This is a smaller change written against current `main`; if #189 is taken instead, the GPU tests here can check it. The wave-wide loop exit (`Atom::WaveAny`) is not on `main`; when it lands, a split program needs it exchanged as well. AI-assisted (Claude Code); no game data is used or committed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
catminou4 commented 2026-11-25 00:32:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T00:32:46Z.

Review: COMMENTED


Mixed PR: shader/formats parts are macOS-tested in the batch; GPU/HLE parts are Windows-only statics.

Console wave64 compute on 32-lane hosts (split waves): apps+docs+gpu+shader mixed — the wave64 split is the riskiest shader change this wave; shader part tested in batch, GPU part Windows-only.

<!-- greyfinch-sync:Marvisak/VIctory:review:6049697304 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1890#pullrequestreview-6049697304). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T00:32:46Z. **Review:** COMMENTED --- Mixed PR: shader/formats parts are macOS-tested in the batch; GPU/HLE parts are Windows-only statics. Console wave64 compute on 32-lane hosts (split waves): apps+docs+gpu+shader mixed — the wave64 split is the riskiest shader change this wave; shader part tested in batch, GPU part Windows-only.
upipibi commented 2026-11-25 01:07:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T00:29:02Z.


Ran on the kind of device this is for: RTX 3070 (Ampere, WaveLaneCountMin = Max = 32), driver 616.56, Windows 11, debug, at d047e12.

  • cargo test -p victory-shader --locked: 209 passed, 3 failed, 2 ignored. The 3 are #1744's NVIDIA failures on main. Both new split tests run and pass here: a_split_wave64_gives_the_consoles_lanes_masks_and_reads and a_split_lane_read_in_a_lane_branch_reads_within_its_half.
  • cargo test -p victory-gpu --locked: 76 passed, with the two NVIDIA heap-cap failures main also has.

Not run: a title.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148555957 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1890#issuecomment-7148555957). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T00:29:02Z. --- Ran on the kind of device this is for: RTX 3070 (Ampere, `WaveLaneCountMin = Max = 32`), driver 616.56, Windows 11, debug, at `d047e12`. - `cargo test -p victory-shader --locked`: 209 passed, 3 failed, 2 ignored. The 3 are #1744's NVIDIA failures on `main`. Both new split tests run and pass here: `a_split_wave64_gives_the_consoles_lanes_masks_and_reads` and `a_split_lane_read_in_a_lane_branch_reads_within_its_half`. - `cargo test -p victory-gpu --locked`: 76 passed, with the two NVIDIA heap-cap failures `main` also has. Not run: a title. AI-assisted (Claude Code).
Marvisak commented 2026-11-25 02:06:16 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:37:50Z.


Automated triage for the maintainers.

The current head (73ee4dd) still conflicts with main, in crates/victory-gpu/src/shader_cache.rs, crates/victory-shader/src/emit/host.rs, lower.rs, mod.rs and several *_tests.rs files under crates/victory-shader/src/emit/. It will be reviewed once it is rebased onto current main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149771366 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1890#issuecomment-7149771366). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:37:50Z. --- <!-- victory-triage v1 head=73ee4dd0c01b204c3b94f4268cf7cd8b48b197cb verdict=needs-rebase at=2026-11-25T03:21:30Z --> Automated triage for the maintainers. The current head (`73ee4dd`) still conflicts with `main`, in `crates/victory-gpu/src/shader_cache.rs`, `crates/victory-shader/src/emit/host.rs`, `lower.rs`, `mod.rs` and several `*_tests.rs` files under `crates/victory-shader/src/emit/`. It will be reviewed once it is rebased onto current `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
KainanP commented 2026-11-25 19:06:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by KainanP on 2026-11-25T18:17:04Z.


On a 16-lane Intel iGPU (UHD 8086:a78b, WaveLaneCount 16..16), host_wave_max = 16 still splits and declares WaveSize(32), which that driver refuses at pipeline creation. a_split_wave64_gives_the_consoles_lanes_masks_and_reads then fails with no device ran the program; it fails the same way with VICTORY_WARP=1. On the RTX 4060 both split tests pass. Details and table: https://github.com/Marvisak/VIctory/issues/2220#issuecomment-7170692046

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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7170696879 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1890#issuecomment-7170696879). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-25T18:17:04Z. --- On a 16-lane Intel iGPU (UHD `8086:a78b`, `WaveLaneCount` 16..16), `host_wave_max` = 16 still splits and declares `WaveSize(32)`, which that driver refuses at pipeline creation. `a_split_wave64_gives_the_consoles_lanes_masks_and_reads` then fails with `no device ran the program`; it fails the same way with `VICTORY_WARP=1`. On the RTX 4060 both split tests pass. Details and table: https://github.com/Marvisak/VIctory/issues/2220#issuecomment-7170692046 _AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this._
steven-seagull27 commented 2026-11-26 03:05:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by steven-seagull27 on 2026-11-26T02:21:08Z.


I found a first-lane mismatch in a converged 64-thread workgroup on 73ee4dd. The guest computes v5 = 100 + tid, narrows EXEC with a vector compare and s_and_saveexec_b64, reads v_readfirstlane_b32 s14, v5, restores EXEC, and writes s14 to all 64 outputs. The whole shader is one basic block. The five masks select first lane 0, 7, 39, 63, or no lanes (which should return lane 0's value, 100).

Wrong output dwords out of 320 PR head Elect inside guest EXEC in each host wave¹ Also choose the participating half
RTX 5080, split Wave32 192 128 0
WARP 1.0.22, split Wave32 192 128 0
WARP 1.0.22, native Wave64 192 0 0

¹ For the middle column I ported only the physical-wave ballot/election from #2830 onto this head. That fixes lane 7. For lane 39, each split Wave32 dispatch still returned 100 in all 64 outputs, where 139 was expected. EXEC's entire low word is zero in this case. Built-in WARP advertises only Wave4 here, so neither pipeline ran.

Commit 6cfdabb adds the regression and elects across halves with the existing two-dword exchange. Each half supplies its value and whether it has a participating lane. When both are empty, the lower half supplies lane zero. The three split tests passed on the RTX and the shader crate passed Clippy with warnings denied. The commit is based directly on this PR head for use during the rebase.

git fetch https://github.com/steven-seagull27/VIctory.git codex/pr1890-masked-first-lane
git cherry-pick 6cfdabb
cargo test -p victory-shader --lib emit::split_tests:: -- --nocapture
<!-- greyfinch-sync:Marvisak/VIctory:comment:7180720630 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1890#issuecomment-7180720630). Originally posted by [steven-seagull27](https://github.com/steven-seagull27) on 2026-11-26T02:21:08Z. --- I found a first-lane mismatch in a converged 64-thread workgroup on `73ee4dd`. The guest computes `v5 = 100 + tid`, narrows EXEC with a vector compare and `s_and_saveexec_b64`, reads `v_readfirstlane_b32 s14, v5`, restores EXEC, and writes s14 to all 64 outputs. The whole shader is one basic block. The five masks select first lane 0, 7, 39, 63, or no lanes (which should return lane 0's value, 100). | Wrong output dwords out of 320 | PR head | Elect inside guest EXEC in each host wave¹ | Also choose the participating half | |---|---:|---:|---:| | RTX 5080, split Wave32 | 192 | 128 | 0 | | WARP 1.0.22, split Wave32 | 192 | 128 | 0 | | WARP 1.0.22, native Wave64 | 192 | 0 | 0 | ¹ For the middle column I ported only the physical-wave ballot/election from #2830 onto this head. That fixes lane 7. For lane 39, each split Wave32 dispatch still returned 100 in all 64 outputs, where 139 was expected. EXEC's entire low word is zero in this case. Built-in WARP advertises only Wave4 here, so neither pipeline ran. [Commit 6cfdabb](https://github.com/steven-seagull27/VIctory/commit/6cfdabb121d148377986e6a3524efd956f8f060f) adds the regression and elects across halves with the existing two-dword exchange. Each half supplies its value and whether it has a participating lane. When both are empty, the lower half supplies lane zero. The three split tests passed on the RTX and the shader crate passed Clippy with warnings denied. The commit is based directly on this PR head for use during the rebase. ```sh git fetch https://github.com/steven-seagull27/VIctory.git codex/pr1890-masked-first-lane git cherry-pick 6cfdabb cargo test -p victory-shader --lib emit::split_tests:: -- --nocapture ```
luciano-repetti commented 2026-11-26 14:01:52 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by luciano-repetti on 2026-11-26T13:30:07Z.


Tested on two GPUs this PR hasn't been run on yet, both with 32-lane waves at most: NVIDIA RTX 3050 6GB Laptop (Ampere, driver 566.07) and Intel Arc iGPU (Meteor Lake, Core Ultra 9 185H, driver 32.0.101.6127). Windows 11 26200, MSVC 2022, Rust 1.98.1 (pinned), debug, cargo test -p victory-shader --locked, PR head 73ee4dd against its base 70564ae. No game files, so only the unit and GPU tests. Each GPU was made the default adapter for the test executable through the Windows per-app GPU preference.

RTX 3050 (Ampere) Arc (Meteor Lake)
base 70564ae 206 passed, 3 failed 202 passed, 7 failed
PR 73ee4dd 209 passed, 3 failed 205 passed, 7 failed
  • emit::split_tests (both tests) pass on both GPUs on the 32-lane path; the 64-lane builds are refused there and skipped, as expected.
  • No regressions in the existing suite: the failing tests are the same set at the base and at the PR head on each GPU. This says nothing about the v_readfirstlane_b32 mismatch reported above, which these tests don't cover; I haven't run that case.
  • RTX 3050 failures (same as the RTX 3070 run above, #1744): 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, synthetic_tests::gathers_at_a_level_match_the_hardware.
  • Arc failures, also on the base (not from this PR), in case they're useful elsewhere:
    • semantics_tests::arithmetic_matches_the_hardware: v_mad_f32 / v_mac_f32 mismatch the model on 102 of 14,440 inputs (WARP 0), e.g. in [00800000, 80800000, 00000000] want 00000000 got 80000000 (sign of a zero from an underflowing product).
    • bvh_tests::intersections_* (3 tests): hit distance off by 1 ULP (1118671093 vs 1118671094).
    • valu_tests::fspx_programs_run_with_the_hardwares_dot_products: 2147483504 vs 2147483312.
    • valu_tests::image_atomics_of_64_bits and stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros: E_INVALIDARG creating the pipeline / dispatching.

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7193437888 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1890#issuecomment-7193437888). Originally posted by [luciano-repetti](https://github.com/luciano-repetti) on 2026-11-26T13:30:07Z. --- Tested on two GPUs this PR hasn't been run on yet, both with 32-lane waves at most: NVIDIA RTX 3050 6GB Laptop (Ampere, driver 566.07) and Intel Arc iGPU (Meteor Lake, Core Ultra 9 185H, driver 32.0.101.6127). Windows 11 26200, MSVC 2022, Rust 1.98.1 (pinned), debug, `cargo test -p victory-shader --locked`, PR head `73ee4dd` against its base `70564ae`. No game files, so only the unit and GPU tests. Each GPU was made the default adapter for the test executable through the Windows per-app GPU preference. | | RTX 3050 (Ampere) | Arc (Meteor Lake) | |---|---|---| | base `70564ae` | 206 passed, 3 failed | 202 passed, 7 failed | | PR `73ee4dd` | 209 passed, 3 failed | 205 passed, 7 failed | - `emit::split_tests` (both tests) pass on both GPUs on the 32-lane path; the 64-lane builds are refused there and skipped, as expected. - No regressions in the existing suite: the failing tests are the same set at the base and at the PR head on each GPU. This says nothing about the `v_readfirstlane_b32` mismatch reported above, which these tests don't cover; I haven't run that case. - RTX 3050 failures (same as the RTX 3070 run above, #1744): `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`, `synthetic_tests::gathers_at_a_level_match_the_hardware`. - Arc failures, also on the base (not from this PR), in case they're useful elsewhere: - `semantics_tests::arithmetic_matches_the_hardware`: `v_mad_f32` / `v_mac_f32` mismatch the model on 102 of 14,440 inputs (WARP 0), e.g. in `[00800000, 80800000, 00000000]` want `00000000` got `80000000` (sign of a zero from an underflowing product). - `bvh_tests::intersections_*` (3 tests): hit distance off by 1 ULP (`1118671093` vs `1118671094`). - `valu_tests::fspx_programs_run_with_the_hardwares_dot_products`: `2147483504` vs `2147483312`. - `valu_tests::image_atomics_of_64_bits` and `stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros`: `E_INVALIDARG` creating the pipeline / dispatching. AI-assisted.
andrewpozdnakov7-jpg commented 2026-11-26 15:02:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-26T14:16:40Z.


I resolved the conflicts between 73ee4dd and current main (63bcca4) in ab0d7e8. It keeps both parents, including the current view-mark and shader-cache paths. e400c3f adds @steven-seagull27's first-lane fix and regression with his Git authorship intact. The integration passes guest EXEC to source-lane election and keeps the scalar write unconditional.

On D3D12 Agility 1.620.2 / WARP 1.0.22 with DXIL validation, I ran the same five masks through split Wave32 and native Wave64 three times. The merge alone returned 384 wrong dwords out of 640 each time. With the fix all 640/640 matched each time. All three split tests passed. The full shader suite was 302 passed, 4 failed, 3 ignored. The same four tests failed on main in this WARP setup. Strict all-feature workspace Clippy and the repository asset-policy check passed.

@beamdotdev, the integration branch can fast-forward the current PR head. A run of the new regression on a physical 32-lane adapter would complement the WARP results. The Intel 16-lane case reported above and the game were outside this run.

Please retain the Git authors when picking up the branch. If folding my integration into another commit, use Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7194546932 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1890#issuecomment-7194546932). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-26T14:16:40Z. --- I resolved the conflicts between `73ee4dd` and current `main` (`63bcca4`) in [`ab0d7e8`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/ab0d7e8eaa532cebc5ad0d32c4669710e0464b46). It keeps both parents, including the current view-mark and shader-cache paths. [`e400c3f`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/e400c3fd685606319bbcbb094bc0807fb27f7d43) adds @steven-seagull27's first-lane fix and regression with his Git authorship intact. The integration passes guest EXEC to source-lane election and keeps the scalar write unconditional. On D3D12 Agility 1.620.2 / WARP 1.0.22 with DXIL validation, I ran the same five masks through split Wave32 and native Wave64 three times. The merge alone returned **384 wrong dwords out of 640** each time. With the fix all **640/640** matched each time. All three split tests passed. The full shader suite was 302 passed, 4 failed, 3 ignored. The same four tests failed on `main` in this WARP setup. Strict all-feature workspace Clippy and the repository asset-policy check passed. @beamdotdev, [the integration branch](https://github.com/andrewpozdnakov7-jpg/VIctory/tree/codex/pr1890-wave32-current-main) can fast-forward the current PR head. A run of the new regression on a physical 32-lane adapter would complement the WARP results. The Intel 16-lane case reported above and the game were outside this run. Please retain the Git authors when picking up the branch. If folding my integration into another commit, use `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`.
Venom2054 commented 2026-11-26 15:02:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Venom2054 on 2026-11-26T14:24:00Z.


Confirmed the integration on a physical RTX 5070 Ti. D3D12 reports 32 lanes for both the minimum and maximum. I ran the five masks from converged_first_lane_respects_both_exec_words three times per revision, with Windows SDK DXIL validation and GPU readback.

Revision Wrong dwords out of 320 per run (split Wave32)
ab0d7e8 192, 192, 192
e400c3f 0, 0, 0

The parent returned 100 where the three affected masks expected 107, 139, and 163. The full and empty masks returned the expected 100 on both revisions. Each run counts five 64-dword readbacks. The driver declined native Wave64 as expected on this adapter. This was a synthetic shader test.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7194765409 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1890#issuecomment-7194765409). Originally posted by [Venom2054](https://github.com/Venom2054) on 2026-11-26T14:24:00Z. --- Confirmed the integration on a physical RTX 5070 Ti. D3D12 reports 32 lanes for both the minimum and maximum. I ran the five masks from `converged_first_lane_respects_both_exec_words` three times per revision, with Windows SDK DXIL validation and GPU readback. | Revision | Wrong dwords out of 320 per run (split Wave32) | | --- | --- | | `ab0d7e8` | 192, 192, 192 | | `e400c3f` | 0, 0, 0 | The parent returned 100 where the three affected masks expected 107, 139, and 163. The full and empty masks returned the expected 100 on both revisions. Each run counts five 64-dword readbacks. The driver declined native Wave64 as expected on this adapter. This was a synthetic shader test.
beamdotdev commented 2026-11-26 16:05:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by beamdotdev on 2026-11-26T15:15:49Z.


Thanks @andrewpozdnakov7-jpg. I fast-forwarded the PR branch to your integration branch, so the head is now e400c3f (from 73ee4dd). Nothing was rewritten: you stay the author of the merge ab0d7e8, and @steven-seagull27 stays the author of the first-lane fix. If this is squash-merged, GitHub will add Co-authored-by lines for both of you.

Before pushing I ran the split tests on a physical 32-lane adapter (RTX 4060) at e400c3f. All three passed, including the new regression:

emit::split_tests::a_split_wave64_gives_the_consoles_lanes_masks_and_reads ... ok
emit::split_tests::converged_first_lane_respects_both_exec_words ... ok
emit::split_tests::a_split_lane_read_in_a_lane_branch_reads_within_its_half ... ok

I didn't run the full shader suite this time. The 16-lane Intel case is still open.

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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7196017790 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1890#issuecomment-7196017790). Originally posted by [beamdotdev](https://github.com/beamdotdev) on 2026-11-26T15:15:49Z. --- Thanks @andrewpozdnakov7-jpg. I fast-forwarded the PR branch to your integration branch, so the head is now `e400c3f` (from `73ee4dd`). Nothing was rewritten: you stay the author of the merge `ab0d7e8`, and @steven-seagull27 stays the author of the first-lane fix. If this is squash-merged, GitHub will add `Co-authored-by` lines for both of you. Before pushing I ran the split tests on a physical 32-lane adapter (RTX 4060) at `e400c3f`. All three passed, including the new regression: ``` emit::split_tests::a_split_wave64_gives_the_consoles_lanes_masks_and_reads ... ok emit::split_tests::converged_first_lane_respects_both_exec_words ... ok emit::split_tests::a_split_lane_read_in_a_lane_branch_reads_within_its_half ... ok ``` I didn't run the full shader suite this time. The 16-lane Intel case is still open. _AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this._
andrewpozdnakov7-jpg commented 2026-11-27 06:40:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T06:40:10Z.


I traced the failing CI run. Neither fixed-wave variant reached dispatch, so the failure did not compare any lane values.

883f35d is a test-only follow-up directly on e400c3f. It still lowers both variants and validates DXIL when the validator is present. It skips dispatch on adapters without the required wave size. Creation or readback failures on an adapter that reports support still fail the test.

On local inbox WARP the original asserted that no device ran. The follow-up reports the unavailable SM 6.6 device explicitly. On app-local WARP 1.0.22 / Agility 1.620.2, both fixed-wave variants ran and matched all 64 lanes, and all three split-wave tests and both strict shader Clippy configurations passed. The GitHub runner still needs a rerun on the proposed commit.

@beamdotdev If you take the follow-up, please retain Git authorship when cherry-picking or rebasing. If folded into another commit, please add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

AI-assisted with Codex. Synthetic shaders only.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7211737411 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1890#issuecomment-7211737411). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T06:40:10Z. --- I traced the [failing CI run](https://github.com/Marvisak/VIctory/actions/runs/45846405749/job/140001102031). Neither fixed-wave variant reached dispatch, so the failure did not compare any lane values. [883f35d](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/883f35da8e7ba6884fc7f12939f97a165604aff5) is a test-only follow-up directly on `e400c3f`. It still lowers both variants and validates DXIL when the validator is present. It skips dispatch on adapters without the required wave size. Creation or readback failures on an adapter that reports support still fail the test. On local inbox WARP the original asserted that no device ran. The follow-up reports the unavailable SM 6.6 device explicitly. On app-local WARP 1.0.22 / Agility 1.620.2, both fixed-wave variants ran and matched all 64 lanes, and all three split-wave tests and both strict shader Clippy configurations passed. The GitHub runner still needs a rerun on the proposed commit. @beamdotdev If you take the follow-up, please retain Git authorship when cherry-picking or rebasing. If folded into another commit, please add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. AI-assisted with Codex. Synthetic shaders only.
andrewpozdnakov7-jpg commented 2026-11-27 06:44:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T06:44:34Z.


@beamdotdev I reproduced the no device ran the program assertion from CI locally with the system D3D12 runtime. 3e27cde is a test-only commit directly on e400c3f.

Both widths still translate and go through the DXIL validator when installed. GPU readback is skipped when the adapter cannot supply the requested wave size. On an adapter that advertises it, pipeline creation, dispatch and every lane comparison must succeed.

  • System D3D12 with no SM 6.6 device: the old test panicked, and the updated test passed translation for both widths.
  • App-local WARP 1.0.22 with Agility 1.620.2: the three split tests passed. The updated test checked all 64 console lanes with each of Wave32 and Wave64.
  • Strict all-features shader Clippy and the asset policy check passed.

Please keep the Git author if cherry-picking. If folding the test into another commit, please add:

Co-authored-by: andrewpozdnakov7-jpg [email protected]

AI-assisted with Codex. Synthetic shaders only.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7211803997 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1890#issuecomment-7211803997). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T06:44:34Z. --- @beamdotdev I reproduced the `no device ran the program` assertion from [CI](https://github.com/Marvisak/VIctory/actions/runs/45846405749/job/140001102031) locally with the system D3D12 runtime. [3e27cde](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/3e27cde71e20e37f9d098629321ba62a20eb17b5) is a test-only commit directly on `e400c3f`. Both widths still translate and go through the DXIL validator when installed. GPU readback is skipped when the adapter cannot supply the requested wave size. On an adapter that advertises it, pipeline creation, dispatch and every lane comparison must succeed. - System D3D12 with no SM 6.6 device: the old test panicked, and the updated test passed translation for both widths. - App-local WARP 1.0.22 with Agility 1.620.2: the three split tests passed. The updated test checked all 64 console lanes with each of Wave32 and Wave64. - Strict all-features shader Clippy and the asset policy check passed. Please keep the Git author if cherry-picking. If folding the test into another commit, please add: Co-authored-by: andrewpozdnakov7-jpg <[email protected]> AI-assisted with Codex. Synthetic shaders only.
omarsaifuddin commented 2026-11-29 05:35:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by omarsaifuddin on 2026-11-29T05:35:26Z.


Related work: #3822 (stacked on #189) implements per-half behavior for the wave-aggregated-atomic idiom only, proof-gated: each half ballots and aggregates its own lanes when every data use of the mask is a count, a first lane or a lane rank, and the count flows only into an atomic add (or a reduction only into a no-return atomic of the same kind). Everything else still refuses.

That is the same class this PR covers with the shortcut: in divergent code, but only where the per-half result is provably equivalent. Flagging in case the two approaches should be reconciled before either lands.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7251343142 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1890#issuecomment-7251343142). Originally posted by [omarsaifuddin](https://github.com/omarsaifuddin) on 2026-11-29T05:35:26Z. --- Related work: **#3822** (stacked on #189) implements per-half behavior for the wave-aggregated-atomic idiom only, proof-gated: each half ballots and aggregates its own lanes when every data use of the mask is a count, a first lane or a lane rank, and the count flows only into an atomic add (or a reduction only into a no-return atomic of the same kind). Everything else still refuses. That is the same class this PR covers with the `shortcut:` in divergent code, but only where the per-half result is provably equivalent. Flagging in case the two approaches should be reconciled before either lands.
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/1890:upstream-pr/1890'
git switch 'upstream-pr/1890'

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