tooling: draft reviewed slot 57 profiles from captures #3507
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!3507
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3505"
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?
@Leyukaka on GitHub · 2026-11-29 18:47 UTC · original
Leyukaka:tooling-mesh57-profile-draft→main· +1399 −166 · 20 files · 14 commits · closed without mergingRefs #3418
Stacked on #3495, #3499 and #3505. Until they merge, this PR also shows their commits (including
1014e85fandea3a90c2) and the merges196adf8c,5a5df32cand2ca22af6. Its own commits are527ee33a,d8af54b7,243d7e4aand5b05bac2.Why
A reviewed slot 57 profile needs the desktop state of the pipeline. Writing that by hand for 100+ pipelines is not practical. The capture and the
.t57sidecar from #3504 already hold most of it, so the tool can prefill what it can decode exactly and leave the rest to the reviewer.What
Depth-only profiles (
527ee33a,d8af54b7).mesh57_profile.pyaccepts a capture with a zero-length.ps57:rt_formatsandblend.targetsmust be empty.depth_write_mask1.depth_formatmust be a typed DSV format (20, 40, 45 or 55).pixelfield. Versions 2–5 need all threepixelfields zero. Version 6 is refused.d8af54b7fixes the padding added in527ee33a, which produced a 564-byte header instead of 532. The padding is now computed from the rasterizer offset (384) minus the 32-byte prefix. The test asserts a 532-byte header on every successful write and adds a refusal case for a depth-only capture with one RTV format and a matching blend target.Draft mode (
243d7e4a,5b05bac2).--draft ARCHIVE DRAFT_JSONwrites a JSON in the reviewed schema to a new path:pipeline_state_decode.h.cb_blend.handstate_block_blend.h: factor table, bit 29 shared or separate alpha, combine mapping, MIN/MAX needing ONE/ONE, alpha forms and dual-source restrictions. All eight words are validated. The draft keeps one target per RTV..t57sidecar when it holds exactly one distinct tuple. Several tuples or an overflow line are refused, and the refusal lists them. Without a tuple these fields and blend stay null..ps57gives an empty target list.review_required: true. The stencil reference and DSV writability appear in provenance only, because the profile has no field for them.The profile writer refuses a draft that still has a null anywhere or still has the
review_requiredkey. For a tag 6 capture it also reruns the decoder refusals.Intentional differences from the C++
independentis derived from differences between the selected targets. The C++ always sets it. With identical targets the result is the same, since RT0 then applies to all.Not covered
write_mask,logic_op,logic_op_enableandalpha_to_coverageare not located in the capture and stay null..t57sidecar is written by #3504.Tests
Dev preset,
X2W_WITH_OPUS=OFF.d8af54b7,ctest -R '^(native_direct_mesh|native_fixed_mesh57_depth_only_)': 3/3 passed (native_direct_mesh,native_fixed_mesh57_depth_only_warp,native_fixed_mesh57_depth_only_hardware).243d7e4a,ctest -R '^(mesh57_profile_draft|native_direct_mesh|startup_pipeline_state(_offset_control|_mesh_shift_control)?)$': 5/5 passed.5b05bac2,ctest -R '^(mesh57_profile_draft|native_direct_mesh|startup_state_block_blend|startup_cb_blend_decode)': 5/5 passed (mesh57_profile_draft,native_direct_mesh,startup_state_block_blend,startup_cb_blend_decode,startup_cb_blend_decode_dest_alpha_control).Mutations, each caught and then restored:
native_direct_mesh(the writer's 532 assert fires first)native_direct_meshmesh57_profile_draft.t57tuples acceptedmesh57_profile_draftreview_requiredcheck removedmesh57_profile_draftmesh57_profile_draftmesh57_profile_draftmesh57_profile_draft@Leyukaka on GitHub · 2026-11-29 19:01 UTC · original
New head
cf40d844: the writer now re-derives from the capture the fields the draft decoded exactly (depth/stencil, blend words, RT/DSV formats and samples) and refuses a reviewed state that contradicts them, naming the fields. Fields left null in the draft stay reviewer-supplied. It also refuses a malformed.t57; without a.t57, only depth/stencil is checked.Test:
tests/mesh57_profile_draft_check.pyedits depth function, blend source, RTV format, and DSV + sample fields, and expects each refusal to name the fields and leave the output directory empty; a valid review is compared byte-for-byte.ctest --preset dev -R '^(native_direct_mesh|mesh57_profile_draft)': 2/2 passed.Mutation: with
if mismatches:disabled in the writer, the editeddepth_funcis accepted and the test fails.@lukaslw-lab on GitHub · 2026-11-30 07:13 UTC · original · approved these changes
Reviewed
cf40d844(own commits 527ee33a..cf40d844; #3499 and #3505 are merged, #3495 is still below) by reading the diff; not built or run. Draft PR.Verdict: approve. The draft path only fills what it can decode exactly, and since
cf40d844the writer re-checks those fields against the capture. One SHOULD can follow. No MUST.read_captured_statedrops the.t57writablebit (tools/startup/mesh57_profile.py:258-259). It reaches the draft only as provenance text (:343), and the writer never compares it. A capture that decodesdepth_write_mask 1but was only observed with a read-only DSV (writable 0) therefore builds a profile that writes depth through a read-only view. The fixture'salternatetuple (tests/mesh57_profile_draft_check.py:152) alone would make a refusal case. Refusingdepth_write_mask 1withwritable 0next to the mismatch check (:491) closes it.depth_write_mask 1(:402), so a stencil-only pass (depth writes off, stencil writes on) is refused. That is fine for now; a line in the experiment note would say so.state_block_blend.h:55), so draft and runtime refuse the same captures.capture_mismatchescompares only the decoded keys. Lists of different lengths count as a mismatch. Fields left null in the draft stay reviewer-owned.--draftopens its output with"x", so it never overwrites a file.read_targetsaccepts exactly what #3504's writer emits: format 0 RTVs, andwritable 1without a DSV, are refused.Tests:
mesh57_profile_draftproves the depth/stencil and blend decoding, the.t57conflict and overflow refusals,review_required, and (cf40d844) refusals of edited fields with an empty output directory. CI ran it in the Linux Python job (green).native_direct_mesh(depth-only writer, 532-byte header) is not in the Windowsprfilter or the Linux list, so only the author's local runs cover it.Pull request closed