shader: lower export target null in gfx2hlsl (Part of #1723) #2019
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2026"
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:26:58Z.
Part of #1723
What this unblocks: Run 20 census #11 (45 pairs).
exp null, off, off, off, off done vm(a pixel shader that only discards) was refused asexport target null, and a shader whose only export is null was classifiedother. The null target now writes nothing and keeps thevmdiscard; the classifier treats it as a pixel shader.Verification:
python3 -B tests/startup_gfx2hlsl_export_null_check.pyon the branch:all ok, exit 0.tools/startup/gfx2hlsl.pychange reverted: exit 1 (export target null, classifiedother).startup_gfx2hlsl_export_nullin CMakeLists.txt.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:31:40Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
7d0bae666dℹ️ 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:53:32Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:27:09Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
7d0bae6ℹ️ 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:31:41Z.
Code review location:
tools/startup/gfx2hlsl.py; line 1582For compressed null encodings with a non-pair EN mask, the decoder appends an
en:token (tools/disasm_rdna2.py:2664–2667); for example,0xf8001c91produces an export ending indone compr vm en:0x1. The regex above absorbs that entire suffix into the last operand, leavingflagsempty, and this new return accepts the instruction while silently droppingvm. A pure-Python translation ofs_mov_b64 exec, 0followed by that export generates a pixel shader withoutdiscard, so a depth-enabled draw can retain killed pixels instead of rejecting the unmodelled encoding as before. Reject unparsed export modifiers or preserve the VM bit before returning.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T00:53:32Z.
Code review location:
tools/startup/gfx2hlsl.py; line 1582Checked:
export()already rejects anyen:flag before the null path (the lazy regex splitsdone compr vm en:0x1into flags correctly), so0xf8001c91raises Unsupported andvmis never dropped. Pinned with a regression test in68b09062(rebased on main, push pending from host). Command run:python3 -I tests/startup_gfx2hlsl_export_null_check.py-> all ok.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T11:01:30Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T11:01:30Z.
Code review location:
tools/startup/gfx2hlsl.py; line 1582Re-checked on current head
68b09062:export()rejects anyen:flag before the null path, with a test in tests/startup_gfx2hlsl_export_null_check.py (68b09062). Resolving. AI-assisted; commands listed were executed locally.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T13:51:38Z.
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 lambirou on 2026-11-25T22:17:32Z.
@tedin7 I found this closed PR after starting a separate
exp nullimplementation. Your semantics are the right ones: the null target writes no channel butvmstill discards. I am not opening a competing PR.I added a draw fixture on top of your branch:
startup/export-null-drawon my forkgithub.com/lambirou/Xbox2Windows@7ee0b6d7(7ee0b6d7, parent68b0906)tests/startup_gfx2hlsl_export_null_draw_check.py,CMakeLists.txt,docs/experiments.mdtools/startup/gfx2hlsl.py; this keeps yourvmdiscard exactly.The draw compiles a colour export followed by
exp null, off, off, off, off donewith DXCps_6_0, draws 4x4 pixels throughoffscreen_check --startup-pixel-words, and compares all 64 words with the four constants. The negative control writesmrt0 = 0from the null site and must producepixel mismatch.CMakeLists.txtregistersstartup_gfx2hlsl_export_null_draw_{warp,hardware}withSKIP_RETURN_CODE 77; the hardware case ran here on the RX 9060 XT, debug layer unavailable.tests/docs_links_check.pyandtests/bidi_controls_check.pypass, andgit diff --checkis clean.Please take this commit when you reopen the PR, or tell me to fold it into your branch after the rebase. It adds only the draw coverage and documentation.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:11:39Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
7f1ece4107ef754df649b15c110e0604a1a07fee:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2):1.48s(configure1.98s)ctest --preset dev -R 'startup_gfx2hlsl_export_null' --parallel 2 --no-tests=error --output-on-failure): 3/3 passed (0.54s:startup_gfx2hlsl_export_null0.09s,startup_gfx2hlsl_export_null_draw_warp0.33s,startup_gfx2hlsl_export_null_draw_hardware0.34s)/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2):1.06s(configure2.03s)ctest --preset release -R 'startup_gfx2hlsl_export_null' --parallel 2 --no-tests=error --output-on-failure): 3/3 passed (0.50s:startup_gfx2hlsl_export_null0.09s,startup_gfx2hlsl_export_null_draw_warp0.30s,startup_gfx2hlsl_export_null_draw_hardware0.29s)tests/mesh_heap_sampler_check.pyok (0.7s),tests/startup_buffer_address_check.pyok (0.5s),tests/startup_buffer_format_word3_table_check.pyok (0.1s),tests/startup_compute_request_offline_check.pyok (0.5s),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.7s),tests/startup_gfx2hlsl_capture_check.pyok (1.0s),tests/startup_gfx2hlsl_cmp16_check.pyok (0.3s),tests/startup_gfx2hlsl_compare_dst_check.pyok (0.1s),tests/startup_gfx2hlsl_compute_check.pyok (0.4s),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.2s),tests/startup_gfx2hlsl_cvt_pk_int16_check.pyok (0.2s),tests/startup_gfx2hlsl_f32_lg_check.pyok (1.1s),tests/startup_gfx2hlsl_f32_nan_check.pyok (4.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.1s),tests/startup_gfx2hlsl_image_arity_check.pyok (0.1s),tests/startup_gfx2hlsl_image_get_lod_check.pyok (0.1s),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_overwrite_check.pyok (0.1s),tests/startup_gfx2hlsl_operand_count_check.pyok (0.3s),tests/startup_gfx2hlsl_pack_absdiff_check.pyok (2.2s),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.5s),tests/startup_gfx2hlsl_root_check.pyok (0.7s),tests/startup_gfx2hlsl_sad_check.pyok (0.3s),tests/startup_gfx2hlsl_saveexec_same_reg_check.pyok (0.1s),tests/startup_gfx2hlsl_scalar_arity_check.pyok (0.2s),tests/startup_gfx2hlsl_scalar_brev_fold_check.pyok (0.2s),tests/startup_gfx2hlsl_scalar_m0_check.pyok (0.1s),tests/startup_gfx2hlsl_scalar_table_arity_check.pyok (0.2s),tests/startup_gfx2hlsl_sdwa_cvt_check.pyok (0.2s),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.5s),tests/startup_gfx2hlsl_sopk_accum_check.pyok (0.8s),tests/startup_gfx2hlsl_sopk_signext_check.pyok (0.1s),tests/startup_gfx2hlsl_swap_check.pyok (0.2s),tests/startup_gfx2hlsl_vopc_sdwa_check.pyok (4.0s),tests/startup_gfx2hlsl_waitcnt_depctr_check.pyok (0.1s),tests/startup_gfx2hlsl_watch_check.pyok (2.5s),tests/startup_image_2d_array_check.pyok (0.2s),tests/startup_image_3d_check.pyok (0.1s),tests/startup_image_gather_lz_check.pyok (0.5s),tests/startup_image_load_d16_check.pyok (0.9s),tests/startup_image_sample_a16_check.pyok (0.2s),tests/startup_image_sample_b_check.pyok (0.2s),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.5s),tests/startup_inline_sampler_check.pyok (0.1s),tests/startup_mesh57_skeleton_check.pyok (0.4s),tests/startup_run_ps1_check.pyok (8.6s),tests/startup_run_sh_check.pyskipped (0.1s),tests/startup_sampler_heap_check.pyok (0.1s),tests/startup_shader_cache_rekey_check.pyok (1.6s),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: 8/17 hits; wall62.9sAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:11:40Z.
@MasterDomino #2026 is ready for review and merge.
What changed:
maininto the branch (clean merge, no conflicts).exp nullaftermrt0, read back and compared with the expected pixels, plus a negative control. The fixture comes from @lambirou's commit7ee0b6d7, kept with their authorship.offscreen_checkbuild line and removed hardware claims we did not run.Head:
7f1ece41. CI is green. Win2025 dev and release both passed on this head (receipt in the comment above).Open point from pre-review: a pixel shader with only a null export has no draw test yet.
AI-assisted; commands listed were executed locally.