shader: test back-edges in both mesh descriptor join branches #2283

Merged
RavenCurseBurg merged 1 commit from upstream-pr/2291 into main 2026-11-25 10:59:13 +00:00
RavenCurseBurg commented 2026-11-25 10:24:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T10:24:23Z.


Follow-up to the review of #2285. It identified two uses of the signed gfx1013 branch displacement in descriptor joins that could individually be removed without a test failing.

The existing per-material fixture loads a selector into SCC at run time. The first control makes the conditional split branch to itself in LLVM 15's unsigned spelling. The second does the same at the branch that ends the fall-through arm. Its unreachable padding puts an instruction exactly at the address a mistaken unsigned read would choose. Without that instruction, the wrong address and the backward branch produce the same refusal, masking the regression.

Verification

  • At 0008525c with these tests, temporarily restoring the old unsigned read in the dynamic SCC split alone failed with KeyError: 262184. Restoring it only in the arm-ending branch produced Unsupported instruction inside a descriptor join arm where the test requires Expected a forward mesh branch. Restoring the signed read made both tests pass.
  • python -B tools/run_checks_parallel.py tests/mesh_join_descriptor_check.py tests/mesh_dynamic_aot_check.py tests/mesh_dynamic_geometry_check.py tests/mesh_scc_any_lane_check.py tests/mesh_lane_spill_check.py tests/docs_links_check.py tests/bidi_controls_check.py passed 7/7. git diff --check passed.
  • python -B tests/mesh_join_descriptor_check.py <dxc> <offscreen_check> warp and the same command with hardware completed. Each adapter ran eight draws of the existing positive fixtures, with 1,024 pixels compared per draw and zero mismatches. WARP 10.0.26100.9711 and desktop RTX 4060 driver 32.0.15.9579 on Windows build 26100.9711. The local debug layer was unavailable. The two new branch controls execute in the host translator before drawing.

The changes are confined to the registered mesh join test. AI-assisted with Codex.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6602319653 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2291). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T10:24:23Z. --- Follow-up to the [review of #2285](https://github.com/R0Y00/Xbox2Windows/pull/2285). It identified two uses of the signed gfx1013 branch displacement in descriptor joins that could individually be removed without a test failing. The existing per-material fixture loads a selector into SCC at run time. The first control makes the conditional split branch to itself in LLVM 15's unsigned spelling. The second does the same at the branch that ends the fall-through arm. Its unreachable padding puts an instruction exactly at the address a mistaken unsigned read would choose. Without that instruction, the wrong address and the backward branch produce the same refusal, masking the regression. ### Verification - At `0008525c` with these tests, temporarily restoring the old unsigned read in the dynamic SCC split alone failed with `KeyError: 262184`. Restoring it only in the arm-ending branch produced `Unsupported instruction inside a descriptor join arm` where the test requires `Expected a forward mesh branch`. Restoring the signed read made both tests pass. - `python -B tools/run_checks_parallel.py tests/mesh_join_descriptor_check.py tests/mesh_dynamic_aot_check.py tests/mesh_dynamic_geometry_check.py tests/mesh_scc_any_lane_check.py tests/mesh_lane_spill_check.py tests/docs_links_check.py tests/bidi_controls_check.py` passed 7/7. `git diff --check` passed. - `python -B tests/mesh_join_descriptor_check.py <dxc> <offscreen_check> warp` and the same command with `hardware` completed. Each adapter ran eight draws of the existing positive fixtures, with 1,024 pixels compared per draw and zero mismatches. WARP 10.0.26100.9711 and desktop RTX 4060 driver 32.0.15.9579 on Windows build 26100.9711. The local debug layer was unavailable. The two new branch controls execute in the host translator before drawing. The changes are confined to the registered mesh join test. AI-assisted with Codex.
upstream-sync closed this pull request 2026-11-25 11:02:22 +00:00
tedin7 commented 2026-11-25 11:02:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T10:29:41Z.

Review: COMMENTED


Review of head 79ad0720af (tests only, tests/mesh_join_descriptor_check.py, +14).

Findings: 0 P1, 0 P2.

  • Both new cases target real guards in tools/mesh_entry_aot.py (join_arms): the target <= pc check and the jumps[join_offset] <= target check on the arm latch.
  • SIMM16 = -1 printed as 65535 is the correct unsigned form for a branch to itself. The second case places a real instruction at the unsigned destination, so a missing destination cannot give the same refusal by accident. Good.
  • No other open PR covers this slice.

Commands executed locally:

  • python3 tests/mesh_join_descriptor_check.py -> ok
  • python3 tests/docs_links_check.py -> 18 files, 436 links ok
  • python3 tests/bidi_controls_check.py -> no bidi controls
  • git diff --check origin/main...HEAD -> clean
  • Mutation 1: target <= pc replaced by False in join_arms -> new test FAILS (Wrong refusal ... Undefined branch predicate). Reverted.
  • Mutation 2: removed or jumps[join_offset] <= target -> new test FAILS (Wrong refusal ... A scalar register is defined in only one join arm). Reverted.
  • CI: Build and test on Windows = pass.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6055869505 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2291#pullrequestreview-6055869505). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T10:29:41Z. **Review:** COMMENTED --- Review of head 79ad0720af808237bd94b2d2f7e9774636b8e763 (tests only, `tests/mesh_join_descriptor_check.py`, +14). Findings: 0 P1, 0 P2. - Both new cases target real guards in `tools/mesh_entry_aot.py` (`join_arms`): the `target <= pc` check and the `jumps[join_offset] <= target` check on the arm latch. - SIMM16 = -1 printed as 65535 is the correct unsigned form for a branch to itself. The second case places a real instruction at the unsigned destination, so a missing destination cannot give the same refusal by accident. Good. - No other open PR covers this slice. Commands executed locally: - `python3 tests/mesh_join_descriptor_check.py` -> ok - `python3 tests/docs_links_check.py` -> 18 files, 436 links ok - `python3 tests/bidi_controls_check.py` -> no bidi controls - `git diff --check origin/main...HEAD` -> clean - Mutation 1: `target <= pc` replaced by `False` in `join_arms` -> new test FAILS (`Wrong refusal ... Undefined branch predicate`). Reverted. - Mutation 2: removed `or jumps[join_offset] <= target` -> new test FAILS (`Wrong refusal ... A scalar register is defined in only one join arm`). Reverted. - CI: `Build and test on Windows` = pass. AI-assisted; commands listed were executed locally.
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!2283
No description provided.