Shaders: worklist register liveness with 96 independent synthetic CFG… #1846

Open
github-bot wants to merge 1 commit from github-bot/gh-1846 into main AGit
Owner

@⁠VlREX on GitHub · 2026-11-24 23:19 UTC · original
VlREX:perf/worklist-liveness-corpus → main · +181 −16 · 2 files · 1 commits · open

Replace repeated full-CFG register liveness sweeps with a predecessor worklist. Includes 96 independent synthetic regression fixtures across 12 graph families. Old sweep, new worklist and path-search models agreed on all 4,192 cases. Synthetic block visits decreased by 47.88%. 100 files, 1,965 additions, no new dependencies. Native Rust tests and real shader benchmarks pending. No proprietary game data. AI-assisted (ChatGPT).

**@⁠VlREX** on GitHub · 2026-11-24 23:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/1846) `VlREX:perf/worklist-liveness-corpus` → `main` · +181 −16 · 2 files · 1 commits · open Replace repeated full-CFG register liveness sweeps with a predecessor worklist. Includes 96 independent synthetic regression fixtures across 12 graph families. Old sweep, new worklist and path-search models agreed on all 4,192 cases. Synthetic block visits decreased by 47.88%. 100 files, 1,965 additions, no new dependencies. Native Rust tests and real shader benchmarks pending. No proprietary game data. AI-assisted (ChatGPT).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:46:26 +00:00
Author
Owner

@⁠upipibi on GitHub · 2026-11-24 23:23 UTC · original

NVIDIA run: RTX 3070 8 GB, driver 616.56, plus WARP, Windows 11, debug, 5d4445d (on main 70564ae). cargo test -p victory-shader --locked: 302 passed, 3 failed, 2 ignored. The 96 new CFG cases pass, and the 3 failures are #1744's NVIDIA heap-cap failures on main.

AI-assisted (Claude Code). Synthetic tests only.

**@⁠upipibi** on GitHub · 2026-11-24 23:23 UTC · [original](https://github.com/Marvisak/VIctory/pull/1846#issuecomment-7147336927) NVIDIA run: RTX 3070 8 GB, driver 616.56, plus WARP, Windows 11, debug, `5d4445d` (on `main` `70564ae`). `cargo test -p victory-shader --locked`: 302 passed, 3 failed, 2 ignored. The 96 new CFG cases pass, and the 3 failures are #1744's NVIDIA heap-cap failures on `main`. AI-assisted (Claude Code). Synthetic tests only.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:37 UTC · original · edited 2026-11-26 00:22 UTC

Automated triage for the maintainers.

Merge candidate. The head (fc589db) hasn't changed since the last review. solve_liveness in crates/victory-shader/src/ir.rs replaces the round-robin fixed point with a predecessor worklist and keeps the transfer function (uses | out & !defs). ir/liveness_tests.rs checks it against a separate path-to-first-use oracle on generated CFGs. The diff is two files and 181 added lines.

On your reply: thanks for the measurements. A 1.9x to 2.7x speed-up of the solver on 2,048-block synthetic CFGs, with identical live sets, supports the change. A timing on a large real shader would still be the stronger number, but it doesn't block this.

CI: passing (check).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/1846#issuecomment-7149758054) · edited 2026-11-26 00:22 UTC <!-- victory-triage v1 head=fc589dbde847ea5bb6b587d9bfcb0dd78d481532 verdict=merge-candidate at=2026-11-26T00:22:16Z --> Automated triage for the maintainers. **Merge candidate.** The head (`fc589db`) hasn't changed since the last review. `solve_liveness` in `crates/victory-shader/src/ir.rs` replaces the round-robin fixed point with a predecessor worklist and keeps the transfer function (`uses | out & !defs`). `ir/liveness_tests.rs` checks it against a separate path-to-first-use oracle on generated CFGs. The diff is two files and 181 added lines. On your reply: thanks for the measurements. A 1.9x to 2.7x speed-up of the solver on 2,048-block synthetic CFGs, with identical live sets, supports the change. A timing on a large real shader would still be the stronger number, but it doesn't block this. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠VlREX on GitHub · 2026-11-25 20:42 UTC · original

Local performance validation

Ryzen 5 3600X / RX 5700 XT / Windows 10
Rust 1.98.1

  • Workspace check: PASS
  • Targeted tests: 3/3 PASS
  • Clippy (-D warnings): PASS
  • Release benchmark: 12/12 PASS

2048-block synthetic CFG results:

CFG Baseline (us) Worklist (us) Speedup
Straight 264.175 142.175 1.858x
Local loops 397.869 152.938 2.602x
Long loop 389.413 146.556 2.657x

All 12 configurations were faster and produced
identical live-in and live-out sets.

Maximum execution time reduction: 62.4%.

PR tested: fc589db
Benchmark source:
github.com/VlREX/VIREX@1627eaa3bb

Seven alternating-order samples per configuration.
Synthetic solver benchmark, not end-to-end shader
translation or game FPS.

AI-assisted development (ChatGPT).
Native local measurements.

**@⁠VlREX** on GitHub · 2026-11-25 20:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/1846#issuecomment-7174065856) ### Local performance validation Ryzen 5 3600X / RX 5700 XT / Windows 10 Rust 1.98.1 - Workspace check: PASS - Targeted tests: 3/3 PASS - Clippy (-D warnings): PASS - Release benchmark: 12/12 PASS 2048-block synthetic CFG results: | CFG | Baseline (us) | Worklist (us) | Speedup | |---|---:|---:|---:| | Straight | 264.175 | 142.175 | 1.858x | | Local loops | 397.869 | 152.938 | 2.602x | | Long loop | 389.413 | 146.556 | 2.657x | All 12 configurations were faster and produced identical live-in and live-out sets. Maximum execution time reduction: 62.4%. PR tested: fc589db Benchmark source: https://github.com/VlREX/VIREX/commit/1627eaa3bba86d6cbce0f8ba8234ef9fdb02c542 Seven alternating-order samples per configuration. Synthetic solver benchmark, not end-to-end shader translation or game FPS. AI-assisted development (ChatGPT). Native local measurements.
Author
Owner

@⁠catminou4 on GitHub · 2026-11-24 23:52 UTC · original · approved these changes

Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (70564ae), cargo test -p victory-shader --locked → 214 passed, 0 failed. GPU execution tests are #[cfg(all(test, windows))] and run only on Windows.

Worklist register liveness with 96 independent synthetic tests: 214 macOS tests green (biggest suite in the repo now) — strong verification of the new liveness worklist.

**@⁠catminou4** on GitHub · 2026-11-24 23:52 UTC · [original](https://github.com/Marvisak/VIctory/pull/1846#pullrequestreview-6049333534) · **approved these changes** Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (70564ae), cargo test -p victory-shader --locked → 214 passed, 0 failed. GPU execution tests are #[cfg(all(test, windows))] and run only on Windows. Worklist register liveness with 96 independent synthetic tests: 214 macOS tests green (biggest suite in the repo now) — strong verification of the new liveness worklist.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 19:24 UTC · original · approved these changes

Verified locally merged onto origin/main (63bcca43, Windows 11 x64, Rust 1.98.1 MSVC):

  • cargo test --locked -p victory-shader --lib ir:: — 11 passed, 0 failed (including duplicate_edges_and_unreachable_predecessors and generated_control_flow_matches_path_oracle, which checks 192 synthetic CFGs against reaches_use)
  • cargo clippy --locked -p victory-shader --all-targets -- -D warnings (default and --all-features) — 0 warnings
  • cargo xtask policy — ok (192 files ok)

Review notes

  • Verified fixed-point equivalence between solve_liveness and the prior round-robin loop: link() keeps preds synced with Exit::successors() (including after split_irreducible), live_out[b] is stored on every pop even when live_in[b] does not change, queued[b] is cleared before evaluation so self-loops re-enqueue cleanly, and unreachable blocks stay zeroed under !reachable[p].
  • Minor non-blocking formatting nit: rustfmt --edition 2024 --check flags three Exit::Branch struct literals in crates/victory-shader/src/ir/liveness_tests.rs (around lines 93, 123, and 129).
**@⁠fuzeofficlal** on GitHub · 2026-11-26 19:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/1846#pullrequestreview-6079495449) · **approved these changes** Verified locally merged onto `origin/main` (`63bcca43`, Windows 11 x64, Rust 1.98.1 MSVC): - `cargo test --locked -p victory-shader --lib ir::` — **11 passed, 0 failed** (including `duplicate_edges_and_unreachable_predecessors` and `generated_control_flow_matches_path_oracle`, which checks 192 synthetic CFGs against `reaches_use`) - `cargo clippy --locked -p victory-shader --all-targets -- -D warnings` (default and `--all-features`) — 0 warnings - `cargo xtask policy` — ok (`192 files ok`) ### Review notes - Verified fixed-point equivalence between `solve_liveness` and the prior round-robin loop: `link()` keeps `preds` synced with `Exit::successors()` (including after `split_irreducible`), `live_out[b]` is stored on every pop even when `live_in[b]` does not change, `queued[b]` is cleared before evaluation so self-loops re-enqueue cleanly, and unreachable blocks stay zeroed under `!reachable[p]`. - Minor non-blocking formatting nit: `rustfmt --edition 2024 --check` flags three `Exit::Branch` struct literals in `crates/victory-shader/src/ir/liveness_tests.rs` (around lines 93, 123, and 129).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1846/head:github-bot/gh-1846'
git switch 'github-bot/gh-1846'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1846'
git switch 'github-bot/gh-1846'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1846'
git switch 'github-bot/gh-1846'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1846'
git switch 'main'
git merge --squash 'github-bot/gh-1846'
git switch 'main'
git merge --ff-only 'github-bot/gh-1846'
git switch 'main'
git merge 'github-bot/gh-1846'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1846
No description provided.