Skip to content

Shaders, CLI: name a host without mesh shaders in the pipeline census - #1676

Open
fiestorra wants to merge 1 commit into
Marvisak:mainfrom
fiestorra:fix/translate-mesh-report
Open

fiestorra wants to merge 1 commit into
Marvisak:mainfrom
fiestorra:fix/translate-mesh-report

Conversation

@fiestorra

Copy link
Copy Markdown
Contributor

A census on a host without mesh shaders now says so, instead of 8,214 Unspecified error rows

victory translate … --pipelines over the whole archive on an adapter whose D3D12_OPTIONS7 mesh tier is not supported (an integrated GPU, a software one) prints:

             8214 emitted of 8713 mesh programs; 8152 validated, 0 pipelines
     8214  pipeline: Unspecified error  (e.g. … MSNC_VS_Cable_MirrorReflection_5863fb9a_Wrapped Ms)

8,214 identical E_FAIL rows are the first thing anyone sees, they look like a translator defect, and they bury the refusal reasons that are ours. The mesh programs translate and validate; it is the device that cannot run them. The runtime already knows this — victory_gpu::host::mesh_shaders() and the refusal at crates/victory-gpu/src/host.rs:324 — but the offline path, which builds its own device in victory_shader::emit::host, never asked.

This pull request adds Host::mesh_shaders() to that offline host (the same two queries the runtime makes: D3D12_OPTIONS7 mesh tier at shader model 6.6) and makes the census ask it once per worker:

// An adapter without mesh shaders refuses every one of these with
// `Unspecified error`; say that instead, once per program, so the
// tally names the host and not the translator.
HwStage::Ms if !checks.mesh => Err("the host has no mesh shaders".to_owned()),

The same run then reads:

             8214 emitted of 8713 mesh programs; 8152 validated, 0 pipelines
     8214  pipeline: the host has no mesh shaders  (e.g. … MST_DS_PNTri_c1b6bb00_Wrapped Ms)

Same count, one bucket, and it says whose limitation it is. Nothing else moves: vertex and pixel stay at 12,231 of 12,231 pipelines and compute at 1,441 of 1,441 on that adapter.

On an adapter that has mesh shaders nothing changes — the condition does not fire and the mesh pipelines are built as before. That is also what VICTORY_D3D12_ADAPTER in #1630 is for: on this machine the default adapter is the integrated GPU, so before that pull request the offline path could not reach the card anyone meant at all.

Verification

  • Two whole-archive censuses on the same machine, adapter 0 (AMD Radeon(TM) Graphics, D3D12_OPTIONS7 mesh tier not supported), before and after: 8,214 pipeline: Unspecified error → 8,214 pipeline: the host has no mesh shaders, with identical counts everywhere else.
  • The software adapter (VICTORY_WARP=1), which reports mesh tier 1 here, to confirm the new condition does not fire where the device claims support: 8,214 of 8,214 mesh pipelines created, the same as before. That run also refuses 428 compute pipelines with E_INVALIDARG (1,013 of 1,441 created), a different set from the 320 the RTX 4090 refuses; that is a separate matter, noted only so the numbers are not read as this change's.
  • cargo test -p victory-shader --locked → 120 passed, 1 ignored; cargo test -p victory --locked → 1 passed.
  • cargo clippy -p victory-shader -p victory --all-targets --all-features --locked -- -D warnings → clean; rustfmt --check clean on both files.

No unit test for the new branch, honestly: the condition is the device's answer, so the evidence is the two censuses rather than a synthetic device. A test that stubbed the answer would assert the if.

No game data is involved: counts, adapter descriptions and program names only.

Written with an AI assistant.

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (ffe310e), cargo test -p victory-shader --locked → 96 passed, 0 failed. Hardware/valu/waterfall execution tests are #[cfg(all(test, windows))] and run only on Windows.

Pipeline census names a host without mesh shaders: HostShader::mesh_shaders() exposes the capability so the CLI/report can say 'no mesh shaders' instead of failing silently. Shader-side compiles clean on macOS; the CLI/apps part is Windows-only.

@fiestorra
fiestorra force-pushed the fix/translate-mesh-report branch from 7e8fa4d to 00b4b1b Compare November 24, 2026 21:45
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
@fiestorra
fiestorra force-pushed the fix/translate-mesh-report branch 2 times, most recently from 6a99441 to 0b97470 Compare November 25, 2026 01:26
translate --pipelines reported every one of the title's 8,214 mesh programs
as 'pipeline: Unspecified error' on an adapter whose D3D12_OPTIONS7 mesh tier
is not supported (an integrated GPU, WARP): 8,214 identical rows that read as
a translator defect and bury the real refusal reasons. The runtime already
knows this (host::mesh_shaders and the refusal at host.rs:324); the offline
path did not ask.

Host::mesh_shaders() answers the same question for the offline device, and
the census asks it once per worker: a mesh program then fails with 'pipeline:
the host has no mesh shaders', one bucket that names the host, and the same
count otherwise. On an adapter with mesh shaders nothing changes: the same
8,214 pipelines are created on the RTX 4090 as before.
@fiestorra
fiestorra force-pushed the fix/translate-mesh-report branch from 0b97470 to 20aa8cb Compare November 25, 2026 01:43
@BaggyALPHA

Copy link
Copy Markdown
Contributor

Independent Windows check of 20aa8cb on upstream 940d32f, using a synthetic mesh shader and a compute control. The probe called translate::check and asserted the pipeline and DXIL validation counters independently.

  • RTX 3080 and WARP both reported mesh support and created the mesh pipeline. Both validated the mesh shader.
  • With the census mesh-capability flag forced false locally on each of those devices, it counted one pipeline: the host has no mesh shaders refusal, still validated the mesh shader, and still created and validated the compute pipeline.
  • Removing the new match guard locally made that probe fail because it counted a mesh pipeline even with the flag disabled. Restoring the guard returned both CLI translation tests to green.

The unsupported case was a controlled branch test on two mesh-capable adapters. No game files were used. AI-assisted (OpenAI Codex).

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Merge candidate. This adds Host::mesh_shaders() to the offline host (crates/victory-shader/src/emit/host.rs), making the same mesh-tier and SM 6.6 queries as the runtime's mesh_shaders in victory-gpu. With it, translate --pipelines reports "the host has no mesh shaders" on such adapters instead of thousands of E_FAIL rows; on adapters with mesh shaders nothing changes. The change is small and diagnostic only. CI passes. It will conflict textually with #1648's changes to translate.rs, whichever lands second.


Generated by Claude Code

@StExpeditus

Copy link
Copy Markdown

Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at 20aa8cb. cargo test --workspace --locked --no-fail-fast -> 695 passed, 6 failed, 10 ignored. Failed: descriptor::host::tests::dynamic_slots_are_held_until_released ... FAILED | draw::tests::root_views_reach_their_copy_and_read_zeros_past_it ... FAILED | memory::tests::lists_share_a_table_and_copies_keep_their_views ... FAILED | emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride ... FAILED | emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros ... FAILED | emit::synthetic_tests::gathers_at_a_level_match_the_hardware ... FAILED

@StExpeditus

Copy link
Copy Markdown

Follow-up on the 6th failure in my report above (draw::tests::root_views_reach_their_copy_and_read_zeros_past_it):

  • In isolation it passes 2/2 on this branch and 2/2 on main.
  • A second full cargo test --workspace --locked --no-fail-fast run on this branch shows the usual 5 failures only; the test passed this time (... ok).

So that one looks like a transient suite-order contention (the test reads zeros when the NVIDIA 1M view-heap cap is hit by parallel tests), not a regression introduced by this PR. The 5 failures are the pre-existing heap-cap ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants