Skip to content

tooling: draft reviewed slot 57 profiles from captures - #3724

Merged
R0Y00 merged 1 commit into
R0Y00:mainfrom
lambirou:codex/3505-profile-draft
Dec 1, 2026
Merged

R0Y00 merged 1 commit into
R0Y00:mainfrom
lambirou:codex/3505-profile-draft

Conversation

@lambirou

@lambirou lambirou commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Refs #3505 #3493 #3502 #870

Why

A reviewed slot 57 profile still has to be written by hand. A long local run left 437 .s57 captures but no .mesh57-state for the color pipelines, so the first color key cannot be reviewed. The capture holds the mesh-layout depth-stencil and blend words; the .t57 sidecar (#3502) holds the ordered RTV formats, DSV and sample description. The tool should prefill exactly those and leave the rest to a reviewer.

What

  • tools/startup/mesh57_profile_draft.py (new): --draft, --check, --census.
    • Decodes DB_DEPTH_CONTROL, DB_STENCIL_CONTROL and DB_STENCILREFMASK(_BF) at A+0x10C with the rules of pipeline_state_decode.h.
    • Decodes the eight CB_BLENDn_CONTROL words at A+0x124 with cb_blend.h / state_block_blend.h, including the dual-source, BOTH_SRC_ALPHA, alpha-factor and MIN/MAX refusals.
    • Reads one distinct .t57 tuple; refuses conflicting tuples, an overflow line and malformed lines.
    • Classifies the pixel stage from its EXP targets (mrt0..mrt7 = color, mrtz, null, none) and refuses a stage/attachment pair that cannot describe the same pipeline.
    • Leaves mesh dimensions, rasterizer, pixel entry, root mappings and version null with per-field provenance; writes review_required and a byte-free capture summary.
  • mesh57_profile.py:
    • --draft, --check and --census dispatch.
    • The writer lists every unreviewed null field at once (profile is incomplete: ...), refuses the review metadata, and refuses a reviewed state that disagrees with a decoded capture value.
    • Depth-only writer support: empty .ps57, zero RTV/blend, enabled depth writes, typed DSV, zeroed pixel for versions 2–5, version 6 refused.
  • Documentation plus a CTest fragment and Linux check-list entry.

Evidence

Commands from the worktree, Release preset, MSVC 19.44 and Windows SDK DXC 10.0.26100.0:

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

ctest --preset release --no-tests=error -R '^mesh57_profile_draft$' --output-on-failure
1/1 passed

ctest --preset release --no-tests=error -R '^(native_direct_mesh|startup_mesh57_real_shape|mesh57_profile_draft|startup_pipeline_state|startup_cb_blend_decode|startup_state_block_blend)$' --output-on-failure
6/6 passed (no skips)

The fixture is source-built: triangle() from native_direct_mesh_check.py, the four-word exp mrt0 pixel from startup_mesh57_real_shape_check.py, the null-export pixel from startup_mesh57_depth_only_check.py, and VALID_ROOT from startup_gfx2hlsl_root_check.py. The optional CTest arguments run compile_dxil gfx1013-raw-mesh-ps on the reviewed meshps1 0 0 64 entry and assert a DXBC output.

Local capture census (read-only cache; no bytes copied or committed):

captures 437: color 239, depth 77, null 25, param 0, none 1, empty 95, refused 0
sidecars 0, attachment tuples 0, consistent stage/attachment pairs 0

A drafted color capture preserves its color-target indices and decoded depth words, but leaves rt_formats, depth_format, samples, blend, mesh, rasterizer, pixel and version null. --check exits 1 and names all of them; no profile is written.

Mutation: with capture != reviewed disabled in capture_mismatches, the mismatch case accepts an edited depth_stencil.depth_func and the test fails (profile complete instead of the refusal); restored.

Limits / blocker

  • No color-capable key was published. The local cache has 0 .t57 sidecars, so the ordered RTV formats, DSV and sample description of the 239 color-capable captures are unknown. A profile would require inventing those values. This needs startup: record bound slot 57 targets with the creation capture #3502 (or equivalent capture evidence) in the run.
  • Mesh dimensions, rasterizer state, pixel entry, root mappings and version are not located in the capture; a reviewer must supply them.
  • The writer keeps the existing sample restriction (count 1, quality 0); a captured multisample tuple is drafted but cannot be written.
  • The four existing reviewed depth-only profiles use a canonical depth state (ALWAYS, stencil off) that differs from the decoded depth words (GREATER, stencil on). They are unchanged; this writer would refuse to re-author them with the same header. New profiles must keep the decoded depth-stencil.
  • The runtime on main still refuses PS-less creation before the profile lookup; depth-only authoring is for the shader: admit PS-less slot 57 mesh pipelines with a reviewed profile #3493 path.

No game files, game bytes, GDK files or borrowed GPL code are included.

@R0Y00 R0Y00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed the capture-derived draft, preservation of unresolved fields, duplicate-key refusal and the explicit reviewed-profile check. The local mesh57_profile_draft_check.py passed with compile_dxil and Windows SDK DXC, including the depth-only profile and refusal controls.

@R0Y00
R0Y00 merged commit e1161e4 into R0Y00:main Dec 1, 2026
5 checks passed
lambirou added a commit to lambirou/Xbox2Windows that referenced this pull request Dec 1, 2026
lambirou added a commit to lambirou/Xbox2Windows that referenced this pull request Dec 1, 2026
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