GPU: mesh pipelines without a pixel shader get an empty one on WARP #3051

Open
github-bot wants to merge 1 commit from github-bot/gh-3051 into main AGit
Owner

@⁠redNSF on GitHub · 2026-11-26 05:29 UTC · original
redNSF:gpu/warp-mesh-without-pixel-shader → main · +59 −3 · 4 files · 1 commits · open

The software adapter (WARP) loses the device at the first draw of a mesh pipeline that has no pixel shader, as depth-only passes do. A trivial mesh shader drawing one triangle shows it, drawn directly and through ExecuteIndirect; with a pixel shader that reads and writes nothing bound, the same draws run and write the same depth.

In diagnostics builds with VICTORY_D3D12_WARP, the host now gives such pipelines that empty pixel shader. Hardware adapters are not affected.

**@⁠redNSF** on GitHub · 2026-11-26 05:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/3051) `redNSF:gpu/warp-mesh-without-pixel-shader` → `main` · +59 −3 · 4 files · 1 commits · open The software adapter (WARP) loses the device at the first draw of a mesh pipeline that has no pixel shader, as depth-only passes do. A trivial mesh shader drawing one triangle shows it, drawn directly and through ExecuteIndirect; with a pixel shader that reads and writes nothing bound, the same draws run and write the same depth. In diagnostics builds with VICTORY_D3D12_WARP, the host now gives such pipelines that empty pixel shader. Hardware adapters are not affected.
The software adapter (WARP) loses the device at the first draw of a mesh
pipeline that has no pixel shader, as depth-only passes do. A trivial mesh
shader drawing one triangle shows it, drawn directly and through
ExecuteIndirect; with a pixel shader that reads and writes nothing bound,
the same draws run and write the same depth.

In diagnostics builds with VICTORY_D3D12_WARP, the host now gives such
pipelines that empty pixel shader. Hardware adapters are not affected.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:27:34 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 06:18 UTC · original

Automated triage for the maintainers.

Verdict: needs work. The change is narrow and gated. In crates/victory-gpu/src/pipeline/host.rs, HostPipeline substitutes victory_shader::emit::empty_ps for a missing pixel shader only on mesh pipelines, and only when host::software() is true (a diagnostics build with VICTORY_D3D12_WARP). The pipeline-library name includes the substituted shader, so cached pipelines stay distinct. A null pixel shader is valid D3D12, though, so this works around a WARP fault. The only evidence is the description. To make it reviewable:

  • Say which WARP build shows the device removal: the system d3d10warp.dll version, or the redistributable package version. Behaviour has differed between them in earlier reports on this repo.
  • Add the repro as a test: the one-triangle mesh shader without a pixel shader, drawn directly and through ExecuteIndirect. Run it under the WARP switch, so the workaround can be dropped once WARP is fixed.
  • CI's check is failing. The failure is in descriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_wait ("both made"), which this PR does not touch, so it looks unrelated. A re-run or a rebase should confirm that.

Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 06:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/3051#issuecomment-7184292466) <!-- victory-triage v1 head=844e6f618a01f696b44d22251b5afb035aec8892 verdict=needs-work at=2026-11-26T06:19:30Z --> Automated triage for the maintainers. **Verdict: needs work.** The change is narrow and gated. In `crates/victory-gpu/src/pipeline/host.rs`, `HostPipeline` substitutes `victory_shader::emit::empty_ps` for a missing pixel shader only on mesh pipelines, and only when `host::software()` is true (a diagnostics build with `VICTORY_D3D12_WARP`). The pipeline-library name includes the substituted shader, so cached pipelines stay distinct. A null pixel shader is valid D3D12, though, so this works around a WARP fault. The only evidence is the description. To make it reviewable: - Say which WARP build shows the device removal: the system `d3d10warp.dll` version, or the redistributable package version. Behaviour has differed between them in earlier reports on this repo. - Add the repro as a test: the one-triangle mesh shader without a pixel shader, drawn directly and through ExecuteIndirect. Run it under the WARP switch, so the workaround can be dropped once WARP is fixed. - CI's `check` is failing. The failure is in `descriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_wait` ("both made"), which this PR does not touch, so it looks unrelated. A re-run or a rebase should confirm that. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 05:36 UTC · original · approved these changes

