Repository navigation
fix(kyty): fold constants through reachable shader phi inputs - #335
Conversation
simnJS
left a comment
There was a problem hiding this comment.
The nested-loop cases cover the key distinctions in this fold. The sampler fixture compiles for a 32-lane host subgroup, but the guard only checks the maximum. Please require a native 32-lane subgroup or the ability to request one on compute. A usable Vulkan device without that capability should report a subgroup skip even when Vulkan is required. Please keep the GPU dispatch out of the sanitizer CPU selection, rerun the focused tests and validation on this head, and include a compile-time comparison on an unaffected shader alongside the reported case.
|
Thanks for the review! Addressed in
All 11 focused tests passed on the updated PR head, with zero Vulkan validation errors. The API trace confirmed Native subgroup, unsupported subgroup, and unavailable Vulkan paths were also checked separately. Performance results over 31 matched runs per build:
The unaffected control ( The original reported shader still stops at the same resource-tracking error on this PR, as expected. Predicate correlation remains a separate follow-up. Sanitizer test selection was verified with AI-assisted: yes. |
simnJS
left a comment
There was a problem hiding this comment.
Reviewed this revision and validated it together with the other changes in the integration branch. The Linux, Windows, sanitizer, and offline checks passed on the exact candidate.
What
Improve constant propagation by folding cyclic Phi nodes when all reachable incoming values agree on a constant.
This addresses cases where scalar registers are saved into VGPR lanes, temporarily reused, and restored across loops.
The implementation preserves genuinely reachable runtime values, conflicting constants, undef inputs, and cycles without a constant seed.
This is a preparatory change for a follow-up addressing #330.
Tested
Windows build 26300, Intel Core i7-10700, NVIDIA RTX 5060 Ti 8 GB, driver 621.24.
688dbf145d8and passed with the patch.1.0in all 32 lanes.git diff --checkpassed.Performance
Nine matched offline runs per build on the recovered compute shader:
Both builds still reproduce the original resource-tracking failure from #330. A separate predicate-correlation correction addresses that failure and will be submitted in a follow-up PR.
Tests were performed on the original implementation commit
2f4b5dfa1d. The submitted commitaa5a5ac0bewas cherry-picked onto upstream90a48455d2, with patch equivalence verified throughgit range-diff. Tests have not been rerun on the transplanted commit.Checklist