Repository navigation
startup: opt-in derived Mesh57 state for immediate-allocation DispatchMesh ExecuteIndirect - #3413
Draft
SimSalabimse wants to merge 7 commits into
Draft
SimSalabimse wants to merge 7 commits into
SimSalabimse wants to merge 7 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Opt-in runtime derivation of the Mesh57 state for one
graphics/mesh_profile_missingshape, so a directDispatchMeshExecuteIndirectcan be forwarded without a hand-written.mesh57-statefile. 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-statefile 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
DispatchMeshExecuteIndirectcalls in 420 seconds and forwarded none. Across draw and mesh, the graphics-pipeline census countedgraphics/no_translation446,421 andgraphics/mesh_profile_missing427,428. Most of themesh_profile_missingprograms are outside the shape this PR handles, so this number is not what the flag forwards.X2W_MESH57_DERIVE_STATE=1builds a desktop mesh pipeline only for a directDispatchMeshwhose pipeline is slot 57, has captured stages, and has no reviewed.mesh57-statefile. The program must be one immediateGS_ALLOC_REQ, the guest root must be empty, and depth and stencil must be off. The existingExecuteIndirectpath 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 non-empty root, or depth or stencil enabled. With the switch off this path is not entered.Tests
Windows test PC (MSVC, WARP and RTX hardware), head aed2c0c:
ctest --preset dev -j 1 --no-tests=error -R 'mesh57_derive_alloc|startup_indirect_mesh_derived': build exit 0, 13/13 passed, ctest exit 0.startup_indirect_mesh_derived_{warp,hardware}forwards one group and reads white at (2,0).derived-off,derived-bad,derived-depth,derived-reviewed, andderived-untranslatedkeep the clear color. Unavailable mesh shaders or a missing command signature return 77.Linux:
g++andclang++with-std=c++17 -Wall -Wextra -Werror -Werror=narrowingon the host reader;tools/run_checks_parallel.py --from-dir tests/checks/python-linuxpassed.AI-assisted (Cursor)