shader: lower s_nor_b32 and s_nand_b32 on lane mask in gfx2hlsl (Part of #1723) #2023
Closed
tedin7 wants to merge 8 commits from
upstream-pr/2030 into main
pull from: upstream-pr/2030
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!2023
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2030"
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-24T23:27:14Z.
Part of #1723
What this unblocks: Run 20 census #9 (64/61 pairs).
Source: AMD RDNA 2 instruction set architecture guide, the SOP2 instructions
s_nor_b32ands_nand_b32(bitwise on the 32-bit scalar operands) and the EXEC / wave32 description (a write toexec_loin wave64 leaves the high half unchanged).gfx2hlslrefuseds_nor_b32ands_nand_b32whenever an operand or the destination was a lane mask. They now lower on a mask when every source is a lane mask: bit i of~(a op b)depends only on bit i of each source, so the lane's own bit is exact. The destination may be an SGPR (any stage) orexec_lo(only for compute with at most 32 threads per group, the one wave32 proof available; pixel, vertex, mesh and larger compute groups keep refusing it, because a write toexec_loleaves lanes 32..63 of a wave64 wave unchanged).s_xnor_b32, avcc_loor high-half destination, mixed mask and word sources, ands_pack_hh_b32_b16on a lane mask stay refused.SCC is not emitted for these forms: translate() refuses a program that can read it.
Changes:
tools/startup/gfx2hlsl.py: lane-complement lowering ofs_nor_b32/s_nand_b32on masks, with the wave32 gate for theexec_lodestination.tests/startup_gfx2hlsl_s_nor_nand_check.py(new, registered inCMakeLists.txt, with_dispatch_warp/_dispatch_hardwareD3D12 UAV readback variants): per-bit CPU reference, GPU readback, andstage_checks()for the stage gate.tests/startup_gfx2hlsl_sop2_complement_check.py: refusal checks narrowed to the forms that stay refused; the shared probe is a 32-thread compute stage.docs/experiments.md: the accepted forms and the stage rule.Verification (head
ef54c20a638f7d0ff72dc3747c6a82158273207a):python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.py,..._sop2_complement_check.py,..._waitcnt_depctr_check.pyok. Without the stage gate,s_nor_nand_checkfails on the wave64 cases.startup_gfx2hlsl_sop2_complement,startup_gfx2hlsl_s_nor_nand,startup_gfx2hlsl_s_nor_nand_dispatch_warp,startup_gfx2hlsl_s_nor_nand_dispatch_hardware). Thewarp-named test ran on the GPU there, not on WARP.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:33:45Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
117d2fd03bℹ️ 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 tedin7 on 2026-11-25T00:50:40Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T00:50:41Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T00:50:43Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:27:27Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
117d2fdℹ️ 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 chatgpt-codex-connector[bot] on 2026-11-24T23:33:45Z.
Code review location:
tools/startup/gfx2hlsl.py; line 680For a newly accepted mask form containing a scalar word whose bits are not all identical, the shared lowering uses bit 0 for every HLSL invocation. For example,
s_nor_b32 vcc_lo, 1, 0now emits a zerovcc, whereas the ISA result is0xfffffffe; consequently, the supportedv_cndmask_b32selects the wrong arm in lanes 1–31.s_nand_b32 vcc_lo, 1, -1has the same issue. Keep these raw-word forms refused until their operands are projected to the actual lane, and cover a nonzero lane rather than testing only supplied 0/1 bits.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:33:45Z.
Code review location:
tools/startup/gfx2hlsl.py; line 678For a pixel shader containing
s_nor_b32 vcc_hi, 0, 0or anexec_hidestination, removing this guard reachesreg_range(dname)[1]inscalar()withNone, raising an uncaughtTypeError; both NAND variants behave identically. The previous revision raisesUnsupported, whichtranslate_to()catches to produce a.failrecord. The new exception instead terminates the pending-cache loop and prevents later requests from being translated. Keep rejecting the unmodelled high halves separately when enabling the low-half forms.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:33:45Z.
Code review location:
CMakeLists.txt; line 2188The newly accepted mask operations change a public translator capability, but this commit updates neither
README.mdnordocs/experiments.md. RootAGENTS.mdrequires one of those documentation updates for public capability changes. Record the supported operand scope, the per-lane SCC limitation, the reproduction command, and the CPU-only validation scope so contributors can reproduce the result and distinguish accepted lowering from verified GPU behavior.AGENTS.md reference: AGENTS.md:L209-L210
Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T00:50:39Z.
Code review location:
tools/startup/gfx2hlsl.py; line 680Fixed in
e73b1f01: nand/nor now refuse any form that mixes a lane mask with a raw scalar word (inline constant or plain SGPR); the test covers vcc_lo,1,0 and vcc_lo,1,-1. Ran: python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.py (PASS). AI-assisted; commands listed were executed locally.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T00:50:41Z.
Code review location:
tools/startup/gfx2hlsl.py; line 678Fixed in
e73b1f01: exec_hi/vcc_hi operands and destinations raise Unsupported again (no TypeError); covered by the refused forms in the test. Ran: python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.py and startup_gfx2hlsl_sop2_complement_check.py (PASS). AI-assisted; commands listed were executed locally.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T00:50:43Z.
Code review location:
CMakeLists.txt; line 2188Fixed in
e73b1f01: docs/experiments.md now records the operand scope, the per-lane SCC limit, the refused forms, the repro command and CPU-only scope. AI-assisted; commands listed were executed locally.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T13:51:47Z.
Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is.
We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-25T22:45:26Z.
The
exec_lodestination of this PR is the first refusal for 23 requests in a local start-up capture (s_nor_b32 exec_lo, <mask>, <mask>, counts only), at mainfc97ade. #2459 took the SGPR-destination forms and left avcc_loorexec_lodestination refused.You wrote that you will reopen this once the Windows queue is clear. Since #2459 merged in between, the branch now overlaps it. If you would rather not rebase, I can port the
exec_lopart onto current main, with you credited as co-author and the remaining SCC case guarded the way #2459 does. I will leave it until tomorrow, or hand it back as soon as you pick it up.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-25T22:49:07Z.
Changing my timeline above: I am taking the
exec_lopart over now, since there has been no activity on this PR since 13:51. I will port it onto current main with you as co-author, and hand it back if you resume.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-25T23:46:36Z.
I see you reopened this at 23:00 UTC, so I am handing the
exec_lopart back as promised and will not open a competing PR. If it saves you a rebase over #2459: my port of that part ontofc97adeis commit482bade0on branchsnor-exec-loin my fork. It accepts only NAND and NOR intoexec_lowith all-mask sources, leaves SCC unmodelled like the SGPR forms, and keeps XNOR,vcc_lo,exec_hiand pairs refused. Yourexec_locases and the source-bit table are in its test. Use any of it or none.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:36:46Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
392a40de0685e69fc27c2d78950d95ff9984aa35:--preset dev):cmake --build --preset dev --target offscreen_check d3d12_xs_device_obj -- -j 2):86.67s(configure0.00s)ctest --preset dev -R '^startup_gfx2hlsl_(s_nor_nand|sop2_complement)' --parallel 4 --no-tests=error --output-on-failure): 4/4 passed (11.26s:startup_gfx2hlsl_s_nor_nand0.28s,startup_gfx2hlsl_s_nor_nand_dispatch_hardware0.68s,startup_gfx2hlsl_s_nor_nand_dispatch_warp0.72s,startup_gfx2hlsl_sop2_complement11.06s)/O2(--preset release):cmake --build --preset release --target offscreen_check d3d12_xs_device_obj -- -j 2):69.16s(configure0.00s)ctest --preset release -R '^startup_gfx2hlsl_(s_nor_nand|sop2_complement)' --parallel 4 --no-tests=error --output-on-failure): 4/4 passed (5.74s:startup_gfx2hlsl_s_nor_nand0.20s,startup_gfx2hlsl_s_nor_nand_dispatch_warp0.54s,startup_gfx2hlsl_s_nor_nand_dispatch_hardware0.53s,startup_gfx2hlsl_sop2_complement5.62s)tests/mesh_heap_sampler_check.pyok (0.9s),tests/startup_buffer_address_check.pyok (0.6s),tests/startup_buffer_format_word3_table_check.pyok (0.1s),tests/startup_compute_request_offline_check.pyok (0.7s),tests/startup_compute_store_format_xyzw_check.pyok (0.3s),tests/startup_compute_translate_check.pyok (0.3s),tests/startup_flat_param_check.pyok (0.2s),tests/startup_gfx2hlsl_add_sub_co_check.pyok (0.2s),tests/startup_gfx2hlsl_add_sub_co_ci_check.pyok (0.2s),tests/startup_gfx2hlsl_bit_alu_check.pyok (1.0s),tests/startup_gfx2hlsl_capture_check.pyok (1.4s),tests/startup_gfx2hlsl_cmp16_check.pyok (0.4s),tests/startup_gfx2hlsl_compare_dst_check.pyok (0.1s),tests/startup_gfx2hlsl_compute_check.pyok (0.6s),tests/startup_gfx2hlsl_cselect_mask_check.pyok (0.1s),tests/startup_gfx2hlsl_cvt_alu_check.pyok (0.3s),tests/startup_gfx2hlsl_cvt_off_f32_i4_check.pyok (0.3s),tests/startup_gfx2hlsl_cvt_pk_int16_check.pyok (0.4s),tests/startup_gfx2hlsl_f32_lg_check.pyok (1.9s),tests/startup_gfx2hlsl_f32_nan_check.pyok (8.2s),tests/startup_gfx2hlsl_fma_mix_check.pyok (0.1s),tests/startup_gfx2hlsl_getpc_refusal_check.pyok (0.1s),tests/startup_gfx2hlsl_handler_arity_check.pyok (0.1s),tests/startup_gfx2hlsl_image_arity_check.pyok (0.1s),tests/startup_gfx2hlsl_image_get_lod_check.pyok (0.2s),tests/startup_gfx2hlsl_int_med3_check.pyok (0.2s),tests/startup_gfx2hlsl_interp_p2_hi_check.pyok (0.3s),tests/startup_gfx2hlsl_join_symbols_check.pyok (0.3s),tests/startup_gfx2hlsl_loop_constants_check.pyok (0.1s),tests/startup_gfx2hlsl_mask_data_check.pyok (0.1s),tests/startup_gfx2hlsl_mask_overwrite_check.pyok (0.1s),tests/startup_gfx2hlsl_operand_count_check.pyok (0.5s),tests/startup_gfx2hlsl_pack_absdiff_check.pyok (4.3s),tests/startup_gfx2hlsl_pack_b32_f16_check.pyok (0.2s),tests/startup_gfx2hlsl_readfirstlane_recompute_check.pyok (0.2s),tests/startup_gfx2hlsl_readfirstlane_uniform_check.pyok (0.2s),tests/startup_gfx2hlsl_refusals_check.pyok (0.9s),tests/startup_gfx2hlsl_root_check.pyok (1.2s),tests/startup_gfx2hlsl_s_nor_nand_check.pyok (0.2s),tests/startup_gfx2hlsl_sad_check.pyok (0.5s),tests/startup_gfx2hlsl_saveexec_same_reg_check.pyok (0.1s),tests/startup_gfx2hlsl_scalar_arity_check.pyok (0.3s),tests/startup_gfx2hlsl_scalar_brev_fold_check.pyok (0.2s),tests/startup_gfx2hlsl_scalar_m0_check.pyok (0.2s),tests/startup_gfx2hlsl_scalar_table_arity_check.pyok (0.4s),tests/startup_gfx2hlsl_sdwa_cvt_check.pyok (0.4s),tests/startup_gfx2hlsl_sgpr_spill_check.pyok (0.2s),tests/startup_gfx2hlsl_shift64_check.pyok (0.3s),tests/startup_gfx2hlsl_sload_const_offset_check.pyok (0.1s),tests/startup_gfx2hlsl_smem_offset_check.pyok (0.1s),tests/startup_gfx2hlsl_sop2_complement_check.pyok (9.3s),tests/startup_gfx2hlsl_sopk_accum_check.pyok (1.5s),tests/startup_gfx2hlsl_sopk_signext_check.pyok (0.3s),tests/startup_gfx2hlsl_swap_check.pyok (0.6s),tests/startup_gfx2hlsl_vopc_sdwa_check.pyok (7.3s),tests/startup_gfx2hlsl_waitcnt_depctr_check.pyok (0.2s),tests/startup_gfx2hlsl_watch_check.pyok (3.1s),tests/startup_image_2d_array_check.pyok (0.3s),tests/startup_image_3d_check.pyok (0.3s),tests/startup_image_gather_lz_check.pyok (0.9s),tests/startup_image_load_d16_check.pyok (1.7s),tests/startup_image_sample_a16_check.pyok (0.4s),tests/startup_image_sample_b_check.pyok (0.3s),tests/startup_image_sample_c_check.pyok (0.3s),tests/startup_image_sample_l_check.pyok (0.3s),tests/startup_image_sample_lod_check.pyok (0.9s),tests/startup_inline_sampler_check.pyok (0.2s),tests/startup_mesh57_loop_refusal_check.pyok (0.3s),tests/startup_mesh57_skeleton_check.pyok (0.7s),tests/startup_run_ps1_check.pyok (19.0s),tests/startup_run_sh_check.pyskipped (0.1s),tests/startup_sampler_heap_check.pyok (0.2s),tests/startup_shader_cache_rekey_check.pyok (3.5s),tests/startup_smem_address_check.pyok (0.2s),tests/startup_stream_fetch_check.pyok (0.3s),tests/startup_stream_interface_check.pyok (0.3s),tests/startup_translator_check.pyok (0.7s)sccache: 10/119 hits; wall252.5sAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:36:47Z.
@MasterDomino ready for review/merge: head
392a40de, CI green, Win2025 WARP dev+release receipt on this exact head posted above.@Leyukaka thank you for the
exec_loport. #2459 took the SGPR-destination forms, so I merged main (merge commit, no force-push), kept main's lowering and brought over only yourexec_lodestination from482bade0, with you as co-author. SCC is not modelled, as in the SGPR forms, andvcc_lo,exec_hi, pairs and XNOR intoexec_lostay refused. I replaced the old per-lane test withstartup_gfx2hlsl_s_nor_nandplus_dispatch_warpand_dispatch_hardware: a D3D12 UAV readback of NOR and NAND intoexec_loand an SGPR over every pair of source bits, against an integer reference. Yourexec_locases instartup_gfx2hlsl_sop2_complementstay.Verification (Win2025, head
392a40de):ctest --preset devand--preset releasewith-R '^startup_gfx2hlsl_(s_nor_nand|sop2_complement)': 4/4 passed each. Linux:python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.pyandtests/startup_gfx2hlsl_sop2_complement_check.pypass.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:30:21Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
9d9dbe9147256a3d1223e7cfb61803c985c31c9a:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2):6.52s(configure2.53s)/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2):1.80s(configure3.94s)tests/mesh_heap_sampler_check.pyok (1.1s),tests/startup_buffer_address_check.pyok (0.8s),tests/startup_buffer_format_word3_table_check.pyok (0.1s),tests/startup_compute_request_offline_check.pyok (0.9s),tests/startup_compute_store_format_xyzw_check.pyok (0.5s),tests/startup_compute_translate_check.pyok (0.4s),tests/startup_flat_param_check.pyok (0.3s),tests/startup_gfx2hlsl_add_sub_co_check.pyok (0.2s),tests/startup_gfx2hlsl_add_sub_co_ci_check.pyok (0.3s),tests/startup_gfx2hlsl_bit_alu_check.pyok (1.3s),tests/startup_gfx2hlsl_capture_check.pyok (1.9s),tests/startup_gfx2hlsl_cmp16_check.pyok (0.5s),tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.pyok (48.4s),tests/startup_gfx2hlsl_compare_dst_check.pyok (0.1s),tests/startup_gfx2hlsl_compute_check.pyok (0.5s),tests/startup_gfx2hlsl_cselect_mask_check.pyok (0.1s),tests/startup_gfx2hlsl_cvt_alu_check.pyok (0.2s),tests/startup_gfx2hlsl_cvt_off_f32_i4_check.pyok (0.3s),tests/startup_gfx2hlsl_cvt_pk_int16_check.pyok (0.3s),tests/startup_gfx2hlsl_f32_lg_check.pyok (1.6s),tests/startup_gfx2hlsl_f32_nan_check.pyok (6.4s),tests/startup_gfx2hlsl_fma_mix_check.pyok (0.1s),tests/startup_gfx2hlsl_getpc_refusal_check.pyok (0.1s),tests/startup_gfx2hlsl_handler_arity_check.pyok (0.2s),tests/startup_gfx2hlsl_heap_record_check.pyok (0.3s),tests/startup_gfx2hlsl_image_arity_check.pyok (0.1s),tests/startup_gfx2hlsl_image_get_lod_check.pyok (0.2s),tests/startup_gfx2hlsl_int_med3_check.pyok (0.1s),tests/startup_gfx2hlsl_interp_p2_hi_check.pyok (0.3s),tests/startup_gfx2hlsl_join_symbols_check.pyok (0.3s),tests/startup_gfx2hlsl_loop_constants_check.pyok (0.1s),tests/startup_gfx2hlsl_mask_data_check.pyok (0.1s),tests/startup_gfx2hlsl_mask_overwrite_check.pyok (0.1s),tests/startup_gfx2hlsl_operand_count_check.pyok (0.4s),tests/startup_gfx2hlsl_pack_absdiff_check.pyok (3.0s),tests/startup_gfx2hlsl_pack_b32_f16_check.pyok (0.2s),tests/startup_gfx2hlsl_readfirstlane_recompute_check.pyok (0.1s),tests/startup_gfx2hlsl_readfirstlane_uniform_check.pyok (0.2s),tests/startup_gfx2hlsl_refusals_check.pyok (0.8s),tests/startup_gfx2hlsl_root_check.pyok (1.0s),tests/startup_gfx2hlsl_s_abs_check.pyok (0.1s),tests/startup_gfx2hlsl_s_bitset_check.pyok (0.1s),tests/startup_gfx2hlsl_s_ff0_check.pyok (0.1s),tests/startup_gfx2hlsl_s_ff1_check.pyok (0.1s),tests/startup_gfx2hlsl_s_flbit_check.pyok (0.1s),tests/startup_gfx2hlsl_s_nor_nand_check.pyok (0.2s),tests/startup_gfx2hlsl_s_quadmask_check.pyok (0.1s),tests/startup_gfx2hlsl_sad_check.pyok (0.4s),tests/startup_gfx2hlsl_saveexec_same_reg_check.pyok (0.1s),tests/startup_gfx2hlsl_scalar_arity_check.pyok (0.3s),tests/startup_gfx2hlsl_scalar_brev_fold_check.pyok (0.2s),tests/startup_gfx2hlsl_scalar_m0_check.pyok (0.2s),tests/startup_gfx2hlsl_scalar_null_check.pyok (0.2s),tests/startup_gfx2hlsl_scalar_table_arity_check.pyok (0.5s),tests/startup_gfx2hlsl_sdwa_cndmask_check.pyok (0.3s),tests/startup_gfx2hlsl_sdwa_cvt_check.pyok (0.3s),tests/startup_gfx2hlsl_sgpr_spill_check.pyok (0.2s),tests/startup_gfx2hlsl_shift64_check.pyok (0.2s),tests/startup_gfx2hlsl_sload_const_offset_check.pyok (0.1s),tests/startup_gfx2hlsl_smem_offset_check.pyok (0.1s),tests/startup_gfx2hlsl_sop2_complement_check.pyok (7.1s),tests/startup_gfx2hlsl_sopk_accum_check.pyok (1.2s),tests/startup_gfx2hlsl_sopk_signext_check.pyok (0.2s),tests/startup_gfx2hlsl_spill_branches_check.pyok (1.2s),tests/startup_gfx2hlsl_swap_check.pyok (0.4s),tests/startup_gfx2hlsl_vopc_sdwa_check.pyok (6.1s),tests/startup_gfx2hlsl_waitcnt_depctr_check.pyok (0.1s),tests/startup_gfx2hlsl_watch_check.pyok (2.9s),tests/startup_image_2d_array_check.pyok (0.2s),tests/startup_image_3d_check.pyok (0.2s),tests/startup_image_gather_lz_check.pyok (0.8s),tests/startup_image_load_d16_check.pyok (1.4s),tests/startup_image_sample_a16_check.pyok (0.3s),tests/startup_image_sample_b_check.pyok (0.3s),tests/startup_image_sample_c_check.pyok (0.3s),tests/startup_image_sample_l_check.pyok (0.3s),tests/startup_image_sample_lod_check.pyok (0.9s),tests/startup_inline_sampler_check.pyok (0.2s),tests/startup_mesh57_depth_only_check.pyok (0.3s),tests/startup_mesh57_lane_spill_check.pyok (0.3s),tests/startup_mesh57_loop_check.pyok (0.3s),tests/startup_mesh57_loop_refusal_check.pyok (0.2s),tests/startup_mesh57_skeleton_check.pyok (1.9s),tests/startup_run_ps1_check.pyok (16.6s),tests/startup_run_sh_check.pyskipped (0.1s),tests/startup_sampler_heap_check.pyok (0.2s),tests/startup_shader_cache_rekey_check.pyok (3.2s),tests/startup_smem_address_check.pyok (0.2s),tests/startup_stream_fetch_check.pyok (0.3s),tests/startup_stream_interface_check.pyok (0.3s),tests/startup_translator_check.pyok (0.6s)sccache: 1314/1415 hits; wall151.1sImported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:30:22Z.
@MasterDomino: #2030 is ready for review/merge.
What changed: merged current main into the branch (one conflict in
tools/startup/gfx2hlsl.py, kept both the address-carry handling from main and the lane-mask complement SCC refusal from this PR). New head9d9dbe91.Verification:
python3 tests/startup_gfx2hlsl_s_nor_nand_check.pyokpython3 tests/startup_gfx2hlsl_sop2_complement_check.pyPASS9d9dbe91: Linux checks, gfx1013 fixtures and Windows build all pass9d9dbe9147256a3d1223e7cfb61803c985c31c9a(receipt in the comment above)AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T05:50:04Z.
Review: CHANGES_REQUESTED
The four-bit-pair fixtures passed on WARP and RTX, but the new EXEC_LO form is accepted by the mesh-stage lowering too. The slot 57 profile is known wave64. A probe with kind=ms and two marked mask sources emits exec = (~(s1 | s2)) & 1 for s_nor_b32 exec_lo, s1, s2 and likewise for NAND, so upper lanes are changed even though the instruction only writes EXEC_LO. Please require a proven wave32 mask for the new EXEC_LO forms, or explicitly preserve lanes 32–63 in wave64. Add a case with an active upper lane and an inactive low lane result so the current lowering fails. The existing SCC-read refusals should remain.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T06:19:46Z.
Review: CHANGES_REQUESTED
Reviewed
9d9dbe91. I agree with @R0Y00's open change request.The
exec_lodestination is accepted for every stage kind. A unit probe withkind='ms'(slot 57 mesh is wave64) and two marked mask sources emitsexec = (~(s1 | s2)) & 1;fors_nor_b32 exec_lo, s1, s2, and NAND does the same. That write also changes lanes 32–63 of a wave64 wave.exec_lodestination only for a proven wave32 stage: pixel, or compute with at most 32 threads per group, as the b32 waterfall close already requires (gfx2hlsl.py:~2606).s_and_b32/s_or_b32/s_mov_b32writes intoexec_loshow the same behaviour in that probe. That can be a separate issue.The branch also conflicts with
mainsince #2580, intools/startup/gfx2hlsl.py, wheremain'smark_heap_indexcall followsset_s. Keeping that call and dropping the movedlane_complementblock should resolve it. Please also refresh the PR description: it still says avcc_lodestination is accepted and that SCC uses the per-lane projection, and the code now refuses both.Otherwise the lane semantics look right:
execwrite, so a reactivated lane computes the hardware bit.No cache revision bump is needed: 60 of 72 probe programs translate identically on
mainand on this head, and the 12 that differ were refused onmain.Runs: Windows 11 build 26300; AMD Radeon RX 9070 XT (driver 32.0.32029.2010); WARP 10.0.26100.9818.
ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_(s_nor_nand|sop2_complement)'4/4, including dispatch on WARP and hardware.ctest -R startup_gfx2hlsl252/253. The failure,startup_gfx2hlsl_fma_mix_dispatch_hardware, also fails onmainon this GPU (#2746).startup_gfx2hlsl_sop2_complement: XNOR intoexec_lo, avcc_lodestination intoexec_lo, mixed sources intoexec_lo, SCC emitted, andscc_effectdropped. The news_nor_nandcheck itself catches none of them; it covers only accepted forms and the readback.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T07:58:58Z.
@MasterDomino @R0Y00 thanks, both points are addressed at
ef54c20a638f7d0ff72dc3747c6a82158273207a.exec_lodestination in a wave64 stage.s_nor_b32/s_nand_b32intoexec_lois now accepted only for compute with at most 32 threads per group, the same proof the b32 waterfall close uses (gfx2hlsl.py, next tomask_source). The slot 57 mesh stage, vertex stages and compute groups above 32 threads refuse it with... on a lane mask. I did not include pixel: the translator has no wave size proof there (require_spill_lanes_apartsays "the wave size is unknown" forps/vs), so I kept it refused rather than assume wave32. If you want pixel accepted, tell me what proves it and I will add that proof.startup_gfx2hlsl_s_nor_nand_check.pygainsstage_checks(): both opcodes intoexec_lofor ps, vs, ms, cs of 64 and 8x8 threads (refused) and cs of 32 and 8x4 threads (accepted), plus thes3destination staying accepted in a mesh stage. Without the gate this check fails (the wave64 cases are accepted); with it, it passes. The sharedProbeinstartup_gfx2hlsl_sop2_complement_check.pyis now a 32-thread compute stage, so the existing accepted-form cases keep their meaning.main. Mergedorigin/main, keptmain'smark_heap_indexcall and thesalu_align4write, dropped the movedlane_complementblock.vcc_loand SCC reads are refused, and the stage rule above.docs/experiments.mdstates the wave32 requirement.s_and_b32/s_or_b32/s_mov_b32intoexec_lo. Left for a separate issue, as you suggested.Linux, from the worktree at this head:
python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.pyok;python3 -B tests/startup_gfx2hlsl_sop2_complement_check.pyok;python3 -B tests/startup_gfx2hlsl_waitcnt_depctr_check.pyok; everytests/startup_gfx2hlsl_*_check.pypasses except the two draw checks that need DXC arguments (export_null_draw,mul24_align_draw).The Win2025 receipt (named tests) follows in an edit to this comment.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T07:59:10Z.
Win2025 receipt at
ef54c20a638f7d0ff72dc3747c6a82158273207a(Windows Server 2025 build 26100, MSVC 14.44.35207, D3D12 WARP), tests run by name:ctest --preset dev -R '^(startup_gfx2hlsl_s_nor_nand|startup_gfx2hlsl_sop2_complement)' --no-tests=error: 4/4 passed:startup_gfx2hlsl_s_nor_nand,startup_gfx2hlsl_s_nor_nand_dispatch_warp,startup_gfx2hlsl_s_nor_nand_dispatch_hardware,startup_gfx2hlsl_sop2_complement.ctest --preset releasewith the same regex: 4/4 passed, same four tests.@MasterDomino @R0Y00 ready for another look.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T08:03:31Z.
Review: APPROVED
Approving
ef54c20a. My change request at9d9dbe91is addressed.exec_lodestination. NOR/NAND intoexec_lois now accepted only for compute groups of at most 32 threads (wave32_stage), where lanes 32..63 hold no thread. Pixel, vertex, mesh and larger compute groups refuse it.wave32_stage = True or ...),startup_gfx2hlsl_s_nor_nand_check.pyfails on the newstage_checks(): the ps, cs (64, 1, 1) and cs (8, 8, 1) cases are no longer refused.main, and CI is green at the head.No cache revision bump is needed:
mainrefuses theseexec_loforms, and this head only adds translations for compute groups of at most 32 threads.Commands, on Windows 11 build 26300, at
ef54c20a:python -B tests/startup_gfx2hlsl_{s_nor_nand,sop2_complement,compute,mask_overwrite}_check.py, all exit 0.@R0Y00, the head now enforces the wave32 requirement from your change request. If you agree, please clear it and I'll merge (or merge it yourself).
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T08:59:03Z.
@R0Y00 the change request of 2026-11-26 05:50Z (on
9d9dbe91:s_nor_b32/s_nand_b32intoexec_loaccepted in the mesh stage, which is wave64) has been addressed at headef54c20a:exec_loas the destination is now accepted only for compute with at most 32 threads per group, the one wave32 proof available. Pixel, vertex, mesh (slot 57) and larger compute groups refuse it, so lanes 32..63 of a wave64 wave are never changed (9b326a3f,f8022065,ef54c20a).startup_gfx2hlsl_s_nor_nandfails on the wave64 cases; the SCC-read refusals are unchanged.ef54c20a: dev 4/4 and release 4/4 passed, tests run by name (receipt in this thread).Please re-review this head, or dismiss the old change request if you agree it is resolved.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T10:09:46Z.
@tedin7,
ef54c20anow conflicts withmain(700522ef) intools/startup/gfx2hlsl.py, after #2736 and the other recent translator merges. Could you mergemainagain? I'll re-check the new head (thes_nor_nand/sop2_complementchecks and the wave32-gate mutant). This PR needs no cache bump, so no revision line should move.The merge also still needs @R0Y00 to re-review or dismiss his change request at
9d9dbe91.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T10:12:18Z.
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