Patch (fork): indirect draw stream compaction pass and Intel Arc DG2 wave clamping #740

Open
opened 2026-11-26 04:13:54 +00:00 by github-bot · 4 comments
Owner

@⁠UnkwnDev on GitHub · 2026-11-24 09:05 UTC · original

Fork branch: https://github.com/UnkwnDev/VIctory/tree/arc-optimizations

Commits:

  • fcdf58: gpu: add indirect draw stream compaction pass to eliminate empty draw stalls
  • 936a6a: shader: clamp WaveSize to hardware capability and ensure bit-exact NaN handling

Summary

  1. Indirect draw stream compaction:
    Empty indirect draw calls from engine passes caused 0.5 to 1.8 second stalls on hardware command queues. We add an atomic compute shader compaction pass and HostList CompactionScratch UMA arena in crates/victory-gpu to filter zero-instance records before ExecuteIndirect dispatch.

  2. WaveSize hardware clamping and bit-exact NaN detection:
    Intel Arc DG2 hardware executes waves of width 32 rather than 64. We add wave_size_max() clamping via VICTORY_WAVE_SIZE_MAX in crates/victory-shader/src/emit/mod.rs and lower.rs so compute threadgroups respect the 32-lane hardware limit. We also implement bit-exact NaN detection in vector median3 operations.

Verification

  • Tested on Intel Arc A770 (16GB, Driver 32.0.101.9175) under Windows 11.
  • cargo test --workspace: 142 passed, 0 failed, 4 ignored.

Repository interaction limits prevent non-collaborators from opening PRs directly; maintainers can cherry-pick directly from UnkwnDev/VIctory:arc-optimizations or grant collaborator access to submit as a PR.

