diff options
| author | Zack <zmasi21@gmail.com> | 2026-11-28 21:24:43 -0800 |
|---|---|---|
| committer | Zack <zmasi21@gmail.com> | 2026-11-28 21:24:43 -0800 |
| commit | 55c6dcbb286ebf4a96e09774ebb8c30bd67b91b7 (patch) | |
| tree | f800cb77835bf9f17ff20266430ed69c575bef6c /runtime/src/xma2_decoder.cpp | |
| parent | e10e9d007e3a727a475ed0963531685d44a517f5 (diff) | |
d3d12/shader: mask host_wide loops for partial groups and merge loop regions
Follow-up fixes for Wave64-on-Wave32 lowering and loop-region analysis:
1. `Lower::wave_wide` `host_wide` partial-group masking (`lower.rs`):
- Mask `mine` by `self.partial_active` (`And(mine, a)` for `any`,
`Or(mine, Xor(a, true))` for `!any`) in the `host_wide` branch so
unlaunched threads kept in the wave for barriers (`USER_DISPATCH_THREADS_X`
in spilled `halves`/`exchange` Wave64 compute programs) never hold
`waveAnyTrue` true until `LOOP_LIMIT` or keep `waveAllTrue` false.
2. Multi-latch & irreducible loop region precision (`lower.rs`):
- Intersect each retreating edge's backward walk from `latch` with forward
reachability from `head` so irreducible multi-entry loops capture only the
exact loop SCC without leaking into entry block `0` or preheaders.
- Merge all loop bodies sharing `head` so per-lane `continue` back-edges
(direct or trampolined) before a uniform latch mark post-dominating
loop-body blocks `all_lane_blocks == false` and include the `continue`
branch in `branches_around`.
3. Paired readlane parity, cached `all_lane_blocks`, and expanded tests
(`paired.rs`, `lower.rs`, `paired_tests.rs`, `wave64_tests.rs`):
- Evaluate `restored_lanes` and post-section `Section::reads` across both
paired halves via `self.both` / `put_lanes` instead of mirroring `lo`.
- Cache `all_lane_blocks(self.x.st)` on `Lower` (`every_lane_block`) and
co-locate `console_lane_read` right below `Lower::shape`.
- Update `wave64_tests` mode-`0` assertion text and add runtime RTX + WARP
coverage for `ds_write_b8`/`ds_read_u8`/`ds_read_i8`, `_d16`/`_d16_hi`
half preservation, `ds_write_b128`/`ds_read_b96`/`ds_read_b128`,
`ds_write2st64_b64`/`ds_read2st64_b64`, counted `host_wide` loops
(`s_cbranch_execnz` & `s_cbranch_execz`), per-lane `continue` before a
uniform latch with cross-half LDS, and irreducible 2-entry loop CFGs.
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 -- --test-threads=4`: 360 passed, 0 failed.
- `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/src/xma2_decoder.cpp')
0 files changed, 0 insertions, 0 deletions