Skip to content

Shaders: keep missing values live through joined phis - #647

Closed
Quat3rnion wants to merge 2 commits into
Marvisak:mainfrom
Quat3rnion:victory-phi-liveness
Closed

Quat3rnion wants to merge 2 commits into
Marvisak:mainfrom
Quat3rnion:victory-phi-liveness

Conversation

@Quat3rnion

Copy link
Copy Markdown
Contributor

What

An unsupported value such as s_memtime was refused when a branch read it
directly, but accepted after two conditional assignments. fill_phis reads
an incoming phi's stored value without going through get, so a phi used
only 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

  • Linux: 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.
  • Windows cross-build: cargo check --target x86_64-pc-windows-gnu --workspace --tests passes. No Windows host here.
  • cargo xtask policy passes (150 files ok). No game files or data from them were added.

Checklist

  • Workspace tests and Windows cross-check pass.
  • cargo xtask policy passes. No game files or data from them were added.
  • AI authorship is disclosed above.

Dathinel and others added 2 commits November 24, 2026 01:06
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 LAKSHYA-cmd-tech left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Quat3rnion

Copy link
Copy Markdown
Contributor Author

Duplicate of #612, which makes the same transitive phi-liveness change with the same reproducer. Closing in favour of that PR.

@Quat3rnion Quat3rnion closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants