shader: a phi read only through another phi keeps its missing incoming value #699
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!699
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/699/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@arthercz on GitHub · 2026-11-24 07:02 UTC · original
arthercz:phi-missing-fix→main· +1884 −659 · 38 files · 4 commits · closed without mergingCloses #604.
The emitter refused a branch on a live
s_memtimeread but accepted the same read through two conditional joins:fill_phissubstitutes zero for a missing incoming value of a phi no reader marks, andLower::getmarked only the phi a comparison reads directly. A phi whose value flows solely into another phi's arguments was never marked, so its missing timestamp value silently became zero instead of surfacing the refusal the direct read gets.The fix follows incoming phi dependencies from the phis actual readers mark (fixpoint) before the substitution decision. A dead phi (read by nothing live) still lowers with the zero substitution, matching the issue's expectation.
The regression test is Dathinel's probe from the issue (test-only commit 4b2ea70f), applied unmodified; it compares the direct and the twice-joined read and expects the dead-timestamp variant to keep lowering.
Verified:
cargo test -p victory-shader --features host a_missing_value_stays_missing_through_two_live_joinspasses;cargo test --workspace266 passed;cargo clippy --workspace --all-featuresclean.@iurysf on GitHub · 2026-11-24 08:16 UTC · original
Measured offline against main
c2e7254withvictory translate --list --validateover the title'sshaders.rpf+ executable (26,096 programs), dxil.dll 1.9.2602.17, comparing outcomes program by program:s_memtimecase in #604.AI-assisted.
@slint6614-dev on GitHub · 2026-11-24 09:30 UTC · original
Measured on the full retail shader pack (26,503 containers) with
victory translate --validate --pipelines(pipelines on an AMD RX 9070, Windows 11, dxil.dll from SDK 10.0.26100). Counts are emitted / validated / pipelines.This PR conflicts with current main (
lower.rs), so it was measured on its own base against main1f858b0, which predates #612 (VS/PS 12272 / 12172, CS 1693 / 1670, MS 8191 / 8129).With this PR: VS/PS 12220 / 12130, CS 1440 / 1417, MS 8163 / 8101. That is the same loss of 323 validated programs (42 VS/PS, 253 CS, 28 MS) as the merged #612 shows (see my measurement there), with the same refusal reasons. So it fixes #604 the same way, but it now duplicates #612.
@Marvisak on GitHub · 2026-11-25 00:27 UTC · original
Automated triage for the maintainers. Closing because this change is already in
main, ormainhas since replaced the code it patches.The fix for #604 (a phi read only through another phi is live) is already in main through #612 (commit
3dd467c), and this copy carries a workspace-wide cargo fmt.If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed