fix(shader): reject modified v_add_co_ci_u32 in address carry tracing #3362
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!3362
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3362"
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?
@reeledMarek on GitHub · 2026-11-26 20:25 UTC · original
reeledMarek:fix/shader-carried-valu-modifiers→main· +66 −0 · 1 files · 1 commits · openSummary
Tracer::carriedmatchedv_add_co_ci_u32without checking VALU input/output modifiers (abs,neg,opsel,clamp,omod,sdwa,dpp).clamp), SDWA sub-dword, or DPP lane-permutedv_add_co_ci_u32was therefore accepted as a plain 64-bit address high-half carry, misclassifying the resulting global memory address as belonging to a root descriptor parameter instead of falling back toMEMORY.Tracer::carriedto require unmodifiedv_add_co_ci_u32(abs == 0 && neg == 0 && opsel == 0 && !clamp && omod == 0 && sdwa.is_none() && dpp.is_none()).modified_v_add_co_ci_u32_is_not_treated_as_plain_address_carrycovering plain vs clamped, SDWA, and DPP16 encodings.Verification
victory-shaderon Linuxcargo clippy -p victory-shader --all-targets --target x86_64-pc-windows-msvc --locked -- -D warningscargo test -p xtask --locked@Dukestar69 on GitHub · 2026-11-26 20:27 UTC · original · approved these changes
LGTM — verified on Windows against
origin/main(63bcca4).v_add_co_ci_u32instructions with VALU modifiers (abs,neg,opsel,clamp,omod,sdwa,dpp) during address carry tracing avoids misclassifying saturating/SDWA/DPP operations as plain 64-bit address high-half carries.cargo test -p victory-shader --lib resource:: -- --test-threads=1: 36 passed, 0 failed (includingmodified_v_add_co_ci_u32_is_not_treated_as_plain_address_carry).cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@fuzeofficlal on GitHub · 2026-11-26 20:48 UTC · original · approved these changes
LGTM — adding the VALU modifier guards (
abs,neg,opsel,clamp,omod,sdwa,dpp) toTracer::carriedprevents modifiedv_add_co_ci_u32instructions from being misclassified as plain 64-bit address high-half carries.Verified
cargo clippy --locked -p victory-shader --all-targets -- -D warnings(default &--all-features): clean.rustfmt --edition 2024: clean on all PR-touched hunks incrates/victory-shader/src/resource.rs.cargo test --locked -p victory-shader --lib resource::tests:: -- --test-threads=1: 36 passed, 0 failed (includingmodified_v_add_co_ci_u32_is_not_treated_as_plain_address_carry).cargo test --locked -p victory-shader --lib -- --test-threads=1 ir:: structure:: io:: emit::lower::: 59 passed, 0 failed, 1 ignored.Non-blocking follow-up notes
resource.rs(vaddat731-753,voriginat764-777, andreaches_pcat863) have similar gaps (missingclamp/omodguards onv_mov_b32/v_add_*, andcarriednot yet validating the other addend or carry-in provenance).resource.rs:3937): since 48-bit global addresses drop the upper 16 bits,dst_sel:WORD_0with zero-pad still produces the same effective address and exercises conservative fallback toMEMORY.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.