shader: test six untested mesh frontend refusal paths #3438

Merged
Leyukaka merged 2 commits from upstream-pr/3438 into main 2026-11-29 10:03:08 +00:00
Leyukaka commented 2026-11-29 09:04:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T09:04:14Z.


Part of #3416

Branch tests-mesh-refusal-coverage (cdd62741, 0feac9c2), based on main 41babe6e. git merge-tree with main 184b15db is clean. Test-only change to tests/native_direct_mesh_check.py (+24).

What changes

Six refused runs for checks in src/gfx1013_direct_mesh.inl that no case reached (line numbers at the branch head):

Case Refusal Source
split-branch-target mesh branch target splits instruction (SCC/VCC branch) :631
split-unconditional-branch-target same text, s_branch path :656
unproven-vcc-branch mesh VCC branch lacks a proven guest whole-wave mask :644
scalar-memory-base-out-of-range unsupported mesh scalar memory address :670
overlapping-execz-exits overlapping mesh EXECZ exits :617
indexed-root-table indexed mesh descriptor table lacks a binding contract :674

Each case asserts the refusal string. A check for any refusal would miss five of the six source mutations below, because a later check refuses the same input with another message.

Evidence

On this head, release build:

cmake --build out/build/release --target compile_dxil
ctest --test-dir out/build/release --no-tests=error -R '^native_direct_mesh$' --output-on-failure

Result: native_direct_mesh Passed. src/gfx1013_direct_mesh.inl and tests/native_direct_mesh_check.py are identical on 41babe6e and 184b15db.

Control on this head: with the expected string of overlapping-execz-exits altered, the test fails and prints the actual refusal, native compute +0x10: overlapping mesh EXECZ exits. Restored, it passes.

Source mutations were run on the previous revision (f528ce28 on main 212d4b5f, same added lines), one at a time, each reverted and rebuilt. They were not repeated on this head. Line numbers are those of the same statements at this head:

Mutation Caught by Without the check
:631 condition prefixed false && split-branch-target refused later: unproven mesh entry register 128
:656 condition prefixed false && (:631 untouched) split-unconditional-branch-target refused later: unsupported opcode 0x00001003u
:644 refusal replaced by a constant mask unproven-vcc-branch compiled to DXIL
:669 condition prefixed false && scalar-memory-base-out-of-range refused later: mesh scalar memory needs a verified guest root mapping
:617 condition prefixed false && overlapping-execz-exits refused later: mesh scalar branch crosses allocation, EXEC or export
:673 condition prefixed false && indexed-root-table refused later: direct descriptor address outside bound table

Not covered

  • No source change. The cases check that the refusal is reached. They do not check whether the accepted neighbours of these inputs lower correctly.
  • A comment in the new test cites src/gfx1013_direct_mesh.inl:649 for the s_branch check. At this head that statement is at :656.

CI

On main 184b15db the pr CTest preset filter does not match native_direct_mesh, so Build and test on Windows does not exercise this change. The command above does.

Interactions with other open mesh branches

By git merge-tree at the current heads: a textual conflict with shader-mesh-udiv-uniform (f74eacc8), because both append cases at the same spot at the end of main() in tests/native_direct_mesh_check.py. Resolution: keep both blocks; each writes its own layout before its cases. No conflict with shader-mesh-udiv-ops, shader-mesh-exec-widen, shader-mesh-exchange-nosave or mesh57-profile-mismatch-part.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5549249337 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3438). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-29T09:04:14Z. --- Part of #3416 Branch `tests-mesh-refusal-coverage` (cdd62741, 0feac9c2), based on main 41babe6e. `git merge-tree` with main 184b15db is clean. Test-only change to `tests/native_direct_mesh_check.py` (+24). ## What changes Six refused runs for checks in `src/gfx1013_direct_mesh.inl` that no case reached (line numbers at the branch head): | Case | Refusal | Source | |---|---|---| | `split-branch-target` | `mesh branch target splits instruction` (SCC/VCC branch) | :631 | | `split-unconditional-branch-target` | same text, `s_branch` path | :656 | | `unproven-vcc-branch` | `mesh VCC branch lacks a proven guest whole-wave mask` | :644 | | `scalar-memory-base-out-of-range` | `unsupported mesh scalar memory address` | :670 | | `overlapping-execz-exits` | `overlapping mesh EXECZ exits` | :617 | | `indexed-root-table` | `indexed mesh descriptor table lacks a binding contract` | :674 | Each case asserts the refusal string. A check for any refusal would miss five of the six source mutations below, because a later check refuses the same input with another message. ## Evidence On this head, release build: ``` cmake --build out/build/release --target compile_dxil ctest --test-dir out/build/release --no-tests=error -R '^native_direct_mesh$' --output-on-failure ``` Result: `native_direct_mesh` Passed. `src/gfx1013_direct_mesh.inl` and `tests/native_direct_mesh_check.py` are identical on 41babe6e and 184b15db. Control on this head: with the expected string of `overlapping-execz-exits` altered, the test fails and prints the actual refusal, `native compute +0x10: overlapping mesh EXECZ exits`. Restored, it passes. Source mutations were run on the previous revision (f528ce28 on main 212d4b5f, same added lines), one at a time, each reverted and rebuilt. They were not repeated on this head. Line numbers are those of the same statements at this head: | Mutation | Caught by | Without the check | |---|---|---| | :631 condition prefixed `false &&` | `split-branch-target` | refused later: `unproven mesh entry register 128` | | :656 condition prefixed `false &&` (:631 untouched) | `split-unconditional-branch-target` | refused later: `unsupported opcode 0x00001003u` | | :644 refusal replaced by a constant mask | `unproven-vcc-branch` | compiled to DXIL | | :669 condition prefixed `false &&` | `scalar-memory-base-out-of-range` | refused later: `mesh scalar memory needs a verified guest root mapping` | | :617 condition prefixed `false &&` | `overlapping-execz-exits` | refused later: `mesh scalar branch crosses allocation, EXEC or export` | | :673 condition prefixed `false &&` | `indexed-root-table` | refused later: `direct descriptor address outside bound table` | ## Not covered - No source change. The cases check that the refusal is reached. They do not check whether the accepted neighbours of these inputs lower correctly. - A comment in the new test cites `src/gfx1013_direct_mesh.inl:649` for the `s_branch` check. At this head that statement is at :656. ## CI On main 184b15db the `pr` CTest preset filter does not match `native_direct_mesh`, so `Build and test on Windows` does not exercise this change. The command above does. ## Interactions with other open mesh branches By `git merge-tree` at the current heads: a textual conflict with `shader-mesh-udiv-uniform` (f74eacc8), because both append cases at the same spot at the end of `main()` in `tests/native_direct_mesh_check.py`. Resolution: keep both blocks; each writes its own layout before its cases. No conflict with `shader-mesh-udiv-ops`, `shader-mesh-exec-widen`, `shader-mesh-exchange-nosave` or `mesh57-profile-mismatch-part`.
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!3438
No description provided.