**@⁠UnkwnDev** on GitHub · 2026-11-24 09:05 UTC · [original](https://github.com/Marvisak/VIctory/issues/740) Fork branch: https://github.com/UnkwnDev/VIctory/tree/arc-optimizations Commits: - fcdf58: gpu: add indirect draw stream compaction pass to eliminate empty draw stalls - 936a6a: shader: clamp WaveSize to hardware capability and ensure bit-exact NaN handling ### Summary 1. **Indirect draw stream compaction**: Empty indirect draw calls from engine passes caused 0.5 to 1.8 second stalls on hardware command queues. We add an atomic compute shader compaction pass and HostList CompactionScratch UMA arena in crates/victory-gpu to filter zero-instance records before ExecuteIndirect dispatch. 2. **WaveSize hardware clamping and bit-exact NaN detection**: Intel Arc DG2 hardware executes waves of width 32 rather than 64. We add wave_size_max() clamping via VICTORY_WAVE_SIZE_MAX in crates/victory-shader/src/emit/mod.rs and lower.rs so compute threadgroups respect the 32-lane hardware limit. We also implement bit-exact NaN detection in vector median3 operations. ### Verification - Tested on Intel Arc A770 (16GB, Driver 32.0.101.9175) under Windows 11. - cargo test --workspace: 142 passed, 0 failed, 4 ignored. Repository interaction limits prevent non-collaborators from opening PRs directly; maintainers can cherry-pick directly from UnkwnDev/VIctory:arc-optimizations or grant collaborator access to submit as a PR.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:13:54 +00:00
Author
Owner

@⁠UnkwnDev on GitHub · 2026-11-24 09:48 UTC · original

Added commit f1aaaa3 to the fork branch:

shader: lower packed dot products to DXIL dot4AddPacked and fused multiply-adds

  • Lowers _dot4_i32_i8, _dot4c_i32_i8, and _dot4_u32_u8 directly to SM 6.4 @⁠dx.op.dot4AddPacked.i32 (opcodes 163 and 164) for single-cycle hardware DP4a execution on Intel Arc Xe-cores.
  • Lowers _dot2_f32_f16 and _dot2c_f32_f16 via chained fused multiply-adds ( mad) matching RDNA2 rounding semantics, and implements _dot2_i32_i16, _dot2_u32_u16, and _dot8_u32_u4.
  • Added end-to-end hardware execution unit tests in crates/victory-shader/src/emit/valu_tests.rs. Full workspace tests pass (143/143 passed, 0 failed, 4 ignored).
**@⁠UnkwnDev** on GitHub · 2026-11-24 09:48 UTC · [original](https://github.com/Marvisak/VIctory/issues/740#issuecomment-7127909607) Added commit f1aaaa3 to the fork branch: shader: lower packed dot products to DXIL dot4AddPacked and fused multiply-adds - Lowers _dot4_i32_i8, _dot4c_i32_i8, and _dot4_u32_u8 directly to SM 6.4 @⁠dx.op.dot4AddPacked.i32 (opcodes 163 and 164) for single-cycle hardware DP4a execution on Intel Arc Xe-cores. - Lowers _dot2_f32_f16 and _dot2c_f32_f16 via chained fused multiply-adds ( mad) matching RDNA2 rounding semantics, and implements _dot2_i32_i16, _dot2_u32_u16, and _dot8_u32_u4. - Added end-to-end hardware execution unit tests in crates/victory-shader/src/emit/valu_tests.rs. Full workspace tests pass (143/143 passed, 0 failed, 4 ignored).
Author
Owner

@⁠UnkwnDev on GitHub · 2026-11-24 11:04 UTC · original

Updated rc-optimizations branch on fork (https://github.com/UnkwnDev/VIctory/tree/arc-optimizations) with two additional optimization passes:

  1. Commit 1aaaa3 (shader: lower packed dot products to DXIL dot4AddPacked and fused multiply-adds):
    Lowers packed 8-bit dot products directly to SM 6.4 dot4AddPacked and fused multiply-adds ( ma) for native execution on Intel Arc Xe-cores and SM 6.4 hardware.

  2. Commit 7bfa689 (shader: clamp whole-wave simulation width to wave_size_max for Wave32 execution):
    Aligns crates/victory-shader/src/emit/wave.rs whole-wave simulation width to super::wave_size_max(), preventing 64-element symbolic vector allocations and 64-bit mask assumptions when running with VICTORY_WAVE_SIZE_MAX=32 on Wave32 hardware. Evaluates wave_size_max() dynamically and adds unit and dispatch test coverage in alu_tests.rs.

Full test suite: cargo test --workspace clean across all crates.

**@⁠UnkwnDev** on GitHub · 2026-11-24 11:04 UTC · [original](https://github.com/Marvisak/VIctory/issues/740#issuecomment-7129624632) Updated rc-optimizations branch on fork (https://github.com/UnkwnDev/VIctory/tree/arc-optimizations) with two additional optimization passes: 1. Commit 1aaaa3 (shader: lower packed dot products to DXIL dot4AddPacked and fused multiply-adds): Lowers packed 8-bit dot products directly to SM 6.4 dot4AddPacked and fused multiply-adds ( ma) for native execution on Intel Arc Xe-cores and SM 6.4 hardware. 2. Commit 7bfa689 (shader: clamp whole-wave simulation width to wave_size_max for Wave32 execution): Aligns crates/victory-shader/src/emit/wave.rs whole-wave simulation width to super::wave_size_max(), preventing 64-element symbolic vector allocations and 64-bit mask assumptions when running with VICTORY_WAVE_SIZE_MAX=32 on Wave32 hardware. Evaluates wave_size_max() dynamically and adds unit and dispatch test coverage in alu_tests.rs. Full test suite: cargo test --workspace clean across all crates.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 03:49 UTC · original · edited 2026-11-25 09:54 UTC

Automated triage for the maintainers.

This offered several changes on a fork branch (arc-optimizations). Thanks for splitting what is left against current main (940d32f) into pull requests: #2201 (compaction of non-empty indirect draw and dispatch arguments) and #2202 (the remaining packed dot products and clamped integer forms). Review happens on those PRs.

What the other parts map to:

  • Packed dot products: v_dot4_i32_i8 and v_dot4c_i32_i8 already lower to dot4AddPacked in crates/victory-shader/src/emit/lower.rs, so #2202 should carry only the forms still missing there. #2092 also lowers v_dot4_u32_u8 and v_dot8_u32_u4, so the two PRs overlap.
  • Wave64 programs on 32-lane hosts: handled by the open PRs #1929, #1922 and #1960, not by these two.
  • v_med3 with a NaN operand: tracked in #726. Open PR #2010 carries a fix.

Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 03:49 UTC · [original](https://github.com/Marvisak/VIctory/issues/740#issuecomment-7152276582) · edited 2026-11-25 09:54 UTC <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-25T07:45:05Z at=2026-11-25T09:50:38Z --> Automated triage for the maintainers. This offered several changes on a fork branch (`arc-optimizations`). Thanks for splitting what is left against current `main` (`940d32f`) into pull requests: #2201 (compaction of non-empty indirect draw and dispatch arguments) and #2202 (the remaining packed dot products and clamped integer forms). Review happens on those PRs. What the other parts map to: - **Packed dot products:** `v_dot4_i32_i8` and `v_dot4c_i32_i8` already lower to `dot4AddPacked` in `crates/victory-shader/src/emit/lower.rs`, so #2202 should carry only the forms still missing there. #2092 also lowers `v_dot4_u32_u8` and `v_dot8_u32_u4`, so the two PRs overlap. - **Wave64 programs on 32-lane hosts:** handled by the open PRs #1929, #1922 and #1960, not by these two. - **`v_med3` with a NaN operand:** tracked in #726. Open PR #2010 carries a fix. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠UnkwnDev on GitHub · 2026-11-25 07:45 UTC · original

Split the remaining uncovered changes against current main (940d32f) into separate single-purpose PRs per the triage note:

  • #2201: gpu: compact non-empty indirect draw and dispatch arguments
  • #2202: shader: lower remaining packed dot products and clamped integer forms
**@⁠UnkwnDev** on GitHub · 2026-11-25 07:45 UTC · [original](https://github.com/Marvisak/VIctory/issues/740#issuecomment-7156210697) Split the remaining uncovered changes against current `main` (`940d32f`) into separate single-purpose PRs per the triage note: - #2201: `gpu: compact non-empty indirect draw and dispatch arguments` - #2202: `shader: lower remaining packed dot products and clamped integer forms`
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#740
No description provided.