Reviewed head 844e6f61 and verified locally on Windows 11 (NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC, Windows SDK 10.0.26100 dxil.dll):

  • victory-shader: emit::empty::tests::the_empty_pixel_shader_validates passed with system dxil.dll validation.
  • victory-gpu (--features diagnostics): pipeline:: tests (26/26) passed on both RTX 5090 and VICTORY_D3D12_WARP=1.
  • cargo clippy -p victory-shader -p victory-gpu --all-targets -- -D warnings (default and --features diagnostics) and cargo xtask policy (192 files ok) passed.

Confirmed empty_ps() is only substituted when mesh.is_some(), code(1).pShaderBytecode.is_null(), and crate::host::software() is true, and the substituted bytes are hashed into library::name so WARP and hardware pipeline-library entries cannot collide.

Note on the red CI run (check job 139713665040): the sole failure is the unrelated descriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_wait (both made) timing flake; everything touched here is clean. Minor non-blocking nit: host::create() can reuse the new software() helper on line 188.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 05:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/3051#pullrequestreview-6069049697) · **approved these changes** Reviewed head `844e6f61` and verified locally on Windows 11 (NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC, Windows SDK 10.0.26100 `dxil.dll`): - `victory-shader`: `emit::empty::tests::the_empty_pixel_shader_validates` passed with system `dxil.dll` validation. - `victory-gpu` (`--features diagnostics`): `pipeline::` tests (26/26) passed on both RTX 5090 and `VICTORY_D3D12_WARP=1`. - `cargo clippy -p victory-shader -p victory-gpu --all-targets -- -D warnings` (default and `--features diagnostics`) and `cargo xtask policy` (`192 files ok`) passed. Confirmed `empty_ps()` is only substituted when `mesh.is_some()`, `code(1).pShaderBytecode.is_null()`, and `crate::host::software()` is true, and the substituted bytes are hashed into `library::name` so WARP and hardware pipeline-library entries cannot collide. Note on the red CI run (`check` job `139713665040`): the sole failure is the unrelated `descriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_wait` (`both made`) timing flake; everything touched here is clean. Minor non-blocking nit: `host::create()` can reuse the new `software()` helper on line 188.
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-26 06:00 UTC · original · approved these changes

Verified: the substitution is scoped exactly right — mesh pipeline + null PS + software adapter only (host::software() is diagnostics-gated, so hardware paths are untouched), and name hashes the substituted bytecode so the cache key matches the compiled pipeline. empty_ps emits through the project's own Shader builder (real DXIL, system-validator-checked), and the OnceLock keeps pShaderBytecode valid for every pipeline using it. The documented failure mode (WARP device loss on depth-only mesh draws) is plausible and consistent with #2949-era WARP issues.

**@⁠kotekompotek** on GitHub · 2026-11-26 06:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/3051#pullrequestreview-6069241967) · **approved these changes** Verified: the substitution is scoped exactly right — mesh pipeline + null PS + software adapter only (`host::software()` is diagnostics-gated, so hardware paths are untouched), and `name` hashes the substituted bytecode so the cache key matches the compiled pipeline. `empty_ps` emits through the project's own Shader builder (real DXIL, system-validator-checked), and the OnceLock keeps `pShaderBytecode` valid for every pipeline using it. The documented failure mode (WARP device loss on depth-only mesh draws) is plausible and consistent with #2949-era WARP issues.
Author
Owner

@⁠oni-swr on GitHub · 2026-11-26 10:16 UTC · original

Independent Windows WARP verification of 844e6f61 against its exact parent, current main (63bcca43). Coordination claim: #1633. I confirmed Microsoft Basic Render Driver (DXGI software adapter, d3d10warp.dll 10.0.26100.9818 loaded) with VICTORY_D3D12_WARP=1 and diagnostics enabled. The adapter reported mesh shader tier 1 and Shader Model 6.6, so neither mesh draw path was skipped. No physical GPU was used.

  • Fixture: a synthetic depth-only mesh shader (one triangle, SV_Position only, built with the SDK dxc) in a local WARP probe test (not part of the PR), with no pixel shader supplied.
  • On the parent, the direct and the indirect mesh draw both lost the device (DXGI_ERROR_DEVICE_REMOVED, 0x887A0005) at the depth readback map.
  • On the parent with an explicit empty pixel shader supplied, both draws passed. Depth readback was [0.25, 0.5, 0.25, 0.5].
  • On the PR head with the pixel stage omitted, both the direct and indirect draws passed, with the same readback [0.25, 0.5, 0.25, 0.5].
  • victory-gpu pipeline:: tests (diagnostics feature): 27 passed, 0 failed.
  • victory-shader emit::empty::tests::the_empty_pixel_shader_validates passed, using the SDK dxil.dll (VICTORY_DXIL) for validation.

AI-assisted with Claude Code (claude-sonnet-5-5), continuing a session started with Codex (gpt-6.2-sol). Synthetic data only.

**@⁠oni-swr** on GitHub · 2026-11-26 10:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/3051#issuecomment-7189140100) <!-- oni-swr warp verification 844e6f618a01f696b44d22251b5afb035aec8892 --> Independent Windows WARP verification of `844e6f61` against its exact parent, current `main` (`63bcca43`). Coordination claim: https://git.gtahub.st/github/Marvisak--VIctory/issues/1633. I confirmed Microsoft Basic Render Driver (DXGI software adapter, `d3d10warp.dll` 10.0.26100.9818 loaded) with `VICTORY_D3D12_WARP=1` and diagnostics enabled. The adapter reported mesh shader tier 1 and Shader Model 6.6, so neither mesh draw path was skipped. No physical GPU was used. - Fixture: a synthetic depth-only mesh shader (one triangle, `SV_Position` only, built with the SDK `dxc`) in a local WARP probe test (not part of the PR), with no pixel shader supplied. - On the parent, the direct and the indirect mesh draw both lost the device (`DXGI_ERROR_DEVICE_REMOVED`, `0x887A0005`) at the depth readback map. - On the parent with an explicit empty pixel shader supplied, both draws passed. Depth readback was `[0.25, 0.5, 0.25, 0.5]`. - On the PR head with the pixel stage omitted, both the direct and indirect draws passed, with the same readback `[0.25, 0.5, 0.25, 0.5]`. - `victory-gpu` `pipeline::` tests (diagnostics feature): 27 passed, 0 failed. - `victory-shader` `emit::empty::tests::the_empty_pixel_shader_validates` passed, using the SDK `dxil.dll` (`VICTORY_DXIL`) for validation. AI-assisted with Claude Code (claude-sonnet-5-5), continuing a session started with Codex (gpt-6.2-sol). Synthetic data only.
Author
Owner

@⁠Jackster on GitHub · 2026-11-26 16:35 UTC · original

Your red check is the same descriptor flake that hit #3192, not this change.

  • CI run 45761913104 failed in descriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_wait — panicked at descriptor/host.rs:2011: both made (230 passed, 1 failed).
  • The identical failure is in #3192's CI (run 45817568596), a shader-only change, so it is not attributable to either PR.
  • The cause is the test's single global WHILE_PREPARING hook, which any test's prepare can take or overwrite in a parallel suite; claimed in #1633 by @⁠fyernald as a test-only per-thread hook, no PR yet.
  • Unpatched 63bcca4 here passes cargo test -p victory-gpu --lib 8 of 8 runs, so it is load dependent.

A re-run will likely go green. AI-assisted.

**@⁠Jackster** on GitHub · 2026-11-26 16:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/3051#issuecomment-7197854917) Your red check is the same descriptor flake that hit #3192, not this change. - CI run [45761913104](https://github.com/Marvisak/VIctory/actions/runs/45761913104) failed in `descriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_wait` — `panicked at descriptor/host.rs:2011: both made` (230 passed, 1 failed). - The identical failure is in #3192's CI (run 45817568596), a shader-only change, so it is not attributable to either PR. - The cause is the test's single global `WHILE_PREPARING` hook, which any test's `prepare` can take or overwrite in a parallel suite; claimed in #1633 by @⁠fyernald as a test-only per-thread hook, no PR yet. - Unpatched `63bcca4` here passes `cargo test -p victory-gpu --lib` 8 of 8 runs, so it is load dependent. A re-run will likely go green. AI-assisted.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3051/head:github-bot/gh-3051'
git switch 'github-bot/gh-3051'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3051'
git switch 'github-bot/gh-3051'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3051'
git switch 'github-bot/gh-3051'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3051'
git switch 'main'
git merge --squash 'github-bot/gh-3051'
git switch 'main'
git merge --ff-only 'github-bot/gh-3051'
git switch 'main'
git merge 'github-bot/gh-3051'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3051
No description provided.