shader: lower v_add_f32_dpp, v_or_b32_dpp, v_add_nc_u32_dpp and v_sub_f32_dpp in gfx2hlsl (Part of #1723) #2038
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!2038
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2038/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-24 23:32 UTC · original
tedin7:x2w-r20-dpp-ops→main· +301 −0 · 5 files · 5 commits · closed without mergingPart of #1723
What this unblocks: Run 20 census #15, the
_dppspellings ofv_add_f32,v_sub_f32,v_or_b32andv_add_nc_u32, but only for the lane-local controls (see the open question).The translator models one lane, so a DPP control that reads a neighbouring lane cannot be lowered correctly. The new
dpp_formacceptsquad_perm:[0,1,2,3]and the identitydpp8withrow_mask:0xf bank_mask:0xf, and translates them exactly like the plain operation (any source or output modifier travels along).quad_permwith another order,row_*,wave_*, a partial mask,bound_ctrlandfiare refused by name. Only ops inVEC_F/VEC_Uare accepted.Open question: if the census pairs mostly use cross-lane controls (for example
quad_perm:[1,0,3,2]orrow_shr), they stay refused. Lowering them needs lane or quad access, which fxc SM5 does not offer except throughddx_fine/ddy_finein pixel shaders. I did not guess that.Verification:
python3 -B tests/startup_gfx2hlsl_dpp_check.py-> PASS (on origin/main the same test fails withUnsupported: v_add_f32_dpp)python3 -B tests/startup_gfx2hlsl_swap_check.py,..._op_refusals_check.py,..._refusals_check.py,..._operand_count_check.py,..._cndmask_neg_check.py-> exit 0startup_gfx2hlsl_dppin CMakeLists.txt.AI-assisted; commands listed were executed locally.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:32 UTC · original · edited 2026-11-24 23:36 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
9bea878ℹ️ 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-24 23:36 UTC · original
This adds publicly usable DPP lowering to the startup translator, but neither
README.mdnordocs/experiments.mdis updated. The rootAGENTS.mdexplicitly requires updating one of those documents when a public capability changes. Add an experiment entry recording the identity-only DPP16/DPP8 scope, full-mask requirement, remaining refusals, and reproduction command/result so contributors can discover and reproduce this narrowly supported behavior without relying on the commit message.AGENTS.md reference: AGENTS.md:L210-L211
Useful? React with 👍 / 👎.
@denn0x on GitHub · 2026-11-25 00:55 UTC · original
I checked this against the DPP use in a private executable's pixel and vertex programs (decode only, aggregate counts):
quad_perm:[0,1,2,3]or the identitydpp8.[1,0,3,2],[2,3,0,1],[3,2,1,0][0,0,0,0],[1,1,1,1],[2,2,2,2][1,1,3,3],[0,0,2,2],[2,3,2,3],[0,1,0,1]row_mirror/row_half_mirrorbound_ctrl.v_add_f32,v_mov_b32,v_subrev_f32,v_mul_f32,v_or_b32andv_min_u32/v_max_u32.The patch looks correct to me. Every non-identity control is refused by name, so nothing is lowered silently with the wrong lane. The test passes locally (pure Python).
One small note: with the identity control and full masks, the source lane is always in range, so
bound_ctrlcannot change the result there. Refusing it is stricter than needed, but harmless.On these programs, though, the identity form never occurs, so this PR removes no refusal there. The forms that matter are the quad broadcasts and quad swaps. They need a model of the 2x2 quad, for example derivative intrinsics or quad-read intrinsics, rather than one lane. They could be a follow-up item.
I agree with the review note that a short
docs/experiments.mdentry would help: the identity-only scope, the full-mask requirement, and the refusals.@tedin7 on GitHub · 2026-11-25 00:55 UTC · original
Added a
Startup translator: lane-local DPP formsentry todocs/experiments.mdin e5abc5f0 (on the rebased branch, pending push). It records the identity-only quad_perm/dpp8 scope, the 0xf row_mask/bank_mask requirement, the refused controls and the reproduction commandpython3 -B tests/startup_gfx2hlsl_dpp_check.py(PASS).AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-25 11:03 UTC · original
Closing:
mainalready lowers quad swaps and broadcasts for these DPP ops, leaving only the identity control (measured at 0 of 19,902 DPP instructions in real programs), so this PR removes no real refusal.@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:36 UTC · original · reviewed
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
9bea878244ℹ️ 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".
Pull request closed