Shaders: mask v_readlane/v_writelane lane index and bypass EXEC on writelane #1312

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

@⁠ashrafsdrop on GitHub · 2026-11-24 17:20 UTC · original
ashrafsdrop:shader/lane-ops-rdna2 → main · +501 −10 · 6 files · 1 commits · open

Summary

Resolves VIC-BT-030 and VIC-BT-031 from #1249:

  1. Lane Index Masking (VIC-BT-030):

    • On RDNA2 hardware, v_readlane_b32 and v_writelane_b32 mask the lane-select operand to S1 & 31 (Wave32) or S1 & 63 (Wave64).
    • In lower.rs, lane operands are now masked against wave64 ? 63 : 31 before reaching waveReadLaneAt.i32 or lane comparison, preventing DXIL undefined behavior on out-of-range lane indices. Constant lanes fold directly without emitting extra instructions.
    • In wave.rs, v_readlane_b32 simulation masks constant lane indices against wave - 1.
  2. EXEC Bypass on v_writelane_b32 (VIC-BT-031):

    • Per the RDNA2 ISA manual, v_writelane_b32 ignores EXEC so compilers can spill SGPRs into inactive lanes of a spill VGPR across divergent branches.
    • Destination write now runs with guard = None, preventing write_placed from suppressing spills when the target lane has EXEC = 0.
  3. Tests:

    • Added synthetic test v_readlane_and_writelane_mask_lane_and_ignore_exec covering zero EXEC masks and out-of-range lane indices validated via dxil.dll.

Verification

  • cargo test -p victory-shader: 121 tests passed, 0 failed.
  • cargo clippy -p victory-shader: 0 warnings.
  • cargo run -p xtask -- policy: 154 files ok.
**@⁠ashrafsdrop** on GitHub · 2026-11-24 17:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/1312) `ashrafsdrop:shader/lane-ops-rdna2` → `main` · +501 −10 · 6 files · 1 commits · open ### Summary Resolves `VIC-BT-030` and `VIC-BT-031` from #1249: 1. **Lane Index Masking (`VIC-BT-030`)**: - On RDNA2 hardware, `v_readlane_b32` and `v_writelane_b32` mask the lane-select operand to `S1 & 31` (Wave32) or `S1 & 63` (Wave64). - In `lower.rs`, lane operands are now masked against `wave64 ? 63 : 31` before reaching `waveReadLaneAt.i32` or lane comparison, preventing DXIL undefined behavior on out-of-range lane indices. Constant lanes fold directly without emitting extra instructions. - In `wave.rs`, `v_readlane_b32` simulation masks constant lane indices against `wave - 1`. 2. **EXEC Bypass on `v_writelane_b32` (`VIC-BT-031`)**: - Per the RDNA2 ISA manual, `v_writelane_b32` ignores `EXEC` so compilers can spill SGPRs into inactive lanes of a spill VGPR across divergent branches. - Destination write now runs with `guard = None`, preventing `write_placed` from suppressing spills when the target lane has `EXEC = 0`. 3. **Tests**: - Added synthetic test `v_readlane_and_writelane_mask_lane_and_ignore_exec` covering zero `EXEC` masks and out-of-range lane indices validated via `dxil.dll`. ### Verification - `cargo test -p victory-shader`: 121 tests passed, 0 failed. - `cargo clippy -p victory-shader`: 0 warnings. - `cargo run -p xtask -- policy`: 154 files ok.
On RDNA2 hardware, v_readlane_b32 and v_writelane_b32 mask the lane-select operand
modulo the wave size (lane & 31 in Wave32, lane & 63 in Wave64), and v_writelane_b32
bypasses EXEC masking so shaders can spill scalar values across inactive lanes.

- Mask lane selectors in whole-wave emulation, spill/restore tracking, and DXIL lowering
- Bypass implicit EXEC read in IR and per-lane EXEC guards in structure/lowering for writelane
- Clean DXIL execution tests using Host with graceful wave size skipping for GPU-less CI
- Resolves VIC-BT-030 and VIC-BT-031 from #1249
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:27:14 +00:00
github-bot force-pushed github-bot/gh-1312 from d192b2ae96 to bf4837dc66 2026-11-26 06:31:40 +00:00 Compare
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-24 17:47 UTC · original

Reviewed 03913d9 and tested Wave32 / native Wave64 / pixel-shader host-lane cases across NVIDIA GeForce RTX 5090, AMD Radeon(TM) Graphics, D3D12 WARP, and dxil.dll. Four subtleties worth addressing:

  1. Dynamic v_readlane_b32 in pixel/vertex shaders (MaskData::Host) gets truncated (emit/lower.rs:4207):
    • Masking lane before checking self.mask_data == MaskData::Host && !matches!(lane, V::Const(_)) clamps computed host lane indices (from v_mbcnt or a ballot mask) to & 31 when native.wave64 == false, breaking lanes 32..63 on 64-wide host waves. Only the non-MaskData::Host (or constant-selector) branch should mask lane by self.wave() - 1.
  2. self.write_i vs self.write (emit/lower.rs:4249):
    • Replacing int(self, r) with self.write(inst, Reg::V(reg), r, None) skips write_i's v.clamp / v.omod integer output modifier checks; self.write_i(inst, r, None) preserves them while dropping the EXEC guard.
  3. Implicit EXEC read & Lanes::finish guard (ir.rs:930, structure.rs:601):
    • ir::effects still appends mask(EXEC) as an implicit read on v_readlane_b32 / v_writelane_b32, and structure::Lanes::finish still attaches an EXEC guard to v_readlane_b32 (and if exec_lo is passed as an explicit source operand to spill the mask into an inactive lane, v_writelane_b32 should still receive guard = None).
  4. Descriptor spill tracking modulo wavefront width (resource.rs:1619, 1653):
    • Tracer::restored and Tracer::spilled compare raw lane_of(...) without & (if self.p.wave64 { 63 } else { 31 }), so out-of-range constant selectors miss matching SGPR spill/restore pairs.

Reference branch with all four fixes + Wave32/Wave64/WARP GPU readback tests: fuzeofficlal/VIctory@d80c77a (fix/shader-readlane-writelane-exec-mask-1044).

**@⁠fuzeofficlal** on GitHub · 2026-11-24 17:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/1312#issuecomment-7139718560) Reviewed `03913d9` and tested Wave32 / native Wave64 / pixel-shader host-lane cases across **NVIDIA GeForce RTX 5090**, **AMD Radeon(TM) Graphics**, **D3D12 WARP**, and **`dxil.dll`**. Four subtleties worth addressing: 1. **Dynamic `v_readlane_b32` in pixel/vertex shaders (`MaskData::Host`) gets truncated (`emit/lower.rs:4207`)**: - Masking `lane` *before* checking `self.mask_data == MaskData::Host && !matches!(lane, V::Const(_))` clamps computed host lane indices (from `v_mbcnt` or a ballot mask) to `& 31` when `native.wave64 == false`, breaking lanes `32..63` on 64-wide host waves. Only the non-`MaskData::Host` (or constant-selector) branch should mask `lane` by `self.wave() - 1`. 2. **`self.write_i` vs `self.write` (`emit/lower.rs:4249`)**: - Replacing `int(self, r)` with `self.write(inst, Reg::V(reg), r, None)` skips `write_i`'s `v.clamp` / `v.omod` integer output modifier checks; `self.write_i(inst, r, None)` preserves them while dropping the `EXEC` guard. 3. **Implicit `EXEC` read & `Lanes::finish` guard (`ir.rs:930`, `structure.rs:601`)**: - `ir::effects` still appends `mask(EXEC)` as an implicit read on `v_readlane_b32` / `v_writelane_b32`, and `structure::Lanes::finish` still attaches an `EXEC` guard to `v_readlane_b32` (and if `exec_lo` is passed as an explicit source operand to spill the mask into an inactive lane, `v_writelane_b32` should still receive `guard = None`). 4. **Descriptor spill tracking modulo wavefront width (`resource.rs:1619, 1653`)**: - `Tracer::restored` and `Tracer::spilled` compare raw `lane_of(...)` without `& (if self.p.wave64 { 63 } else { 31 })`, so out-of-range constant selectors miss matching SGPR spill/restore pairs. Reference branch with all four fixes + Wave32/Wave64/WARP GPU readback tests: [`fuzeofficlal/VIctory@d80c77a`](https://github.com/fuzeofficlal/VIctory/commit/d80c77aff14f0e3ddbb0eca09b782b1021549dd9) (`fix/shader-readlane-writelane-exec-mask-1044`).
Author
Owner

