Skip to content

startup: opt-in derived Mesh57 state for immediate-allocation DispatchMesh ExecuteIndirect - #3413

Open
SimSalabimse wants to merge 14 commits into
R0Y00:mainfrom
SimSalabimse:cursor/mesh-ei-first-slice
Open

SimSalabimse wants to merge 14 commits into
R0Y00:mainfrom
SimSalabimse:cursor/mesh-ei-first-slice

Conversation

@SimSalabimse

@SimSalabimse SimSalabimse commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Opt-in runtime derivation of the Mesh57 state for one graphics/mesh_profile_missing shape, so a direct DispatchMesh ExecuteIndirect can be forwarded without a hand-written .mesh57-state file. Refs #870. Refs #2413.

Opened as a draft because it touches the question @Leyukaka asked in #2413 (whether a derivation from the fixed descriptor and state blocks is acceptable, or whether those values must stay hand-reviewed). The switch is off by default and a reviewed .mesh57-state file always wins, so the reviewed path in #3308 is unchanged. If derived values are not acceptable on the runtime side, I'm happy to close this or narrow it to a tool that only writes candidate layouts for review.

Context: a startup run on the Windows test PC with the refusal census from #3411 refused 653,708 DispatchMesh ExecuteIndirect calls in 420 seconds and forwarded none. Across draw and mesh, the graphics-pipeline census counted graphics/no_translation 446,421 and graphics/mesh_profile_missing 427,428. Most of the mesh_profile_missing programs are outside the shape this PR handles, so this number is not what the flag forwards.

X2W_MESH57_DERIVE_STATE=1 builds a desktop mesh pipeline only for a direct DispatchMesh whose pipeline is slot 57, has captured stages, and has no reviewed .mesh57-state file. The program must be one immediate GS_ALLOC_REQ, and depth and stencil must be off. The guest root may be empty, or one 32-bit-constants block of 1 to 8 dwords copied into desktop b0 at user SGPR s8. A heap-indexed flag on that one-constant root does not by itself refuse it. Any other root, including a five-parameter heap-indexed root, stays refused. A slot 55 pipeline reuses that mesh only when its program matches the slot 57 base and every patch record is blend tag 2, or the patch list is empty. A failure on that pipeline is remembered there, not on the base. The existing ExecuteIndirect path then records the call. The rasterizer stays solid, cull none, and depth clip.

What stays refused: graphics/no_translation, including a slot 57 pipeline with no captured stages; slot 86 meshes that only lack a cached stage; any other allocation shape; a guest root that is neither empty nor that one constant block; a slot 55 patch tag other than 2; or depth or stencil enabled. With the switch off this path is not entered.

Tests

Windows test PC (MSVC, WARP and hardware), head 46be84356b6a47aa5053873d6c4b062133e86d4f:

ctest --preset dev --no-tests=error -j 1 -R '^(mesh57_derive_alloc|startup_indirect_mesh_derived)' -E 'startup_audio_(output|pacing|provider)' --output-on-failure

cmake --build --preset dev exit 0, 37/37 passed, ctest exit 0. None skipped.

On both backends, mesh-derived, mesh-derived-dxc, mesh-derived-root, mesh-derived-root-heap, and mesh-derived-slot55 paint 1/8 at (2,0) 0xffffffff. mesh-derived-slot55-isolate stays 0/8, then paints 1/8. The other derived modes stay 0/8 0xff000000, including mesh-derived-root-five. That mode now creates the five-parameter root and logs reason=derived mesh guest root is heap indexed with root=5 const=1 other=4 heap=1024 params=t,t,t,srv,c1 and real=0. Unavailable mesh shaders or a missing command signature return 77. The branch is 6 commits behind current main 17b662a2 and still merges cleanly. It is still based on c04e0dd6.

Linux: g++ and clang++ with -std=c++17 -Wall -Wextra -Werror -Werror=narrowing on the host reader; tools/run_checks_parallel.py --from-dir tests/checks/python-linux passed.

AI-assisted (Cursor)

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

Comment on 35b0d54 (draft). Evidence: reading the diff and the head blobs; git merge-tree against main aff3b1a is clean. Nothing was built or run.

  • The derived pipeline uses fixed values where the reviewed path reads them per program. mesh57_alloc.h:89-94 sets 64 threads, topology 2 and wave size 64; the only wave32 signal is an s_mov_b32 into exec_lo (:70-71). native_mesh57.inl:834 uses default_pso_rasterizer(), :845 triangles, and mesh57_alloc.h:223 puts the constant block at s8. The reviewed path takes threads, topology and wave size from the profile (native_mesh57.inl:311-312), the rasterizer from the profile (:403) and the SGPR from the mapping entry (:324). The docs state these defaults. The consequence is that a program with culling, another topology, wave32 without an exec_lo write, or its constant block at another SGPR is forwarded with the defaults, not refused.
  • A slot 55 failure is stored on its slot 57 base. derive_slot55_mesh passes base_info as source (native_mesh57.inl:679), info = source (:690), and remember writes info->mesh57_derive_reason (:696). A desktop pipeline refusal with the slot 55 blend override (:876) is then returned at :693 for the base itself and for every other slot 55 pipeline on that base.
  • derived-root does not observe the constant. The word is 0 (tests/startup_indirect_draw_indexed.cpp:1118) and the MS only adds s_mov_b32 s9, s8 (:2414); no later instruction reads s9. A constant that never reaches b0, or the wrong word, still paints (2,0). A non-zero word that drives the export would catch it.
  • The heap-indexed root with one constant block is only covered as a decision (tests/mesh57_derive_alloc_check.cpp:228-230). No device mode sets a heap flag on the guest root, so the deferred_root branch (native_mesh57.inl:783) is not run by any test.
  • mesh57_stage_copy and mesh57_fixed_stages_kept (mesh57_alloc.h:122, :132) are called only from tests/mesh57_derive_alloc_check.cpp. The capture they describe (d3d12_capture.inl:246-259) does not call them, so that test does not fail if the capture changes.
  • None of the new tests are in the pr ctest filter (CMakePresets.json:51: the startup_indirect_(...|mesh(_xmem_arguments(_skip_wait)?)?|...)_warp alternative does not match startup_indirect_mesh_derived*, and mesh57_derive_alloc is not listed), and pull request CI runs ctest --preset pr (windows.yml:489-493). mesh57_derive_alloc needs no device.
  • The PR body is behind the head: it cites aed2c0c and 13/13, and says "the guest root must be empty" and "a non-empty root" stays refused, while the head binds one constant block and slot 55 pipelines. The docs record three 420 s runs with the switch on (075e461 "forwarded none", f358a2e "forwarded nothing", 5433113 forwards: 0).

@SimSalabimse

Copy link
Copy Markdown
Contributor Author

A 420 s run on the Windows test PC at 35b0d54, with X2W_MESH57_DERIVE_STATE=1, X2W_MESH57_DXC_DIR set, and X2W_TRANSLATED_INDIRECT_DRAW=1, forwarded 0 derived mesh pipelines (x2w-render mesh57-derive forwards: 0). Indirect DispatchMesh stayed refused (864,129).

Last derive census:

  • derived mesh guest root is heap indexed 305,958. Sample: path=57 desc=768 ms=9536 ps=4352, root=5 const=1 other=4 heap=1024 params=t,t,t,srv,c1
  • slot 57 pixel stage is absent from the descriptor 111,185. Sample: path=57 desc=768 ms=1408 ps=0, root=5 const=2 other=4 heap=3072 params=t,t,t,srv,c2
  • slot 55 patch tag 1 is not applied 442,686. Sample: path=55 base=57 desc=332 patches=1:332, same five-parameter root, heap=3072 params=t,t,t,srv,c2
  • slot 55 patch tag 0 is not applied 4,300. Sample: patches=0:332, same root as the tag 1 sample

params is three descriptor tables, one root SRV, then a 1-dword or 2-dword constant. Heap 1024 is the view-heap flag. Heap 3072 is view plus sampler. The slot 55 records are 0x14c bytes, the same size as the reviewed blend tag 2, but the tags here are 0 and 1.

I have not bound that root, and I have not treated tag 0 or tag 1 as blend. No reviewed mesh user-SGPR map in the tree covers a five-parameter heap-indexed root. If one exists, what I would need is the user SGPR of each of those five parameters, the user SGPR of the resource heap, and the user SGPR of the sampler heap when 0x800 is set. Is there a reviewed map for this shape, or should it stay refused?

AI-Assisted

@cursor
cursor Bot force-pushed the cursor/mesh-ei-first-slice branch from 35b0d54 to 278f1a9 Compare November 29, 2026 12:55
cursoragent and others added 9 commits November 29, 2026 13:11
X2W_MESH57_DERIVE_STATE=1 builds one desktop mesh pipeline from a single
immediate GS_ALLOC_REQ when no reviewed profile was opened, then the
existing ExecuteIndirect path forwards it. The switch off leaves every
current refusal unchanged.

Refs R0Y00#870
Refs R0Y00#2413

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
X2W_MESH57_DERIVE_STATE only attempts a direct DispatchMesh whose pipeline
is slot 57 and has no desktop PSO. Draws and other mesh pipelines stay
refused. A slot 57 pipeline with no captured stages stays refused too.

Refs R0Y00#870
Refs R0Y00#2413

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
X2W_MESH57_DXC_DIR supplies dxcompiler.dll and dxil.dll to the slot 57
derivation alone. X2W_NATIVE_SHADERS stays unset for other programs and is
only a fallback compiler directory for this path. A missing directory still
logs the existing compiler refusal. A present .mesh57-state file is still
honored when the native switch did not open it.

Refs R0Y00#870
Refs R0Y00#2413

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
The opt-in now records each DispatchMesh ExecuteIndirect, including calls
that never enter slot 57 derivation. The fixed-pair check reports which
clause failed, and the heartbeat prints the counts with one sample per
reason. Captured stage bytes stay available for a later attempt while the
switch is on.

Refs R0Y00#870
Refs R0Y00#2413

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
MSVC does not give two copies of the same reason string the same address,
so the census treated the second note as a new reason and kept that sample.
Rows now compare the characters. The host check uses two distinct copies.

Refs R0Y00#870
Refs R0Y00#2413

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
A DispatchMesh derivation now copies a single guest constant block of
1..8 dwords into desktop b0, including a heap-indexed root whose only
parameter is that block. Descriptor roots and other heap-indexed shapes
stay refused by name. A slot 55 pipeline uses its slot 57 base when every
patch is a blend record. The heartbeat adds the derived forward count.

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
A slot 55 record that is not a blend tag stays refused, and the reason names the tag. The sample lists the first patch tags and sizes and the first guest-root parameter types. A zero pixel length is an empty descriptor span, not a dropped copy. No reviewed mesh user-SGPR map covers a five-parameter heap-indexed root, so that shape stays refused.

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
Refuse wave32, an unproven thread count, a non-triangle export, a captured
rasterizer that is not the bound default, and a constant that is not the
word at user SGPR s8. Store a slot 55 refusal on that slot 55 pipeline.
The one-constant device modes use a non-zero word in the export, including
the heap-indexed root the deferred path binds. The five-parameter heap
root stays refused.

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
d3d12_xs_device_obj compiles d3d12_capture.inl without X2W_NATIVE_SHADERS.
note_pipeline calls the stage-copy helpers, so mesh57_alloc.h is included
before that file for every translation unit of d3d12_xs_device.cpp.

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/mesh-ei-first-slice branch from 278f1a9 to 6c93fc6 Compare November 29, 2026 13:11
The three SRV tables and the root SRV no longer all claim t0 in space 0,
so the root signature can be created. The shape stays five parameters
with the heap-indexed flag, and that root stays refused.

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
@SimSalabimse

Copy link
Copy Markdown
Contributor Author

Windows test PC (MSVC, --preset dev, -j 1), at 46be84356b6a47aa5053873d6c4b062133e86d4f. cmake --build --preset dev exit 0.

ctest --preset dev --no-tests=error -j 1 -R '^(mesh57_derive_alloc|startup_indirect_mesh_derived)' -E 'startup_audio_(output|pacing|provider)' --output-on-failure

37/37 passed, ctest exit 0. None skipped. WARP and hardware.

At 6c93fc6f the two mesh-derived-root-five tests failed before any draw with serialize root failed (HRESULT 0x80070057). The fixture's three SRV tables and the root SRV all claimed t0 in space 0. This commit only fills distinct registers: tables are t0 in spaces 0, 1 and 2, the root SRV is t0 in space 3, the constant is b0. The shape is still five parameters with D3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED. The mode is still not on the paint list.

On both WARP and hardware, mesh-derived-root-five logged:

x2w-render mesh57-derive sample reason=derived mesh guest root is heap indexed path=57 base=0 desc=768 ms=72 ps=16 state_a=324 state_b=4 vs=0 ms_len=72 ps_len=16 key=0000000000000000 list=0 real=0 mesh86=0 root=5 const=1 other=4 heap=1024 params=t,t,t,srv,c1 patches=- raster=0

x2w-render ExecuteIndirect refused: indirect graphics requires a direct list with a matching desktop pipeline and root

Target (2,0) packed RGBA 0xff000000, 0/8 non-clear pixels, argument guards intact.

Painted 1/8 at (2,0) 0xffffffff on both backends: mesh-derived, mesh-derived-dxc, mesh-derived-root, mesh-derived-root-heap, mesh-derived-slot55. mesh-derived-slot55-isolate was 0/8 then 1/8. The other derived modes stayed 0/8 0xff000000.

No user-SGPR map was added for the five-parameter heap-indexed root. That root was not forwarded (real=0). Slot 55 tags other than 2 are unchanged. The branch is 6 commits behind current main 17b662a2 and still merges cleanly (git merge-tree exit 0). It is still based on c04e0dd6.

AI-Assisted

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

Comment on 46be843 (draft); line numbers are on that commit. Evidence is reading the diff and the blobs. Nothing was built or run here. Checks on 46be843: Build and test on Windows, Assemble and translate gfx1013 fixtures and the Linux Python checks pass; the /O2 job is skipped. Only points not in the earlier review on 35b0d54.

  1. MUST, code reading. The wave64 claim is wider than the check. docs/startup-runtime.md:1738 says the program is forwarded only when it proves wave64, and docs/experiments/native-fixed-mesh57.md:129 says a 32-bit exec write is refused. mesh57_alloc.h:67-74 and :90-94 flag only s_mov_b32 and eight bitwise SOP2 names with destination 126. Not flagged:

    • the *_saveexec_b32 and *_wrexec_b32 forms the decoder names (gfx1013_isa_tables.inl:59-61): they write exec implicitly and their destination field is the save register, so dst == 126 never matches;
    • other 32-bit writers of exec_lo: s_not_b32, s_movk_i32, s_cselect_b32, shifts, adds;
    • a wave32 program with no exec write at all.

    v_mbcnt_lo_u32_b32 (:63-64, :117) does not separate the cases: a wave32 program computes its lane id with that same instruction. The accepted fixture (tests/mesh57_derive_alloc_check.cpp:37-40) has v_mbcnt_lo and no v_mbcnt_hi. Scenario: a wave32 mesh program that masks with s_and_saveexec_b32, has one immediate allocation, v_mbcnt_lo and a target 20 export returns a layout with wave_size = 64, threads = 64 and is forwarded. Either refuse on every 32-bit instruction that can write exec (by name, including the implicit forms) and require a positive wave64 signal, or state in both docs that wave32 is detected only for the listed spellings.

  2. SHOULD, code reading. Nine negative cases in tests/mesh57_derive_alloc_check.cpp pass with the check they name removed: no allocation (:83), gap (:87), twice (:91), high (:95), zero (:99), wide (:103), exchange (:107), wave32 exec move (:118), from_register (:122). Each program has no v_mbcnt_lo and no export, and each assertion only checks that derive_immediate_mesh_layout returns nothing. With mesh57_alloc.h:77-78, :81-83, :93-94 or :109 deleted, the reader still returns no layout at :117 (thread count is not proven). Only alloc alone, no triangle export and wave32 exec alu (:48-64) compare the reason. Build each negative from the accepted triangle words with one change, and compare mesh57_read_layout(...).reason.

  3. SHOULD, code reading. A slot 57 base that was dispatched once passes its blend refusal to slot 55 children whose patch replaces that blend. A direct dispatch on the base stores the state_block_blend reason on the base (native_mesh57.inl:801-802, stored == shaders). A later slot 55 child with a tag 2 patch reaches :725-726, which returns the base reason before blend_override is looked at (:799-800). The same child dispatched before the base is built. The same applies to derived mesh desktop pipeline was refused (:924), which was decided with the base blend. derived-slot55-isolate (tests/startup_indirect_draw_indexed.cpp:2649-2674) dispatches the two children only, never the base, so it passes either way. native-fixed-mesh57.md:133 says the last blend patch replaces the base blend. Skip the inherited reason when it came from the blend or from pipeline creation and an override is present, and add the base-first order to the test.

  4. SHOULD, code reading. mesh57_rasterizer_reason and Mesh57RasterizerView (mesh57_alloc.h:150-165) are called only from tests/mesh57_derive_alloc_check.cpp:66-81. The runtime decides at native_mesh57.inl:879-881, and it decides differently: the helper refuses an absent rasterizer (:160-161), the runtime forwards it with the default. native-fixed-mesh57.md:135 says slot 57 creation does not pass a rasterizer, so for these pipelines the runtime check does not fire and the culling case from the earlier review is still forwarded. The rasterizer case in the host check does not fail if :879-881 changes.

A 32-bit exec write, including saveexec and wrexec, stays wave32.
Wave size 64 now requires v_mbcnt_hi or a 64-bit exec write.
A slot 55 blend patch retries a base blend or pipeline refusal.
An absent rasterizer is not a refusal.

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
@SimSalabimse

Copy link
Copy Markdown
Contributor Author

On the review of 46be8435. Head is now 0f69e4edf78cbdd1ea9ff560db1636ee39af6dd7, one commit on top of that review, not a rewrite of it. Windows run of this head is below.

  1. MUST. mesh57_read_layout no longer returns wave size 64 from a missing 32-bit exec flag. A 32-bit exec write is still derived mesh is wave32, and that check still wins when a wave64 signal is also present. The 32-bit writers are by name, from the decoder forms: every *_saveexec_b32 and *_wrexec_b32 (destination field is the saved register), and SOP1, SOP2, and SOPK whose data destination is SGPR 126 and whose result is 32 bits, including s_mov_b32, s_not_b32, s_movk_i32, s_cselect_b32, s_add_u32, and s_lshl_b32. Compares, s_setreg*, s_waitcnt*, s_subvector*, and the PC transfers are not treated as data writes of that field. Wave size 64 now requires a positive signal: v_mbcnt_hi_u32_b32, or a 64-bit exec write (s_mov_b64 of exec, the other 64-bit scalar forms with that destination, *_saveexec_b64, *_wrexec_b64). v_mbcnt_lo_u32_b32 is still only the thread-count proof. A program that has that and the allocation and the triangle export, but no wave64 signal, is derived mesh wave size is not proven and returns no layout. The words that were accepted at 46be8435 are that case. They were not kept green by relaxing the rule. The accepted host triangle and the device shader add v_mbcnt_hi_u32_b32 v6, exec, 0 (0xd7660006, 0x000100c1) before s_endpgm. v0 is still the low-half lane id the exports use. Both docs now describe this check, including the saveexec and wrexec forms.

    Host cases, each built from the accepted triangle with one change, and each comparing mesh57_read_layout(...).reason: s_and_saveexec_b32 through s_orn1_saveexec_b32, s_andn1_wrexec_b32, s_andn2_wrexec_b32, s_not_b32, s_movk_i32, s_cselect_b32, s_add_u32, s_lshl_b32, and s_mov_b32 / s_and_b32 of exec_lo are derived mesh is wave32. The triangle with the v_mbcnt_hi pair removed is derived mesh wave size is not proven. s_mov_b64 exec and s_and_saveexec_b64 on that same program are accepted. s_cmpk_eq_i32 of exec_lo does not count as a write and stays accepted.

  2. SHOULD. The nine negatives that only checked that derive_immediate_mesh_layout returned nothing are rebuilt from the accepted triangle with one change, and each now compares the reason: no allocation, gap, twice, high, zero, wide, and exchange are derived mesh needs one immediate allocation; wave32 exec move is derived mesh is wave32; from_register is the allocation reason. empty uses the same reason compare. alloc alone, no triangle export, and wave32 exec alu still compare the reason. Order is allocation, then wave32, then thread count, then topology, then wave64.

  3. SHOULD. A remembered base reason is not returned for a slot 55 child when the call has a blend override and the reason is a blend-decoder reason, derived mesh blend was refused, or derived mesh desktop pipeline was refused. Any other base reason is still inherited and is not copied onto the child. New device mode mesh-derived-slot55-base draws the base first, then a tag 2 child. On both WARP and hardware the base stayed 0/8 with CONSTANT_ALPHA factor without alpha blend factor support at path=57, and the child then painted 1/8 at (2,0) 0xffffffff with reason=forwarded path=55 base=57. mesh-derived-slot55-isolate is unchanged: 0/8, then 1/8. A slot 55 failure is still not written onto the base.

  4. SHOULD. mesh57_rasterizer_reason now returns no reason when the rasterizer is absent, matching the runtime. A present rasterizer that is not the bound default (solid, cull none, depth clip, clockwise) is still derived mesh rasterizer does not match the bound state. The host check covers absent, matched, culled, wireframe, no depth clip, and front ccw. There is still no device mode that sets a captured rasterizer (has_stream_rasterizer is not set anywhere in the device test), so the culling case is still not a device test. I did not add one that does not actually set it.

The paint list is unchanged: mesh-derived, mesh-derived-dxc, mesh-derived-root, mesh-derived-root-heap, and mesh-derived-slot55 expect 1/8. mesh-derived-root-five stays off it. Slot 55 tags other than 2 are not treated as blend.

Windows test PC (MSVC, --preset dev, -j 1), at 0f69e4edf78cbdd1ea9ff560db1636ee39af6dd7. Built x2w_build_rev is 0f69e4ed. cmake --build --preset dev exit 0.

ctest --preset dev --no-tests=error -j 1 -R '^(mesh57_derive_alloc|startup_indirect_mesh_derived)' -E 'startup_audio_(output|pacing|provider)' --output-on-failure

39/39 passed, ctest exit 0, none skipped. WARP and hardware. That is the previous 37 plus startup_indirect_mesh_derived-slot55-base_warp and startup_indirect_mesh_derived-slot55-base_hardware.

The device shader is 8 bytes longer than at 46be8435 (ms_len 72 to 80 on the default program, 80 to 88 on the one-constant root). Paints and reasons on WARP match that earlier run aside from ms_len and the new mode. Hardware matched WARP on every derived-mesh mode.

Painted 1/8 at (2,0) 0xffffffff, reason=forwarded, on both backends: mesh-derived, mesh-derived-dxc, mesh-derived-root, mesh-derived-root-heap, mesh-derived-slot55. mesh-derived-slot55-isolate and mesh-derived-slot55-base are 0/8 then 1/8, as above. mesh-derived-slot55-mask is still forwarded and 0/8. mesh-derived-root-zero is still forwarded and 0/8.

Stayed 0/8 0xff000000 on both backends: mesh-derived-off (ExecuteIndirect refused, no derive sample), mesh-derived-bad (derived mesh needs one immediate allocation), mesh-derived-depth (derived mesh keeps depth and stencil disabled), mesh-derived-reviewed and mesh-derived-dxc-reviewed (a reviewed mesh profile is present), mesh-derived-untranslated (slot 57 descriptor has no mesh stage length), mesh-derived-root-unset (derived mesh root constants are incomplete), mesh-derived-root-sgpr (native compute +0x24: unbound numeric SGPR s12), mesh-derived-root-table (derived mesh guest root has descriptors), mesh-derived-root-five (derived mesh guest root is heap indexed, real=0).

ctest --preset pr --no-tests=error -j 1 -E 'startup_audio_(output|pacing|provider)' --output-on-failure

95 passed, 7 skipped, none failed, ctest exit 0. Skipped: spirv_minlod_warp, spirv_minlod_exact_warp, spirv_minlod_levels_warp, spirv_minlod_fractional_warp, xmem_placeholder_split_control, xmem_placeholder_split_deployed, xmem_placeholder_split_partial. Same seven as at 46be8435. The extra pass is the new WARP slot55-base mode. Hardware derived-mesh tests are not in that preset; they are in the 39 above.

Still a draft. No game run on this head.

AI-Assisted

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

Re-review of 0f69e4e against our 13:30Z review (diff only, nothing built or run here).

  • Point 1 (wave64), fixed: mesh57_alloc.h:111-127 marks *saveexec_b32 / *wrexec_b32 and any SOP1/SOP2/SOPK 32-bit write with SDST 126 as wave32, and :179-182 refuses with derived mesh wave size is not proven when there is neither v_mbcnt_hi_u32_b32 nor a 64-bit exec write.
  • Point 3 (slot 55 child inheriting the base blend refusal), fixed: native_mesh57.inl:726-728 skips a base reason listed in mesh57_blend_override_replaces (mesh57_alloc.h:228) when the call has a blend override; device mode mesh-derived-slot55-base (tests/startup_indirect_draw_indexed.cpp:2653) covers it.
  • Point 2 (negatives), fixed: the refusal cases in tests/mesh57_derive_alloc_check.cpp:154-197 are now built from the accepted triangle, so each one differs from an accepted program by the named change only.
  • Point 4 (rasterizer helper), partly: mesh57_rasterizer_reason (mesh57_alloc.h:216-222) now returns no reason for an absent rasterizer, which agrees with the runtime, but only the test calls it (tests/mesh57_derive_alloc_check.cpp:142-151). The runtime check stays separate at native_mesh57.inl:881-883, so the host case does not pin it.
  • NIT: from_register (tests/mesh57_derive_alloc_check.cpp:195-197) replaces word 0 only and keeps the literal 0x1003, which decodes as a 4-byte VOP2 between the m0 write and GS_ALLOC_REQ. The case would still be refused by the gap rule if the register-source rule were removed; dropping word 1 isolates it.
  • NIT: docs/experiments/native-fixed-mesh57.md:129 says "Any 32-bit instruction that writes exec is refused". The reader checks SOP1/SOP2/SOPK destinations and the implicit saveexec/wrexec forms; a VOP writer with SGPR destination 126 (v_readfirstlane_b32, v_readlane_b32) or an SMEM load into s126 is not covered. Narrow the sentence or extend the reader.
  • NIT: the PR body still cites 46be843 as the verified head.

Nothing here blocks. We approve once the PR is out of draft.

Bring the 125 commits of upstream main since the PR base (including the
census/triage/stream-key work) into the opt-in X2W_MESH57_DERIVE_STATE
slice. Resolve three content conflicts, keeping both sides' behavior:

- tests/startup_indirect_draw_indexed.cpp: keep the derived_mesh guard
  arg and main's bucket_case/stream_key_case guard args in the arg-validity
  check.
- src/startup_stubs/d3d12_capture.inl: keep the PR's mesh57_reviewed_present
  and mesh57_derive_reason members and main's guest_stream_key member.
- src/startup_stubs/d3d12_xs_device.cpp: keep the PR's plain_constants
  indexing-match relaxation and main's cached_mesh_root refusal census code.

No behavior change beyond the merge: still opt-in, reviewed .mesh57-state
still wins, five-parameter root still refused, tags 0/1 still not blend.

AI-assisted (Cursor)
@R0Y00 R0Y00 added the priority: P0 Highest project priority label Nov 30, 2026 — with ChatGPT Codex Connector
Bring the 148 commits of R0Y00 main since the previous merge (45f9045,
including slot 86 native bindings, present planes, and mesh57 real-shape
work) into the opt-in X2W_MESH57_DERIVE_STATE slice. Resolve five content
conflicts, keeping both sides' behavior:

- CMakeLists.txt: keep the PR's derived-mesh test modes and main's
  guarded, empty, and missing-position allocation tests.
- CMakePresets.json: keep mesh57_derive_alloc_check and the derived-mesh
  pr-filter entries, and main's compile_dxil, present-planes, and
  present-composite targets and filter entries.
- docs/experiments/native-fixed-mesh57.md: keep the PR's opt-in
  allocation section and main's real-shape v6 and partial-EXEC sections.
- src/startup_stubs/d3d12_xs_device.cpp: keep the PR's plain_constants
  field and main's slot 86 heap, texture-map, and Mesh86HeapEntry
  members. Fold the derived-mesh indexing relaxation into
  cached_mesh_root_matches so a one-constant non-heap root still
  matches, without loosening slot 86 heap or texture-map cases.
- src/startup_stubs/native_mesh57.inl: keep main's profile_open_failed
  outcome and profile_error helper, and the PR's mesh57_reviewed_present
  flag after a successful profile open.

No behavior change beyond the merge: still opt-in, reviewed
.mesh57-state still wins, five-parameter root still refused, tags 0/1
still not blend.

AI-assisted (Cursor)
@SimSalabimse
SimSalabimse marked this pull request as ready for review November 30, 2026 19:22
After merging current main, state_block_blend applies the mesh layout
shift itself from the tag at +0x004. The derived-mesh path still passed
a pointer already advanced by +0x54, so the reader looked for the tag
in the wrong place and refused with "unknown state block A layout".
Give it the full block.

AI-assisted (Cursor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: P0 Highest project priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants