Shaders: track s_add_u32 with src_scc in address high halves (#815) #2385
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2385
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2385"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@fuzeofficlal on GitHub · 2026-11-25 12:26 UTC · original
fuzeofficlal:fix/shader-add-scc-carry-high-half-815→main· +280 −8 · 3 files · 1 commits · openSummary
Tracks
s_add_u32(and zero-high-bases_mov_b32) readingsrc_scc(Operand::Const(253)) in 64-bit address high halves (Tracer::high_halfandTracer::carriedincrates/victory-shader/src/resource.rs), and removessccfromLower::operand's unsupported special-operand message (crates/victory-shader/src/emit/lower.rs, which already lowersOperand::Const(253)viascc_in).In the native compute pipeline measurements on
mainreported in #815 (#issuecomment-7160878577world-run breakdown), 31 distinct compute programs fail translation with"an address into a descriptor heap with an untracked high half"when adding thes_add_u32low-half carry into the high dword vias_add_u32 hi, 0, src_sccrather thans_addc_u32 hi, 0, 0.Details
ir::add_regs(crates/victory-shader/src/ir.rs:1068) already recordsReg::Sccininst.readsforOperand::Const(253).Tracer::add_sccverifiesinst.writes.first()?.1 == vandinst.read(Reg::Scc).is_some(), returning the non-carry termxfors_add_u32 v, x, src_scc/s_add_u32 v, src_scc, xandTerm::Const(0)fors_mov_b32 v, src_scc.Tracer::high_halfacceptsself.add_scc(v) == Some(want)alongsides_addc_u32(supporting descriptor tables/heaps wherewant = Term::Const(0)as well as 64-bit root descriptors ands_getpc_b64code tables wherewant = Term::Value(base_hi)), while rejectings_mov_b32 hi, src_sccwhenbase_hiis non-zero.Tracer::carriedrecurses throughadd_sccalongsides_addc_u32.Verification
resource::tests::add_scc_carries_into_address_high_halves: covers table/heap (s_add_u32in both operand orders ands_mov_b32), root descriptors,s_getpc_b64code tables, and negative cases (adding an arbitrary SGPR to a heap high half stays refused;s_mov_b32 hi, src_sccon a root descriptor dropsbase_hiand falls back to title memory).emit::valu_tests::add_scc_carry_in_table_and_code_addresses_runs_on_host: validates DXIL withdxil.dlland executes on both hardware GPU andWARP.cargo clippy -p victory-shader --lib --tests --all-features --locked -- -D warnings&cargo xtask policypass.Refs #815
@Marvisak on GitHub · 2026-11-25 14:58 UTC · original · edited 2026-11-26 02:19 UTC
Automated triage for the maintainers.
Merge candidate.
d996f08is the same change as the earlier reviewed head, now as one commit on currentmain, and it merges cleanly. The resource tracer (Tracer::high_half/carriedincrates/victory-shader/src/resource.rs, via a newadd_scc) accepts an address high half built ass_add_u32 hi, x, src_scc(either operand order) ors_mov_b32 hi, src_scc, the carry form the title's compute programs use instead ofs_addc_u32.mainalready reads SCC for operand 253 (ir.rs) and lowers it as 0/1 (Lower::operand,scc_in), so only the tracer was missing and the error message's "scc" was stale. The check is as lenient as the existings_addc_u32one, which also does not tie the carry to the low add. I re-checked the test words (0x8007FD80iss_add_u32 s7, 0, src_scc,0xBE8703FDiss_mov_b32 s7, src_scc). The tests cover tables, root descriptors,s_getpc_b64code tables and two refusals, plus a GPU readback on hardware and WARP.CI:
checkpassing.Generated by Claude Code
@cloph-dsp on GitHub · 2026-11-25 15:41 UTC · original
Independent local validation for Victory PR #2385 (Windows, Rust 1.100.0/MSVC, head 2b68ca3, no game data):
cargo test --locked -p victory-shader --lib-> 249 passed, 0 failed, 3 ignored, exit 0 (138.91s, shared target);git diff --checkclean. CPU-only regression run; synthetic s_add_u32/src_scc address-high-half scenario not replayed. AI-assisted (Hy4 flash). GPU/driver N/A for CPU tests.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.