shader: exact static Wave32 LDS alias, lane-private, and commutative-atomic analysis #289

Open
github-bot wants to merge 1 commit from github-bot/gh-289 into main AGit
Owner

@⁠Vladimir-Human on GitHub · 2026-11-27 13:44 UTC · original
Vladimir-Human:shader/wave32-lds-hazard-analysis → main · +5793 −363 · 6 files · 1 commits · open

Summary

Replaces coarse per-region LDS read+write refusal inside divergent (!all) lane-branch regions with exact static Wave32 LDS hazard analysis in crates/victory-shader/src/emit/lds.rs, unlocking native WaveSize(32) lowering with zero approximation while preserving VICTORY_LDS_FLAGS, loose_lds, and opt-in VICTORY_LDS_WRITE_ONLY_OK=1 (32-lane hosts only).

What Changed

  1. Static Wave32 LDS Hazard Analyzer (crates/victory-shader/src/emit/lds.rs, lower.rs, mod.rs):
    • Refinement A (region_disjoint_ranges): Accepts acyclic !all regions whose accesses resolve to non-wrapping (MAX_OFFSET = 1 MiB) constant byte offsets on one shared group-uniform base (s < cs.user_sgprs() / GroupId, excluding scratch_wave_offset, uninitialized SGPRs, VOP3B carry/SCC, non-inline special constants, and Operand::Attr), with <4-byte enclosing-dword guards (ranges_may_overlap) and group-uniform stored data verified across every stored dword (is_uniform_ds_operand / is_uniform_val_at) so concurrent stores from both 32-lane halves are idempotent. Cyclic regions permit only disjoint reads and same-family commutative atomics.
    • Refinement B (region_lane_private): Proves injective per-thread private slots across all active (x, y, z) workgroup dimensions and paired v_mbcnt console lanes (group <= 64) with half-open [min_lo, max_hi) cross-cluster footprint disjointness (covering partial workgroup sizes n = 33..63), optionally combined with disjoint constant reads and disjoint constant non-returning commutative atomics.
    • Refinement C (region_commutative_atomics + ModCong): Accepts acyclic or cyclic !all regions of strictly non-returning (dst.is_none() && !name.contains("_rtn")) 32-bit integer commutative/associative atomics (ds_add_u32/ds_sub_u32, ds_or_b32, ds_and_b32, ds_xor_b32, ds_min_u32, ds_max_u32, ds_min_i32, ds_max_i32). Single-family regions allow arbitrary dynamic scatter addresses (e.g., histogram/bitmask loops); multi-family regions prove dword disjointness via wrap-safe modular congruence x == rem (mod 2^bits) (bits >= 3, e.g., dynamic tile * 8 + 0 vs tile * 8 + 4) or disjoint constant offsets on a shared uniform base. All _rtn returning atomics, ds_rsub_u32, ds_cmpst*, ds_wrxchg*, ds_min_f32/ds_max_f32, divergent s_barrier, and unknown DS ops remain refused unless proven lane-private.
    • Sound default write-only policy: Unproven pure write-only !all regions are refused by default (CyclicSharedWrite / WriteWriteOverlap); the legacy write-only / returning-atomic shortcut stays strictly opt-in behind VICTORY_LDS_WRITE_ONLY_OK=1 on 32-lane hosts only.
    • Two-tier cycle-safe DAG memoization: Memoizes eval_mod_val, eval_val, and is_uniform_val_at (mod_memo/val_memo/unif_memo for cycle-free nodes + per-query EvalState::local for cycle-hit nodes, checking dominance before lookup/insert) to keep deep shared/cyclic DAGs linear.
    • Shrinks lower.rs: Moves lds_flag_region into emit/lds.rs (lower.rs shrinks from 604.5 KiB to 577.9 KiB, well below the 640 KiB policy cap) and refines VICTORY_WAVE_WHY reasons via Refusal::reason().
  2. Cache Key & Translator Version (crates/victory-shader/src/lib.rs, crates/victory-gpu/src/shader_cache.rs):
    • Bumps TRANSLATOR_VERSION 9 -> 10 so cached Wave64 shaders affected by the exact analyzer re-translate cleanly.
    • Registers "VICTORY_LDS_WRITE_ONLY_OK" alongside "VICTORY_LDS_FLAGS" in shader_cache.rs.

