71 mesh shaders exceed the 32 KB mesh output limit (validator), NVIDIA accepts them #283

Open
opened 2026-11-26 03:39:53 +00:00 by github-bot · 2 comments
Owner

@⁠arminkhaleghirod on GitHub · 2026-11-24 23:13 UTC · original

With #61 applied, the validator stops hiding this one: 71 mesh programs fail with vertex plus primitive output size is greater than 32768.

  • All 71 declare 128 vertices on 128 lanes, with 65–71 output scalars per vertex, every one written. At 128 vertices the limit works out to 64 scalars, so they need 33–36 KB.
  • 27–34 of those scalars are 16-bit values declared as 32-bit. Declaring them as 16-bit would bring them under the limit with every vertex kept.
  • On an RTX 4080, translate --pipelines still creates all 8,762 mesh pipelines, including these 71. So NVIDIA draws them today, and it's a validator-level problem there. Other drivers may refuse them.

Lowering the vertex maximum to 96 makes them validate, but it drops the triangles that use vertices 96–127. I tried it and am not proposing it. The real fix is 16-bit signature elements for the 16-bit outputs.

**@⁠arminkhaleghirod** on GitHub · 2026-11-24 23:13 UTC · [original](https://github.com/fxceless/victory-fork/issues/283) With #61 applied, the validator stops hiding this one: 71 mesh programs fail with `vertex plus primitive output size is greater than 32768`. - All 71 declare 128 vertices on 128 lanes, with 65–71 output scalars per vertex, every one written. At 128 vertices the limit works out to 64 scalars, so they need 33–36 KB. - 27–34 of those scalars are 16-bit values declared as 32-bit. Declaring them as 16-bit would bring them under the limit with every vertex kept. - On an RTX 4080, `translate --pipelines` still creates all 8,762 mesh pipelines, including these 71. So NVIDIA draws them today, and it's a validator-level problem there. Other drivers may refuse them. Lowering the vertex maximum to 96 makes them validate, but it drops the triangles that use vertices 96–127. I tried it and am not proposing it. The real fix is 16-bit signature elements for the 16-bit outputs.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:39:53 +00:00
Author
Owner

@⁠avt0m4t48 on GitHub · 2026-11-24 23:32 UTC · original

I checked the output limit on 2119b0e with a source-built fixture. The D3D12 rule charges four bytes per signature scalar, including native FP16. At 128 vertices, 65 scalars count as 33,280 bytes. Microsoft dxv rejected both 65-scalar FP32 and true-FP16 versions, including the version with storeVertexOutput.f16. D3D12 specification · Validator implementation

A control packed two already-paired FP16 export values into one flat uint and validated at 64 scalars. The fixture retained 128 vertices and a triangle using indices 125, 126, and 127. A companion pixel shader independently validated when it unpacked each vertex's value before barycentric interpolation.

This suggests a shared mesh/pixel signature layout keyed into the stage cache. The offline check covers DXIL validation. Linked pipeline creation and rendered interpolation still need verification.

**@⁠avt0m4t48** on GitHub · 2026-11-24 23:32 UTC · [original](https://github.com/fxceless/victory-fork/issues/283#issuecomment-7147506693) I checked the output limit on `2119b0e` with a source-built fixture. The D3D12 rule charges four bytes per signature scalar, including native FP16. At 128 vertices, 65 scalars count as 33,280 bytes. Microsoft `dxv` rejected both 65-scalar FP32 and true-FP16 versions, including the version with `storeVertexOutput.f16`. [D3D12 specification](https://microsoft.github.io/DirectX-Specs/d3d/MeshShader.html#mesh-shader-output-size-limits) · [Validator implementation](https://github.com/microsoft/DirectXShaderCompiler/blob/01b62ad47db7dee3dd33f90e7339cf9e860b3f93/lib/DxilValidation/DxilValidation.cpp#L6543-L6563) A control packed two already-paired FP16 export values into one flat `uint` and validated at 64 scalars. The fixture retained 128 vertices and a triangle using indices 125, 126, and 127. A companion pixel shader independently validated when it unpacked each vertex's value before barycentric interpolation. This suggests a shared mesh/pixel signature layout keyed into the stage cache. The offline check covers DXIL validation. Linked pipeline creation and rendered interpolation still need verification.
Author
Owner

@⁠avt0m4t48 on GitHub · 2026-11-25 00:18 UTC · original · edited 2026-11-25 00:27 UTC

The packed interface now has a native Windows readback check. On a Windows CI runner I used the pinned Microsoft WARP 1.0.22, verified SM 6.6, mesh tier 1 and barycentric support, then created and rendered four mesh/pixel PSOs. The mesh retained 128 declared vertices with triangle indices 125, 126 and 127.

The packed and split reference shaders covered the same 66 pixels of a 16×16 target. The perspective-correct results matched each other and the CPU oracle with unequal clip-space W. Both flat variants matched the provoking vertex. The PSO check rejected the deliberately mismatched pair whose pixel input semantic was absent from the mesh output. Windows run and logs · Synthetic fixture and test

This run used original Microsoft DXC stages. The implementation work in Victory is to select the same layout for both stages, unpack each vertex before weighting, and key both translation caches by that layout. The test covers D3D12 software execution. Results on physical GPUs and title shaders are still pending. The fixture and checks were prepared with Codex assistance.

**@⁠avt0m4t48** on GitHub · 2026-11-25 00:18 UTC · [original](https://github.com/fxceless/victory-fork/issues/283#issuecomment-7148375780) · edited 2026-11-25 00:27 UTC The packed interface now has a native Windows readback check. On a Windows CI runner I used the pinned Microsoft WARP 1.0.22, verified SM 6.6, mesh tier 1 and barycentric support, then created and rendered four mesh/pixel PSOs. The mesh retained 128 declared vertices with triangle indices 125, 126 and 127. The packed and split reference shaders covered the same 66 pixels of a 16×16 target. The perspective-correct results matched each other and the CPU oracle with unequal clip-space W. Both flat variants matched the provoking vertex. The PSO check rejected the deliberately mismatched pair whose pixel input semantic was absent from the mesh output. [Windows run and logs](https://github.com/avt0m4t48/victory-fork/actions/runs/45516754565) · [Synthetic fixture and test](https://github.com/avt0m4t48/victory-fork/commit/43fb96b47c40fa11c02354f448fc7ba7fa762c3e) This run used original Microsoft DXC stages. The implementation work in Victory is to select the same layout for both stages, unpack each vertex before weighting, and key both translation caches by that layout. The test covers D3D12 software execution. Results on physical GPUs and title shaders are still pending. The fixture and checks were prepared with Codex assistance.
This discussion has been locked. Commenting is limited to contributors.
No description provided.