Shaders: automatically guard divergent single-console-wave barriers on narrower host waves #30
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/30"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Zettrox/ztrx. Originally posted by rivaldodev on 2026-11-25T03:59:21Z.
Split out from #20 per review feedback and narrowed to preserve cross-console-wave synchronization.
Scope & Semantic Note (Targeted Compatibility Workaround)
This change is a targeted compatibility workaround for narrow-wave hosts (e.g. NVIDIA wave32) running console wave64 shaders where a single-console-wave group spans two host waves:
fence_only) to dropSyncThreadGroup(keeping memory fences2 | 8) only when:host_max_wave()) is narrower than the console wave width, ANDgroup_threads <= console_wave), where the console had no other wave in the group to synchronize with.SyncThreadGroupso cross-wave LDS producer-consumer accesses cannot race.VICTORY_GROUP_SYNCoverrides (0,1,2).host_max_wave()in the shader cache key (crates/victory-gpu/src/shader_cache.rs).Tests
emit::lower::tests::automatic_barriers_keep_fences_and_only_drop_unsafe_sync(covers single-wave, multi-wave, unknown group size, uniform, wave64, and explicit overrides).emit::lower::tests::automatic_barrier_flags_reach_the_emitted_shader(verifies emitted DXIL barrier mode for 64-thread vs. 128-thread groups on wave32 and wave64 hosts).emit::wave64_tests::an_automatic_barrier_inside_a_lane_branch_runs_on_narrow_hardware(runs on live narrow-wave GPU hardware).Imported from Zettrox/ztrx. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T04:08:50Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from Zettrox/ztrx. Originally posted by iGoldenNinja on 2026-11-25T04:17:44Z.
Independent RTX 5080 check on PR head
52e06e5, Windows 11 Pro 26200, driver 617.14, Ryzen 9 5900X, 32 GB RAM, MSVCdiag, DXC/DXIL validator 1.9.2609.5.cargo test --profile diag --locked -p victory-shader --lib automatic_barrier -- --nocapture --test-threads=1passed all three selected tests. The hardware fixture ran on wave32 and read back the expected result for 1, 10, 32, 33 and 64 active lanes.90b529f8and PR head52e06e5. Each refusal was an incorrect-parameter error. The group sizes were 64, 64, 128 and 256. The two larger groups are outside the automatic barrier rule. The four samples were checked through PSO creation, and the synthetic fixture above performed execution and readback.Method and results. Testing and reporting assisted by OpenAI Codex.
Imported from Zettrox/ztrx. Originally posted by futurepro62 on 2026-11-25T06:38:44Z.
Full-suite run, to go with iGoldenNinja's RTX 5080 run of the three new tests above. Tested exact head
52e06e5(on its base90b529f).Tested
rust-toolchain.toml), DXC + dxil.dll 1.9.2602.17, debug.cargo test --workspace --locked: 500 passed, 0 failed, 7 ignored (main90b529fon this machine: 496 passed, 0 failed, 7 ignored).cargo clippy --workspace --all-targets --locked -- -D warnings(the CI lint step): passed.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings(the CI lint step): passed.automatic_barriers_keep_fences_and_only_drop_unsafe_sync,automatic_barrier_flags_reach_the_emitted_shader,group_sync_defaults_to_auto_and_keeps_explicit_overrides,an_automatic_barrier_inside_a_lane_branch_runs_on_narrow_hardware.Not tested
AI use
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.