Attribution

  • Base Refinement A / Refinement B static alias and lane-private framework adapted from the community LDS hazard analysis approach (vitutu1/victory-perf#12), incorporating @Dathinel's partial-workgroup byte-alias half-open footprint fix; extended here with Refinement C commutative-atomic + ModCong analysis, Refinement A uniform-data enforcement, default write-only soundness refusal, and cycle-safe DAG memoization.

Verification

Verified on Windows 11 (NVIDIA GeForce RTX 4070 SUPER, native D3D12 SM 6.6 Wave32 hardware, dxil.dll validation, VICTORY_D3D12_DEBUG=1, --test-threads=1, 0 D3D12 debug errors):

  • Policy & Hygiene: cargo run -p xtask -- policy (314 files ok), cargo test -p xtask (11/11), git diff --check clean, merge-tree clean against main.
  • Clippy: cargo clippy -p victory-shader --all-targets -- -D warnings (default & --all-features) and cargo clippy -p victory-gpu --lib -- -D warnings: 0 warnings.
  • Unit & Exhaustive Oracles (emit::lds, 24/24 in 0.38s):
    • exhaustive_byte_access_oracle_has_zero_false_accepts (48,212 cases, 0 false accepts)
    • exhaustive_mod_congruence_oracle_has_zero_false_disjoint_claims (35,721 cases, 0 false disjoint claims)
    • exhaustive_ranges_may_overlap_oracle_has_zero_false_disjoint_claims (72,000 cases, 0 false disjoint claims)
    • exhaustive_commutative_atomic_families_are_schedule_invariant (all 8 algebraic families across Wave64, hi-then-lo, reversed, and interleaved schedules)
    • Regression coverage for Refinement A uniform stored data (7 cases), default refusal of unproven write-only / cross-branch dynamic WAW / cyclic dynamic writes, and linear-time completion on 36-step doubling, 28-step tripling, and 36-step cyclic Phi DAGs.
  • Hardware D3D12 Wave32 Parity & Negative Controls (emit::wave64_tests, 32/32; lds_* 7/7 HW + 7/7 WARP):
    • 5 new Wave32 hardware compute parity tests (35 dispatches total on RTX 4070 SUPER, all asserting lowered.wave_size == Some(32) strictly without loose_lds/local_waves/widen + bit-exact Wave64 parity): Refinement A disjoint ranges, Refinement B lane-private + returning atomic loop, Refinement C1 dynamic ds_add_u32+ds_sub_u32 histogram loop, Refinement C3 multi-family dynamic stride-8 ds_max_u32+ds_min_u32, and mixed B+C private scratch + shared counter.
    • 2 negative controls: shared returning atomic stays Wave64; unresolved dynamic cross-branch WAW and uniform-address lane-varying store stay Wave64 by default (with VICTORY_LDS_WRITE_ONLY_OK=1 opt-in verified).
  • Full victory-shader & shader_cache: Full victory-shader HW suite (356 passed; 0 failed; 4 ignored), victory-gpu --lib shader_cache (4/4).
**@⁠Vladimir-Human** on GitHub · 2026-11-27 13:44 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/289) `Vladimir-Human:shader/wave32-lds-hazard-analysis` → `main` · +5793 −363 · 6 files · 1 commits · open ## Summary Replaces coarse per-region LDS read+write refusal inside divergent (`!all`) lane-branch regions with exact static Wave32 LDS hazard analysis in `crates/victory-shader/src/emit/lds.rs`, unlocking native `WaveSize(32)` lowering with zero approximation while preserving `VICTORY_LDS_FLAGS`, `loose_lds`, and opt-in `VICTORY_LDS_WRITE_ONLY_OK=1` (32-lane hosts only). ### What Changed 1. **Static Wave32 LDS Hazard Analyzer (`crates/victory-shader/src/emit/lds.rs`, `lower.rs`, `mod.rs`):** - **Refinement A (`region_disjoint_ranges`):** Accepts acyclic `!all` regions whose accesses resolve to non-wrapping (`MAX_OFFSET = 1 MiB`) constant byte offsets on one shared group-uniform base (`s < cs.user_sgprs()` / `GroupId`, excluding `scratch_wave_offset`, uninitialized SGPRs, VOP3B carry/SCC, non-inline special constants, and `Operand::Attr`), with `<4`-byte enclosing-dword guards (`ranges_may_overlap`) and **group-uniform stored data** verified across every stored dword (`is_uniform_ds_operand` / `is_uniform_val_at`) so concurrent stores from both 32-lane halves are idempotent. Cyclic regions permit only disjoint reads and same-family commutative atomics. - **Refinement B (`region_lane_private`):** Proves injective per-thread private slots across all active `(x, y, z)` workgroup dimensions and paired `v_mbcnt` console lanes (`group <= 64`) with half-open `[min_lo, max_hi)` cross-cluster footprint disjointness (covering partial workgroup sizes `n = 33..63`), optionally combined with disjoint constant reads and disjoint constant non-returning commutative atomics. - **Refinement C (`region_commutative_atomics` + `ModCong`):** Accepts acyclic or cyclic `!all` regions of strictly non-returning (`dst.is_none() && !name.contains("_rtn")`) 32-bit integer commutative/associative atomics (`ds_add_u32`/`ds_sub_u32`, `ds_or_b32`, `ds_and_b32`, `ds_xor_b32`, `ds_min_u32`, `ds_max_u32`, `ds_min_i32`, `ds_max_i32`). Single-family regions allow arbitrary dynamic scatter addresses (e.g., histogram/bitmask loops); multi-family regions prove dword disjointness via wrap-safe modular congruence `x == rem (mod 2^bits)` (`bits >= 3`, e.g., dynamic `tile * 8 + 0` vs `tile * 8 + 4`) or disjoint constant offsets on a shared uniform base. All `_rtn` returning atomics, `ds_rsub_u32`, `ds_cmpst*`, `ds_wrxchg*`, `ds_min_f32`/`ds_max_f32`, divergent `s_barrier`, and unknown DS ops remain refused unless proven lane-private. - **Sound default write-only policy:** Unproven pure write-only `!all` regions are refused by default (`CyclicSharedWrite` / `WriteWriteOverlap`); the legacy write-only / returning-atomic shortcut stays strictly opt-in behind `VICTORY_LDS_WRITE_ONLY_OK=1` on 32-lane hosts only. - **Two-tier cycle-safe DAG memoization:** Memoizes `eval_mod_val`, `eval_val`, and `is_uniform_val_at` (`mod_memo`/`val_memo`/`unif_memo` for cycle-free nodes + per-query `EvalState::local` for cycle-hit nodes, checking dominance before lookup/insert) to keep deep shared/cyclic DAGs linear. - **Shrinks `lower.rs`:** Moves `lds_flag_region` into `emit/lds.rs` (`lower.rs` shrinks from `604.5 KiB` to `577.9 KiB`, well below the `640 KiB` policy cap) and refines `VICTORY_WAVE_WHY` reasons via `Refusal::reason()`. 2. **Cache Key & Translator Version (`crates/victory-shader/src/lib.rs`, `crates/victory-gpu/src/shader_cache.rs`):** - Bumps `TRANSLATOR_VERSION` `9 -> 10` so cached Wave64 shaders affected by the exact analyzer re-translate cleanly. - Registers `"VICTORY_LDS_WRITE_ONLY_OK"` alongside `"VICTORY_LDS_FLAGS"` in `shader_cache.rs`. ### Attribution - Base Refinement A / Refinement B static alias and lane-private framework adapted from the community LDS hazard analysis approach (`vitutu1/victory-perf#12`), incorporating `@Dathinel`'s partial-workgroup byte-alias half-open footprint fix; extended here with Refinement C commutative-atomic + `ModCong` analysis, Refinement A uniform-data enforcement, default write-only soundness refusal, and cycle-safe DAG memoization. ### Verification Verified on Windows 11 (`NVIDIA GeForce RTX 4070 SUPER`, native D3D12 SM 6.6 Wave32 hardware, `dxil.dll` validation, `VICTORY_D3D12_DEBUG=1`, `--test-threads=1`, `0` D3D12 debug errors): - **Policy & Hygiene:** `cargo run -p xtask -- policy` (`314 files ok`), `cargo test -p xtask` (**11/11**), `git diff --check` clean, `merge-tree` clean against `main`. - **Clippy:** `cargo clippy -p victory-shader --all-targets -- -D warnings` (default & `--all-features`) and `cargo clippy -p victory-gpu --lib -- -D warnings`: **0 warnings**. - **Unit & Exhaustive Oracles (`emit::lds`, 24/24 in `0.38s`):** - `exhaustive_byte_access_oracle_has_zero_false_accepts` (`48,212` cases, `0` false accepts) - `exhaustive_mod_congruence_oracle_has_zero_false_disjoint_claims` (`35,721` cases, `0` false disjoint claims) - `exhaustive_ranges_may_overlap_oracle_has_zero_false_disjoint_claims` (`72,000` cases, `0` false disjoint claims) - `exhaustive_commutative_atomic_families_are_schedule_invariant` (all 8 algebraic families across Wave64, hi-then-lo, reversed, and interleaved schedules) - Regression coverage for Refinement A uniform stored data (7 cases), default refusal of unproven write-only / cross-branch dynamic WAW / cyclic dynamic writes, and linear-time completion on 36-step doubling, 28-step tripling, and 36-step cyclic Phi DAGs. - **Hardware D3D12 Wave32 Parity & Negative Controls (`emit::wave64_tests`, 32/32; `lds_*` 7/7 HW + 7/7 WARP):** - 5 new Wave32 hardware compute parity tests (`35` dispatches total on RTX 4070 SUPER, all asserting `lowered.wave_size == Some(32)` strictly without `loose_lds`/`local_waves`/`widen` + bit-exact Wave64 parity): Refinement A disjoint ranges, Refinement B lane-private + returning atomic loop, Refinement C1 dynamic `ds_add_u32`+`ds_sub_u32` histogram loop, Refinement C3 multi-family dynamic stride-8 `ds_max_u32`+`ds_min_u32`, and mixed B+C private scratch + shared counter. - 2 negative controls: shared returning atomic stays Wave64; unresolved dynamic cross-branch WAW and uniform-address lane-varying store stay Wave64 by default (with `VICTORY_LDS_WRITE_ONLY_OK=1` opt-in verified). - **Full `victory-shader` & `shader_cache`:** Full `victory-shader` HW suite (**356 passed; 0 failed; 4 ignored**), `victory-gpu --lib shader_cache` (**4/4**).
Replace coarse per-region read+write refusal in `!all` lane-branch regions
with exact static Wave32 LDS hazard analysis (`emit/lds.rs`), unlocking
native Wave32 lowering with zero approximation while preserving
`VICTORY_LDS_FLAGS`, `loose_lds`, and opt-in `VICTORY_LDS_WRITE_ONLY_OK=1`
(32-lane hosts only):

- Refinement A (`region_disjoint_ranges`): proves non-wrapping constant byte
  offsets on a shared group-uniform base with `<4`-byte enclosing-dword
  guards, acyclic plain-write discipline, and group-uniform stored data on
  every plain write (idempotent across both 32-lane halves).
- Refinement B (`region_lane_private`): proves injective per-thread slots
  across active `(x, y, z)` workgroup dimensions and paired `v_mbcnt`
  console lanes (`group <= 64`) with half-open `[min_lo, max_hi)` cross-
  cluster footprints, optionally combined with disjoint constant reads and
  disjoint constant non-returning commutative atomics.
- Refinement C (`region_commutative_atomics` + `ModCong`): accepts acyclic
  or cyclic `!all` regions of non-returning 32-bit integer commutative/
  associative atomics (`ds_add_u32`/`ds_sub_u32`, `ds_or_b32`, `ds_and_b32`,
  `ds_xor_b32`, `ds_min_u32`, `ds_max_u32`, `ds_min_i32`, `ds_max_i32`),
  allowing arbitrary dynamic scatter within one family and proving cross-
  family dword disjointness via wrap-safe modular congruence `(k, r)`.
- Refuse unproven pure write-only `!all` regions by default (keeping the
  legacy shortcut strictly opt-in behind `VICTORY_LDS_WRITE_ONLY_OK=1`).
