shader: lower bounded 64-bit word loads and stores through the SPIR-V address window #1157
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!1157
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1157/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 01:56 UTC · original
tedin7:x2w-spirv-address-window-64bit-loads→main· +510 −30 · 9 files · 4 commits · merged 2026-11-24 03:42 UTCBounded 64-bit loads and stores through the SPIR-V address window.
A plain 64-bit load or store through a physical pointer becomes two 32-bit accesses inside an explicit branch, taken only for an address that is 8-byte aligned, below 0xfffffff8, and does not wrap on an indexed address. Otherwise a load returns zero and a store changes nothing; the substitute index is never used (same approach as the atomics). Atomics, Volatile, other alignments and other uses of the pointer are rejected.
AI-assisted.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 02:35 UTC · original · edited 2026-11-24 02:39 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
3f8a40bℹ️ 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.
@ -150,0 +253,4 @@stem = "%x2w_" + (f"load_{fields[0][1:]}" if wide_load else f"store_{wide_accesses}")new, label = wide_access(kind, stem, valid_of[pointer], label, wide_words[pointer], fields)final_label[origin] = labeloutput.extend(new)@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 02:39 UTC · original
When a QWORD access occurs in a block that feeds a successor
OpPhi, this moves the original terminator into a generated*_mergeblock without updating the successor's incoming parent label. In a variant ofqword.spvasmthat branches from%entryto%exitwith%copied = OpPhi %ulong %result %entry, lowering retains%entryin that phi even though%x2w_load_value_mergeis now the actual predecessor. The generated SPIR-V is therefore invalid, so output validation rejects an otherwise supported shader. Track each original block's final label and rewrite the original successor phi parents after inserting these guards.Useful? React with 👍 / 👎.
@tedin7 on GitHub · 2026-11-24 02:42 UTC · original
AI-assisted update addressing the P2 finding: a QWORD access that splits a block now rewrites the parent label of
OpPhis in successor blocks to the generated*_mergeblock.tests/spirv_window/check.pygains a module with a successor phi, validated with spirv-as and spirv-val before and after lowering. The check fails on the previous lowering (spirv-val: phi parent is not a predecessor) and passes now.docs/experiments.mdnotes the rewrite.@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 02:39 UTC · original · reviewed
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
3f8a40bbc9ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".