@⁠ashrafsdrop on GitHub · 2026-11-24 17:55 UTC · original

Thanks @⁠fuzeofficlal for the thorough review and hardware testing!

Integrated in commit d27838e:

  • Dynamic MaskData::Host lane selectors in pixel/vertex shaders now bypass console wave masking so 64-wide host lanes remain unclipped.
  • Preserved integer output modifiers on v_writelane_b32 via write_i(inst, r, None) while bypassing EXEC.
  • Dropped implicit EXEC reads and per-lane EXEC guards on v_readlane_b32 / v_writelane_b32 in ir.rs and structure.rs.
  • Masked SGPR spill tracking selectors modulo wave width in resource.rs.
  • Added multi-lane Wave32/Wave64 execution tests across adapters.

cargo test -p victory-shader (126 tests passed), cargo clippy -p victory-shader --all-targets --all-features -- -D warnings, and cargo run -p xtask -- policy pass with zero warnings.

**@⁠ashrafsdrop** on GitHub · 2026-11-24 17:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/1312#issuecomment-7139895815) Thanks [@⁠fuzeofficlal](https://github.com/fuzeofficlal) for the thorough review and hardware testing! Integrated in commit d27838e: - Dynamic `MaskData::Host` lane selectors in pixel/vertex shaders now bypass console wave masking so 64-wide host lanes remain unclipped. - Preserved integer output modifiers on `v_writelane_b32` via `write_i(inst, r, None)` while bypassing EXEC. - Dropped implicit EXEC reads and per-lane EXEC guards on `v_readlane_b32` / `v_writelane_b32` in `ir.rs` and `structure.rs`. - Masked SGPR spill tracking selectors modulo wave width in `resource.rs`. - Added multi-lane Wave32/Wave64 execution tests across adapters. `cargo test -p victory-shader` (126 tests passed), `cargo clippy -p victory-shader --all-targets --all-features -- -D warnings`, and `cargo run -p xtask -- policy` pass with zero warnings.
Author
Owner

@⁠wbkepler on GitHub · 2026-11-24 20:59 UTC · original

A merge note: #1336 (VIC-BT-030/031) changes the same two instructions. I compared the two diffs against ffe310e:

  • The same in both: the lane selector is masked by the console wave (wave() - 1, so & 63 for wave64 programs), v_writelane_b32 writes through write_i(inst, r, None) without the EXEC guard, and the wave.rs simulate hunk is identical.
  • Only in #1312:
    1. A computed MaskData::Host selector stays unmasked. #1336 masks it after the Host branch, which clips host lanes 32–63 when a wave32 console pixel or vertex program runs in a 64-wide host wave. That is harmless on 32-lane NVIDIA hosts but wrong on AMD.
    2. Tracer::restored and Tracer::spilled mask the selector too.
    3. The implicit EXEC read and the structure guard are dropped.
  • Only in #1336: nothing for these two instructions.

For the wave64-on-32-lane case: a compute program that uses either instruction sets console_lanes, so it declares WaveSize(64) and is never split into two 32-lane host waves. Masking against the console wave is therefore correct. Pixel and vertex programs refuse constant cross-lane selectors in cross_lane.

So #1312 is the more complete version of these items. The v_readlane_b32 / v_writelane_b32 arms in lower.rs and the test blocks at the end of emit::lower::tests will conflict with whichever of the two lands second.

AI-assisted review (Claude Code); checked on Windows 11 / RTX 5090.

**@⁠wbkepler** on GitHub · 2026-11-24 20:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/1312#issuecomment-7144334917) A merge note: #1336 (VIC-BT-030/031) changes the same two instructions. I compared the two diffs against `ffe310e`: - **The same in both:** the lane selector is masked by the console wave (`wave() - 1`, so `& 63` for wave64 programs), `v_writelane_b32` writes through `write_i(inst, r, None)` without the EXEC guard, and the `wave.rs` `simulate` hunk is identical. - **Only in #1312:** 1. A computed `MaskData::Host` selector stays unmasked. #1336 masks it after the Host branch, which clips host lanes 32–63 when a wave32 console pixel or vertex program runs in a 64-wide host wave. That is harmless on 32-lane NVIDIA hosts but wrong on AMD. 2. `Tracer::restored` and `Tracer::spilled` mask the selector too. 3. The implicit EXEC read and the structure guard are dropped. - **Only in #1336:** nothing for these two instructions. For the wave64-on-32-lane case: a compute program that uses either instruction sets `console_lanes`, so it declares `WaveSize(64)` and is never split into two 32-lane host waves. Masking against the console wave is therefore correct. Pixel and vertex programs refuse constant cross-lane selectors in `cross_lane`. So #1312 is the more complete version of these items. The `v_readlane_b32` / `v_writelane_b32` arms in `lower.rs` and the test blocks at the end of `emit::lower::tests` will conflict with whichever of the two lands second. _AI-assisted review (Claude Code); checked on Windows 11 / RTX 5090._
Author
Owner

