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

Merged
SimSalabimse merged 4 commits from upstream-pr/2657 into main 2026-11-26 01:27:28 +00:00
SimSalabimse commented 2026-11-26 00:55:21 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-26T00:55:21Z.


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.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6617004795 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2657). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-26T00:55:21Z. --- ## 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. ```bash 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: ```powershell 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 - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets.
upstream-sync closed this pull request 2026-11-26 02:04:57 +00:00
tedin7 commented 2026-11-26 02:04:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T01:25:07Z.

Review: COMMENTED


Review of head f84124ee (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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6067309005 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2657#pullrequestreview-6067309005). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T01:25:07Z. **Review:** COMMENTED --- Review of head f84124ee (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.
R0Y00 commented 2026-11-26 02:05:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T01:21:03Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179686144 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2657#issuecomment-7179686144). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T01:21:03Z. --- 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!2649
No description provided.