shader: add NGG pass-through lowering dropping LDS round-trip in gfx2hlsl (Part of #1723) #2089
Closed
tedin7 wants to merge 15 commits from
upstream-pr/2096 into main
pull from: upstream-pr/2096
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!2089
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2096"
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-25T00:14:01Z.
Part of #1723
What this unblocks: NGG pass-through vertex shaders (the largest refusal in the startup batch, 846 of 1,171 pairs) can now be translated instead of refused.
Changes in
tools/startup/gfx2hlsl.py:s_sendmsgGS_ALLOC_REQ ands_barrierare accepted as no-ops in a straight-line vertex shader with entry EXEC.ds_write_b32/ds_read_b32round trip: forwarded to a register copy only when the address is proven lane-private:stride * lane + offsetbuilt fromv_mbcnt, aligned, inside 64 KiB, and every write checked disjoint from every earlier write across all lane pairs. Aliasing, non-affine and entry-v0addresses, reads of unwritten or stale slots and any other LDS form stay refused.exp prim/target_20) is accepted only as one uncompressed VGPR0 word, with VGPR0 never written. Any other primitive export is refused asnon-identity primitive export.New test:
tests/startup_gfx2hlsl_ngg_passthrough_check.py, registered inCMakeLists.txtasstartup_gfx2hlsl_ngg_passthrough. It covers the accepted round trip, offset separation, the kept position export, and negative controls (computed or other-register primitive word, extra channels, compressed, after a branch, unwritten/stale/changed slots, unknown message, pixel shader, branch).Source: AMD RDNA 2 Instruction Set Architecture guide, LDS (DS) instructions and the s_sendmsg GS_ALLOC_REQ message sections; the lane id as read by v_mbcnt_lo/hi (Vector ALU section).
Verification:
python3 -I -B tests/startup_gfx2hlsl_ngg_passthrough_check.py-> all oktests/startup_gfx2hlsl_*_check.pyrun locally on Linux -> all passAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T00:22:56Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
84b7c144ccℹ️ 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 chatgpt-codex-connector[bot] on 2026-11-25T00:14:10Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
84b7c14ℹ️ 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-25T00:22:56Z.
Code review location:
tools/startup/gfx2hlsl.py; line 1495If a straight-line VS sets
v1 = 4 * laneand copies it tov4, then writes one value throughv1, writes another throughv4at the same offset, and reads throughv1, this cache still forwards the first value. Both register versions remain unchanged, but the second write overwrote the same LDS word; a decoded synthetic fixture is accepted byPipelineand miscomputes the exported value. Before retaining old entries across a write, prove its effective address is disjoint or invalidate/refuse potentially aliased slots.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T00:22:56Z.
Code review location:
tools/startup/gfx2hlsl.py; line 1493In a multi-lane straight-line VS,
v_and_b32_e32 v1, 0, v0makes every lane's address zero, butv1is absent fromuniform_vbecause that operation is outsideUNIFORM_VALU. This therefore acceptsds_write_b32 v1, v0 offset:16followed by a wait/barrier andds_read_b32 v3, v1 offset:16, lowering the read tov3 = v0. The actual read accesses one shared word and must return the same stored value to every lane, whereas the translation returns different values. Absence of a uniformity proof is not proof of lane-private addressing; require a positive non-overlap proof before eliminating LDS.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T00:22:56Z.
Code review location:
CMakeLists.txt; line 2520This introduces public NGG translation support, but neither the README nor
docs/experiments.mdis updated, contrary toAGENTS.md's requirement to update capability documentation when a public capability or reproduction command changes. The existing NGG experiment section documents the older classification fixture, not this accepted straight-line profile or its regression check. Document the supported/refused cases and the reproduction commandpython3 -B tests/startup_gfx2hlsl_ngg_passthrough_check.py.AGENTS.md reference: AGENTS.md:L223-L224
Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T00:22:56Z.
Code review location:
tools/startup/gfx2hlsl.py; line 1482For encoded DS instructions whose immediate offset is zero,
disasm_rdna2.decode_instruction()omits the modifier entirely, producing forms such asds_write_b32 v2, v8andds_read_b32 v24, v2. Consequentlyparse()supplies an empty modifier list and this condition rejects an otherwise supported same-lane round trip. The new fixture only supplies explicit nonzero offsets, so it misses the decoder/parser mismatch. Accept an omitted offset as zero while continuing to reject unsupported modifiers.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:05:33Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:05:34Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:05:36Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:05:37Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:05:32Z.
Code review location:
tools/startup/gfx2hlsl.py; line 1495Fixed in
6fc39f2c: a ds_write now drops every cached slot whose address register differs or whose offset is within 4 bytes, so a write through a copied address can no longer leave a stale forward.Verification: python3 -B tests/startup_gfx2hlsl_ngg_passthrough_check.py (all ok); all 32 tests/startup_gfx2hlsl_*_check.py pass locally.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:05:34Z.
Code review location:
tools/startup/gfx2hlsl.py; line 1493Fixed in
6fc39f2c: the write address must now be proven lane-distinct (entry v0 or a plain v_mov copy of it); v_and with 0 and any other computed address is refused. New refusal cases added.Verification: python3 -B tests/startup_gfx2hlsl_ngg_passthrough_check.py (all ok); all 32 tests/startup_gfx2hlsl_*_check.py pass locally.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:05:36Z.
Code review location:
CMakeLists.txt; line 2520Fixed in
6fc39f2c: docs/experiments.md now documents the NGG pass-through profile, refusals and the ctest/python reproduction commands.Verification: python3 -B tests/startup_gfx2hlsl_ngg_passthrough_check.py (all ok); all 32 tests/startup_gfx2hlsl_*_check.py pass locally.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:05:37Z.
Code review location:
tools/startup/gfx2hlsl.py; line 1482Fixed in
6fc39f2c: an omitted DS offset is parsed as offset 0; covered by a new test case.Verification: python3 -B tests/startup_gfx2hlsl_ngg_passthrough_check.py (all ok); all 32 tests/startup_gfx2hlsl_*_check.py pass locally.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T12:25:34Z.
Review: CHANGES_REQUESTED
The LDS substitution still needs a cross-lane byte-range proof. At
29d2c2c8,lane_vrecords entry v0 and copies. It does not establish a stride or exclude another lane hitting a slot through a different immediate. For example, even if valid entry addresses are 4 bytes apart, lane A'sv0 + 20and lane B'sv0 + 16can name the same DWORD. The positive 16/20 fixture currently checks the emitted register assignments without exercising whether the source slots can alias.Please either establish and enforce the entry address layout and prove the four-byte intervals disjoint across all active lanes and write offsets, or refuse the unproven LDS lowering. Add a control with distinct per-lane payloads and two aligned offsets that alias across lanes, plus a disjoint case.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T13:50:26Z.
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 tedin7 on 2026-11-25T23:24:41Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
d909d5f8e47062971cfae47ce7b3c648c7c0edab:--preset dev):cmake --build --preset dev --target offscreen_check -- -j 2):1.49s(configure0.00s)ctest --preset dev -R '^startup_gfx2hlsl_ngg_passthrough' --parallel 2 --no-tests=error --output-on-failure): 3/3 passed (1.11s:startup_gfx2hlsl_ngg_passthrough_warp0.88s,startup_gfx2hlsl_ngg_passthrough_hardware0.88s,startup_gfx2hlsl_ngg_passthrough0.11s)/O2(--preset release):cmake --build --preset release --target offscreen_check -- -j 2):1.15s(configure0.00s)ctest --preset release -R '^startup_gfx2hlsl_ngg_passthrough' --parallel 2 --no-tests=error --output-on-failure): 3/3 passed (1.32s:startup_gfx2hlsl_ngg_passthrough_warp1.08s,startup_gfx2hlsl_ngg_passthrough_hardware1.18s,startup_gfx2hlsl_ngg_passthrough0.12s)tests/startup_gfx2hlsl_ngg_passthrough_check.pyok (0.1s),tests/startup_gfx2hlsl_refusals_check.pyok (0.5s),tests/startup_ngg_slice_check.pyok (0.3s)9.8sNo separate physical-GPU result is claimed; the VM reports WARP.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T23:25:59Z.
@R0Y00 @MasterDomino the LDS point is now handled by a proof, not a refusal. Head
d909d5f8.Your request: prove the four-byte intervals disjoint across all active lanes and write offsets, enforced in the translator, or refuse; add an aliasing control with distinct per-lane payloads and a disjoint case.
v0is a packed word, so it is no longer accepted as a lane address. The address must bestride * lane + offsetbuilt fromv_mbcnt_lo_u32_b32 v, -1, 0+v_mbcnt_hi_u32_b32 v, -1, v(lane 0..63) byv_mov,v_lshlrev,v_add_nc,v_mul_u32_u24/v_mul_lo_u32,v_mad_u32_u24with immediates. Stride and offset must be 4-byte aligned and stay inside 64 KiB for all 64 lanes.ds_write_b32is checked against every earlier write and itself for all lane pairs (Stage.lds_overlap); any meeting is refused with the two strides and offsets named. A read takes the write with the identical form, and is refused if the payload register changed.v2/v8: refused (not disjoint). Mutation: with the overlap check replaced byFalsethe same program is lowered, so the control fails without the check.v3 = v2; v9 = v8;. Also lowered: stride 12 from a mad with a read through another register of equal form, and stride 4 with one offset.v0and a copy of it,v_mbcnt_loalone, stride 0, unaligned stride/offset, lane 63 past 64 KiB, non-affine sums and products, a lane address read as data, a read with no matching write, a changed payload, a second DS modifier, exacts_sendmsgmessage 9 only.startup_gfx2hlsl_ngg_passthrough_warpdraws a vertex shader that writes twelve payload words to LDS (stride 48, offsets 0..44), reads them back and exports them; the pixels are compared with a CPU reference. The fixture assembles fromtests/startup_gfx2hlsl_ngg_passthrough_tail.s.Verification: the Win2025 dev + release receipt is in the comment above (3/3 passed in both presets for
^startup_gfx2hlsl_ngg_passthrough, plus the Python checks). Locally on Linux:python3 -B tests/startup_gfx2hlsl_ngg_passthrough_check.pyandpython3 -B tests/startup_gfx2hlsl_ngg_passthrough_check.py binary <llvm-mc>, plus thestartup_gfx2hlsl_*Python checks.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:42:45Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
1c8f605f5f1a9e3b8702d3e41d5e4307daa8670c:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2):2.51s(configure4.08s)/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2):2.80s(configure4.16s)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.6s),tests/startup_compute_store_format_xyzw_check.pyok (0.3s),tests/startup_compute_translate_check.pyok (0.2s),tests/startup_flat_param_check.pyok (0.2s),tests/startup_gfx2hlsl_add_sub_co_check.pyok (0.1s),tests/startup_gfx2hlsl_add_sub_co_ci_check.pyok (0.2s),tests/startup_gfx2hlsl_bit_alu_check.pyok (0.8s),tests/startup_gfx2hlsl_capture_check.pyok (1.2s),tests/startup_gfx2hlsl_cmp16_check.pyok (0.3s),tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.pyok (44.1s),tests/startup_gfx2hlsl_compare_dst_check.pyok (0.2s),tests/startup_gfx2hlsl_compute_check.pyok (0.7s),tests/startup_gfx2hlsl_cselect_mask_check.pyok (0.2s),tests/startup_gfx2hlsl_cvt_alu_check.pyok (0.3s),tests/startup_gfx2hlsl_cvt_off_f32_i4_check.pyok (0.4s),tests/startup_gfx2hlsl_cvt_pk_int16_check.pyok (0.5s),tests/startup_gfx2hlsl_f32_lg_check.pyok (2.0s),tests/startup_gfx2hlsl_f32_nan_check.pyok (6.1s),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_heap_record_check.pyok (0.2s),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.2s),tests/startup_gfx2hlsl_join_symbols_check.pyok (0.2s),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.4s),tests/startup_gfx2hlsl_pack_b32_f16_check.pyok (0.3s),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.0s),tests/startup_gfx2hlsl_s_abs_check.pyok (0.1s),tests/startup_gfx2hlsl_s_bitset_check.pyok (0.2s),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_quadmask_check.pyok (0.1s),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_null_check.pyok (0.2s),tests/startup_gfx2hlsl_scalar_table_arity_check.pyok (0.4s),tests/startup_gfx2hlsl_sdwa_cndmask_check.pyok (0.3s),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 (6.2s),tests/startup_gfx2hlsl_sopk_accum_check.pyok (1.2s),tests/startup_gfx2hlsl_sopk_signext_check.pyok (0.1s),tests/startup_gfx2hlsl_spill_branches_check.pyok (1.0s),tests/startup_gfx2hlsl_swap_check.pyok (0.4s),tests/startup_gfx2hlsl_vopc_sdwa_check.pyok (5.2s),tests/startup_gfx2hlsl_waitcnt_depctr_check.pyok (0.1s),tests/startup_gfx2hlsl_watch_check.pyok (2.8s),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.7s),tests/startup_image_load_d16_check.pyok (1.1s),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.2s),tests/startup_image_sample_lod_check.pyok (0.7s),tests/startup_inline_sampler_check.pyok (0.2s),tests/startup_mesh57_depth_only_check.pyok (0.2s),tests/startup_mesh57_lane_spill_check.pyok (0.3s),tests/startup_mesh57_loop_check.pyok (0.2s),tests/startup_mesh57_loop_refusal_check.pyok (0.2s),tests/startup_mesh57_skeleton_check.pyok (1.3s),tests/startup_run_ps1_check.pyok (19.2s),tests/startup_run_sh_check.pyskipped (0.1s),tests/startup_sampler_heap_check.pyok (0.3s),tests/startup_shader_cache_rekey_check.pyok (4.6s),tests/startup_smem_address_check.pyok (0.3s),tests/startup_stream_fetch_check.pyok (0.4s),tests/startup_stream_interface_check.pyok (0.4s),tests/startup_translator_check.pyok (0.8s)sccache: 7/23 hits; wall147.7sAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:42:46Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
1c8f605f5f1a9e3b8702d3e41d5e4307daa8670c:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2):1.87s(configure0.00s)ctest --preset dev -R '^startup_gfx2hlsl_ngg_passthrough' --parallel 2 --no-tests=error --output-on-failure): 3/3 passed (1.80s:startup_gfx2hlsl_ngg_passthrough_warp1.42s,startup_gfx2hlsl_ngg_passthrough_hardware1.43s,startup_gfx2hlsl_ngg_passthrough0.13s)/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2):1.96s(configure0.00s)ctest --preset release -R '^startup_gfx2hlsl_ngg_passthrough' --parallel 2 --no-tests=error --output-on-failure): 3/3 passed (1.83s:startup_gfx2hlsl_ngg_passthrough_warp1.38s,startup_gfx2hlsl_ngg_passthrough_hardware1.39s,startup_gfx2hlsl_ngg_passthrough0.17s)tests/startup_gfx2hlsl_ngg_passthrough_check.pyok (0.2s)sccache: 4/4 hits; wall21.8sAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:42:56Z.
@R0Y00 @MasterDomino head
1c8f605fis ready for another look. The LDS point from the 12:25Z review is handled by a proof, as described in the previous reply (d909d5f8). Since then:origin/main(107 commits). One conflict intools/startup/gfx2hlsl.py, resolved by keeping both sides. No force-push.startup_gfx2hlsl_ngg_passthrough_check.py binary llvm-mc-15is in thepixel-binaryjob, so the hand-written tail words in the WARP fixture are checked against the assembler on every push.gfx2hlsl.pyand the paragraph indocs/experiments.mdnow say that, instead of pointing to a per-wave base the translator does not check.Verification:
1c8f605f: Linux Python checks, gfx1013 assemble and translate, Windows build and test all green.^startup_gfx2hlsl_ngg_passthrough3/3 passed in both presets, plus the full default plan (receipts in the two comments above). One first full run failed only intests/startup_run_ps1_check.py(PowerShell launcher, unrelated to this change); the re-run passed.python3 -B tests/startup_gfx2hlsl_ngg_passthrough_check.py, the same withbinary llvm-mc-19,python3 -B tests/docs_links_check.py, and everytests/startup_gfx2hlsl_*_check.pythat runs without a GPU.Re-requesting review.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T07:35:29Z.
Review: COMMENTED
Reviewed
1c8f605f(comment only; @R0Y00's change request is his to clear).On the change request (12:25Z):
v0and its copies are no longer accepted as addresses. Addresses must bestride * lane + offsetbuilt fromv_mbcnt_lo/v_mbcnt_hi, aligned, and inside 64 KiB.lds_overlapchecks every lane pair of each write against every earlier write, and against itself. Removing the check against earlier writes makes the 16/20 aliasing control lower tov3 = v8; v9 = v2, so the control catches it.Requested before merge:
main.tools/startup/gfx2hlsl.pyconflicts atset_v, wheremainaddedalign4=False.v3 = v2. Please add both as refused fixtures:v_mbcnt_hi_u32_b32 v1, -1, 0without theloresult, which gives 0 in lanes 0..31;v_add_nc_u32 v11, -8, v10), which puts lane 0 outside LDS.No cache bump is needed. Every new path was refused at the merge base (
s_sendmsg,v_mbcntin a VS, and VS LDS ops). The 504 pipelines that the no-argumentstartup_*checks translate have identical HLSL before and after.Runs: Windows 11 build 26300; RX 9070 XT (driver 32.0.32029.2010); WARP 10.0.26100.9818.
ctest --preset dev --no-tests=error -R 'startup_gfx2hlsl|startup_ngg|startup_mesh57': 272 passed out of 273, including the threestartup_gfx2hlsl_ngg_passthroughtests andstartup_ngg_slice. The one failure,startup_gfx2hlsl_fma_mix_dispatch_hardware, also fails onmain(#2746).startup_gfx2hlsl_ngg_passthrough_check.py binarymatches llvm-mc 15.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T07:46:54Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
106c044513f1aa35797dd97a90c674d2e43ead9b:--preset dev):cmake --build --preset dev --target offscreen_check -- -j 2):62.13s(configure1.89s)ctest --preset dev -R '^startup_gfx2hlsl_ngg_passthrough' --parallel 2 --no-tests=error --output-on-failure): 3/3 passed (1.17s:startup_gfx2hlsl_ngg_passthrough_hardware0.92s,startup_gfx2hlsl_ngg_passthrough_warp0.93s,startup_gfx2hlsl_ngg_passthrough0.11s)/O2(--preset release):cmake --build --preset release --target offscreen_check -- -j 2):90.06s(configure2.17s)ctest --preset release -R '^startup_gfx2hlsl_ngg_passthrough' --parallel 2 --no-tests=error --output-on-failure): 3/3 passed (1.17s:startup_gfx2hlsl_ngg_passthrough_warp0.91s,startup_gfx2hlsl_ngg_passthrough_hardware0.92s,startup_gfx2hlsl_ngg_passthrough0.10s)tests/mesh_heap_sampler_check.pyok (0.8s),tests/startup_buffer_address_check.pyok (0.5s),tests/startup_buffer_format_word3_table_check.pyok (0.1s),tests/startup_compute_global_load_check.pyok (0.2s),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.1s),tests/startup_gfx2hlsl_add_sub_co_ci_check.pyok (0.2s),tests/startup_gfx2hlsl_bfm_b64_check.pyok (1.5s),tests/startup_gfx2hlsl_bit_alu_check.pyok (0.8s),tests/startup_gfx2hlsl_capture_check.pyok (1.4s),tests/startup_gfx2hlsl_cmp16_check.pyok (0.3s),tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.pyok (45.5s),tests/startup_gfx2hlsl_compare_dst_check.pyok (0.1s),tests/startup_gfx2hlsl_compute_check.pyok (0.6s),tests/startup_gfx2hlsl_const_copy_join_check.pyok (0.1s),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.4s),tests/startup_gfx2hlsl_cvt_pk_int16_check.pyok (0.4s),tests/startup_gfx2hlsl_f32_lg_check.pyok (1.3s),tests/startup_gfx2hlsl_f32_nan_check.pyok (5.0s),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_heap_record_check.pyok (0.2s),tests/startup_gfx2hlsl_heap_word_check.pyok (0.2s),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 (2.5s),tests/startup_gfx2hlsl_pack_b32_f16_check.pyok (0.2s),tests/startup_gfx2hlsl_readfirstlane_load_recompute_check.pyok (0.1s),tests/startup_gfx2hlsl_readfirstlane_recompute_check.pyok (0.1s),tests/startup_gfx2hlsl_readfirstlane_uniform_check.pyok (0.1s),tests/startup_gfx2hlsl_refusals_check.pyok (0.6s),tests/startup_gfx2hlsl_root_check.pyok (0.9s),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_quadmask_b64_check.pyok (0.1s),tests/startup_gfx2hlsl_s_quadmask_check.pyok (0.1s),tests/startup_gfx2hlsl_sad_check.pyok (0.3s),tests/startup_gfx2hlsl_sad_hi_msad_check.pyok (0.3s),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.4s),tests/startup_gfx2hlsl_sdwa_cndmask_check.pyok (0.2s),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 (5.9s),tests/startup_gfx2hlsl_sopk_accum_check.pyok (1.2s),tests/startup_gfx2hlsl_sopk_signext_check.pyok (0.1s),tests/startup_gfx2hlsl_spill_branches_check.pyok (1.1s),tests/startup_gfx2hlsl_swap_check.pyok (0.4s),tests/startup_gfx2hlsl_vopc_sdwa_check.pyok (4.5s),tests/startup_gfx2hlsl_waitcnt_depctr_check.pyok (0.1s),tests/startup_gfx2hlsl_watch_check.pyok (2.6s),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.6s),tests/startup_image_load_d16_check.pyok (1.0s),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.2s),tests/startup_image_sample_l_check.pyok (0.2s),tests/startup_image_sample_lod_check.pyok (0.7s),tests/startup_inline_sampler_check.pyok (0.2s),tests/startup_mesh57_depth_only_check.pyok (0.2s),tests/startup_mesh57_lane_spill_check.pyok (0.2s),tests/startup_mesh57_loop_check.pyok (0.2s),tests/startup_mesh57_loop_refusal_check.pyok (0.2s),tests/startup_mesh57_skeleton_check.pyok (1.2s),tests/startup_run_ps1_check.pyok (10.8s),tests/startup_run_sh_check.pyskipped (0.1s),tests/startup_sampler_heap_check.pyok (0.1s),tests/startup_shader_cache_rekey_check.pyok (2.2s),tests/startup_smem_address_check.pyok (0.1s),tests/startup_stream_fetch_check.pyok (0.2s),tests/startup_stream_interface_check.pyok (0.2s),tests/startup_translator_check.pyok (0.4s)sccache: 3/122 hits; wall273.2sAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T07:46:59Z.
@R0Y00 @MasterDomino head
106c0445(merge of currentorigin/main, no force-push). Your 12:25Z request (cross-lane byte-range proof) is answered point by point:stride * lane + offset, built fromv_mbcnt_lo/hiwith proven ops; stride and offset 4-byte aligned, inside 64 KiB for all 64 lanes. Everyds_write_b32is checked against every earlier write and itself for all lane pairs (Stage.lds_overlap). Anything unproven is refused with a message naming the missing proof.tools/startup/gfx2hlsl.py(set_v), resolved by keeping both sides: main'salign4argument and this PR's lane-read refusal. The NGG check passes after the merge.Verification:
106c0445: Linux Python checks, gfx1013 assemble and translate, Windows build and test all green.^startup_gfx2hlsl_ngg_passthrough3/3 passed in both presets (receipt comment above).python3 -B tests/startup_gfx2hlsl_ngg_passthrough_check.py(all ok), every non-GPUtests/startup_gfx2hlsl_*_check.py.Re-requesting review.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T08:58:41Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
27f400935dfc359e64150796ca8fe47d42eb80cc:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2):38.63s(configure2.70s)ctest --preset dev -R '^startup_gfx2hlsl_ngg_passthrough' --parallel 2 --no-tests=error --output-on-failure): 3/3 passed (1.54s:startup_gfx2hlsl_ngg_passthrough_warp1.24s,startup_gfx2hlsl_ngg_passthrough_hardware1.26s,startup_gfx2hlsl_ngg_passthrough0.14s)/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2):72.29s(configure2.89s)ctest --preset release -R '^startup_gfx2hlsl_ngg_passthrough' --parallel 2 --no-tests=error --output-on-failure): 3/3 passed (1.03s:startup_gfx2hlsl_ngg_passthrough_warp0.81s,startup_gfx2hlsl_ngg_passthrough_hardware0.83s,startup_gfx2hlsl_ngg_passthrough0.09s)tests/startup_gfx2hlsl_ngg_passthrough_check.pyok (0.1s)sccache: 14/22 hits; wall125.5sAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T08:58:42Z.
New head
27f40093: merged main (conflict in gfx2hlsl.py lower/_lower resolved, both sides kept), CI green, Win2025 dev and release 3/3 by name (startup_gfx2hlsl_ngg_passthrough, _warp, _hardware). Body now has the Source line. @R0Y00 @MasterDomino ready for another look.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T10:12:24Z.
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