diff options
| author | Zack <zmasi21@gmail.com> | 2026-11-28 21:44:15 -0800 |
|---|---|---|
| committer | Zack <zmasi21@gmail.com> | 2026-11-28 21:44:15 -0800 |
| commit | 53a6ec172d3b5ec09cfb104811efafff1eb45b28 (patch) | |
| tree | 54c7531261b9dc49506eaa73acbc48ad15c0c067 /runtime/test/vk_queue_query_sync_test.cpp | |
| parent | 55c6dcbb286ebf4a96e09774ebb8c30bd67b91b7 (diff) | |
d3d12/shader: close lane_regions loop fixpoint and exit dead host_wide waves
Follow-up fixes for Wave64-on-Wave32 loop-region analysis and partial-group
`host_wide` loops:
1. Fixpoint closure over `full_by_head` in `lower::lane_regions` (`lower.rs`):
- Replace the pre-walk `sub_loops` check with a monotone fixpoint over
`full_by_head` (`expanded`), expanding any enclosing loop `full_body`
with `full_body[d]` whenever the non-post-dominated walk reaches `head`,
leaves `full_body`, or reaches a block with an edge to `head` or outside
`full_body`.
- Captures shared-latch per-lane `continue` branches and guarded `break`
exits inside per-lane branches while keeping diamond `if/else` joins and
nested per-lane loops inside uniform outer loops unexpanded.
2. Dead half-wave early exit in `Lower::wave_wide` (`lower.rs`):
- When an entire 32-lane host half-wave is unlaunched (`waveAnyTrue(a) ==
false`, e.g. lanes `32..63` when `USER_DISPATCH_THREADS_X <= 32`), combine
`host_wide`'s branch result with `waveAnyTrue(a)` (`And` when `taken`
cycles back to `b` and `!any`, `Or(!waveAnyTrue(a))` when `not_taken`
cycles back to `b` and `any`) so dead half-waves exit on iteration 1 and
reach post-loop barriers cleanly instead of spinning to `LOOP_LIMIT`.
3. Regression coverage (`paired_tests.rs`):
- Verify live on RTX 3090 + WARP that lane 40's `v6` equals `1` when
`active_in_group <= 32` and `4` when `active_in_group > 32`, and add unit
assertions for shared-latch `continue`, guarded `break` inside a per-lane
branch, diamond `if/else` non-expansion, and nested-loop non-expansion.
Verification (Windows 11 + NVIDIA GeForce RTX 3090 D3D12 & Microsoft WARP):
- `cargo test --manifest-path d3d12/Cargo.toml -p leonida-shader --lib paired_tests -- --test-threads=4`: 21/21 passed.
- `cargo test --manifest-path d3d12/Cargo.toml -p leonida-shader --lib wave64_tests -- --test-threads=4`: 30/30 passed.
- `cargo clippy --manifest-path d3d12/Cargo.toml -p leonida-shader --all-targets`: 0 warnings on touched code.
- `python -I scripts/check_no_game_data.py`: 0 issues.
AI-assisted.
Diffstat (limited to 'runtime/test/vk_queue_query_sync_test.cpp')
0 files changed, 0 insertions, 0 deletions