Graphics: mesh programs pick their form from the measured mesh-shader wave #29

Manually merged
github merged 2 commits from gh-pr/29/head into gh-pr/29/base 2026-11-27 03:14:32 +00:00
Owner

@⁠Sr-0w on GitHub · 2026-11-25 12:45 UTC · original
Sr-0w:graphics/mesh-wave-probe → main · +375 −23 · 18 files · 2 commits · merged 2026-11-25 13:05 UTC

D3D12 reports one wave range for every stage (WaveLaneCountMin-Max), so a wave64 mesh program with floor 64 took its superstep form on any 32-64 adapter. An RX 7800 XT runs every mesh shader in 64-lane waves (at 32, 64 and 128 threads and with long loops), and there the superstep form of a skinned depth pass (85 group-barrier stops) held a retail game's queue for 1.5 s or more per draw.

  • MeshWaveProbe (FiveStar.Graphics) dispatches a 128-thread probe mesh shader, embedded as HLSL and compiled by the DXIL backend (bindless raw UAV at heap slot 0), and keeps the least WaveGetLaneCount.
  • The loader measures it once per device (DesktopAdapter, logged as mesh shaders run in N-lane waves (probe)). The CLI measures it through MeasuredAdapters for plan, pso and setup.
  • AdapterInfo.MeshWaveLanes carries the result. The compile-host protocol passes it on, the program-cache adapter folder includes it (-ms64), and --list-adapters prints it.
  • VariantSelector compares a mesh shader's floor with the measured wave, or with WaveLaneCountMin when nothing was measured. Compute fallbacks still use WaveLaneCountMin.

Tests:

  • The probe runs on WARP and reports the same wave the desktop adapter describes.
  • A floor-64 mesh program runs natively when the measured mesh wave is 64. It keeps its superstep form when the wave was not measured or is 32.
  • Full suite green locally.

Docs: shader-translation.md (Variant selection) and d3d12x-pipelines.md (adapter folder, variant row).

🤖 Generated with Claude Code

**@⁠Sr-0w** on GitHub · 2026-11-25 12:45 UTC · [original](https://github.com/ThatRecompDev/five-star-recomp/pull/29) `Sr-0w:graphics/mesh-wave-probe` → `main` · +375 −23 · 18 files · 2 commits · merged 2026-11-25 13:05 UTC D3D12 reports one wave range for every stage (`WaveLaneCountMin`-`Max`), so a wave64 mesh program with floor 64 took its superstep form on any 32-64 adapter. An RX 7800 XT runs every mesh shader in 64-lane waves (at 32, 64 and 128 threads and with long loops), and there the superstep form of a skinned depth pass (85 group-barrier stops) held a retail game's queue for 1.5 s or more per draw. - `MeshWaveProbe` (FiveStar.Graphics) dispatches a 128-thread probe mesh shader, embedded as HLSL and compiled by the DXIL backend (bindless raw UAV at heap slot 0), and keeps the least `WaveGetLaneCount`. - The loader measures it once per device (`DesktopAdapter`, logged as `mesh shaders run in N-lane waves (probe)`). The CLI measures it through `MeasuredAdapters` for plan, pso and setup. - `AdapterInfo.MeshWaveLanes` carries the result. The compile-host protocol passes it on, the program-cache adapter folder includes it (`-ms64`), and `--list-adapters` prints it. - `VariantSelector` compares a mesh shader's floor with the measured wave, or with `WaveLaneCountMin` when nothing was measured. Compute fallbacks still use `WaveLaneCountMin`. Tests: - The probe runs on WARP and reports the same wave the desktop adapter describes. - A floor-64 mesh program runs natively when the measured mesh wave is 64. It keeps its superstep form when the wave was not measured or is 32. - Full suite green locally. Docs: `shader-translation.md` (Variant selection) and `d3d12x-pipelines.md` (adapter folder, variant row). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
D3D12 reports one wave range for every stage (WaveLaneCountMin-Max), so a
wave64 mesh program whose floor is 64 took its superstep form on any
32-64 adapter. An RX 7800 XT runs every mesh shader in 64-lane waves
(at 32, 64 and 128 threads and with long loops alike), and there the
superstep form of a skinned depth pass (85 group-barrier stops) held a
retail game's queue for 1.5 s or more per draw, frames of 3.5 to 6 s.

MeshWaveProbe dispatches a 128-thread probe mesh shader (embedded DXIL,
its HLSL and dxc line beside it) and keeps the least WaveGetLaneCount.
The loader measures it once per device in DesktopAdapter and the CLI in
AdapterCatalog; AdapterInfo carries it as MeshWaveLanes, the compile
host receives it, the program-cache adapter folder names it (-ms64) and
--list-adapters prints it. VariantSelector compares a mesh shader's
floor with it (WaveLaneCountMin when unmeasured); the compute fallbacks
keep WaveLaneCountMin.

Tests: the probe runs on WARP and its wave is the one the desktop adapter
reports; a mesh program of floor 64 runs natively with a measured 64-lane
mesh wave and keeps its superstep form unmeasured or at 32.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XTYmP8DzdtgeCMD6HPuCyc
The repository keeps no DXIL (*.dxil is ignored), so the probe's DXIL was
never committed. MeshWaveProbe now embeds its HLSL (bindless: a raw UAV
at heap slot 0, as the backend compiles only heap-indexed resources) and
takes the DXIL from its caller: the loader's DesktopAdapter and the CLI's
MeasuredAdapters (plan, pso, setup) compile it with DxilBackend.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XTYmP8DzdtgeCMD6HPuCyc
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 03:14:31 +00:00
github manually merged commit c7f7b56e05 into gh-pr/29/base 2026-11-27 03:14:32 +00:00
Author
Owner

@⁠ThatRecompDev on GitHub · 2026-11-25 13:05 UTC · original

this is a great one: measuring the real mesh wave instead of trusting WaveLaneCountMin means AMD skips the superstep form entirely where it runs mesh shaders at 64. 1.5 s per skinned depth draw is exactly the kind of stall we've been fighting on NVIDIA too. merging, thanks!

**@⁠ThatRecompDev** on GitHub · 2026-11-25 13:05 UTC · [original](https://github.com/ThatRecompDev/five-star-recomp/pull/29#issuecomment-7163276453) this is a great one: measuring the real mesh wave instead of trusting WaveLaneCountMin means AMD skips the superstep form entirely where it runs mesh shaders at 64. 1.5 s per skinned depth draw is exactly the kind of stall we've been fighting on NVIDIA too. merging, thanks!
This discussion has been locked. Commenting is limited to contributors.
No description provided.