Repository navigation
Shaders: keep missing values live through joined phis - #647
Closed
Quat3rnion wants to merge 2 commits into
Closed
Quat3rnion wants to merge 2 commits into
Quat3rnion wants to merge 2 commits into
Conversation
fill_phis reads an incoming phi's stored value directly, so a phi used only as an input to another phi was never marked read. A missing value such as an unsupported s_memtime could then be replaced with zero and pass lowering. Mark a phi and the phis feeding it when it is read through get, so both the direct and two-join cases refuse consistently. Regression from issue Marvisak#604's reproducer.
LAKSHYA-cmd-tech
approved these changes
Nov 24, 2026
LAKSHYA-cmd-tech
left a comment
There was a problem hiding this comment.
Tested on native Windows 11 with Rust 1.98.1 (x86_64-pc-windows-msvc).
- cargo test -p victory-shader: all 62 tests passed cleanly (0 failed).
- Verified mark_phi_live recursive traversal marking feeding phis as live so missing values (such as s_memtime) are preserved across multiple join edges. Fixes #604.
- cargo xtask policy: 150 files ok.
Contributor
Author
|
Duplicate of #612, which makes the same transitive phi-liveness change with the same reproducer. Closing in favour of that PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
An unsupported value such as
s_memtimewas refused when a branch read itdirectly, but accepted after two conditional assignments.
fill_phisreadsan incoming phi's stored value without going through
get, so a phi usedonly as an input to another phi was never marked as read; a missing value
could then be replaced with zero and pass lowering. Reading a phi now marks
the phis feeding it as live too, so both forms agree. Regression reproducer
comes from issue #604 (credited in the branch history).
An AI tool wrote part of this change.
Tested
cargo test --workspace: 165 passed, 0 failed, 3 ignored. The reproducer compares direct and joined reads of a missing timestamp and checks that a dead timestamp still lowers.cargo check --target x86_64-pc-windows-gnu --workspace --testspasses. No Windows host here.cargo xtask policypasses (150 files ok). No game files or data from them were added.Checklist
cargo xtask policypasses. No game files or data from them were added.