- Memoize `eval_mod_val`, `eval_val`, and `is_uniform_val_at` (two-tier
  global + per-query cycle-safe caching) to prevent exponential DAG blowup.
- Bump `TRANSLATOR_VERSION` `9 -> 10` and register `VICTORY_LDS_WRITE_ONLY_OK`
  in `shader_cache.rs`.
- Add 24 `emit::lds` unit/oracle/DAG-stress tests and 7 `emit::wave64_tests`
  HW/WARP compute parity and negative-control tests.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 13:47:57 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 13:48 UTC · original

@⁠Vladimir-Human The important correctness checks are partial workgroups, aliased dwords and atomics that return a value. Keep the negative cases next to the new accepted cases so the analyzer proves why each Wave32 lowering is safe. The hardware comparison should use complete readbacks on the same inputs.

**@⁠TaynanGT** on GitHub · 2026-11-27 13:48 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/289#issuecomment-7219966977) @⁠Vladimir-Human The important correctness checks are partial workgroups, aliased dwords and atomics that return a value. Keep the negative cases next to the new accepted cases so the analyzer proves why each Wave32 lowering is safe. The hardware comparison should use complete readbacks on the same inputs.
Author
Owner

@⁠Vladimir-Human on GitHub · 2026-11-27 13:52 UTC · original

