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

Merged
fuzeofficlal merged 1 commit from upstream-pr/2487 into main 2026-11-30 14:12:02 +00:00
fuzeofficlal commented 2026-11-29 13:31:38 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by fuzeofficlal on 2026-11-29T13:31:38Z.


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.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5551202473 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2487). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-29T13:31:38Z. --- ### 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.
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!2487
No description provided.