startup: refuse compute branches that decide for the whole wave but are lowered per lane #2764
Closed
tedin7 wants to merge 9 commits from
upstream-pr/2772 into main
pull from: upstream-pr/2772
merge into: R0Y00:main
R0Y00:main
R0Y00:codex/indirect-large-backed-views
R0Y00:codex/word3-preflight-check
R0Y00:codex/vertex-table-two-records
R0Y00:codex/live-index-alias
R0Y00:codex/copied-vertex-buffer-srv
R0Y00:codex/windows-stage-test-output
R0Y00:codex/preserve-live-srv-retirement
R0Y00:codex/share-render-target-tracking
R0Y00:codex/sgd5-negative-offset-fixture
R0Y00:coverage-dashboard
R0Y00:codex/mesh-loose-root
R0Y00:codex/mesh86-cache-padding
R0Y00:codex/xmem-scatter-preflight
R0Y00:codex/mesh-depth-ps
R0Y00:codex/indirect-dispatch-refresh
R0Y00:codex/compute-container-index
R0Y00:codex/startup-compute-formatted-load
R0Y00:codex/compute-indirect-producer
R0Y00:codex/compute-atomic-soffset
R0Y00:codex/mesh-dual-handoff
R0Y00:codex/startup-run-sh-watcher-control
R0Y00:codex/queue31-page-alias
R0Y00:codex/indexed-indirect-compute-root
R0Y00:codex/typed-buffer-view-metadata
R0Y00:codex/translated-indexed-address-alias
R0Y00:codex/fixed-mesh-create-result
R0Y00:codex/xmem-section-lease
R0Y00:codex/startup-slot86-mesh-cache
R0Y00:codex/restore-mesh-barrier-iteration
R0Y00:codex/translated-indirect-upload-index
R0Y00:codex/xapu-completion-opt-in
R0Y00:codex/translated-indexed-rect
R0Y00:codex/translated-indexed-indirect
R0Y00:codex/startup-mesh-lds-integration
R0Y00:codex/startup-console-ms24
R0Y00:codex/startup-slot57-mesh-request
R0Y00:codex/indirect-copy-provenance
R0Y00:codex/present-color-producer-trace
R0Y00:codex/compute-dispatch-binding-trace
R0Y00:codex/translated-indirect-table-buffers
R0Y00:codex/indirect-copy-provenance-base
R0Y00:codex/mix-half-literal-source
R0Y00:codex/translated-indirect-draw
R0Y00:codex/xmem-scatter-diagnostics
R0Y00:codex/slot148-recording-upload
R0Y00:codex/slot70-loading-art-verified
R0Y00:codex/command-list-upload-arena
R0Y00:codex/recover-failed-command-list
R0Y00:codex/startup-heap-timing-notes
R0Y00:codex/align-audio-input-timeline
R0Y00:codex/synthetic-depth-export-control
R0Y00:codex/startup-texture1d-on-windows
R0Y00:codex/1629-packed-position-fixture
R0Y00:codex/cpu-srv-refresh
R0Y00:codex/stream-root-srv-draw
R0Y00:codex/audio-mixer-timer
R0Y00:codex/startup-reload-published-shader
R0Y00:codex/priority-integrate-1284
R0Y00:codex/guest-sixteen-page-record
R0Y00:codex/aot-placed-dxr-batch
R0Y00:codex/guest-directory-selection
R0Y00:codex/gamesave-enumerate-read
R0Y00:codex/readme-archive-to-pixels
R0Y00:codex/pe-placed-view-draw
R0Y00:codex/archive-directory-gpu
R0Y00:codex/slot133-dxr-build
R0Y00:codex/materialize-placed-vertex-view
R0Y00:codex/dstorage-directory-offsets
R0Y00:codex/xg-nine-bc-copy
R0Y00:codex/xg-slot10-bc64-arrays
R0Y00:codex/dxr-guest-address-readback
R0Y00:codex/gpu-va-high-bits
R0Y00:codex/clarify-diagnostic-startup-scope
R0Y00:codex/xg-six-levels
R0Y00:codex/typed-derived-blend
R0Y00:codex/english-legal-text-progress
R0Y00:codex/address-bc-4ks
R0Y00:codex/dstorage-bounded-file-read
R0Y00:codex/wide-srv-offsets-menu
R0Y00:codex/startup-memory-srv
R0Y00:codex/bound-view-tail
R0Y00:codex/language-selector-readback
R0Y00:codex/setup-menu-progress
R0Y00:codex/cpu-plane-refresh
R0Y00:codex/startup-ubyte-vertex
R0Y00:codex/presenter-window-selection
R0Y00:codex/startup-uniform-buffer-lane
R0Y00:codex/intro-loop-timing
R0Y00:codex/static-clzero-loops
R0Y00:codex/document-rtx-intro
R0Y00:codex/startup-insertq
R0Y00:codex/nv12-startup-texture
R0Y00:codex/stream-stage-draw
R0Y00:codex/startup-null-uav-format
R0Y00:codex/startup-draw-capture
R0Y00:codex/shorten-windows-checks
R0Y00:codex/dstorage-rfc1950
R0Y00:codex/startup-dump-fence
R0Y00:codex/pr1135-review-base
R0Y00:codex/startup-stream-requests
R0Y00:codex/startup-chroma-view
R0Y00:codex/readme-graphics-pipeline-streams
R0Y00:codex/static-crt-free-tls
R0Y00:codex/arc-140t-rtx-5080-laptop-gpu-reports
R0Y00:codex/main-startup-progress-entry
R0Y00:codex/signed-dxil-catalogue
R0Y00:codex/reloc-free-preferred-base
R0Y00:codex/quad-dpp-bit-mask
R0Y00:codex/raw-srv-bounds
R0Y00:codex/rx9070-31044-hardware-report
R0Y00:codex/gpu-page-source-provenance
R0Y00:codex/runtime-placeholder-interior
R0Y00:codex/gpu-copy-queue-tile-order
R0Y00:codex/pe-pin-external-providers
R0Y00:codex/xmem-placeholder-reservations
R0Y00:codex/xmem-shared-physical-pages
R0Y00:codex/pe-package-startup
R0Y00:codex/xmem-tools-memory-query
R0Y00:codex/cpu-stack-output-import
R0Y00:codex/pe-load-security-cookie
R0Y00:codex/record-three-bvh-retests
R0Y00:codex/cpu-rbp-frame-anchor
R0Y00:codex/xmem-default-startup
R0Y00:codex/record-rtx-3050-ti-9597
R0Y00:codex/docs-readme-start-here
R0Y00:codex/check-compute-mad24-truncation
R0Y00:codex/docs-discord-community
R0Y00:codex/bound-rcx-branch-mutants
R0Y00:codex/rtx5060ti-bvh-62114
R0Y00:codex/837-neutral-readme-disclaimer
R0Y00:codex/record-rtx-3070-ti
R0Y00:codex/title-neutral-public-wording
R0Y00:codex/exe-shadow-frame-submissions
R0Y00:codex/exe-shadow-runtime-chain
R0Y00:codex/readme-polish
R0Y00:codex/gpu-coverage-nov23
R0Y00:codex/spirv-minlod
R0Y00:codex/shadow-shim-device
R0Y00:codex/exe-two-shadow-frames
R0Y00:codex/shim-dispatch-cleanup
R0Y00:codex/fix-spirv-cache-probe
R0Y00:codex/sampler-use
R0Y00:codex/ballot-bit-extract
R0Y00:codex/packed-fma-release
R0Y00:codex/cpu-packed-fma-o2
R0Y00:codex/publish-coverage-dashboard
R0Y00:codex/mesh-cbv-binding-order
R0Y00:codex/spirv-window-fixture
R0Y00:codex/ps-e32-float-uint
R0Y00:codex/ps-cbuffer-reads
R0Y00:codex/fixed-profile-rescan
R0Y00:codex/shim-compute-integration
R0Y00:codex/readme-visible-coverage
R0Y00:codex/readme-research-navigation
R0Y00:codex/integrate-pr-256
R0Y00:codex/indexed-mesh
R0Y00:codex/sampled-coverage
R0Y00:codex/first-ms
R0Y00:codex/dual-ps
R0Y00:codex/ps-attribute
R0Y00:codex/compute-first
R0Y00:codex/ps-export
R0Y00:codex/readme-research-status
R0Y00:codex/ps-layout
R0Y00:codex/blast-window
R0Y00:codex/chart-caption
R0Y00:codex/reviewer-roles
R0Y00:codex/blast-aot
R0Y00:codex/archive-program
R0Y00:codex/crc-stream-program
R0Y00:codex/exe-image-data-chain
R0Y00:codex/local-cpu-fixture-coverage
R0Y00:codex/exe-bound-frame-chain
R0Y00:codex/exe-mapped-comparison
R0Y00:codex/contribution-dependencies
R0Y00:codex/exe-entry-aot
R0Y00:codex/bink-frame-heap-integration
R0Y00:docs/hardware-seven-reports
R0Y00:codex/bink-custom-heap
R0Y00:codex/bink-heap-callers
R0Y00:codex/discussions-entry-points
R0Y00:codex/gpu-community-batch-64
R0Y00:codex/ffx-scratch-writers
R0Y00:codex/generic-project-documentation
R0Y00:codex/ffx-dispatch-rcas
R0Y00:codex/four-windows-gpu-reports
R0Y00:codex/title-neutral-project-wording
R0Y00:codex/community-coverage-provenance
R0Y00:codex/rcas-packed-texels
R0Y00:codex/community-gpu-retests
R0Y00:codex/community-build-and-gpu-reports
R0Y00:codex/ffx-provider-loop
R0Y00:codex/ffx-recurrent-views
R0Y00:codex/ffx-recurrent-resource
R0Y00:codex/amd-wave64-reports
R0Y00:codex/ffx-backend-slots
R0Y00:codex/upscaler-device-init
R0Y00:codex/ffx-context-lifecycle
R0Y00:codex/ffx-version-query
R0Y00:codex/ffx-provider-contract
R0Y00:codex/typed-object-callback
R0Y00:codex/cpu-ordinal-import
R0Y00:codex/chained-cpu-ranges
R0Y00:codex/cpu-import-call
R0Y00:codex/cpu-direct-call
R0Y00:codex/cpu-leaf-aot
R0Y00:codex/community-project-status
R0Y00:codex/script-state-path-replay
R0Y00:codex/script-state-evidence
R0Y00:codex/bc7-resident-tail
R0Y00:codex/bcpack-mip-tail
R0Y00:codex/bc7-texture-draw
R0Y00:codex/asset-ranges
R0Y00:codex/pixel-constants
R0Y00:codex/pixel-aot
R0Y00:codex/pre-exe-workloads
R0Y00:codex/root-signature-device-coverage
R0Y00:engineering/packed-bvh-leaves
R0Y00:engineering/bvh-build-and-update
R0Y00:engineering/intake-root-roundtrip
R0Y00:community/gpu-check-release
R0Y00:community/english-contributor-entry
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
R0Y00/Xbox2Windows!2764
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2772"
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-26T07:33:35Z.
Part of #1723
What this unblocks: stops silently wrong compute shader output: a branch that the wave takes as a whole is no longer lowered as a per-lane decision.
What changed
Compute programs are lowered one lane at a time.
s_cbranch_vccz,s_cbranch_vccnz,s_cbranch_execnzand ans_cbranch_scc0/scc1on an SCC that depends on lane data decide once for the whole wave: the wave runs on while any lane's bit is set. The lowering took the branch from its own lane's bit, so a lane whose bit was clear skipped code the wave ran for it (or left a loop early while a scalar counter kept the wave's count). Such programs translated and gave a different value than the wave model.They are now refused by name:
<branch> decides for the whole wave and the one-lane model decides per lane. Still accepted, because an existing proof covers them:s_cbranch_execnzinside a block that ans_cbranch_execzskips (execz_refusalsproves the block's EXEC writes).s_cbranch_vccz/vccnzand lane-data SCC branches inside such a block stay refused: the proof does not cover their condition (the wave runs the code while any lane's bit is set);s_cbranch_scc1of a readfirstlane waterfall (waterfall_refusal);s_cbranch_execnzback edge whose loop writes no scalar register except EXEC and VCC, whose EXEC writes can only narrow the mask (v_cmpx,s_and/s_andn2of EXEC with itself; a restore of a saved mask in the loop sets lanes an earlier round cleared, so it is refused) and whose VCC is not read after it (a lane that left changes nothing; no scalar count escapes; the wave's VCC after the loop holds the last compare, 0 for lanes that left earlier, which a lane running alone would not reproduce, so a later VCC read is refused: fixture withv_cndmask_b32_e32 ... vcc_loafter the loop);s_cbranch_scc0/scc1whose SCC is proven wave-uniform.The refusal is recorded at the branch and raised at the end of lowering, so every other refusal keeps its reason and order.
Tests
tests/startup_gfx2hlsl_compute_check.py: newcheck_wave_branches(vccz skip, SCC froms_and_saveexec, vccnz loop, execnz loop with a scalar counter, vccz/vccnz inside an execz block, an execnz loop that restores the saved EXEC in its body, an execnz loop with a VCC read after it: translated onmain, refused now; a uniform-SCC branch and a vector-only execnz loop still translate). One existing assertion changed: as_cbranch_vcczafter the join of an execz block (s_and_b32 vcc_lo, vcc_lo, exec_lo, then the branch) was expected to translate; it is the same whole-wave decision and is now expected to be refused, the other reads in that loop are unchanged.What stays open
Cache revision
The compute lowering now refuses programs it used to translate, so a translation cached under the old revision could still be served. This PR advances the startup shader cache revision to
x2w-startup-shader-28/28cs(runtime, offline tool, C++ test mirrors, docs, known-answer values recomputed with a separate FNV-1a loop). The C++ targets were not built here.Verification:
python3 -B tests/startup_gfx2hlsl_compute_check.pyandpython3 -B tests/startup_gfx2hlsl_compute_check.py binary llvm-mc-19: pass; the new shapes translate onmain'sgfx2hlsl.pyand are refused here.python3 -B tests/startup_compute_readfirstlane_check.py: pass.tests/*check.pysweep againstorigin/main: 0 scripts change result (356 pass, 131 fail in both trees; the fails need the Windows toolchain).AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-26T07:43:31Z.
I will independently check the accepted vector-only EXECNZ loop and the boundary where an SCC or VCC value escapes the loop. I will use source-built, per-lane readbacks and a separate wave reference, and report any counterexample or confirmation against this PR head here.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T07:48:09Z.
I found a separate EXECNZ counterexample at
d35433de. The loop has no ordinary SGPR writes, but its first instruction widens EXEC from the saved entry mask. The current scalar-free shortcut accepts it. I spliced this before the store in startup_gfx2hlsl_compute_check.py case A:The first round leaves local X=0 running. The second round restores the saved mask, so the original wave stores 2 and 3 for the two X lanes. The translated shader stores 2 and 2. Windows Release WARP and RTX 4060 Laptop both report 144/320 mismatches, first word=1 expected=00000003 actual=00000002, with the debug layer enabled and no warnings/errors. The acceptance guard needs to prove that each EXEC write in this span only narrows the current mask. Keep the vector-only monotone loop as the positive control. This is independent of the SCC/VCC values escaping the loop that Raven is checking.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T07:50:43Z.
Thank you for the counterexample (the loop that restores the saved EXEC in its first instruction). Reproduced on
d35433de: the one-lane model stores 2 and 2, the wave stores 2 and 3.Fixed in
eb1e369e3(together with the review of the vccz/vccnz inside an execz block, below):s_cbranch_execnzback edge is accepted only when every EXEC write in the loop can only narrow the mask (v_cmpx,s_and/s_andn2of EXEC with itself). A move, an OR or a restore of a saved mask in the loop is refused. New refused fixture incheck_wave_branches(your shape, assembled words, translated before this commit). The vector-only monotone loop stays accepted as the positive control.s_cbranch_vccz/vccnz(and lane-data SCC) inside ans_cbranch_execzblock are refused again: the block proof covers its EXEC writes, not that condition. Onlys_cbranch_execnzstays exempt there. New refused fixtures for both branches.Verification:
python3 -B tests/startup_gfx2hlsl_compute_check.pyand... binary llvm-mc-19: pass; the new shapes translate onmainand are refused here.python3 -B tests/startup_compute_readfirstlane_check.py: pass;tests/*check.pysweep againstorigin/main: no script changes result.Update for the second report (the restore at the loop head, wave reference [3, 3, 3, 3], translated [1, 1, 2, 3]): this is the same defect, already fixed on the current head
eb1e369e3. The loop is refused by name because its head writes EXEC with a move; onlyv_cmpxands_and/s_andn2of EXEC with itself are accepted, so a restore anywhere in the loop is refused. The refused fixture incheck_wave_brancheshas the same shape (saved mask, restore at the head,v_cmp+s_andlatch,s_cbranch_execnz). Thank you for the paired readback and for confirming that the monotone loop and the post-loop SCC read stay correct and the post-loop VCC read is refused.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-26T07:52:20Z.
I found an accepted loop that writes three wrong words at
d35433de. The EXECNZ exception inscalar_free_spanpermits a write to EXEC that reactivates lanes. The wave can run those lanes again while any lane takes the back edge.Four lanes start with
v3=0andv0=lane_id. Save the incoming EXEC ins20before the loop. This is the complete body and latch:Restore
exec_lofroms20after the latch and store each lane's counter. While lane 3 keeps the wave running, each trip restores all four lanes, so the wave reference is [3, 3, 3, 3]. The translated shader returned [1, 1, 2, 3] on Intel UHD 770, RTX 4060 and WARP. On each device the 320-word comparison had exactly three mismatches against the wave reference and zero against the lane-local vector. Removing the restore at the loop head made all 320 words match. Reading SCC after the monotone loop also passed, and a post-loop VCC select produced the intended named refusal.Please require a proof that every EXEC write in the accepted loop can only remove lanes. In particular, restoring a saved mask at the head needs the named refusal. The paired source-built fixtures and Python wave model are in this commit.
Command:
python -B tests/verify_execnz_loop_readback.py <clang> <llvm-objcopy> <dxc> <offscreen_check> <warp|hardware>. LLVM 15.0.7 gfx1013 wave32, DXC 1.9.2609.5, Windows 11 build 26100.9711. UHD 770 driver 32.0.101.5973, RTX 4060 driver 32.0.15.9579, WARP 10.0.26100.9711. Debug layer unavailable. AI-assisted with Codex.Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T08:18:24Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
eb1e369e3dℹ️ 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".
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T08:20:12Z.
Review: CHANGES_REQUESTED
The original standalone EXECNZ loop now refuses on
2743cc3e. The same loop still translates and writes wrong data if it is inside a forward EXECZ span. Here is the splice for case A oftests/startup_gfx2hlsl_compute_check.py, with case A's original output code atjoin.The wave reference repeats [2, 3] for 288 words and preserves 32 sentinel words. Using the existing case A DXC dispatch harness, both WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656 disagreed at 144/320 words. First mismatch was word 1, expected 3 and received 2. Windows 11 build 26200, D3D12 debug layer enabled, zero debug warnings/errors.
The
execz_coveredexemption bypasses the EXEC-narrowing proof for this nested backward branch. The outer proof keeps lanes inactive at entry clear. The latch can still re-enable a lane that was active at entry and left an earlier iteration. Please require the loop proof for a backward EXECNZ inside the span as well, add this refusal, and retain the existing monotone-loop positive control.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T08:28:33Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T08:28:37Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by Ybucaille on 2026-11-26T08:15:59Z.
Independent GPU confirmation of the compute case, and a note on scope.
Source-built compute fixture (8 lanes per group, 4 groups):
v_cmp_gt_u32 vcc_lo, 3, v0, thens_cbranch_vcczover abuffer_store. On the wave VCC is non-zero, so no lane skips and all 8 store.mainlowers it topc = ((vcc & 1) == 0) ? ... : ...per lane. Readback on WARP and on an RTX 2070: 20 of 320 words wrong (lanes 3 to 7 of each group lost their store). This shape is in yourcheck_wave_branches, so nothing to add there.Scope: the same per-lane lowering of
s_cbranch_vccz/vccnzand of an SCC branch on lane data is used for pixel and vertex programs, and this PR only guards compute. On a sample of 4000 cached graphics requests, 169 translate onmain; 5 of them (all pixel) branch withs_cbranch_scc0/scc1on an SCC computed from VCC/EXEC (s_and_b32 sN, vcc_lo, exec_loshape). No VCC branch and no vertex program in that sample.I have a branch that applies an equivalent refusal to the non-mesh graphics path. To avoid two versions of the same proof, I will not open it as is: once this PR lands I would follow up with the pixel/vertex extension reusing your helpers, unless you prefer to widen this PR yourself. I'll take the pixel/vertex part unless you say otherwise.
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T08:13:56Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
eb1e369ℹ️ 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 RavenCurseBurg on 2026-11-26T08:20:52Z.
Verified the reopening fix at
eb1e369e(includesdb8a5ed7) with the same four-lane fixture. The loop that used to return [1, 1, 2, 3] instead of [3, 3, 3, 3] now stops at the nameds_cbranch_execnzrefusal. Both accepted controls, including the SCC observation, still match [1, 1, 2, 3] and all 316 untouched words on WARP, UHD 770 and RTX 4060. The live-VCC refusal also remains. This addresses my finding.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T08:13:45Z.
Independent Stage-2 gate of head
eb1e369e3: PASS.Checked:
vccz/vccnz/execnzand ansccon lane data are refused by name, includingvccz/vccnzinside a block thats_cbranch_execzskips (the earlier head accepted that shape and decided it per lane).s_cmpon a workgroup id) still translates; anexecnzloop translates only when its EXEC writes can only narrow (s_and exec, exec, Xin either order,s_andn2 exec, exec, X,v_cmpx);or,xor,mov,orn2,andwith a non-EXEC source ands_and_saveexecin the loop are refused; a VCC read after the loop is refused; lane-crossing ops in such a loop were already refused by their own checks.vcczafter the join) is right: a whole-wave decision.Verification (Win2025, WARP):
python3 -B tests/startup_gfx2hlsl_compute_check.pyandtests/startup_compute_readfirstlane_check.py: pass on Linux.origin/main: 0 scripts change result.x2w_pipe.py win2025 2772 --force --keep-release --regex 'gfx2hlsl|startup_compute|startup_.*readfirstlane': dev 444/444 and release 444/444 passed.--regex 'compute|gfx2hlsl', 649 tests) had one failure,compute_store_aot_mac_f32_hardware(compute_store_check.py, not touched by this PR); it fails the same way in the logs of other PRs that do not touch that file, and its_warptwin passes.Update, head
2743cc3ee(main merged in):fresh_gateGO (0 behindorigin/main); same shapes still refuse or translate as above;python3 -B tests/startup_gfx2hlsl_compute_check.pyandtests/startup_compute_readfirstlane_check.pypass;x2w_pipe.py win2025 2772 --force --keep-release --regex "gfx2hlsl|startup_compute|startup_.*readfirstlane": dev 446/446 and release 446/446 passed.Correction, head
157d06f64: the PASS above is withdrawn for one open shape. The Windows runs are green (x2w_pipe.py win2025 2772 --force --keep-release --regex 'gfx2hlsl|startup_compute|startup_.*readfirstlane|shader_cache_key': dev 453/453, release 453/453) but they do not cover it:spliced into case A of
tests/startup_gfx2hlsl_compute_check.pyit still translates. The SCC written by thes_and_b32on one arm is lane data (any lane's bit keeps SCC set for the wave) but the branch after the join is lowered from the lane's own bit: the lanes whose EXEC bit is clear skip the EXEC restore and do not store, while the wave would not take the branch. The same shape without the join is refused; at the joinscc_verifiedis false, so thescc_verified and not scc_uniformcondition does not fire. Fix idea: at a join makescc_uniformthe AND over the paths and refuse anscc0/scc1branch whenever it is false; add this shape tocheck_wave_branchesas refused. Back to Draft until then.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T08:18:25Z.
Code review location:
tools/startup/gfx2hlsl.py; line 4330For a compute shader that reuses a uniform SCC after a forward join,
translate()retains the uniform reaching definition inscc_defand setsscc_verified=True, but resetsscc_uniform=False. This new condition therefore rejects a proven-uniform branch. For example, insertings_cmp_lt_u32 s7, 4followed by two forwards_cbranch_scc1 1instructions, each skipping a vector move, into case A now refuses the second branch; the parent translates it successfully. Both branches read the same group-ID comparison, with no intervening SCC write. Consult or preserve the retained uniform reaching-definition proof so these supported compute shaders continue to translate.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T08:18:25Z.
Code review location:
tools/startup/gfx2hlsl.py; line 834For an EXEC-narrowing loop containing
v_cmpx_gt_u32_e32 s7, v3,destinations()returns the first printed operand, so this code incorrectly treats the read ofs7as a scalar-register write. CMPX prints only source operands and writes EXEC implicitly. Consequently, a vector-only increment/CMPX loop closed bys_cbranch_execnznow fails the scalar-free proof and is refused, although the parent translates it and the equivalent loop using literal2instead ofs7still translates. Use the actual scalar write effects or explicitly exclude CMPX sources when checking the loop.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T08:28:33Z.
Code review location:
tools/startup/gfx2hlsl.py; line 4330Real, and fixed in the commit that follows this review: after a forward join the retained uniform reaching definition (
scc_def) now counts as uniform for the whole-wave branch check, so the seconds_cbranch_scc1ofs_cmp_lt_u32 s7, 4+ two forward branches translates again (it was refused on the previous head, translated onmain). New assertion incheck_wave_branches. Linux:python3 -B tests/startup_gfx2hlsl_compute_check.pypasses.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T08:28:37Z.
Code review location:
tools/startup/gfx2hlsl.py; line 834Real, and fixed in the same commit: the scalar-free loop test now skips
v_cmpx(it prints only its sources and writes EXEC; the narrowing check judges that write). Av_add_nc_u32/v_cmpx_gt_u32 s7, v3loop closed bys_cbranch_execnztranslates again (refused on the previous head, translated onmain). New assertion incheck_wave_branches, with the decoder text of the hand-assembled word checked. Linux:python3 -B tests/startup_gfx2hlsl_compute_check.pypasses.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T10:12:48Z.
Withdrawn: shader translation is moving to the native C++ frontend (see #870), so we are not continuing this change to the Python translator. The branch stays available if any part is useful later. Thank you to everyone who reviewed and tested it.
Pull request closed