perf(shader): speed up control-flow structurisation #1013
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1013"
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?
Imported from Marvisak/VIctory. Originally posted by matheusfrta on 2026-11-24T15:02:24Z.
Rebased onto main keeping all recent structurisation fixes (discards, spilled masks, bounded memo). Applies pure BDD implication checking, per-block forced-atom restriction, and dirty-block propagation in paths. Added trailing newline for cargo fmt.
Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T15:40:27Z.
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
cbbb17e:cargo test -p victory-gpu -p victory-shaderpasses, 173 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:32:44Z.
Automated triage for the maintainers.
Needs work. Rebased cleanly. The change is now only
crates/victory-shader/src/structure.rs: a recursiveBools::impliesthat no longer buildsand(a, not b), normalization and argument ordering inite, an early contradiction check in the refutation path, and dirty-block propagation. This is a performance change to the code that decides lane masks for every shader, so it needs the two things asked for before. Neither needs game files:crates/victory-shader/benches/guard_runs.rs, which is inmain, to show the speed-up.victory-shadertests plus a check that structured output (or emitted DXIL) is byte-identical on the synthetic programs in the test suite.Also worth a sentence in the description: the new early
return falsewhen the sorted list holds the sameBooltwice changes what that function returns. Say why that is equivalent.On your reply: understood that you have no game dump. The benchmark and the test-suite comparison above don't need one. Until then there is no evidence of a speed-up, and the risk is a silent change in lane masks.
CI: passing.
Generated by Claude Code
[PR #1013] speed up shader structurisation and prioritize live pipeline compilesto [PR #1013] perf(shader): speed up control-flow structurisationImported from Marvisak/VIctory. Originally posted by matheusfrta on 2026-11-25T01:21:44Z.
Rebased onto
mainand dropped thepipeline/make.rschanges sincemainalready prioritizes live draws ahead of early starts. All CI checks are passing now with no conflicts.Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T03:56:32Z.
Review: APPROVED
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main
940d32f69b,cargo test -p victory-shader --locked.146 passed / 0 failed / 2 ignored. Control-flow structurisation speedup (+2 tests) — perf work on the structurizer; suite green.
Imported from Marvisak/VIctory. Originally posted by matheusfrta on 2026-11-25T15:33:01Z.
Fixed the trailing newline in
crates/victory-shader/src/structure.rs.I don't have a game dump available locally to run
victory translateand compare real-world timings and DXIL hashes. If anyone following this PR with the game shaders handy (maybe @Zipettte or @pablogonz12 since it was tested/merged in Scarlight) could share a before/aftervictory translaterun and check the output hashes, that would help verify the speedup on real title shaders.Imported from Marvisak/VIctory. Originally posted by matheusfrta on 2026-11-25T23:10:47Z.
Rebased onto
main(keeping the recentdiscards/kill_exitchanges) and ensured the trailing newline incrates/victory-shader/src/structure.rs.Imported from Marvisak/VIctory. Originally posted by smaxxey on 2026-11-26T10:23:36Z.
Numbers for the two things the triage asked for, neither of which needs game files. Laptop with an i7-13620H, Windows 11 26300, Rust 1.98.1. Head
ab9de6fmerged locally ontomain63bcca4.benches/guard_runs.rs, median per program, three rounds alternatingmainand this PR:mainAbout 1.9× faster on short runs and no change on unmasked; long runs stay within this laptop's noise.
Output unchanged. A local example (not part of this PR) put 312 synthetic compute programs through
range::build→resource::track→io::raise→emit::emit: wave32 and wave64; 0–12v_cmpxnarrowings; runs of 1, 2, 7 and 64 adds; three shapes (each narrowing followed by its run, the same withs_cbranch_execzover each run, and all narrowings first). All 312 DXIL containers are byte-identical betweenmainand this PR, and none is refused on either.Tests.
cargo test -p victory-shader --lib --locked -- --test-threads=1 --skip heap_direct_texture_reads_mark_their_heap_index(that test kills the process onmainhere, #2571): 300 passed, 3 failed. The 3 are the same NVIDIA failuresmainhas on this card (#1835); the 2 more passing are this PR's new tests.Tested with Claude Code's help.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.