@⁠TaynanGT CI is now green across Clippy, Default tests, Diagnostics tests, and check. Here are the paired accepted/negative checks and full-readback hardware tests on disk for each area:

  • Partial workgroups (n = 33..63):
    • crates/victory-shader/src/emit/lds.rs:4709 (partial_workgroup_byte_alias_is_refused) pairs the aliasing negative case ([0, n) byte write vs uniform read at n - 1 -> refused, Wave64) next to the disjoint accepted case (read at n -> Wave32) for n = 32, 33, 63, 64 (including end-to-end n = 33, 63 lowering).
    • lds.rs:4772 (exhaustive_byte_access_oracle_has_zero_false_accepts) sweeps 48,212 (n = 32..=65, stride, initial, r) combinations with 0 false accepts.
  • Aliased dwords (<4-byte enclosing-dword & range/stride overlap):
    • lds.rs:3599 (overlapping_constant_offsets_refuse_wave32), lds.rs:3610 (wide_b128_disjoint_and_overlap_checks), and lds.rs:3644 (uniform_base_shared_disjoint_and_mismatch_refused, including unaligned ds_write_b8 + ds_read_b32 enclosing-dword refusal) sit alongside lds.rs:3980 (exhaustive_ranges_may_overlap_oracle_has_zero_false_disjoint_claims, 72,000 checks).
    • lds.rs:3759 (commutative_non_returning_atomics_recover_exact_wave32) pairs accepted stride-8 ds_max_u32+ds_min_u32 directly next to colliding stride-4, cross-family, plain-write, and overlapping private+counter negative controls, backed by lds.rs:3894 (exhaustive_mod_congruence_oracle_has_zero_false_disjoint_claims, 35,721 cases).
    • lds.rs:4825 (refinement_a_requires_uniform_write_data) and lds.rs:4924 (unproven_write_only_regions_refused_by_default_and_gated_by_opt_in) pair lane-varying stores and unresolved cross-branch/cyclic write-only negative cases next to uniform-data positive controls.
  • Atomics that return a value (ds_*_rtn*):
    • lds.rs:3707 (returning_and_non_commutative_atomics_require_lane_privacy) pairs refused shared ds_add_rtn_u32, ds_cmpst_rtn_b32, ds_rsub_u32, ds_cmpst_b32, and ds_min_f32 (64) directly next to accepted lane-private ds_add_rtn_u32 at tid * 4 (32).
    • lds.rs:4539 (write_only_ok_flag_handles_returning_atomics_and_four_kernels) and crates/victory-shader/src/emit/wave64_tests.rs:1717 (lds_shared_returning_atomic_stays_wave64) verify shared returning atomics stay Wave64 by default (and remain Wave64 on mixed read+atomic or non-32-lane hosts even under opt-in VICTORY_LDS_WRITE_ONLY_OK=1).
  • Complete hardware readbacks on the same inputs (crates/victory-shader/src/emit/wave64_tests.rs):
    • The two negative controls (:1717 lds_shared_returning_atomic_stays_wave64, :1743 lds_unresolved_dynamic_waw_and_varying_store_stay_wave64) sit directly ahead of the 5 Wave32 hardware parity tests (:1877 lds_disjoint_constant_ranges_wave32_hw_parity — all 128 dwords; :1939 lds_lane_private_and_rtn_atomic_loop_wave32_hw_parity — all 128 dwords; :2015 lds_commutative_dynamic_histogram_wave32_hw_parity — all 8 bins; :2090 lds_commutative_multifamily_mod_stride_wave32_hw_parity — all 16 min/max dwords; :2161 lds_mixed_private_and_commutative_counter_wave32_hw_parity — all 65 private+counter dwords). Every dispatch checks the full readback buffer bit-for-bit against the exact Wave64 reference across the same boundary lane-count inputs (0, 1, 31, 32, 33, 63, 64 + loop counts; 35 dispatches total under VICTORY_D3D12_DEBUG=1).
