Shaders: keep missing values live through joined phis #647

Closed
Quat3rnion wants to merge 2 commits from upstream-pr/647 into main
Quat3rnion commented 2026-11-24 06:08:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Quat3rnion on 2026-11-24T06:08:45Z.


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.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6575793405 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/647). Originally posted by [Quat3rnion](https://github.com/Quat3rnion) on 2026-11-24T06:08:45Z. --- ## 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 - [x] Workspace tests and Windows cross-check pass. - [x] `cargo xtask policy` passes. No game files or data from them were added. - [x] AI authorship is disclosed above.
upstream-sync closed this pull request 2026-11-24 06:54:11 +00:00
LAKSHYA-cmd-tech commented 2026-11-24 06:54:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T06:14:19Z.

Review: APPROVED


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.
<!-- greyfinch-sync:Marvisak/VIctory:review:6034543374 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/647#pullrequestreview-6034543374). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T06:14:19Z. **Review:** APPROVED --- 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 commented 2026-11-24 06:56:18 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Quat3rnion on 2026-11-24T06:15:57Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7123755275 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/647#issuecomment-7123755275). Originally posted by [Quat3rnion](https://github.com/Quat3rnion) on 2026-11-24T06:15:57Z. --- Duplicate of #612, which makes the same transitive phi-liveness change with the same reproducer. Closing in favour of that PR.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!647
No description provided.