gpu: name the failing part when a fixed mesh profile does not match #3442

Manually merged
github merged 3 commits from github-bot/gh-3440 into main 2026-11-29 10:08:52 +00:00 AGit
Owner

@⁠Leyukaka on GitHub · 2026-11-29 09:04 UTC · original
Leyukaka:mesh57-profile-mismatch-part → main · +76 −10 · 2 files · 3 commits · merged 2026-11-29 10:03 UTC

Part of #3418

Branch mesh57-profile-mismatch-part, head 50900f60, based on main 1a44cee5:

  • fa46de00 mesh57: name the part when a fixed mesh profile does not match
  • af406982 tests: check the slot-57 descriptor content refusal text
  • 50900f60 tests: check the slot-57 length and trailing-bytes refusal texts

git merge-tree with main 1a0120ba is clean; main has not changed the two files since 1a44cee5.

What changes

prepare_native_mesh57 compared six parts of the reviewed profile in one expression, together with the end of the file:

  • normalized descriptor
  • state_a
  • state_b
  • root blob
  • mesh shader
  • pixel shader

On any mismatch it threw a single profile input bytes differ.

The message now names the first check that fails (src/startup_stubs/native_mesh57.inl:301-319, line numbers at the branch head):

  • profile input bytes differ: <part> length <profile> != <actual> (:303)
  • profile input bytes differ: <part> content (:310)
  • profile input bytes differ: trailing bytes after the pixel shader (:319)

The prefix, the check order and the set of accepted and refused profiles are unchanged. The refusal is still logged as x2w-render native slot57 mesh %016llx refused: %s (:466).

tests/startup_indirect_draw_indexed.cpp points X2W_TRAP_LOG at the fixture's log (:2075) and requires one exact log line per message:

Message How the fixture reaches it Required text after refused:
content existing unreviewed fixed-state case, directly after const auto mismatched = create(); (:2275-2289) profile input bytes differ: normalized descriptor content
length indexed profile rewritten with lengths[0] one larger, then create() (:2301-2327) profile input bytes differ: normalized descriptor length 769 != 768
trailing bytes original header written back, one byte appended at the end of the file, then create() (:2328-2340) profile input bytes differ: trailing bytes after the pixel shader

The content check runs before the block #3435 added at the same place (:2290), so that it reads the log right after the create() under test. The length and trailing-bytes cases run after #3435's lookup-count check (:2299), so they do not change its counts.

Evidence

On 50900f60, release build of startup_indirect_draw_indexed and startup_cache_index_check, then:

ctest --test-dir out/build/release --no-tests=error -R '^(native_fixed_mesh57.*_warp|startup_cache_index.*)$'

Result: 12/12 passed, the mesh57 cases on WARP:

  • native_fixed_mesh57_{,mrt,varying,uint_heap,pixel_heap,waterfall,waterfall_fine,buffers,constant,mask}_warp
  • startup_cache_index, startup_cache_index_per_call_control

Mutations in src/startup_stubs/native_mesh57.inl, one at a time, each reverted and rebuilt (12/12 after the revert):

Head Mutation Result
50900f60 length throw prints <part> content native_fixed_mesh57_warp fails: malformed fixed mesh profile: missing log line '... refused: profile input bytes differ: normalized descriptor length 769 != 768'
50900f60 trailing-bytes text removed native_fixed_mesh57_warp fails: malformed fixed mesh profile: missing log line '... refused: profile input bytes differ: trailing bytes after the pixel shader'
af406982 content throw prints the length message all 10 native_fixed_mesh57*_warp cases fail: unreviewed fixed mesh state: missing log line '... normalized descriptor content'
af406982 " content" changed to " contents" all 10 fail, same message

The two content mutations were not repeated on 50900f60; that commit only adds lines after the content check.

Behaviour control, run on an earlier revision (base 212d4b5f, before the log check existed), not repeated since: with the memcmp for part 0 skipped, the fixtures fail on pixels, unreviewed fixed mesh state: pixel (2,0): got 0xffffffff, expected 0xff000000.

No test or document expected the old text: at the branch head, git grep "input bytes differ" -- tests docs only hits the checks in tests/startup_indirect_draw_indexed.cpp.

Not covered

  • All three messages are asserted for the normalized descriptor only. The part names of parts 1 to 5 are not checked.

CI

On main 1a0120ba the pr build preset builds startup_indirect_draw_indexed, but the pr CTest filter does not match native_fixed_mesh57*_warp. PR CI compiles the changed test file and does not run the new checks. The run above does.

Interactions with other open mesh branches

By git merge-tree at af406982: no textual conflict with the five native_direct_mesh branches; the files are disjoint. 50900f60 touches only tests/startup_indirect_draw_indexed.cpp.

**@⁠Leyukaka** on GitHub · 2026-11-29 09:04 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3440) `Leyukaka:mesh57-profile-mismatch-part` → `main` · +76 −10 · 2 files · 3 commits · merged 2026-11-29 10:03 UTC Part of #3418 Branch `mesh57-profile-mismatch-part`, head 50900f60, based on main 1a44cee5: - fa46de00 mesh57: name the part when a fixed mesh profile does not match - af406982 tests: check the slot-57 descriptor content refusal text - 50900f60 tests: check the slot-57 length and trailing-bytes refusal texts `git merge-tree` with main 1a0120ba is clean; main has not changed the two files since 1a44cee5. ## What changes `prepare_native_mesh57` compared six parts of the reviewed profile in one expression, together with the end of the file: - normalized descriptor - `state_a` - `state_b` - root blob - mesh shader - pixel shader On any mismatch it threw a single `profile input bytes differ`. The message now names the first check that fails (`src/startup_stubs/native_mesh57.inl:301-319`, line numbers at the branch head): - `profile input bytes differ: <part> length <profile> != <actual>` (:303) - `profile input bytes differ: <part> content` (:310) - `profile input bytes differ: trailing bytes after the pixel shader` (:319) The prefix, the check order and the set of accepted and refused profiles are unchanged. The refusal is still logged as `x2w-render native slot57 mesh %016llx refused: %s` (:466). `tests/startup_indirect_draw_indexed.cpp` points `X2W_TRAP_LOG` at the fixture's log (:2075) and requires one exact log line per message: | Message | How the fixture reaches it | Required text after `refused:` | |---|---|---| | content | existing unreviewed fixed-state case, directly after `const auto mismatched = create();` (:2275-2289) | `profile input bytes differ: normalized descriptor content` | | length | indexed profile rewritten with `lengths[0]` one larger, then `create()` (:2301-2327) | `profile input bytes differ: normalized descriptor length 769 != 768` | | trailing bytes | original header written back, one byte appended at the end of the file, then `create()` (:2328-2340) | `profile input bytes differ: trailing bytes after the pixel shader` | The content check runs before the block #3435 added at the same place (:2290), so that it reads the log right after the `create()` under test. The length and trailing-bytes cases run after #3435's lookup-count check (:2299), so they do not change its counts. ## Evidence On 50900f60, release build of `startup_indirect_draw_indexed` and `startup_cache_index_check`, then: ``` ctest --test-dir out/build/release --no-tests=error -R '^(native_fixed_mesh57.*_warp|startup_cache_index.*)$' ``` Result: 12/12 passed, the mesh57 cases on WARP: - `native_fixed_mesh57_{,mrt,varying,uint_heap,pixel_heap,waterfall,waterfall_fine,buffers,constant,mask}_warp` - `startup_cache_index`, `startup_cache_index_per_call_control` Mutations in `src/startup_stubs/native_mesh57.inl`, one at a time, each reverted and rebuilt (12/12 after the revert): | Head | Mutation | Result | |---|---|---| | 50900f60 | length throw prints `<part> content` | `native_fixed_mesh57_warp` fails: `malformed fixed mesh profile: missing log line '... refused: profile input bytes differ: normalized descriptor length 769 != 768'` | | 50900f60 | trailing-bytes text removed | `native_fixed_mesh57_warp` fails: `malformed fixed mesh profile: missing log line '... refused: profile input bytes differ: trailing bytes after the pixel shader'` | | af406982 | content throw prints the length message | all 10 `native_fixed_mesh57*_warp` cases fail: `unreviewed fixed mesh state: missing log line '... normalized descriptor content'` | | af406982 | `" content"` changed to `" contents"` | all 10 fail, same message | The two content mutations were not repeated on 50900f60; that commit only adds lines after the content check. Behaviour control, run on an earlier revision (base 212d4b5f, before the log check existed), not repeated since: with the memcmp for part 0 skipped, the fixtures fail on pixels, `unreviewed fixed mesh state: pixel (2,0): got 0xffffffff, expected 0xff000000`. No test or document expected the old text: at the branch head, `git grep "input bytes differ" -- tests docs` only hits the checks in `tests/startup_indirect_draw_indexed.cpp`. ## Not covered - All three messages are asserted for the normalized descriptor only. The part names of parts 1 to 5 are not checked. ## CI On main 1a0120ba the `pr` build preset builds `startup_indirect_draw_indexed`, but the `pr` CTest filter does not match `native_fixed_mesh57*_warp`. PR CI compiles the changed test file and does not run the new checks. The run above does. ## Interactions with other open mesh branches By `git merge-tree` at af406982: no textual conflict with the five `native_direct_mesh` branches; the files are disjoint. 50900f60 touches only `tests/startup_indirect_draw_indexed.cpp`.
prepare_native_mesh57 compared six parts of the reviewed profile
(normalized descriptor, state_a, state_b, root blob, mesh shader,
pixel shader) and the end of the file in one expression and threw a
single "profile input bytes differ". The message now names the first
failing check: the part and whether its length or its content differs,
or trailing bytes after the pixel shader. The prefix, the check order
and the set of accepted and refused profiles are unchanged.
Capture the fixture's log and require the exact refusal line for the
unreviewed fixed mesh state, so a wrong part name or message fails.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 09:04:57 +00:00
github manually merged commit a63e1429d9 into main 2026-11-29 10:08:52 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.