mesh86: publish a PS-less mesh SRV table profile #3803
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3803"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-12-02T00:21:27Z.
Problem
nnSlot 86 DispatchMesh requests can arrive with no pixel stage. The translator compiled the mesh stage, but every published profile refused the request:nn---prove-root-srvand--prove-texture1d-maprequire a pixel stage;n---heap-bufferrequires at least onecreateHandleFromHeapread;n---prove-root-constantsrefuses the mesh stage's SRVs.nnThe cache at_wt/agent-b-86-evidence/out/startup/shader_cachecurrently holds 3,876req_*.m86files: 987 have an empty.ps86, 2,889 have a pixel stage. Of the 987 PS-less requests, 614 reached the heap proof and now translate when the mesh stage has no direct heap read, 357 stop earlier in mesh translation, 10 index only the sampler heap, and 6 stop at the root-constants proof.nn## DesignnnAdds profile 6, a PS-less mesh SRV table marker. The publisher dumps only the mesh stage and accepts the profile only when:nn- every binding is a DXILtexture byte r/oSRV,t0..tN-1;n- every desktop SRV handle is eithercreateHandleFromBindingfor onetNin space 0, or the single legacycreateHandle(rangeId=0)form of a version-1 root SRV;n- the plan's guest root parameter exists and is a descriptor table or root SRV (32-byte-aligned table record inside the runtime bound, offset 0 for a root SRV);n- the mesh stage contains nocreateHandleFromHeapread.nnThe marker storesconstantandsrvlines. The runtime builds a synthetic root with the plan's constants and flat SRV table and reusesbind_native_mesh86to resolve each record; an unusable record refuses the draw. Existing profile 1/2/3/4/5 output is unchanged, and PS-full requests still use the old paths.nnThe source-built depth case accepts exactly the two D16 quantizations of 0.5 used by conforming adapters:0x8000and0x7fff. Clear and all other depth expectations remain exact. The WARP wrapper propagates nonzero exits; a capability skip is accepted only when the fixture itself reports 77. A device removal after DispatchMesh therefore stays a visible test failure.nn## Validationnn- Real PS-less request08dc8a7b1c8fd5datranslated to profile 6 withconstant 4 2and seven SRV lines (t0..t6), including a root SRV and descriptor-table records. Request bytes were not committed.n-startup_mesh86_psless_hardwarepasses: the source-built mesh-only root SRV reads0x12345678and writes D16 depth 0.5; negative controls cover a missing proof, an unproven/missing SRV, a bad table offset and a pixel-stage attempt. The expected depth set is{0x7fff, 0x8000}, with a negative control at0x8001.n-startup_mesh86_translate_hardwarepasses (PS-full profile 4 unchanged).n-startup_mesh86_srv_proofpasses (PS-full profile 2 unchanged).n- WARP10.0.26100.10068records DispatchMesh and then removes the device atmap argument readback failed (HRESULT 0x887a0005). The corrected runner reports this asFailed, 1/1. No capability skip is claimed and the WARP defect remains open.n- The NVIDIA0x7fffcase is covered by the comparator and the owner's measurement on RTX 4060 Laptop; the local recheck was on the RX 9060 XT.nnStack: Windows 11 build 26300, AMD Radeon RX 9060 XT driver 32.0.32029.2010; WARP 10.0.26100.10068. DXC 10.0.26100.0.nnRefs #3641, #3703. AI-assisted.`nImported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-12-02T14:44:50Z.
Review: COMMENTED
Reviewed
7e71182dagainst #3725; read the profile-6 parser/publisher and its fixture, not built here.Verdict: approve. The PS-less mesh profile is represented explicitly as manifest version 6 with a constant/SRV plan, the publisher validates every planned root parameter and every desktop binding, and the runtime side rejects a plan that does not match the root signature. The source-built fixture covers the profile through the target.
_mesh_plan()builds a dict fromfield.split('=', 1)and then indexesvalues['root'],values['count'],values['offset'],values['size'],values['kind'],values['dim']directly. A malformed compiler report raisesKeyError, which escapes the(ValueError, Unsupported)catch and aborts the whole watcher scan. Convert a missing field intoUnsupported(or validate the field set) so one bad request cannot stop the translator.root_parameters()accepts version 1 and 2 only. If the compiler can emit a newer RTS0 version, the error should name the version rather thaninvalid root signature.t0..tN-1byte SRVs and a matching number of views; a legacycreateHandle(rangeId=0)binding is accepted only for a single root SRV; the publisher rejects a PS-less plan with a pixel stage and vice versa. The new test covers the manifest and the runtime refusal paths.The PR is stacked on #3725 and currently conflicts with main; rebase before merge.
Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-03T10:34:03Z.
Independent RTX 5080 + WARP run, in case a second NVIDIA data point helps (the reviewer runs here are on an RTX 4060 Laptop). Two of these findings repeat on all three of #3803, #3812 and #3813, so they probably do not come from this PR's own change, and I have not bisected them: (1)
native_direct_meshfails itsuniform-load-offenrefusal assertion, and (2) in-box WARP removes the device (0x887a0005) after the PS-less dispatch. The RTX 5080 depth readback of0x7fffwhere the new fixtures expect0x8000looks NVIDIA-specific. It might need a one-ULP tolerance, or a depth value that is exactly representable. Full details below.Independent verification of head
7e71182df23cc8f0d1769ca630557cf17519ac83against pinned maind2e6a4ed9fd7377ea5a01d9384a845c26ed7b5e5.The merge stopped with 12 conflicts, including
src/startup_stubs/mesh86_cache.inlandtests/startup_indirect_draw_indexed.cpp. These runs used the published head.Windows 11 build 26200.9974. RTX 5080 driver 32.0.16.2140 (621.40). Microsoft Basic Render Driver with in-box WARP 10.0.26100.9818. DXC 1.9.2602.17 (21d28f727). The startup fixture reported the debug layer unavailable.
Commands run with
$cfgset todevandrelease,$pythonset to the project venv interpreter andXBOX2WINDOWS_ADAPTERset toNVIDIA GeForce RTX 5080.Counts are pass/fail/skip. The totals include the adapter-independent tests.
Failure diagnostics
Debug
native_direct_meshDebug/Release
startup_mesh86_psless_warpDebug/Release
startup_mesh86_psless_hardwareRelease
native_direct_meshnative_direct_meshfailed itsuniform-load-offenrefusal assertion. The compiler published a shader where the fixture expected a refusal.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T12:24:30Z.
Review: CHANGES_REQUESTED
I rebuilt
a2301d70with MSVC Debug and SDK DXC on Windows 11 build 26300. native_direct_mesh passed. The source-built startup_mesh86_psless cases expose two independent problems:#3812 and #3813 carry this base and should recheck the corrected fixture behavior when they refresh.
Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-12-03T14:06:26Z.
Updated at
d6d49e92. The D16 draw now admits precisely0x7fffand0x8000; clear and other depth checks remain exact. The Python wrapper propagates every nonzero child exit and reserves 77 for a capability the fixture actually reports. On RX 9060 XT the hardware fixture passes at0x8000; on WARP the post-dispatch device removal now fails visibly rather than passing as a skip. Refs #3641, #3703.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T14:21:13Z.
Re-ran
d6d49e92in MSVC Debug on Windows 11 build 26300. Native direct mesh passed. The RTX 4060 Laptop fixture accepted 0x7fff and passed with the exact clear and other controls. On inbox WARP 10.0.26100.9818, the source-built fixture reached the cached PSO but failed at the argument readback map with DXGI_ERROR_DEVICE_REMOVED (0x887a0005). The revised wrapper correctly reports a failure. The WARP failure remains open and I am leaving the review in place.Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-12-03T14:35:47Z.
Rebased onto
mainatadfc0d945(including #3935 and #3938). The conflicts ind3d12_xs_device.cppandstartup_indirect_draw_indexed.cppnow retain both the upstream indirect-index snapshot path and the PS-less synthetic-root/D16 changes.Targeted Release checks after the rebase:
startup_indirect_translated_indexed_snapshot_{warp,hardware}pass 2/2;startup_mesh86_psless_hardwarepasses with depth0x8000on the AMD RX 9060 XT.startup_mesh86_psless_warpremains a visible failure after the valid DispatchMesh because WARP removes the device with0x887a0005; it is not reported as a capability skip.New head:
c2dbff29b28d88c08f5fdf2edad461571039b4e7.Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-12-03T14:56:19Z.
Root cause found. In-box WARP removes the device for a mesh pipeline with no pixel shader when it dispatches into depth. On the true fixture, omitting only
DispatchMeshlets the argument readback complete (clear depth0xffff). The same removal occurs with directDispatchMesh, so neither the command signature nor the argument buffer is involved. The standard indirect mesh fixture with a pixel shader passes, and the existing Mesh57/Mesh86 depth-only guard already records the same WARP limitation.57df7cbdadds a source-built empty pixel shader generated at build time and injects it into profile-6 PSOs only on software adapters. The true fixture now passes through bothExecuteIndirectand directDispatchMeshon WARP10.0.26100.10068, writing depth0x8000; hardware passes without the fallback. The targeted Release set passes 7/7, including both indirect-index snapshot tests. The debug layer is unavailable locally and DRED reports no breadcrumb before the former device-removal path; this is now a successful execution path rather than a skip.New head:
57df7cbd2708c827693099f9312c1867ade2d610.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T15:05:46Z.
Review: APPROVED
Re-reviewed
57df7cbd. The empty pixel stage is scoped to the software depth-only profile and does not change the published no-pixel manifest contract. Independently rebuilt in MSVC Debug on Windows 11 build 26300, D3D12 debug layer enabled.ctest --preset dev --no-tests=error -j 1 -V -R '^(startup_mesh86_psless_(warp|hardware)|native_direct_mesh)$'passed 3/3. Direct DispatchMesh and ExecuteIndirect each wrote 0x8000 on WARP 10.0.26100.9818 and 0x7fff on RTX 4060 Laptop 32.0.16.1656. No capability skips. Disabling only the software fallback reproduced the original WARP readback failure (DXGI_ERROR_DEVICE_REMOVED, 0x887a0005), and restoring the fallback made the same case pass. This resolves my WARP and D16 review requests.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T15:07:56Z.
Review: CHANGES_REQUESTED
Update after the hardware review: required Windows CI fails to compile d3d12_xs_device_obj with C1083, because it cannot find mesh86_psless_null_pixel.h. The generated header is a source and its directory is an include path on d3d12_xs_shim only. d3d12_xs_device_obj also compiles d3d12_xs_device.cpp, and the Agility configurations compile it directly in offscreen_check and cpu_placed_dxr_provider. Please attach the generated header dependency and build directory include path to each actual compilation target, then recheck the PR preset from a clean build. The earlier WARP and RTX runtime results used d3d12_xs_shim.
Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-12-03T15:09:03Z.
The Windows failure on
57df7cbdwas only the generated-header dependency:d3d12_xs_device_objcompiled the shim source withoutmesh86_psless_null_pixel.hin its generated include dependency graph.b3348a2battaches that generated HLSL header tod3d12_xs_device_objand the Agility input-compilation paths too. A clean Release configure/build in a new build directory generated the header before bothd3d12_xs_shimandd3d12_xs_device_obj. The local true-fixture checks still pass: WARP and hardware each pass through ExecuteIndirect and direct DispatchMesh with depth0x8000; only WARP receives the empty pixel-stage fallback.New head:
b3348a2bd5a7f46b7c8af90181452a20bf01d2a0.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T15:20:41Z.
Review: APPROVED
Re-reviewed
b3348a2b. The generated fallback header is now an input to every target that compiles d3d12_xs_device.cpp directly. In a clean MSVC Debug build directory, building d3d12_xs_device_obj by itself generated the header before compiling the object. The previous head failed the same object target with C1083. I also rebuilt the shim and ranctest --preset dev --no-tests=error -j 1 -V -R '^(startup_mesh86_psless_(warp|hardware)|native_direct_mesh)$': 3/3 passed on Windows build 26300. Both direct and indirect cases read 0x8000 on WARP 10.0.26100.9818 and 0x7fff on RTX 4060 Laptop 32.0.16.1656, with the debug layer enabled. This resolves the generated-header request.