runtime: key slot 57 profiles by stable descriptor fields #3750
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3750
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3748"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@lambirou on GitHub · 2026-12-01 14:53 UTC · original
lambirou:codex/mesh57-profile-key→main· +337 −19 · 9 files · 4 commits · closed without mergingThe slot 57 profile name was derived from the descriptor produced by
normalize_mesh57_descriptor, which keeps the relative section and shaderrecord 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 726andready 0, and twocaptured variants with identical state blocks still produced different names.
This adds
stable_mesh57_profile_descriptor, which clears the pointer andrelocation words of the 0x300-byte descriptor while keeping sizes, formats and
scalar state. The stable form names and finds
<variant>.mesh57-state, andthe 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.pycompares the descriptorin 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.4d90315b3d7500e2andb92ce68218bb5610now both derive9482ea4411e1e03f; the profile is 15 344 bytes and passesmesh57_profile.py --check.X2W_NATIVE_SHADERSnow opens the profile and reacheslowering_reached 1; the remaining refusal is the separatemesh heap descriptor addressform at+0x614.mesh57_profile_draft_check.py,startup_mesh57_depth_only_check.py,docs_links_check.pyandstartup_tools_lint_check.py tools/startuppass.Refs #3499
Refs #3726
@Leyukaka on GitHub · 2026-12-01 15:31 UTC · original · requested changes
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 #3732 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 on GitHub · 2026-12-01 16:11 UTC · original
Thanks. Both points are addressed in
15df9040.Layout gate and unclassified bytes.
stable_mesh57_profile_descriptornow first recognizes the same 0x300 layout asnormalize_mesh57_descriptor/ #3732:+0x11cand+0x27cmust be0x04010000,+0x48/+0x50zero,+0x30/+0x70non-zero, and the ten required record pointers must be withinINT32_MAXof the+0x38section base. Any other 0x300 descriptor is returned unchanged. The negative test uses an unknown+0x11cand+0x1b80x40versus0x80: 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,+0x2f8are made relative only when they are near the section.#3730 second base. The 32-bit values at
+0x188,+0x1a8,+0x1c8,+0x2e8are now reduced to their distance from the first valid value. A common shift gives the same key; changing the spacing from0x2f100to0x2f200gives a different key. Small values such as0x40/0x80stay metadata and still distinguish profiles.+0x188/+0x1a8/+0x1c8/+0x2e8are not cleared.The two survey captures
4d90315b3d7500e2andb92ce68218bb5610now both map to profile key1387cf9e765e57ad.Tests:
normalize_mesh57_descriptorand its stream-key test are unchanged.Refs #3499 #3726
@lambirou on GitHub · 2026-12-02 14:46 UTC · original · reviewed
Re-reviewed
c71ba7f8after the layout-gating fix. Read the delta, not built here.Verdict: approve. The profile key now returns the descriptor byte-for-byte when the extended layout is not recognized, so an unknown 0x300 descriptor cannot collide by discarding bytes. For a recognized layout, the optional record pointers become section-relative and the four second-base words keep only their spacing.
The PR is still
DIRTYagainst main; rebase and rerun the profile-draft check before merge.c71ba7f8fdto47a6053766@lambirou on GitHub · 2026-12-02 18:52 UTC · original
Superseded by #3732 (
33c8ef57), which implements the same stable slot 57 descriptor key inormalize_mesh57_descriptor with layout version 2, and already gates unknown layouts. Closing to avoid a second, conflicting key implementation. Reopen if a byte-level difference remains after #3732.
Pull request closed