**@⁠Vladimir-Human** on GitHub · 2026-11-27 13:52 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/289#issuecomment-7220048239) @⁠TaynanGT CI is now green across Clippy, Default tests, Diagnostics tests, and `check`. Here are the paired accepted/negative checks and full-readback hardware tests on disk for each area: - **Partial workgroups (`n = 33..63`):** - `crates/victory-shader/src/emit/lds.rs:4709` (`partial_workgroup_byte_alias_is_refused`) pairs the aliasing negative case (`[0, n)` byte write vs uniform read at `n - 1` -> refused, Wave64) next to the disjoint accepted case (read at `n` -> Wave32) for `n = 32, 33, 63, 64` (including end-to-end `n = 33, 63` lowering). - `lds.rs:4772` (`exhaustive_byte_access_oracle_has_zero_false_accepts`) sweeps `48,212` `(n = 32..=65, stride, initial, r)` combinations with `0` false accepts. - **Aliased dwords (`<4`-byte enclosing-dword & range/stride overlap):** - `lds.rs:3599` (`overlapping_constant_offsets_refuse_wave32`), `lds.rs:3610` (`wide_b128_disjoint_and_overlap_checks`), and `lds.rs:3644` (`uniform_base_shared_disjoint_and_mismatch_refused`, including unaligned `ds_write_b8` + `ds_read_b32` enclosing-dword refusal) sit alongside `lds.rs:3980` (`exhaustive_ranges_may_overlap_oracle_has_zero_false_disjoint_claims`, `72,000` checks). - `lds.rs:3759` (`commutative_non_returning_atomics_recover_exact_wave32`) pairs accepted stride-8 `ds_max_u32`+`ds_min_u32` directly next to colliding stride-4, cross-family, plain-write, and overlapping private+counter negative controls, backed by `lds.rs:3894` (`exhaustive_mod_congruence_oracle_has_zero_false_disjoint_claims`, `35,721` cases). - `lds.rs:4825` (`refinement_a_requires_uniform_write_data`) and `lds.rs:4924` (`unproven_write_only_regions_refused_by_default_and_gated_by_opt_in`) pair lane-varying stores and unresolved cross-branch/cyclic write-only negative cases next to uniform-data positive controls. - **Atomics that return a value (`ds_*_rtn*`):** - `lds.rs:3707` (`returning_and_non_commutative_atomics_require_lane_privacy`) pairs refused shared `ds_add_rtn_u32`, `ds_cmpst_rtn_b32`, `ds_rsub_u32`, `ds_cmpst_b32`, and `ds_min_f32` (`64`) directly next to accepted lane-private `ds_add_rtn_u32` at `tid * 4` (`32`). - `lds.rs:4539` (`write_only_ok_flag_handles_returning_atomics_and_four_kernels`) and `crates/victory-shader/src/emit/wave64_tests.rs:1717` (`lds_shared_returning_atomic_stays_wave64`) verify shared returning atomics stay Wave64 by default (and remain Wave64 on mixed read+atomic or non-32-lane hosts even under opt-in `VICTORY_LDS_WRITE_ONLY_OK=1`). - **Complete hardware readbacks on the same inputs (`crates/victory-shader/src/emit/wave64_tests.rs`):** - The two negative controls (`:1717` `lds_shared_returning_atomic_stays_wave64`, `:1743` `lds_unresolved_dynamic_waw_and_varying_store_stay_wave64`) sit directly ahead of the 5 Wave32 hardware parity tests (`:1877` `lds_disjoint_constant_ranges_wave32_hw_parity` — all `128` dwords; `:1939` `lds_lane_private_and_rtn_atomic_loop_wave32_hw_parity` — all `128` dwords; `:2015` `lds_commutative_dynamic_histogram_wave32_hw_parity` — all `8` bins; `:2090` `lds_commutative_multifamily_mod_stride_wave32_hw_parity` — all `16` min/max dwords; `:2161` `lds_mixed_private_and_commutative_counter_wave32_hw_parity` — all `65` private+counter dwords). Every dispatch checks the full readback buffer bit-for-bit against the exact Wave64 reference across the same boundary lane-count inputs (`0, 1, 31, 32, 33, 63, 64` + loop counts; `35` dispatches total under `VICTORY_D3D12_DEBUG=1`).
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 14:11 UTC · original

@⁠Vladimir-Human The 33/63-lane checks and full readbacks on the returning-atomic cases cover the boundaries I wanted to see. Keep VICTORY_LDS_WRITE_ONLY_OK off for the first comparison and give 0bb3acd its own cache directory. #258 and #287 also declare translator version 10.

**@⁠TaynanGT** on GitHub · 2026-11-27 14:11 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/289#issuecomment-7220458870) @⁠Vladimir-Human The 33/63-lane checks and full readbacks on the returning-atomic cases cover the boundaries I wanted to see. Keep `VICTORY_LDS_WRITE_ONLY_OK` off for the first comparison and give `0bb3acd` its own cache directory. #258 and #287 also declare translator version 10.
Author
Owner

@⁠Aniseto on GitHub · 2026-11-27 18:01 UTC · original

Ran the new Wave32 LDS unit tests on an NVIDIA Blackwell part at 0bb3acd:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 19.44.35230, DXC 1.9.2609.5, debug build.

cargo test -p victory-shader --lib emit::lds -- --test-threads=4
24 passed; 0 failed; 0 ignored      (exit 0)

The filter covers the analyzer's accepted and negative cases, including the exhaustive byte-access, ModCong and ranges-may-overlap oracles. The thread already has CI plus the owner's checks; this adds a Blackwell host on a newer driver and Windows build. These are CPU-side analyzer tests, so they do not by themselves show execution of the recovered Wave32 programs on hardware.

Not tested: hardware D3D12 execution of these programs, native wave64, AMD and Intel adapters, Wine, release profile, retail titles.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR head in a detached worktree, ran the command above and wrote this report; no game data was used.

**@⁠Aniseto** on GitHub · 2026-11-27 18:01 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/289#issuecomment-7225041579) Ran the new Wave32 LDS unit tests on an NVIDIA Blackwell part at 0bb3acd: Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 19.44.35230, DXC 1.9.2609.5, debug build. ``` cargo test -p victory-shader --lib emit::lds -- --test-threads=4 24 passed; 0 failed; 0 ignored (exit 0) ``` The filter covers the analyzer's accepted and negative cases, including the exhaustive byte-access, ModCong and ranges-may-overlap oracles. The thread already has CI plus the owner's checks; this adds a Blackwell host on a newer driver and Windows build. These are CPU-side analyzer tests, so they do not by themselves show execution of the recovered Wave32 programs on hardware. Not tested: hardware D3D12 execution of these programs, native wave64, AMD and Intel adapters, Wine, release profile, retail titles. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - checked out the PR head in a detached worktree, ran the command above and wrote this report; no game data was used.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 18:05 UTC · original

@⁠Aniseto All 24 CPU-side cases are accounted for at 0bb3acd, including the byte-range and ModCong oracles. That gives us an analyzer pass on Windows 11 26200. The complementary check is a complete D3D12 readback for the newly accepted cases, especially the ones involving returning atomics.

**@⁠TaynanGT** on GitHub · 2026-11-27 18:05 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/289#issuecomment-7225110273) @⁠Aniseto All 24 CPU-side cases are accounted for at `0bb3acd`, including the byte-range and ModCong oracles. That gives us an analyzer pass on Windows 11 26200. The complementary check is a complete D3D12 readback for the newly accepted cases, especially the ones involving returning atomics.
This pull request has changes conflicting with the target branch.
  • crates/victory-shader/src/emit/lower.rs
  • crates/victory-shader/src/lib.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/289/head:github-bot/gh-289'
git switch 'github-bot/gh-289'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-289'
git switch 'github-bot/gh-289'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-289'
git switch 'github-bot/gh-289'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-289'
git switch 'main'
git merge --squash 'github-bot/gh-289'
git switch 'main'
git merge --ff-only 'github-bot/gh-289'
git switch 'main'
git merge 'github-bot/gh-289'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.