Shaders: track s_add_u32 with src_scc in address high halves #2487

Manually merged
github merged 1 commit from github-bot/gh-2487 into main 2026-11-30 14:15:52 +00:00 AGit
Owner

@⁠fuzeofficlal on GitHub · 2026-11-29 13:31 UTC · original
fuzeofficlal:fix/shader-add-scc-carry-high-half → main · +294 −7 · 3 files · 1 commits · merged 2026-11-30 14:12 UTC

Summary

Tracks s_add_u32 (and zero-high-base s_mov_b32) reading src_scc (Operand::Const(253)) in 64-bit address high halves (Tracer::high_half and Tracer::carried in crates/victory-shader/src/resource.rs), and removes scc from Lower::operand's unsupported special-operand message (crates/victory-shader/src/emit/lower.rs, which already lowers Operand::Const(253) via scc_in).

When shaders propagate the low-half carry of a 64-bit table/heap, root-descriptor, or s_getpc_b64 address using s_add_u32 hi, base_hi, src_scc or s_mov_b32 hi, src_scc instead of s_addc_u32, resource tracking previously rejected the address with "an address with an untracked high half".

Details

  • Tracer::add_scc verifies inst.writes.first()?.1 == v and inst.read(Reg::Scc).is_some(), returning the non-carry term x for s_add_u32 v, x, src_scc / s_add_u32 v, src_scc, x and Term::Const(0) for s_mov_b32 v, src_scc.
  • Tracer::high_half accepts self.add_scc(v) == Some(want) alongside s_addc_u32, while rejecting s_mov_b32 hi, src_scc when base_hi is non-zero.
  • Tracer::carried recurses through add_scc alongside s_addc_u32.

Verification

  • cargo test --locked -p victory-shader --lib resource::tests — all pass (including add_scc_carries_into_address_high_halves).
  • cargo test --locked -p victory-shader --lib emit::valu_tests::add_scc_carry_in_table_and_code_addresses_runs_on_host — pass on RTX 5090 (VICTORY_ADAPTER=NVIDIA), WARP, and dxil.dll.
  • cargo clippy --locked -p victory-shader --all-targets — 0 new warnings in touched files.
  • cargo run --quiet --locked -p xtask -- policy --staged — pass.
**@⁠fuzeofficlal** on GitHub · 2026-11-29 13:31 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2487) `fuzeofficlal:fix/shader-add-scc-carry-high-half` → `main` · +294 −7 · 3 files · 1 commits · merged 2026-11-30 14:12 UTC ### Summary Tracks `s_add_u32` (and zero-high-base `s_mov_b32`) reading `src_scc` (`Operand::Const(253)`) in 64-bit address high halves (`Tracer::high_half` and `Tracer::carried` in `crates/victory-shader/src/resource.rs`), and removes `scc` from `Lower::operand`'s unsupported special-operand message (`crates/victory-shader/src/emit/lower.rs`, which already lowers `Operand::Const(253)` via `scc_in`). When shaders propagate the low-half carry of a 64-bit table/heap, root-descriptor, or `s_getpc_b64` address using `s_add_u32 hi, base_hi, src_scc` or `s_mov_b32 hi, src_scc` instead of `s_addc_u32`, resource tracking previously rejected the address with `"an address with an untracked high half"`. ### Details - `Tracer::add_scc` verifies `inst.writes.first()?.1 == v` and `inst.read(Reg::Scc).is_some()`, returning the non-carry term `x` for `s_add_u32 v, x, src_scc` / `s_add_u32 v, src_scc, x` and `Term::Const(0)` for `s_mov_b32 v, src_scc`. - `Tracer::high_half` accepts `self.add_scc(v) == Some(want)` alongside `s_addc_u32`, while rejecting `s_mov_b32 hi, src_scc` when `base_hi` is non-zero. - `Tracer::carried` recurses through `add_scc` alongside `s_addc_u32`. ### Verification - `cargo test --locked -p victory-shader --lib resource::tests` — all pass (including `add_scc_carries_into_address_high_halves`). - `cargo test --locked -p victory-shader --lib emit::valu_tests::add_scc_carry_in_table_and_code_addresses_runs_on_host` — pass on RTX 5090 (`VICTORY_ADAPTER=NVIDIA`), WARP, and `dxil.dll`. - `cargo clippy --locked -p victory-shader --all-targets` — 0 new warnings in touched files. - `cargo run --quiet --locked -p xtask -- policy --staged` — pass.
Track s_add_u32 (and zero-high-base s_mov_b32) reading src_scc (Operand::Const(253)) in Tracer::high_half and Tracer::carried, and remove scc from Lower::operand's unsupported special-operand message.

Co-authored-by: Machad3x <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 13:34:04 +00:00
github manually merged commit a26b120bd9 into main 2026-11-30 14:15:52 +00:00
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/trustno1-coder--VIctory-NVIDIA!2487
No description provided.