gpu: measure default and -Od mesh pipeline creation across adapters #836
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/842"
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 alvaroolt on 2026-11-23T11:37:39Z.
Change
Adds a cross-adapter measurement of default and
-Odmesh shader DXIL for #810, using a source-built mesh shader with a known draw.tools/mesh_od_pipeline.pygenerates a mesh shader in which threads 0-2 emit one triangle covering the 32x32 target. Before writing vertices, every thread runs a generated integer computation on a constant-buffer seed. The vertex depth stays inside the clip volume only when the result equals the value the tool computes in Python. The stress families (chain_N,branches_N,loops_N) grow that computation and keep the expected image.ms_6_5, default and-Od). Compile time, peak working set and outcome come from the runner intools/dxc_compile_time.py. Every blob that compiles goes unchanged tooffscreen_check <adapter> --mesh-entry, so both blobs share the root signature, pixel shader, pipeline stream and draw.tests/mesh_entry_draw.cppnow prints and flushesmesh_pipeline_ms=around the meshCreatePipelineStatecall. That separates pipeline time from process time and places a crash or timeout before or after pipeline creation. The line is printed only on the native mesh path. The existingmesh_*tests pass unchanged in dev and release.pass,mismatch,unsupported(exit 77),hresult,timeout,crash(NTSTATUS) anderror. Timeouts are caller-supplied policy values. The tool has no defaults and changes no watchdog, memory or host stack setting.--seedchanges every expected constant and therefore the DXIL, so the first creation in a run misses the driver shader cache.mesh_od_pipeline_{hardware,warp}runcontrol,chain_64,branches_64andloops_16with--check.Refs #810. Apart from importing its runner, this does not change the tool from #801.
Verification
Checks below are from this branch rebased on
527a255; the measurements in the docs were taken on523d9acplus the same change. Windows 11 build 26300.9974, Ryzen 7 9800X3D, MSVC 14.52, Windows SDK 10.0.26100, DXC 1.9.2602.17, debug layer unavailable (Graphics Tools not installed).mesh_od_pipeline_hardware: passed on NVIDIA GeForce RTX 5080 (10de:2c02, 32.0.16.2124) and on the AMD Radeon iGPU (1002:13c0, 32.0.11034.2).mesh_od_pipeline_warp: passed on WARP (1414:008c, 10.0.26100.9818).ctest --preset dev --no-tests=error: 415 passed, 7 skipped and 2 failed out of 424. The two failures arepixel_aot_e64_approx_hardwareandpixel_aot_sdwa_unary_hardwareon the RTX 5080, already reported in #828. They also fail onmainwithout this change.cmake --build --preset releasesucceeded, andctest --preset release --no-tests=error -R '^mesh_'passed 28 of 28.Negative controls:
Draw reference mismatch(1024 pixels) on all three adapters.--checkfails when the renderer prints nomesh_pipeline_ms. With the binary built before this change, every blob reportedno mesh_pipeline_ms line from the renderer.wrong_referenceinput was built with the default seed instead of the run seed, so it passed whenever--seedwas not the default. The CTest command now uses a non-default seed. Reverting that fix makes--check --seed 0x5eed0001exit 1 withcontrol wrong_reference gave pass.Evidence and follow-up
The measurements and the reproduction command are in the new
docs/experiments.mdsection "Mesh shader -Od pipeline creation across adapters". In summary:-Odchanges loop-variant pipeline time by less than 15 %. Bothloops_8192blobs exceed the 300 s policy at about 11.6 GiB working set.-Odturns the default-optimization timeouts ofloops_4096andloops_8192into pipelines that draw the reference (17.6 s and 75.2 s).branches_4096 -Od,loops_4096andloops_8192exit with0xc0000005or0xc0000374after pipeline creation.loops_768gives a wrong image at both optimization levels.loops_512andloops_640match.loops_1024alternates between a crash and a mismatch across runs.The shaders are generated by the tool (MIT, this repository) and need no external input. They do not replay archive records. A passing draw establishes the reference image for that seed. It does not establish that default and
-Odblobs are equivalent for other inputs.Checklist
This change was AI-assisted (Claude Code); I reviewed the diff and the test results. The measurements were run on the hardware listed above.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T11:53:08Z.
Thanks for separating DXC time, PSO creation and draw outcomes across the three adapters. I pushed
930905bto make--checkreturn 77 only when every blob compiles and every draw reports missing mesh capability. A compiler failure now remains a failure even if a different blob skips. The CLI also rejects non-finite timeouts. Local synthetic controls covered all-unsupported, unsupported mixed with a compile error or crash, all-pass, and NaN/infinite timeouts. The seed wording now distinguishes varying the DXIL from observing the driver's cache. The measured results are unchanged. The new commit is waiting on CI.