shader: keep successor phi parents valid after splitting a window atomic #1182
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!1182
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1182/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?
@tedin7 on GitHub · 2026-11-24 02:49 UTC · original
tedin7:x2w-spirv-window-atomic-phi-parent→main· +25 −1 · 2 files · 2 commits · merged 2026-11-24 05:01 UTCChange
Lowering a DWORD atomic in the SPIR-V address window splits its block into
*_issueand*_merge. A successor block with anOpPhithat named the original block as its parent was left unchanged, andspirv-valrejects the result with "OpPhi's incoming basic block is not a predecessor". The adapter now records the block that ends in the branch after each split and rewrites those phi parents to it. A fixture module with an atomic followed by a phi in the next block is added totests/spirv_window/check.py.Related: #1088 (atomic lowering) and #1157 (the same problem for 64-bit accesses). #1157 is not merged, so this change is independent and uses its own small edit; a mixed 64-bit and atomic case in one block can be added once both land. The two PRs touch nearby lines of
lower(), so whichever lands second may need a trivial rebase.This work is AI-assisted.
Verification
python3 -B tests/spirv_window/check.pywith spirv-as and spirv-val from SPIRV-Tools, with this change: exits 0, "physical, logical and combined SPIR-V validated; 8 atomics and rejection cases passed".2da8071b) with only the new test applied exits 1 becausespirv-valrejects the lowered phi module.Evidence and follow-up
subtract.spvasm, and is MIT licensed with the repository.docs/experiments.mdgets one sentence about the phi parent rewrite.Checklist
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 03:30 UTC · original · edited 2026-11-24 03:33 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
4e5c1a7ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@tedin7 on GitHub · 2026-11-24 03:54 UTC · original
AI-assisted. Merged main (one conflict in the address-window tool). Main now carries the same successor phi-parent rewrite, so this PR keeps only the regression test and the docs sentence on top of it. tests/spirv_window/check.py passes with SPIRV-Tools on Linux. Merge commit
16d2031f.@tedin7 on GitHub · 2026-11-24 04:49 UTC · original
Windows Server 2025 verification (
16d2031f) — PASS (Debug + Release/O2, WARP)--preset dev) (24.30s build+test):cmake --build --preset dev -j 6 --target offscreen_checkctest --test-dir out\build\dev -R "^spirv_.*_warp$" --output-on-failure-> 11/11 passed (0 skipped, 11.65s)/O2(--preset release) (26.57s configure+build+test):cmake --preset release && cmake --build --preset release -j 6 --target offscreen_checkctest --test-dir out\build\release -R "^spirv_.*_warp$" --output-on-failure-> 11/11 passed (0 skipped, 10.10s)