Skip to content

startup: accept entry-prefix DPP broadcasts when a later loop exists - #2657

Merged
R0Y00 merged 4 commits into
R0Y00:mainfrom
SimSalabimse:cursor/dpp-broadcast-in-loop-e885
Nov 26, 2026
Merged

R0Y00 merged 4 commits into
R0Y00:mainfrom
SimSalabimse:cursor/dpp-broadcast-in-loop-e885

Conversation

@SimSalabimse

@SimSalabimse SimSalabimse commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Change

Refs #2618 (batch M200-01, ticket M200-01/003) and #2125 item A.

The pixel translator refused every DPP16 quad_perm:[k,k,k,k] broadcast once the stage contained any branch, including a later uniform loop that never touches EXEC. That matches the M200-01/003 shape (broadcast early, loop later).

  • Stage.dpp_broadcast no longer gates on has_branches alone.
  • Entry-prefix proof kept: pixel stage, empty blocks, exec_known, wqm_exec after s_wqm exec, exec.
  • Still refused: broadcast after a branch target, divergent EXEC before the broadcast, missing WQM, vertex stage, and the existing bad DPP controls.
  • Fixture adds a four-distinct-lane integer program with a two-trip scalar loop after the broadcasts (same CPU lane reference as the integer image), plus after-branch and divergent-EXEC refusals. WARP/hardware draws cover the new loop kind.

AI-assisted.

Verification

Commit under test: this PR head.

python3 -B tests/startup_gfx2hlsl_dpp_quad_broadcast_check.py
# all ok (includes loop fixture + divergent refusal)

python3 -B tests/docs_links_check.py
python3 -B tests/startup_gfx2hlsl_handler_arity_check.py

All passed on Linux. This agent could not run DXC / WARP / hardware draws.

Windows verification:

ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_dpp_quad_broadcast' -V

Expect: controls pass; startup_gfx2hlsl_dpp_quad_broadcast_warp matches all 256 pixels for integer, float and loop (wrong-lane / own-lane mutations fail the reference); hardware may pass or skip 77.

Evidence and follow-up

  • Source-built gfx1013 words (hand encodings + decoder round-trip); no retail bytes.
  • Independent Python quad-lane reference (not the lowering text).
  • Negative controls: wrong-lane / own-lane mutations; after-branch and divergent-EXEC refusals.
  • Does not claim the 17 Q rows are verified against capture; that needs a capture root replay.
  • Broadcasts after a branch target remain refused on purpose.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

A later uniform loop used to refuse every DPP16 quad broadcast in the
same pixel stage via has_branches, even when the broadcast still ran in
the entry prefix under s_wqm with EXEC unchanged (M200-01/003). Keep the
blocks/exec/wqm gates so a broadcast after a branch target or with
divergent EXEC stays refused. Extend the broadcast fixture with a loop
case, divergent control, and the same CPU lane reference for draws.

Refs R0Y00#2618, R0Y00#2125

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
cursoragent and others added 3 commits November 26, 2026 01:15
Split the non-ps check from the entry-prefix gate so
startup_gfx2hlsl_cvt_off_f32_i4_check still matches
"straight-line pixel stage" while later loops stay accepted.

Refs R0Y00#2618

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>

R0Y00 commented Nov 26, 2026

Copy link
Copy Markdown
Owner

I kept your vertex diagnostic fix in f4d84e83 and pushed 3e12adf8 on top. The old guard also accepted a loop whose branch targets offset zero, because the block list is empty when the translator first sees the broadcast. This uses the translator's existing entry-prefix proof and adds a control with an actual back edge to offset zero. The original vertex refusal and the new back-edge control pass. DXC draws of the integer, float and later-loop fixtures matched all 256 pixels on both WARP and RTX 4060 Laptop. Wrong-lane and self-lane controls still differ.

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of head f84124e (main merged in), comment only.

Checked:

  • Stage.dpp_broadcast now gates on past_entry (set at gfx2hlsl.py:2731 from blocks or a branch to offset 0) plus exec_known and wqm_exec, instead of has_branches. This keeps the proof: the broadcast must sit in the entry prefix, with EXEC equal to the s_wqm exec, exec mask. A later loop or forward branch cannot reach back to the prefix, so the whole quad is still active. Vertex stage stays refused.
  • Sibling gates (the fi:1 form near line 3462 and the other has_branches users) are unchanged and still conservative.
  • No other open or merged PR covers this slice (searched DPP broadcast / quad_perm: #2140, #2143, #2483 are the earlier forms this extends).
  • Test: the new loop fixture runs the same four-lane integer program with a two-trip scalar loop against an independent CPU lane reference, with wrong-lane and own-lane mutations, plus refusals for broadcast after a branch target, branch back to the entry block, and divergent EXEC.

Commands run (Linux, on the head):

  • python3 -B tests/startup_gfx2hlsl_dpp_quad_broadcast_check.py -> all ok
  • python3 -B tests/docs_links_check.py, python3 -B tests/bidi_controls_check.py, python3 -B tests/startup_gfx2hlsl_handler_arity_check.py -> ok
  • git diff --check origin/main...HEAD -> clean
  • Mutation: replacing the past_entry gate with False makes the check FAIL ("broadcast after a branch target", "branch back to the broadcast entry block" refusals), so the new refusals guard the behavior.
  • CI on this head: all required jobs green.

Scope note: this is fixture and code review only. The PR refers to the M200-01/003 shape but does not claim a verified startup advance; no executable result is claimed here. Win2025 WARP receipt follows in a separate comment.

AI-assisted; commands listed were executed locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants