Skip to content

Capture slot 57 indirect mesh translation requests - #2253

Merged
R0Y00 merged 1 commit into
mainfrom
codex/startup-slot57-mesh-request
Nov 25, 2026
Merged

R0Y00 merged 1 commit into
mainfrom
codex/startup-slot57-mesh-request

Conversation

@R0Y00

@R0Y00 R0Y00 commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Refs #1759 and #1760.

A recognized indirect mesh command on a direct list can publish the fixed slot 57 mesh program, optional pixel program and recorded root signature. The root must be the same one bound to the list and the vertex slot must be empty. Slot 55 derivatives reuse the slot 57 base. The cache uses a separate length-framed key and writes the mesh marker last. The watcher validates roles and reports the first unsupported workgroup-memory instruction where present. The shim leaves these commands unforwarded while mesh code emission and resource binding are pending.

cmake --build --preset release --target startup_indirect_draw_indexed
ctest --preset release --no-tests=error -j 1 -R '^startup_indirect_(mesh_|draw(_indexed)?_(warp|hardware))' -V
.\out\pe-env\Scripts\python.exe -B tests/startup_gfx2hlsl_watch_check.py

Windows 11 build 26200.9974 passed 8/8 Release CTests with no skips. WARP 10.0.26100.9818 and RTX 4060 Laptop GPU 32.0.16.1656 both ran with the D3D12 debug layer enabled. Each published one paired request and one mesh-only request with exact bytes. A mismatched root, populated vertex slot and incomplete pixel span each left the cache empty. All slot 57 controls retained the clear target and argument guards. The Python watcher test passed, including a missing marker, vertex code under either mesh or pixel role, and a tampered key.

@tedin7 tedin7 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.

Review of head c50fa24258030857797a20559dba0ff56dc27649 (7 files, +223/-5). CI was still pending when I looked, so the Windows jobs are not covered here. I did not run the Windows WARP/hardware tests (startup_indirect_mesh_request_*). They need a Windows run before this is ready.

Commands executed locally (Linux), all rc=0:

  • python3 tests/startup_gfx2hlsl_watch_check.py -> startup_gfx2hlsl_watch_check passed
  • python3 tests/docs_links_check.py -> Checked 18 Markdown files and 419 links.
  • python3 tests/bidi_controls_check.py -> no bidirectional controls
  • git diff --check origin/main...HEAD -> clean

Findings:

P2 (tests, tests/startup_gfx2hlsl_watch_check.py ~L80-110): three mutations of the new reader survived, and the watch check still passed.

  1. In inspect_mesh57_request (tools/startup/gfx2hlsl.py), dropping the 'target_20' not in exports condition. No fixture has a mesh stage with a position export but no primitive export.
  2. In inspect_mesh57_request, replacing if op.startswith('ds_') with if False. No fixture contains a ds_* op, so the workgroup-memory refusal is never exercised.
  3. In pending_keys, removing the m57 exemption from the "already done" skip. No fixture covers an .m57 request that has a stale .txt and .cso.
    Please add a fixture for each. Each is small and uses the existing mesh57_fixture helper.

P2 (ordering, inspect_mesh57_request): the ds_ refusal runs after the pixel-stage check, and the final Unsupported is unconditional. This is consistent today. Still, the ds_ refusal is dead until the previous point is fixed, so the "mesh workgroup memory" message can never surface in practice.

Nit (d3d12_draw.inl, request_slot57_mesh): written is only inserted after all three publishes succeed. A partial failure (for example .ps57 and .root written, .m57 failed) is retried on the next call, which is fine. Because .m57 is written last, the scanner never sees a partial request.

Nit (d3d12_xs_device.cpp, list_execute_indirect): when mesh is true but the list is not DIRECT, or the pipeline is real, neither branch runs. That seems intended, but a one-line comment would help.

Clean-room and title: neutral title, no model names, MIT-compatible content. Mergeable, not draft.

AI-assisted; commands listed were executed locally.

R0Y00 commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

The slot 57 follow-up is available as one commit on an integration branch with this PR and tedin7's #2142 commits. It depends on both PRs and retains main's retired-wave handling from #2241.

The mesh request reader now runs the bounded two-wave LDS evaluator as a diagnostic. The request format stays compatible. Because the request lacks verified mesh entry bindings, the evaluator uses synthetic inputs for the diagnostic and the runtime keeps these requests unforwarded. A local replay reached the LDS store-completion check for all 32 captures (29 distinct requests). An offline control with an explicit store-completion wait reached the distinct-barrier rejection for all 32. These replay inputs and logs stay local.

python -B tests/mesh_scc_any_lane_check.py, python -B tests/mesh_dynamic_geometry_check.py, python -B tests/mesh_dynamic_aot_check.py, and python -B tests/startup_gfx2hlsl_watch_check.py passed. The 19-instruction source-built control decoded identically in the checked-in decoder and the LLVM 15 disassembler. The translated draw control (python -B tests/mesh_scc_any_lane_draw_check.py <dxc> <offscreen_check> <warp|hardware>) matched 1,024/1,024 pixels on WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656 under Windows 11 build 26200.9974, with no D3D12 debug errors or warnings.

@R0Y00
R0Y00 merged commit a186f05 into main Nov 25, 2026
5 checks passed
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