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

Open
redNSF wants to merge 1 commit from upstream-pr/3051 into main
redNSF commented 2026-11-26 05:29:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by redNSF on 2026-11-26T05:29:13Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6620194045 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3051). Originally posted by [redNSF](https://github.com/redNSF) on 2026-11-26T05:29:13Z. --- 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.
fuzeofficlal commented 2026-11-26 05:36:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T05:36:28Z.

Review: APPROVED


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.

<!-- greyfinch-sync:Marvisak/VIctory:review:6069049697 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3051#pullrequestreview-6069049697). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T05:36:28Z. **Review:** APPROVED --- 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.
kotekompotek commented 2026-11-26 06:00:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T06:00:31Z.

Review: APPROVED


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.

<!-- greyfinch-sync:Marvisak/VIctory:review:6069241967 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3051#pullrequestreview-6069241967). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-26T06:00:31Z. **Review:** APPROVED --- 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.
Marvisak commented 2026-11-26 07:01:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T06:18:01Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7184292466 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3051#issuecomment-7184292466). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-26T06:18:01Z. --- <!-- 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)_
oni-swr commented 2026-11-26 11:03:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-26T10:16:18Z.


Independent Windows WARP verification of 844e6f61 against its exact parent, current main (63bcca43). Coordination claim: https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7184310773. 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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7189140100 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3051#issuecomment-7189140100). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-26T10:16:18Z. --- <!-- oni-swr warp verification 844e6f618a01f696b44d22251b5afb035aec8892 --> Independent Windows WARP verification of `844e6f61` against its exact parent, current `main` (`63bcca43`). Coordination claim: https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7184310773. 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.
Jackster commented 2026-11-26 16:35:57 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T16:35:57Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7197854917 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3051#issuecomment-7197854917). Originally posted by [Jackster](https://github.com/Jackster) on 2026-11-26T16:35:57Z. --- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3051:upstream-pr/3051'
git switch 'upstream-pr/3051'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3051'
git switch 'upstream-pr/3051'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3051'
git switch 'upstream-pr/3051'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3051'
git switch 'main'
git merge --squash 'upstream-pr/3051'
git switch 'main'
git merge --ff-only 'upstream-pr/3051'
git switch 'main'
git merge 'upstream-pr/3051'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!3049
No description provided.