Skip to content

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

Merged
JohnConnorNPC merged 3 commits into
R0Y00:mainfrom
Leyukaka:mesh57-profile-mismatch-part
Nov 29, 2026
Merged

JohnConnorNPC merged 3 commits into
R0Y00:mainfrom
Leyukaka:mesh57-profile-mismatch-part

Conversation

@Leyukaka

@Leyukaka Leyukaka commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #3416

Branch mesh57-profile-mismatch-part, head 50900f6, based on main 1a44cee:

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

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

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 #3433 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 #3433's lookup-count check (:2299), so they do not change its counts.

Evidence

On 50900f6, 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
50900f6 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'
50900f6 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'
af40698 content throw prints the length message all 10 native_fixed_mesh57*_warp cases fail: unreviewed fixed mesh state: missing log line '... normalized descriptor content'
af40698 " content" changed to " contents" all 10 fail, same message

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

Behaviour control, run on an earlier revision (base 212d4b5, 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 1a0120b 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 af40698: no textual conflict with the five native_direct_mesh branches; the files are disjoint. 50900f6 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.
@JohnConnorNPC
JohnConnorNPC merged commit a63e142 into R0Y00:main Nov 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants