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

Manually merged
github merged 1 commit from gh-pr/2291/head into gh-pr/2291/base 2026-11-27 00:13:05 +00:00
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-25 10:24 UTC · original
RavenCurseBurg:tests/mesh-descriptor-join-backedge → main · +14 −0 · 1 files · 1 commits · merged 2026-11-25 10:59 UTC

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.

**@⁠RavenCurseBurg** on GitHub · 2026-11-25 10:24 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2291) `RavenCurseBurg:tests/mesh-descriptor-join-backedge` → `main` · +14 −0 · 1 files · 1 commits · merged 2026-11-25 10:59 UTC Follow-up to the [review of #2285](https://git.gtahub.st/github/R0Y00--Xbox2Windows/pulls/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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:13:04 +00:00
github manually merged commit 79ad0720af into gh-pr/2291/base 2026-11-27 00:13:05 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-25 10:29 UTC · original · reviewed

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.

**@⁠tedin7** on GitHub · 2026-11-25 10:29 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2291#pullrequestreview-6055869505) · **reviewed** 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.