Shaders: compress replaced phi chains in remove_trivial_phis #1371

Manually merged
github merged 1 commit from gh-pr/1371/head into gh-pr/1371/base 2026-11-26 04:29:12 +00:00
Owner

@⁠fuzeofficlal on GitHub · 2026-11-24 17:38 UTC · original
fuzeofficlal:fix/shader-phi-path-compression-950 → main · +225 −9 · 1 files · 1 commits · merged 2026-11-25 00:22 UTC

Fixes #950.

Summary

  • Add iterative two-pass path compression to find inside ir::remove_trivial_phis so deep chains of trivial phis eliminated in reverse block order do not repeatedly walk O(N) chains (O(N^2) total) during the fixed-point and operand-rewrite passes.

Verification

  • Added deterministic IR tests covering 4,096-layer reverse-ordered vs forward-ordered diamond CFG chains, step-count linearity, and preservation of non-trivial loop phis.
  • cargo test --workspace, cargo clippy --workspace --all-targets --all-features, and cargo xtask policy: passed.
**@⁠fuzeofficlal** on GitHub · 2026-11-24 17:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/1371) `fuzeofficlal:fix/shader-phi-path-compression-950` → `main` · +225 −9 · 1 files · 1 commits · merged 2026-11-25 00:22 UTC Fixes #950. ### Summary - Add iterative two-pass path compression to `find` inside `ir::remove_trivial_phis` so deep chains of trivial phis eliminated in reverse block order do not repeatedly walk `O(N)` chains (`O(N^2)` total) during the fixed-point and operand-rewrite passes. ### Verification - Added deterministic IR tests covering 4,096-layer reverse-ordered vs forward-ordered diamond CFG chains, step-count linearity, and preservation of non-trivial loop phis. - `cargo test --workspace`, `cargo clippy --workspace --all-targets --all-features`, and `cargo xtask policy`: passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:29:11 +00:00
github manually merged commit 5c44562868 into gh-pr/1371/base 2026-11-26 04:29:12 +00:00
Author
Owner

@⁠sinan-cmyk on GitHub · 2026-11-25 01:48 UTC · original

Offline measurement on a retail dump, and the shader tests on Ada

Result: no count change against main.

Offline. I merged head 5c44562 onto main ffe310e (clean merge) and ran victory translate --validate --list on shaders.rpf (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with main program by program (25,889 programs). Validated: 21,724 on main, 21,724 with this PR.

No program changes its failure reason either. That is the expected result for a fix whose instructions sit behind the earlier failures on main. The count shows that the change rejects nothing. It does not show whether the output is right.

Tests: with the same merge, cargo test --locked -p victory-shader --lib passed 123, failed 0. The bitcode benchmark is ignored, as on main, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, with VICTORY_WARP unset.

No shader names or data are included, per the asset policy. AI-assisted (Claude Code).

**@⁠sinan-cmyk** on GitHub · 2026-11-25 01:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/1371#issuecomment-7149977691) ### Offline measurement on a retail dump, and the shader tests on Ada **Result: no count change against `main`.** **Offline.** I merged head 5c44562 onto `main` ffe310e (clean merge) and ran `victory translate --validate --list` on `shaders.rpf` (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with `main` program by program (25,889 programs). Validated: 21,724 on `main`, 21,724 with this PR. No program changes its failure reason either. That is the expected result for a fix whose instructions sit behind the earlier failures on `main`. The count shows that the change rejects nothing. It does not show whether the output is right. **Tests:** with the same merge, `cargo test --locked -p victory-shader --lib` passed 123, failed 0. The bitcode benchmark is ignored, as on `main`, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, with `VICTORY_WARP` unset. No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
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!1371
No description provided.