shader: add NGG pass-through lowering dropping LDS round-trip in gfx2hlsl (Part of #1723) #2096
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!2096
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2096/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@tedin7 on GitHub · 2026-11-25 00:14 UTC · original
tedin7:x2w-b4-ngg-passthrough→main· +497 −0 · 6 files · 15 commits · closed without mergingPart 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.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 00:14 UTC · original · edited 2026-11-25 00:23 UTC
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.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 00:22 UTC · original
If 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 👍 / 👎.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 00:22 UTC · original
In 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 👍 / 👎.
@ -4827,1 +4834,4 @@"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_calculated_target_check.py")# Startup shader translator: NGG vertex pass-through, LDS round trip dropped (#1723).add_test(NAME startup_gfx2hlsl_ngg_passthrough COMMAND "${INTAKE_PYTHON}" -B"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_ngg_passthrough_check.py")@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 00:22 UTC · original
This 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 👍 / 👎.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 00:22 UTC · original
For 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 👍 / 👎.
@tedin7 on GitHub · 2026-11-25 01:05 UTC · original
Fixed 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.
@tedin7 on GitHub · 2026-11-25 01:05 UTC · original
Fixed 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.
@ -4827,1 +4834,4 @@"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_calculated_target_check.py")# Startup shader translator: NGG vertex pass-through, LDS round trip dropped (#1723).add_test(NAME startup_gfx2hlsl_ngg_passthrough COMMAND "${INTAKE_PYTHON}" -B"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_ngg_passthrough_check.py")@tedin7 on GitHub · 2026-11-25 01:05 UTC · original
Fixed 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.
@tedin7 on GitHub · 2026-11-25 01:05 UTC · original
Fixed 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.
@tedin7 on GitHub · 2026-11-25 13:50 UTC · original
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.
@tedin7 on GitHub · 2026-11-25 23:24 UTC · original
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.
@tedin7 on GitHub · 2026-11-25 23:25 UTC · original
@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.
@tedin7 on GitHub · 2026-11-26 03:42 UTC · original
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.
@tedin7 on GitHub · 2026-11-26 03:42 UTC · original
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.
@tedin7 on GitHub · 2026-11-26 03:42 UTC · original
@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.
@tedin7 on GitHub · 2026-11-26 07:46 UTC · original
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.
@tedin7 on GitHub · 2026-11-26 07:46 UTC · original
@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.
@tedin7 on GitHub · 2026-11-26 08:58 UTC · original
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.
@tedin7 on GitHub · 2026-11-26 08:58 UTC · original
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.
@tedin7 on GitHub · 2026-11-26 10:12 UTC · original
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.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 00:22 UTC · original · reviewed
💡 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".
@R0Y00 on GitHub · 2026-11-25 12:25 UTC · original · requested changes
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.
@MasterDomino on GitHub · 2026-11-26 07:35 UTC · original · reviewed
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.
Pull request closed