Repository navigation
Conversation
# Conflicts: # tests/startup_indirect_draw_indexed.cpp
|
New head cf40d84: 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 Test: |
lukaslw-lab
left a comment
There was a problem hiding this comment.
Reviewed cf40d844 (own commits 527ee33..cf40d84; #3497 and #3503 are merged, #3493 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 cf40d84 the writer re-checks those fields against the capture. One SHOULD can follow. No MUST.
- SHOULD check DSV writability against depth writes.
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. - NIT depth-only requires
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. - Checked, no finding:
- All eight blend words are validated, including unused ones. That matches the C++ (
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.- The header padding is now computed from the rasterizer offset, and the 532-byte assert guards it.
--draftopens its output with"x", so it never overwrites a file. read_targetsaccepts exactly what #3502's writer emits: format 0 RTVs, andwritable 1without a DSV, are refused.
- All eight blend words are validated, including unused ones. That matches the C++ (
Tests: mesh57_profile_draft proves the depth/stencil and blend decoding, the .t57 conflict and overflow refusals, review_required, and (cf40d84) 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 Windows pr filter or the Linux list, so only the author's local runs cover it.
Refs #3416
Stacked on #3493, #3497 and #3503. Until they merge, this PR also shows their commits (including 1014e85 and ea3a90c) and the merges 196adf8, 5a5df32 and 2ca22af. Its own commits are 527ee33, d8af54b, 243d7e4 and 5b05bac.
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 #3502 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 (527ee33, d8af54b).
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.d8af54b fixes the padding added in 527ee33, 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 (243d7e4, 5b05bac).
--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 startup: record bound slot 57 targets with the creation capture #3502.Tests
Dev preset,
X2W_WITH_OPUS=OFF.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).ctest -R '^(mesh57_profile_draft|native_direct_mesh|startup_pipeline_state(_offset_control|_mesh_shift_control)?)$': 5/5 passed.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