Shaders: require EXEC coverage when tracing VALU address operands #2923
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!2923
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2923"
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-26 00:13 UTC · original
fuzeofficlal:fix/shader-resource-guarded-valu-address→main· +367 −50 · 2 files · 1 commits · openProblem
In
crates/victory-shader/src/resource.rs,Tracer::lane_valuealready callsTracer::runs(site, known)to verify that every lane reaching a consumer actually executed each guarded VALU write. However,vorigin,vadd,carried(v_add_co_ci_u32),lane_term, andsumfollowed guardedv_mov_b32/v_add_co_u32/v_add_nc_u32/v_add_co_ci_u32definitions without checkinglanes.guards.When a shader updates a VGPR offset (or high-half address carry) under narrowed
EXEC(e.g.v_cmp_*+s_and_saveexec_b32), restoresEXEC, and executes aglobal_load_*/global_store_*/global_atomic_*:flat_addressfolded the guarded add/move into a staticAddress::offsetfor every lane, so lanes skipped whileEXEC == 0silently read or wrote at the wrong offset.v_add_co_ci_u32high-half carry afterEXECrestore was still attributed to the root parameter instead of falling back toMEMORY.Changes
Tracer::site_knownandTracer::runs_valueincrates/victory-shader/src/resource.rs, threading lane conditions (known: &[(Bool, bool)]) and guard tracking (unguarded: &mut bool) throughvorigin,vterm,vadd,sum/sum_tracked,carried,flat_address,address,traced_address,smem_address,lane_term,fetched, andwaterfall.Tracer::sumsmemoization to sums traced without encountering anyEXECguard (local == true), preventing guarded and unguarded uses of the same SSAValue(or its ancestors) from poisoning each other regardless of visit order while still allowing unguarded siblings to cache.emit/lower.rsuntouched.Verification
All tests use synthetic GFX10 encodings (no external files):
crates/victory-shader/src/resource.rs:a_guarded_move_is_folded_only_for_lanes_that_run_it(same guard folds,s_xor_b32else-arm and post-restore copy stay dynamic)sums_with_guarded_terms_are_not_cached_in_either_order(checks both visit orders and verifiesTracer::sumsstays unpopulated for guarded ancestors)a_guarded_high_half_carry_requires_exec_coverage(guardedv_add_co_ci_u32folds inside guard and falls back toMEMORYafter restore)emit::synthetic_tests::global_stores_keep_each_lanes_offset_after_exec_is_restored: verified with Windows SDK 10.0.26100.0dxil.dll, NVIDIA GeForce RTX 5090 (hardware), and D3D12 WARP (VICTORY_WARP=1).cargo test --locked -p victory-shader --lib -- resource::tests emit::lower::tests emit::flow_tests emit::waterfall_tests global_stores_keep_each_lanes_offset_after_exec_is_restored: 78/78 passed on RTX 5090, andglobal_stores_keep_each_lanes_offset_after_exec_is_restoredpassed on WARP.cargo clippy --locked -p victory-shader --all-targets -- -D warnings(default and--all-features) andcargo xtask policy(191 files ok): clean.@Jackster on GitHub · 2026-11-26 01:08 UTC · original
Independent verification on Windows 11 26100, AMD Radeon RX 7900 XTX (RDNA3, driver 32.0.32029.2010), Rust 1.100.0, Windows SDK 10.0.26100.0 (
dxil.dll):All three new
resource::testspass, andglobal_stores_keep_each_lanes_offset_after_exec_is_restoredruns on both backends:hardware: verified narrowed and restored EXEC storesVICTORY_WARP=1:WARP: verified narrowed and restored EXEC storesDXIL validation ran with the SDK's
dxil.dll(Validator::default_pathselects10.0.26100.0\x64\dxil.dll).cargo clippy --locked -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.No game files. AI-assisted.
@Marvisak on GitHub · 2026-11-26 04:22 UTC · original
Automated triage for the maintainers.
Merge candidate. This fixes a real hole in
victory-shader/src/resource.rs:vorigin,vadd,carriedandsumfollowedv_mov_b32/v_add_*/v_add_co_ci_u32definitions written under narrowed EXEC without theruns()coverage checklane_valuealready makes, so lanes that skipped the write got a wrong static offset. The newsite_known/runs_valuethreading throughflat_address,address,traced_address,smem_address,lane_termandwaterfallreads correctly, and restricting thesumscache to unguarded traces is right. The end-to-end test's expected values follow from EXEC semantics. Note for the maintainer: the descriptor-from-memory path now passes an emptyknown, which is more conservative and can fall back to MEMORY where it used to resolve to a root parameter.CI: passing.
Generated by Claude Code
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.