@⁠ashrafsdrop on GitHub · 2026-11-25 00:50 UTC · original

Thanks @⁠wbkepler for the comparison against #1336 and detailed verification on RTX 5090.

Merged main (42363ab) in commit 31fd70e resolving all merge conflicts:

  • Preserved unmasked computed MaskData::Host lane selectors for 64-wide host pixel/vertex waves.
  • Maintained the unguarded v_readlane_b32 / v_writelane_b32 path alongside the new last_guard cache.
  • Updated shader test initializers with new HostShader bindless heap/memory fields.

Verification on Windows 11 x64 (Rust 1.98.1 MSVC):

  • cargo test -p victory-shader: 252 passed, 0 failed.
  • cargo clippy -p victory-shader --all-targets --all-features -- -D warnings: 0 warnings.
  • cargo run -p xtask -- policy: 182 files ok.
**@⁠ashrafsdrop** on GitHub · 2026-11-25 00:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/1312#issuecomment-7148938901) Thanks @⁠wbkepler for the comparison against #1336 and detailed verification on RTX 5090. Merged `main` (`42363ab`) in commit `31fd70e` resolving all merge conflicts: - Preserved unmasked computed `MaskData::Host` lane selectors for 64-wide host pixel/vertex waves. - Maintained the unguarded `v_readlane_b32` / `v_writelane_b32` path alongside the new `last_guard` cache. - Updated shader test initializers with new `HostShader` bindless heap/memory fields. Verification on Windows 11 x64 (Rust 1.98.1 MSVC): - `cargo test -p victory-shader`: 252 passed, 0 failed. - `cargo clippy -p victory-shader --all-targets --all-features -- -D warnings`: 0 warnings. - `cargo run -p xtask -- policy`: 182 files ok.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 02:35 UTC · original · edited 2026-11-26 07:20 UTC

Automated triage for the maintainers.

Merge candidate. The new head is one rebased commit with the same content as before:

  • mask_lane in emit/lower.rs masks the v_readlane_b32/v_writelane_b32 selector to the console wave. A computed MaskData::Host selector stays unmasked.
  • v_writelane_b32 writes through write_i(inst, r, None).
  • The implicit EXEC read (ir::effects) and the structure::Lanes guard are dropped.
  • wave::simulate and resource::Tracer mask the selector too.

This matches the RDNA2 ISA: both instructions ignore EXEC. The wave32/wave64 readback tests in valu_tests.rs now skip cleanly when no device is present. Note: lower.rs ends at 523,623 bytes, about 660 under the policy's 512 KiB limit. The PR still competes with #1336 for the same arms.

CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 02:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/1312#issuecomment-7150915207) · edited 2026-11-26 07:20 UTC <!-- victory-triage v1 head=bf4837dc66559824cbc8143aecdbe8608891474f verdict=merge-candidate at=2026-11-26T07:20:41Z --> Automated triage for the maintainers. **Merge candidate.** The new head is one rebased commit with the same content as before: - `mask_lane` in `emit/lower.rs` masks the `v_readlane_b32`/`v_writelane_b32` selector to the console wave. A computed `MaskData::Host` selector stays unmasked. - `v_writelane_b32` writes through `write_i(inst, r, None)`. - The implicit EXEC read (`ir::effects`) and the `structure::Lanes` guard are dropped. - `wave::simulate` and `resource::Tracer` mask the selector too. This matches the RDNA2 ISA: both instructions ignore EXEC. The wave32/wave64 readback tests in `valu_tests.rs` now skip cleanly when no device is present. Note: `lower.rs` ends at 523,623 bytes, about 660 under the policy's 512 KiB limit. The PR still competes with #1336 for the same arms. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠ashrafsdrop on GitHub · 2026-11-25 11:30 UTC · original

