shader: a spilled descriptor's phi agrees when its spills have one origin (#400) #418
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/418"
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?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by lautarocherro on 2026-11-27T17:31:07Z.
What this changes
Refs #400.
A descriptor spilled to VGPR lanes is followed back through
v_writelane_b32writes, and through phis of the VGPR when every edge spills the same value. The title's compiler restores a spilled descriptor inside a loop and spills it again, so the loop's edge spills the restored copy: another value with the same dwords.Tracer::spilledsaw two values and refused the descriptor as "a descriptor neither loaded nor built".The edges now agree when the values they spill have one origin in the copy propagation. That is the rule
propagate_copiesalready applies to SGPR phis: a copy keeps every bit, so the values hold the same descriptor.restorednow returns the origin itself, and "no origin yet" leaves the value for the next sweep, as before.How it was tested
cargo test -p victory-shader: passes. The new testresource::tests::a_descriptor_spilled_again_in_a_loop_is_still_the_loadfails without the change with "a descriptor neither loaded nor built".cargo test -p victory-gpu -p xtask(arm64, with the Metal Shader Converter), Windows clippy on the workspace with-D warnings, andcargo xtask policy: all pass (victory-gpu 412 tests).examples/sweepon 21,556 shaders from one run, mainb998bb65against this branch,tools/corpus/compare.sh:Checklist
VICTORY_*variable and documented (none)Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T02:00:40Z.
Thanks for this PR, now merged! For the record, an offline check on main
86cefd22(world corpus, 21,600 shaders):So the passes those shaders cost are now held by the next refusal classes, which helps rank what comes next.