Skip to content

runtime: key slot 57 profiles by stable descriptor fields - #3748

Open
lambirou wants to merge 3 commits into
R0Y00:mainfrom
lambirou:codex/mesh57-profile-key
Open

lambirou wants to merge 3 commits into
R0Y00:mainfrom
lambirou:codex/mesh57-profile-key

Conversation

@lambirou

@lambirou lambirou commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

The slot 57 profile name was derived from the descriptor produced by
normalize_mesh57_descriptor, which keeps the relative section and shader
record offsets because the stream key uses them. Those offsets change with the
process allocation, so a profile authored from one run never matched the next
one: the 180 s run reported profile_absent 10 726 and ready 0, and two
captured variants with identical state blocks still produced different names.

This adds stable_mesh57_profile_descriptor, which clears the pointer and
relocation words of the 0x300-byte descriptor while keeping sizes, formats and
scalar state. The stable form names and finds <variant>.mesh57-state, and
the stored descriptor is compared after the same normalization; the stream-key
normalization and its test are unchanged. The Python authoring tools write and
validate the stable name, and mesh57_pixel_entry.py compares the descriptor
in the stable form.

Validation (Windows, Release; AMD Radeon RX 9060 XT for the hardware run):

  • ctest --preset release --no-tests=error -R '^(native_fixed_mesh57(_mrt)?_warp|startup_indirect_mesh_create_result_warp)$'
    — 3/3 pass; the fixture prints mesh57 profile key: relocations collapse, metadata/scalar differ, idempotent.
  • The two captures 4d90315b3d7500e2 and b92ce68218bb5610 now both derive
    9482ea4411e1e03f; the profile is 15 344 bytes and passes
    mesh57_profile.py --check.
  • A 180 s title run with X2W_NATIVE_SHADERS now opens the profile and reaches
    lowering_reached 1; the remaining refusal is the separate
    mesh heap descriptor address form at +0x614.
  • mesh57_profile_draft_check.py, startup_mesh57_depth_only_check.py,
    docs_links_check.py and startup_tools_lint_check.py tools/startup pass.

Refs #3497
Refs #3724

@Leyukaka Leyukaka left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The profile key and stored-descriptor comparison both discard bytes even when the descriptor layout is unrecognized. Consider two 0x300-byte descriptors with an unrecognized marker at +0x11c. They differ only at +0x1b8 (0x40 versus 0x80), with the same shaders and state blocks. Both select the same profile and pass its descriptor check. Please preserve the unclassified bytes or reject that layout, and add a negative test showing that a profile generated for one cannot authorize the other.

The shared-base fixture in #3730 shifts the values at +0x188, +0x1c8 and +0x2e8 together. Those bytes still participate verbatim in this profile key, so that relocation can prevent lookup of a matching profile. Please reconcile the two changes and test both a common shift (same profile key) and a change to the spacing (different key).

@lambirou

lambirou commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. Both points are addressed in 15df9040.

Layout gate and unclassified bytes. stable_mesh57_profile_descriptor now first recognizes the same 0x300 layout as normalize_mesh57_descriptor/ #3730: +0x11c and +0x27c must be 0x04010000, +0x48/+0x50 zero, +0x30/+0x70 non-zero, and the ten required record pointers must be within INT32_MAX of the +0x38 section base. Any other 0x300 descriptor is returned unchanged. The negative test uses an unknown +0x11c and +0x1b8 0x40 versus 0x80: the stable bytes and profile keys differ, so a profile generated for one cannot pass the stored-descriptor check for the other. Optional pointers +0x198, +0x1b8, +0x1d8, +0x2f8 are made relative only when they are near the section.

#3730 second base. The 32-bit values at +0x188, +0x1a8, +0x1c8, +0x2e8 are now reduced to their distance from the first valid value. A common shift gives the same key; changing the spacing from 0x2f100 to 0x2f200 gives a different key. Small values such as 0x40/0x80 stay metadata and still distinguish profiles. +0x188/+0x1a8/+0x1c8/+0x2e8 are not cleared.

The two survey captures 4d90315b3d7500e2 and b92ce68218bb5610 now both map to profile key 1387cf9e765e57ad.

Tests:

ctest --preset release --no-tests=error -R '^(startup_indirect_mesh_create_result_warp|native_fixed_mesh57(_mrt)?_(warp|hardware))$' -j 1
5/5 passed

python -B tests/mesh57_profile_draft_check.py
slot 57 profile draft, review, depth-only and refusal checks passed

python -B tests/docs_links_check.py
208 Markdown files, 802 links: passed

python -B tests/native_direct_mesh_check.py .../compile_dxil.exe <DXC dir>
mesh allocation, indexed outputs, group exchange and negative controls passed

normalize_mesh57_descriptor and its stream-key test are unchanged.

Refs #3497 #3724

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