feat: lower DPP quad broadcasts in the pixel translator #2135
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2143"
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-25T01:31:07Z.
Part of #2125
What this unblocks: pixel stages that broadcast one lane of a quad with DPP
quad_perm:[k,k,k,k](the coarse-derivative idiom) now translate instead of stopping at the first_dppinstruction.What changed
tools/startup/gfx2hlsl.py:v_mov_b32_dppand the VOP1/VOP2 float, integer and integer-to-float_dppforms lower to oneQuadReadLaneAt(src, k)read followed by the existing handler. Only a pixel stage with straight-line code and a known entry mask is accepted (every lane of the quad is live), with fullrow_mask/bank_maskandbound_ctrl:1or none.Pipeline.ps_profile()returnsps_6_0andtranslate_tocompiles it with DXC (X2W_DXC, Windows Kitsbin, orPATH). Every other pixel stage staysps_5_1with FXC.fi,bound_ctrl:0, non-VGPR sources, vertex stages, branches, EXEC-narrowed code.tests/startup_gfx2hlsl_dpp_quad_broadcast_check.pyplus CMake entriesstartup_gfx2hlsl_dpp_quad_broadcastandstartup_gfx2hlsl_dpp_quad_broadcast_{warp,hardware}; docs indocs/startup-runtime.md.VEC_F,VEC_U,VEC_U_TO_Fare reused unchanged;v_swap_b32_dppstays refused (swap check still passes).Verification
Run locally (Linux, no D3D12, no DXC, no llvm-mc):
python3 tests/startup_gfx2hlsl_dpp_quad_broadcast_check.py: all controls ok (fixture decode, QuadReadLaneAt per lane, ps_6_0 choice, mutation images differ, accepted forms, 20 refusals).python3 tests/startup_gfx2hlsl_swap_check.py,..._vopc_sdwa_check.py,..._op_refusals_check.py,..._bit_alu_check.py,..._cvt_alu_check.py: all pass.NOT yet run (Draft until done on Win2025):
python3 tests/startup_gfx2hlsl_dpp_quad_broadcast_check.py binary <llvm-mc>ctest --preset dev --no-tests=error -R "^startup_gfx2hlsl_dpp_quad_broadcast"(WARP draw of 16 x 16 pixels against a CPU reference; wrong-lane and own-lane mutations must fail the draw; includes the mixed DXBC vertex plus DXIL pixel pair when FXC is set, and the FXC refusal control).AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T01:47:30Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
68c282f65fℹ️ 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-25T01:37:00Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
68c282fℹ️ 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-25T01:47:30Z.
Code review location:
tools/startup/gfx2hlsl.py; line 2467The existing
fxc_environment()intests/startup_translator_check.pysubstitutesStubPipeline, which does not defineps_profile(). This call therefore raisesAttributeErrorbefore the stub compiler runs, andpython3 -B tests/startup_translator_check.pynow exits 1 with two failures in the pending/retry checks; the same test passes against the parent commit. Update that test double alongside the new interface, otherwise the registeredstartup_translatorCTest and the Linux Python-checks job fail.AGENTS.md reference: AGENTS.md:L159-L159
Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T01:47:30Z.
Code review location:
tools/startup/gfx2hlsl.py; line 781For a triangle covering only part of a 2×2 quad, the guest's entry EXEC can exclude the selected source lane even in straight-line code:
exec_knownmeans unchanged since entry, not whole-quad execution. This guard nevertheless accepts shaders that reach DPP withouts_wqm_*, and the emittedQuadReadLaneAtreads a D3D helper's computed value instead of preserving the guest DPP inactive-source behavior withfiunset. Covered edge pixels can consequently differ, while the fullscreen fixtures explicitly cover whole quads and cannot detect this case. Track proven whole-quad activity and source definition, or explicitly model inactive-source behavior.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T01:47:30Z.
Code review location:
docs/startup-runtime.md; line 1085This introduces supported DPP operations, a new compiler-selection path and a reproduction command, but updates only the runtime notes. The capability/reproduction update required by
AGENTS.mdis still absent from bothREADME.mdanddocs/experiments.md. Add the bounded support to the relevant README entry and put the reproduction details indocs/experiments.mdso the central experiment documentation reflects the new capability.AGENTS.md reference: AGENTS.md:L230-L231
Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T02:13:42Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T02:13:44Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T02:13:47Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T02:44:23Z.
I resolved the overlap with #2141. Broadcast and swap retain their respective operand handlers, use the same whole-quad EXEC proof and DXC compilation path, and each now checks that the other form is still accepted. Both draw suites passed on WARP and RTX 4060 Laptop with their wrong-lane controls. LLVM 15 assembled all four fixtures to their recorded words. Pair permutations remain a separate slice under #2140.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T02:13:42Z.
Code review location:
tools/startup/gfx2hlsl.py; line 2467Fixed in
aafa4a63: the translator test stub pipeline now definesps_profile(). Verification on Windows Server 2025 (Build 26100, MSVC 14.44, D3D12 WARP) at08e0143a: debug and releasectest -R ^startup_gfx2hlsl_dpp_quad_broadcast3/3 passed each;tests/startup_translator_check.pyandtests/docs_links_check.pyok. Linux:python3 -B tests/startup_gfx2hlsl_dpp_quad_broadcast_check.py,startup_translator_check.py,startup_buffer_address_check.py,docs_links_check.pypass.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T02:13:44Z.
Code review location:
tools/startup/gfx2hlsl.py; line 781Fixed in
08e0143a: a DPP quad broadcast is now lowered only afters_wqm exec, execwith EXEC unchanged since (whole-quad activity proven); otherwise it is refused. Fixtures carry thes_wqm; new controls cover a missings_wqmand ans_wqminto another register. Verification on Windows Server 2025 (Build 26100, MSVC 14.44, D3D12 WARP) at08e0143a: debug and releasectest -R ^startup_gfx2hlsl_dpp_quad_broadcast3/3 passed each;tests/startup_translator_check.pyandtests/docs_links_check.pyok. Linux:python3 -B tests/startup_gfx2hlsl_dpp_quad_broadcast_check.py,startup_translator_check.py,startup_buffer_address_check.py,docs_links_check.pypass.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T02:13:47Z.
Code review location:
docs/startup-runtime.md; line 1085Fixed in
08e0143a: README row for the capability and a reproduction section indocs/experiments.md;docs/startup-runtime.mdupdated. Verification on Windows Server 2025 (Build 26100, MSVC 14.44, D3D12 WARP) at08e0143a: debug and releasectest -R ^startup_gfx2hlsl_dpp_quad_broadcast3/3 passed each;tests/startup_translator_check.pyandtests/docs_links_check.pyok. Linux:python3 -B tests/startup_gfx2hlsl_dpp_quad_broadcast_check.py,startup_translator_check.py,startup_buffer_address_check.py,docs_links_check.pypass.AI-assisted; commands listed were executed locally.