perf(shader): add DXIL folds, pure LICM, local/shared reuse, and barrier dedup #42
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!42
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-42"
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?
@Vladimir-Human on GitHub · 2026-11-27 12:51 UTC · original
Vladimir-Human:perf/dxil-opt-licm-barriers→main· +4700 −94 · 2 files · 1 commits · openSummary
Extends
victory-shader'sbitcode::optDXIL clean-up pipeline with four exact optimization improvements:FOLD, bit2) — canonicalizes and folds additional integer/boolean/compare/select identities while keeping float semantics exact.LICM, bit128) — hoists pure, non-trapping loop-invariant instructions out of natural loops into their dominating preheader (splitting conditional preheaders lazily when needed).LOADS, bit16) — separates thread-private (space 0), groupshared (space 3), constant tables, and DXIL resource memory so non-aliasing writes preserve unrelated reads, forwardsspace 0stores to loads, reuses consecutivespace 3reads across non-aliasing resource writes, and eliminates overwritten dead stores within a block.space 3(groupshared) store-to-load forwarding is intentionally omitted (const stores invalidate the slot; dynamic stores clear cachedspace 3loads without inserting) so barrierless wave-ordered LDS exchange patterns (lds[bucket] = lane; if (lds[bucket] == lane)) remain exact.BARRIERS, bit256) — eliminates redundantdx.op.barrier(mode)calls covered by an earlier barrier across pure ALU or bounded non-escaping LDS read phases.DEFAULTis updated from63to447(all passes except opt-inWIDE = 64;ALL = 511). Disk shader cache invalidation is automatic viavictory-shader/build.rs(VICTORY_SHADER_SOURCE_HASH),victory-gpu/build.rs(VICTORY_TRANSLATOR), andshader_opt()inshader_cache.rs.Verification
cargo clippy -p victory-shader -p xtask --all-targets --locked -- -D warnings(default &--all-features): 0 warningscargo test -p xtask --locked: 6 passed; 0 failed (repository_passes_policygreen)VICTORY_D3D12_DEBUG=1,VICTORY_REQUIRE_HW_GPU=1):cargo test -p victory-shader --locked -- --test-threads=1— 300 passed; 0 failed; 5 ignoredVICTORY_D3D12_DEBUG=1):opt::tests::hw_tests2 passed; 0 failed; 1 ignoredVICTORY_SHADER_OPT=511):scalar_buffer_loads_read_the_same_dwords_one_call_or_four1/1,opt::tests::hw_tests2/2@jptorres96 on GitHub · 2026-11-27 15:33 UTC · original
Independent run on Ada: RTX 4080 SUPER 16 GB, driver 621.01, Ryzen 5 5600X, Windows build 26300, PR head
00d5623, toolchain 1.98.1, DXIL validator from DXC 1.9.2609.5,VICTORY_REQUIRE_HW_GPU=1, nothing else using the GPU.dxil_opt_hw_gpu_bit_exact_parity_and_validation: passedcargo test -p victory-shader --lib -- --test-threads=1: 300 passed, 0 failed, 5 ignoredbench_dxil_opt_hw_gpu(release, GPU median, one run):On this card the synthetic cases gain −19% (1) and −31% (2) over
old_bits; in case 1old_bitsgains nothing over opt=0, so the driver does not hoist these itself. The two real translated programs show no change betweenold_bitsand the new default, so the in-game gain is still open. I have no game dump to measure it.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.