Updated in head d192b2a:

Rebase & Adapter Deduplication

  • Rebased cleanly on latest origin/main.
  • Removed custom DXGI adapter enumeration (all_wave_hosts, open_wave_adapter, AdapterHost) and standardized on host::Host.

CI Runner Graceful Fallback

  • compute_pipeline wave checks skip gracefully when the host device or WARP does not support Wave32/Wave64, eliminating the panic on GPU-less CI runners.
  • Fixed the synthetic test store helper (buffer_store_dword_offen) to set the offen bit (w0 bit 12), ensuring per-lane offset buffers index accurately during execution.

Verification

  • cargo test -p victory-shader (252 passed, 0 failed, 3 ignored).
  • cargo clippy -p victory-shader --all-targets --all-features -- -D warnings (clean).
  • cargo run -p xtask -- policy (182 files ok).
**@⁠ashrafsdrop** on GitHub · 2026-11-25 11:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/1312#issuecomment-7161139634) Updated in head `d192b2a`: ### Rebase & Adapter Deduplication - Rebased cleanly on latest `origin/main`. - Removed custom DXGI adapter enumeration (`all_wave_hosts`, `open_wave_adapter`, `AdapterHost`) and standardized on `host::Host`. ### CI Runner Graceful Fallback - `compute_pipeline` wave checks skip gracefully when the host device or WARP does not support Wave32/Wave64, eliminating the panic on GPU-less CI runners. - Fixed the synthetic test store helper (`buffer_store_dword_offen`) to set the `offen` bit (`w0` bit 12), ensuring per-lane offset buffers index accurately during execution. ### Verification - `cargo test -p victory-shader` (252 passed, 0 failed, 3 ignored). - `cargo clippy -p victory-shader --all-targets --all-features -- -D warnings` (clean). - `cargo run -p xtask -- policy` (182 files ok).
Author
Owner

@⁠DenRakEiw on GitHub · 2026-11-24 17:26 UTC · original · approved these changes

Tested head 542b36e (fast-forward on main ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC):

  • cargo test -p victory-shader emit::lower: 12 passed, 0 failed (including v_readlane_and_writelane_mask_lane_and_ignore_exec)
  • cargo clippy -p victory-shader --all-targets: 0 warnings
  • cargo xtask policy: ok

Clean fix masking v_readlane/v_writelane lane indices and bypassing EXEC on v_writelane. Approving.

AI-assisted (Gemini 4 Neon).

