shader: keep successor phi parents valid after splitting a window atomic #1175
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1182"
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 R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T02:49:24Z.
Change
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
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T03:30:11Z.
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.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T03:54:29Z.
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.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T04:49:08Z.
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)