**@⁠DenRakEiw** on GitHub · 2026-11-24 17:26 UTC · [original](https://github.com/Marvisak/VIctory/pull/1312#pullrequestreview-6044161490) · **approved these changes** Tested head `542b36e` (fast-forward on `main` `ffe310e`) on Windows 11 x64 (Rust 1.98.1 MSVC): - `cargo test -p victory-shader emit::lower`: **12 passed, 0 failed** (including `v_readlane_and_writelane_mask_lane_and_ignore_exec`) - `cargo clippy -p victory-shader --all-targets`: **0 warnings** - `cargo xtask policy`: ok Clean fix masking `v_readlane`/`v_writelane` lane indices and bypassing EXEC on `v_writelane`. Approving. AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠catminou4 on GitHub · 2026-11-24 20:09 UTC · original · approved these changes

Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (ffe310e), cargo test -p victory-shader --locked → 99 passed, 0 failed. Execution/valu tests are #[cfg(all(test, windows))] and only run on Windows; macOS covers lowering/structure/IR unit tests.

Masks the v_readlane/v_writelane lane index by wave size and bypasses EXEC for writelane; adds wave32/wave64 lowering+validation tests and host-lane tests across backends including WARP.

**@⁠catminou4** on GitHub · 2026-11-24 20:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/1312#pullrequestreview-6046556328) · **approved these changes** Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (ffe310e), cargo test -p victory-shader --locked → 99 passed, 0 failed. Execution/valu tests are #[cfg(all(test, windows))] and only run on Windows; macOS covers lowering/structure/IR unit tests. Masks the v_readlane/v_writelane lane index by wave size and bypasses EXEC for writelane; adds wave32/wave64 lowering+validation tests and host-lane tests across backends including WARP.
Author
Owner

@⁠Lyrnc on GitHub · 2026-11-26 18:38 UTC · original

Wave64 hardware check of bf4837d.

Checked against a hardware table measured on an AMD Radeon iGPU (gfx1036, RDNA 2, Ryzen 7 9800X3D) in native
wave64: 64 cross-lane instructions x 8 EXEC masks (all, lo32, hi32, all but lane 0, alternate lanes, lane 40 alone,
lanes 31+32, a sparse mask). Each case was assembled with the same assembler, run through VIctory as a wave64
compute program of 64 threads on the same Radeon through D3D12 (WaveSize 64, dxil.dll validated), and all 64
lanes compared with the hardware. EXEC is narrowed two ways: straight-line (v_cmpx_ne_u32, lowered with a lane
guard) and branched (s_and_saveexec_b64 + s_cbranch_execz, a DXIL if). Windows 11, Rust pinned, debug.
No game files were used.

Tested (merged with #2830 onto main 63bcca4; Radeon, wave64):

  • Straight-line narrowing: v_writelane_b32 d, s21, L for L = 5, 33, 63 is exact in all 24 cases with this PR.
    On main, 14 of 24 are wrong: every case whose lane is outside EXEC keeps its old value (lo32 / lane 33: hardware
    0x777, main 0xdead0021; hi32 / lane 5: hardware 0x777, main 0xdead0005).
  • Branched form: still 14 of 24 wrong with this PR, the same as main: a lane outside the DXIL branch does not run
    the write, so the bypass cannot reach it. (#320's console flow gives 24/24 there.)
  • v_readlane_b32 (lanes 0, 31, 32, 40, 63): unchanged, exact under straight-line narrowing.
  • The lane-index masking is not covered (all lanes in the table are below 64).

Not tested: NVIDIA, out-of-range lane selectors, the title.

AI use: Claude Code (Claude Opus 5.5) built the harness and the hardware table, ran them on the GPU above and wrote this report; the numbers come from those runs.

**@⁠Lyrnc** on GitHub · 2026-11-26 18:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/1312#issuecomment-7200693377) Wave64 hardware check of `bf4837d`. Checked against a hardware table measured on an AMD Radeon iGPU (gfx1036, RDNA 2, Ryzen 7 9800X3D) in native wave64: 64 cross-lane instructions x 8 EXEC masks (all, lo32, hi32, all but lane 0, alternate lanes, lane 40 alone, lanes 31+32, a sparse mask). Each case was assembled with the same assembler, run through VIctory as a wave64 compute program of 64 threads on the same Radeon through D3D12 (WaveSize 64, dxil.dll validated), and all 64 lanes compared with the hardware. EXEC is narrowed two ways: straight-line (`v_cmpx_ne_u32`, lowered with a lane guard) and branched (`s_and_saveexec_b64` + `s_cbranch_execz`, a DXIL `if`). Windows 11, Rust pinned, debug. No game files were used. **Tested** (merged with #2830 onto main 63bcca4; Radeon, wave64): - Straight-line narrowing: `v_writelane_b32 d, s21, L` for L = 5, 33, 63 is exact in all 24 cases with this PR. On main, 14 of 24 are wrong: every case whose lane is outside EXEC keeps its old value (lo32 / lane 33: hardware 0x777, main 0xdead0021; hi32 / lane 5: hardware 0x777, main 0xdead0005). - Branched form: still 14 of 24 wrong with this PR, the same as main: a lane outside the DXIL branch does not run the write, so the bypass cannot reach it. (#320's console flow gives 24/24 there.) - `v_readlane_b32` (lanes 0, 31, 32, 40, 63): unchanged, exact under straight-line narrowing. - The lane-index masking is not covered (all lanes in the table are below 64). **Not tested:** NVIDIA, out-of-range lane selectors, the title. **AI use:** Claude Code (Claude Opus 5.5) built the harness and the hardware table, ran them on the GPU above and wrote this report; the numbers come from those runs.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1312'
git switch 'github-bot/gh-1312'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1312'
git switch 'github-bot/gh-1312'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1312'
git switch 'main'
git merge --squash 'github-bot/gh-1312'
git switch 'main'
git merge --ff-only 'github-bot/gh-1312'
git switch 'main'
git merge 'github-bot/gh-1312'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!1312
No description provided.