translate --pipelines: driver reasons for refusals, and --only <stages> (#2537) #2560

Open
oni-swr wants to merge 5 commits from upstream-pr/2562 into main
oni-swr commented 2026-11-25 15:51:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-25T15:51:42Z.


What

Fixes #2537.

  • VICTORY_D3D12_DEBUG now reaches the device translate --pipelines creates (emit::host::Host::new), in a diagnostics build and before the first device of the process (so also before the census's initial probe). A refused root signature or pipeline then reads <error>; debug layer: id N: <message>; ... instead of a bare error code. Gating matches victory-gpu (diagnostics feature, 0 is off).
  • Hosts of one adapter share one device and one ID3D12InfoQueue (see the note on the issue), so with the layer on, creation and the read of its messages run one at a time under a process-wide lock; shader translation stays parallel. Without the layer nothing is serialized.
  • translate --pipelines --only vs,ps,cs,ms makes pipelines for the listed stages only; every stage is still emitted and validated. It requires --pipelines and conflicts with --cache. Documented in the README usage and the VICTORY_D3D12_DEBUG row.

Orthogonal to #2456 (adapter selection): no adapter logic touched. Expect a trivial textual overlap in emit/host.rs Host::new and the README usage lines.

Tests (software adapter only, no GPU, no title data)

  • tests/debug_layer.rs (own process, layer on): a non-shader refused on WARP names the layer's reason; 8 hosts on the same device refusing concurrently each keep their message (fails without the lock — checked).
  • tests/debug_layer_off.rs: same refusal without the layer is the bare error.
  • Unit tests for the stage filter.
  • cargo test -p victory, -p xtask repository_passes_policy, cargo clippy -p victory-shader -p victory --all-targets clean. cargo test -p victory-shader --features host,diagnostics on WARP: 3 hardware-behavior tests fail (a_mask_joined_with_data_at_a_uniform_loop_is_its_number, gathers_at_a_level_match_the_hardware, permutes_read_the_lane_named_and_zero_from_lanes_left_out), identically on unmodified main.

Not measured: census performance with the layer on.

AI disclosure: written by Claude Code (Claude Sonnet 5.5).

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:5494622301 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2562). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-25T15:51:42Z. --- ## What Fixes #2537. - `VICTORY_D3D12_DEBUG` now reaches the device `translate --pipelines` creates (`emit::host::Host::new`), in a diagnostics build and before the first device of the process (so also before the census's initial probe). A refused root signature or pipeline then reads `<error>; debug layer: id N: <message>; ...` instead of a bare error code. Gating matches `victory-gpu` (`diagnostics` feature, `0` is off). - Hosts of one adapter share one device and one `ID3D12InfoQueue` (see the note on the issue), so with the layer on, creation and the read of its messages run one at a time under a process-wide lock; shader translation stays parallel. Without the layer nothing is serialized. - `translate --pipelines --only vs,ps,cs,ms` makes pipelines for the listed stages only; every stage is still emitted and validated. It requires `--pipelines` and conflicts with `--cache`. Documented in the README usage and the `VICTORY_D3D12_DEBUG` row. Orthogonal to #2456 (adapter selection): no adapter logic touched. Expect a trivial textual overlap in `emit/host.rs` `Host::new` and the README usage lines. ## Tests (software adapter only, no GPU, no title data) - `tests/debug_layer.rs` (own process, layer on): a non-shader refused on WARP names the layer's reason; 8 hosts on the same device refusing concurrently each keep their message (fails without the lock — checked). - `tests/debug_layer_off.rs`: same refusal without the layer is the bare error. - Unit tests for the stage filter. - `cargo test -p victory`, `-p xtask repository_passes_policy`, `cargo clippy -p victory-shader -p victory --all-targets` clean. `cargo test -p victory-shader --features host,diagnostics` on WARP: 3 hardware-behavior tests fail (`a_mask_joined_with_data_at_a_uniform_loop_is_its_number`, `gathers_at_a_level_match_the_hardware`, `permutes_read_the_lane_named_and_zero_from_lanes_left_out`), identically on unmodified `main`. Not measured: census performance with the layer on. AI disclosure: written by Claude Code (Claude Sonnet 5.5). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Marvisak commented 2026-11-25 19:06:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T18:40:17Z.


Automated triage for the maintainers.

Merge candidate (recommending a look, not an approval). Thanks for the rebase and the follow-up. In crates/victory-shader/src/emit/host.rs, create_device now enables the debug layer once per process (enable_debug_layer, diagnostics builds, VICTORY_D3D12_DEBUG not 0) and warns once if it is unavailable; Host::made wraps root-signature and pipeline creation so that, when the device has an ID3D12InfoQueue, creation is serialised under CREATION and a refusal carries the layer's messages. Without the layer the cast fails and nothing is serialised. translate --pipelines --only vs,ps,cs,ms (apps/victory/src/translate.rs, wanted) limits pipeline creation by stage, and clap enforces requires = "pipelines" / conflicts_with = "cache". I checked that victory-gpu only reaches this module through Host::from_device (no second EnableDebugLayer in the game process). It merges cleanly and CI check is passing.

Minor: in the game process with the layer on, fuses_fmad goes through made once at start-up and clears the device's stored messages at that point. Overlaps #2560 (same issue #2537), which currently conflicts with main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7171231212 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2562#issuecomment-7171231212). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T18:40:17Z. --- <!-- victory-triage v1 head=ad66ddf5fc1d5b86d1c9b5f5238ed117be588464 verdict=merge-candidate at=2026-11-26T02:18:05Z --> Automated triage for the maintainers. **Merge candidate** (recommending a look, not an approval). Thanks for the rebase and the follow-up. In `crates/victory-shader/src/emit/host.rs`, `create_device` now enables the debug layer once per process (`enable_debug_layer`, diagnostics builds, `VICTORY_D3D12_DEBUG` not `0`) and warns once if it is unavailable; `Host::made` wraps root-signature and pipeline creation so that, when the device has an `ID3D12InfoQueue`, creation is serialised under `CREATION` and a refusal carries the layer's messages. Without the layer the cast fails and nothing is serialised. `translate --pipelines --only vs,ps,cs,ms` (`apps/victory/src/translate.rs`, `wanted`) limits pipeline creation by stage, and clap enforces `requires = "pipelines"` / `conflicts_with = "cache"`. I checked that `victory-gpu` only reaches this module through `Host::from_device` (no second `EnableDebugLayer` in the game process). It merges cleanly and CI `check` is passing. Minor: in the game process with the layer on, `fuses_fmad` goes through `made` once at start-up and clears the device's stored messages at that point. Overlaps #2560 (same issue #2537), which currently conflicts with `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
KainanP commented 2026-11-25 23:06:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by KainanP on 2026-11-25T22:54:00Z.


Compared with #2560 on an RTX 4060 and WARP. This machine has no debug layer, so the reasons themselves are unverified. There are no regressions with the switch on or off (also 0ec4c483 on f3578e38). Recommended, with one ask: warn when the layer is missing. https://github.com/Marvisak/VIctory/issues/2537#issuecomment-7176909182 (AI-assisted)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7176915803 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2562#issuecomment-7176915803). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-25T22:54:00Z. --- Compared with #2560 on an RTX 4060 and WARP. This machine has no debug layer, so the reasons themselves are unverified. There are no regressions with the switch on or off (also `0ec4c483` on `f3578e38`). Recommended, with one ask: warn when the layer is missing. https://github.com/Marvisak/VIctory/issues/2537#issuecomment-7176909182 (AI-assisted)
oni-swr commented 2026-11-26 00:03:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-25T23:57:12Z.


Merged upstream main (f3578e3) into the existing fork branch and pushed 0ec4c48 as a fast-forward. GitHub reports this head mergeable and up to date with main.

The earlier EnableDebugLayer suggestion is addressed. A process-wide Once now guards setup before the shader host creates its first device. The merge preserves upstream's shared WARP device and locking, and root-signature and pipeline refusals still capture debug-layer messages.

Local checks passed on the updated head:

  • All three debug-layer integration tests on WARP, including concurrent refusals with the layer on and the original error with the layer off.
  • A synthetic compute dispatch on WARP with DXIL validation confirmed using the Windows SDK dxil.dll.
  • The victory tests, repository asset-policy test, and workspace Clippy with default and all features.

AI disclosure: Claude Code (Claude Sonnet 5.5) authored the original PR. Claude Code (Claude Opus 5.5) resolved the merge and implemented the one-time initialization. Codex (gpt-6.2-sol) verified the update, ran the final checks, and pushed it.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7178237073 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2562#issuecomment-7178237073). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-25T23:57:12Z. --- Merged upstream `main` (`f3578e3`) into the existing fork branch and pushed `0ec4c48` as a fast-forward. GitHub reports this head mergeable and up to date with `main`. The earlier `EnableDebugLayer` suggestion is addressed. A process-wide `Once` now guards setup before the shader host creates its first device. The merge preserves upstream's shared WARP device and locking, and root-signature and pipeline refusals still capture debug-layer messages. Local checks passed on the updated head: - All three debug-layer integration tests on WARP, including concurrent refusals with the layer on and the original error with the layer off. - A synthetic compute dispatch on WARP with DXIL validation confirmed using the Windows SDK `dxil.dll`. - The `victory` tests, repository asset-policy test, and workspace Clippy with default and all features. AI disclosure: Claude Code (Claude Sonnet 5.5) authored the original PR. Claude Code (Claude Opus 5.5) resolved the merge and implemented the one-time initialization. Codex (gpt-6.2-sol) verified the update, ran the final checks, and pushed it.
oni-swr commented 2026-11-26 01:04:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-26T00:23:58Z.


@KainanP Thanks for flagging this. ad66ddf now warns once per process if VICTORY_D3D12_DEBUG requests the layer and it is unavailable. The warning points to Graphics Tools in Windows Optional Features. Pipeline checks continue without debug-layer messages.

On WARP, the existing debug-layer tests passed with the layer available and with it disabled. I temporarily simulated an unavailable layer and verified that concurrent pipeline creation and draws still completed, with one warning when requested and zero with VICTORY_D3D12_DEBUG=0. Synthetic DXIL validation with the Windows SDK dxil.dll, the repository asset-policy test, and shader-library Clippy also passed.

AI disclosure: Codex (gpt-6.2-sol) implemented and verified this follow-up.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7178713955 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2562#issuecomment-7178713955). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-26T00:23:58Z. --- @KainanP Thanks for flagging this. `ad66ddf` now warns once per process if `VICTORY_D3D12_DEBUG` requests the layer and it is unavailable. The warning points to Graphics Tools in Windows Optional Features. Pipeline checks continue without debug-layer messages. On WARP, the existing debug-layer tests passed with the layer available and with it disabled. I temporarily simulated an unavailable layer and verified that concurrent pipeline creation and draws still completed, with one warning when requested and zero with `VICTORY_D3D12_DEBUG=0`. Synthetic DXIL validation with the Windows SDK `dxil.dll`, the repository asset-policy test, and shader-library Clippy also passed. AI disclosure: Codex (gpt-6.2-sol) implemented and verified this follow-up.
reboot0000-cmd commented 2026-11-26 12:05:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by reboot0000-cmd on 2026-11-26T11:27:07Z.


Verified on the host this exists for: every refusal now names the driver's reason — 396 of 396.

Windows 10 IoT Enterprise LTSC 2021 (19044.7846) with Graphics Tools installed, RTX 4090 (WaveLaneCount 32..32), validator DXC 1.8.2502.8, --features diagnostics, VICTORY_D3D12_DEBUG=1, translate --validate --pipelines --list --only cs over the whole archive (26,503 containers, 26,084 programs). The two comparisons above could not observe this because those machines have no debug layer; this one does.

count
compute pipelines refused in this run 396
refusal lines carrying a debug-layer message 397 lines over 396 distinct programs
of those programs, ones already known as refusals from a layer-less run on this same host 396 of 396
programs the layer text reached that the control did not refuse 0

One program is recorded twice (two containers, same program), which is why 397 lines describe 396 programs. Every one of them is the same message id:

pipeline: The parameter is incorrect.; debug layer: id 622: ID3D12Device::CreateComputeShader:
Shader wants wave lane count of 64 but maximum wave lane count for device is 32.

That is the whole of #2220's complaint resolved at source: the bare E_INVALIDARG these runs used to emit now arrives with the sentence that explains it, and the offset set is identical to the layer-less census I ran on this machine this afternoon — so nothing was refused that wasn't before, and nothing was missed. The PR does what our issue asked, on the host class that motivated it.

Two things to flag about the tests, both about Windows 10 rather than the change.

cargo test -p victory-shader --features diagnostics --test debug_layer reports ok. 0 passed — silently, because the file is gated on all(windows, feature = "host", feature = "diagnostics") and one of the two was missing. It reads as a pass. With --features host,diagnostics:

no debug layer on this machine; skipped
no debug layer on this machine; skipped
test a_refused_pipeline_names_the_debug_layers_reason ... ok
test hosts_sharing_a_device_keep_their_messages ... ok
test result: ok. 2 passed; 0 failed   (finished in 0.02s)

test a_refused_pipeline_carries_no_debug_layer_text ... FAILED
  WARP: "the device supports SM 0x62 only"

This machine has the layer (System32\d3D12SDKLayers.dll present), so the skip message points at the wrong cause. What actually happens is earlier: Host::new needs a shader-model 6.6 device, and on Windows 10 a test binary runs on the in-box runtime — the app-local Agility opt-in from #463 lives in the victory executable, not in cargo test outputs — so the device creation fails at 6.2 and host() returns None. The negative-control test has no skip path and fails outright for the same reason.

Concretely, if useful:

  • separate the two skip reasons in the message — "debug layer not installed" versus "no shader-model 6.6 device (on Windows 10 the test binary has no Agility opt-in)". Right now a Windows 10 tester is told to install a feature they already installed, and then sees two green tests that examined nothing.
  • the failure and the skip are the same root cause as the link-args issue on #463, which is worth knowing while both are open.

Cost, so nobody is surprised: the layer is not free. This compute-only run took 47 minutes; the same archive with all stages and no layer took 26 on this host, so the scopes differ and it isn't a clean ratio, but the direction is clear — and the machine was only about three logical cores busy for most of it, so the extra time is waiting on the single process-wide ID3D12InfoQueue, not translating. That's inherent to draining one queue from eight workers, and it's what your second test exists to keep correct. Worth one sentence in the docs: expect a census with the layer to run several times slower and near-serial, and run it with --only cs when refusals are the question.

One setup note that cost me a wasted run: in our measurement the layer only became reachable once D3D12SDKLayers.dll was staged next to the app-local runtime. With only D3D12\D3D12Core.dll present, the new code printed VICTORY_D3D12_DEBUG requested the D3D12 debug layer, but it is unavailable. Install Graphics Tools… on a machine that has it; the same binary with D3D12\D3D12SDKLayers.dll alongside D3D12Core.dll printed no warning and produced the 396 messages above. Whether the System32 copy is consulted at all when the Agility runtime is loaded, I did not test — but if the warning also mentioned staging D3D12SDKLayers.dll beside D3D12Core.dll it would have saved me an hour.

Counts and driver text only; no game files.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7190745169 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2562#issuecomment-7190745169). Originally posted by [reboot0000-cmd](https://github.com/reboot0000-cmd) on 2026-11-26T11:27:07Z. --- **Verified on the host this exists for: every refusal now names the driver's reason — 396 of 396.** Windows 10 IoT Enterprise LTSC 2021 (`19044.7846`) with Graphics Tools installed, RTX 4090 (`WaveLaneCount` 32..32), validator DXC `1.8.2502.8`, `--features diagnostics`, `VICTORY_D3D12_DEBUG=1`, `translate --validate --pipelines --list --only cs` over the whole archive (26,503 containers, 26,084 programs). The two comparisons above could not observe this because those machines have no debug layer; this one does. | | count | |---|---:| | compute pipelines refused in this run | 396 | | refusal lines carrying a debug-layer message | 397 lines over **396 distinct programs** | | of those programs, ones already known as refusals from a layer-less run on this same host | **396 of 396** | | programs the layer text reached that the control did not refuse | 0 | One program is recorded twice (two containers, same program), which is why 397 lines describe 396 programs. Every one of them is the same message id: ``` pipeline: The parameter is incorrect.; debug layer: id 622: ID3D12Device::CreateComputeShader: Shader wants wave lane count of 64 but maximum wave lane count for device is 32. ``` That is the whole of #2220's complaint resolved at source: the bare `E_INVALIDARG` these runs used to emit now arrives with the sentence that explains it, and the offset set is identical to the layer-less census I ran on this machine this afternoon — so nothing was refused that wasn't before, and nothing was missed. The PR does what our issue asked, on the host class that motivated it. **Two things to flag about the tests, both about Windows 10 rather than the change.** `cargo test -p victory-shader --features diagnostics --test debug_layer` reports `ok. 0 passed` — silently, because the file is gated on `all(windows, feature = "host", feature = "diagnostics")` and one of the two was missing. It reads as a pass. With `--features host,diagnostics`: ``` no debug layer on this machine; skipped no debug layer on this machine; skipped test a_refused_pipeline_names_the_debug_layers_reason ... ok test hosts_sharing_a_device_keep_their_messages ... ok test result: ok. 2 passed; 0 failed (finished in 0.02s) test a_refused_pipeline_carries_no_debug_layer_text ... FAILED WARP: "the device supports SM 0x62 only" ``` This machine *has* the layer (`System32\d3D12SDKLayers.dll` present), so the skip message points at the wrong cause. What actually happens is earlier: `Host::new` needs a shader-model 6.6 device, and on Windows 10 a test binary runs on the in-box runtime — the app-local Agility opt-in from #463 lives in the `victory` executable, not in `cargo test` outputs — so the device creation fails at 6.2 and `host()` returns `None`. The negative-control test has no skip path and fails outright for the same reason. Concretely, if useful: - separate the two skip reasons in the message — "debug layer not installed" versus "no shader-model 6.6 device (on Windows 10 the test binary has no Agility opt-in)". Right now a Windows 10 tester is told to install a feature they already installed, and then sees two green tests that examined nothing. - the failure and the skip are the same root cause as the link-args issue on #463, which is worth knowing while both are open. **Cost, so nobody is surprised:** the layer is not free. This compute-only run took 47 minutes; the same archive with all stages and no layer took 26 on this host, so the scopes differ and it isn't a clean ratio, but the direction is clear — and the machine was only about three logical cores busy for most of it, so the extra time is waiting on the single process-wide `ID3D12InfoQueue`, not translating. That's inherent to draining one queue from eight workers, and it's what your second test exists to keep correct. Worth one sentence in the docs: expect a census with the layer to run several times slower and near-serial, and run it with `--only cs` when refusals are the question. One setup note that cost me a wasted run: in our measurement the layer only became reachable once `D3D12SDKLayers.dll` was staged **next to the app-local runtime**. With only `D3D12\D3D12Core.dll` present, the new code printed `VICTORY_D3D12_DEBUG requested the D3D12 debug layer, but it is unavailable. Install Graphics Tools…` on a machine that has it; the same binary with `D3D12\D3D12SDKLayers.dll` alongside `D3D12Core.dll` printed no warning and produced the 396 messages above. Whether the System32 copy is consulted at all when the Agility runtime is loaded, I did not test — but if the warning also mentioned staging `D3D12SDKLayers.dll` beside `D3D12Core.dll` it would have saved me an hour. Counts and driver text only; no game files.
fuzeofficlal commented 2026-11-26 17:05:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T17:05:13Z.

Review: APPROVED


Reviewed ad66ddf5fc1d5b86d1c9b5f5238ed117be588464 (merged cleanly onto 63bcca43 and verified clean co-merge with #1767) on Windows 11 with Graphics Tools debug layer active.

Enabling VICTORY_D3D12_DEBUG once per process before device creation, warning once when Graphics Tools are absent, wiring --only <stages> cleanly through Clap (requires = "pipelines", conflicts_with = "cache"), and reporting debug-layer refusal reasons directly in translate --pipelines all work cleanly.

Non-blocking follow-up notes:

  • drain_messages (crates/victory-shader/src/emit/host.rs:108-132) iterates GetNumStoredMessages() while indexing GetMessage (which uses the retrieval-filtered count); switching the loop bound to GetNumStoredMessagesAllowedByRetrievalFilter() matches the API contract.
  • Host::made clears the device-wide ID3D12InfoQueue even on Host::from_device (caller-owned devices) and on successful creations; scoping queue clearing to census-owned hosts preserves external diagnostics.
  • VICTORY_PAIRS currently still builds paired graphics/mesh pipelines under --only cs (worth documenting in --help / README or gating on wanted), and debug_layer.rs's concurrent WARP test currently runs serialized by WARP_LOCK with identical refusal messages.

Verification

  • xtask policy (192 files ok), cargo clippy (default & --all-features) clean.
  • With Windows Graphics Tools active: debug_layer 2/2 passed (unskipped), debug_layer_off 1/1 passed (both host and host,diagnostics), victory translate::tests 3/3 passed (4/4 co-merged with #1767), and invalid CLI flag combinations (--only cs without --pipelines, --only bogus, --only cs --cache) rejected as expected.
<!-- greyfinch-sync:Marvisak/VIctory:review:6078041304 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2562#pullrequestreview-6078041304). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T17:05:13Z. **Review:** APPROVED --- Reviewed `ad66ddf5fc1d5b86d1c9b5f5238ed117be588464` (merged cleanly onto `63bcca43` and verified clean co-merge with `#1767`) on Windows 11 with Graphics Tools debug layer active. Enabling `VICTORY_D3D12_DEBUG` once per process before device creation, warning once when Graphics Tools are absent, wiring `--only <stages>` cleanly through Clap (`requires = "pipelines"`, `conflicts_with = "cache"`), and reporting debug-layer refusal reasons directly in `translate --pipelines` all work cleanly. Non-blocking follow-up notes: - `drain_messages` (`crates/victory-shader/src/emit/host.rs:108-132`) iterates `GetNumStoredMessages()` while indexing `GetMessage` (which uses the retrieval-filtered count); switching the loop bound to `GetNumStoredMessagesAllowedByRetrievalFilter()` matches the API contract. - `Host::made` clears the device-wide `ID3D12InfoQueue` even on `Host::from_device` (caller-owned devices) and on successful creations; scoping queue clearing to census-owned hosts preserves external diagnostics. - `VICTORY_PAIRS` currently still builds paired graphics/mesh pipelines under `--only cs` (worth documenting in `--help` / README or gating on `wanted`), and `debug_layer.rs`'s concurrent WARP test currently runs serialized by `WARP_LOCK` with identical refusal messages. ### Verification - `xtask policy` (`192 files ok`), `cargo clippy` (default & `--all-features`) clean. - With Windows Graphics Tools active: `debug_layer` **2/2 passed** (unskipped), `debug_layer_off` **1/1 passed** (both `host` and `host,diagnostics`), `victory translate::tests` **3/3 passed** (4/4 co-merged with `#1767`), and invalid CLI flag combinations (`--only cs` without `--pipelines`, `--only bogus`, `--only cs --cache`) rejected as expected.
Victorzinn704 commented 2026-11-26 18:08:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Victorzinn704 on 2026-11-26T18:08:40Z.

Review: COMMENTED


Independent run with Windows Graphics Tools installed. With the shader-crate changes from ad66ddf5fc1 applied to main 63bcca43c6a0, both WARP debug-layer tests ran and passed, including the shared-device test. The debug-off test passed as well. On an RTX 5060 Ti (616.92), the rejected compute-shader case reported D3D12 message 322 (CREATECOMPUTESHADER_INVALIDSHADERBYTECODE), with the encoded-size mismatch in the text.

I also tested the inline feature guard below. The ordinary build avoids a COM interface query for each creation through Host::made. The debug-on and debug-off tests passed with the guard applied. Clippy passed with host and with host,diagnostics.

AI-assisted. These were local runs with synthetic shaders.

<!-- greyfinch-sync:Marvisak/VIctory:review:6078791090 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2562#pullrequestreview-6078791090). Originally posted by [Victorzinn704](https://github.com/Victorzinn704) on 2026-11-26T18:08:40Z. **Review:** COMMENTED --- Independent run with Windows Graphics Tools installed. With the shader-crate changes from `ad66ddf5fc1` applied to main `63bcca43c6a0`, both WARP debug-layer tests ran and passed, including the shared-device test. The debug-off test passed as well. On an RTX 5060 Ti (616.92), the rejected compute-shader case reported D3D12 message 322 (`CREATECOMPUTESHADER_INVALIDSHADERBYTECODE`), with the encoded-size mismatch in the text. I also tested the inline feature guard below. The ordinary build avoids a COM interface query for each creation through `Host::made`. The debug-on and debug-off tests passed with the guard applied. Clippy passed with `host` and with `host,diagnostics`. AI-assisted. These were local runs with synthetic shaders.
Victorzinn704 commented 2026-11-26 18:08:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Victorzinn704 on 2026-11-26T18:08:40Z.

Code review location: crates/victory-shader/src/emit/host.rs; line 276

@@ -196,6 +266,29 @@ impl Host {
         Host { device, warp }
     }
 
+    /// Makes an object, naming the debug layer's reasons if it is refused:
+    /// with the layer on (`VICTORY_D3D12_DEBUG=1` in a diagnostics build) the
+    /// error carries what the layer said, not only the bare code. Creations
+    /// are then one at a time (the queue is shared, see [`CREATION`]); without
+    /// the layer they run in parallel. Callers take [`WARP_LOCK`] (if at all)
+    /// before this, never after.
+    fn made<T>(&self, make: impl FnOnce() -> windows::core::Result<T>) -> Result<T, String> {
+        let Ok(queue) = self.device.cast::<ID3D12InfoQueue>() else {

Host::made can go straight to the create call when diagnostics is absent. This avoids attempting QueryInterface for ID3D12InfoQueue on every creation in the ordinary build.

        if !cfg!(feature = "diagnostics") {
            return make().map_err(err);
        }
        let Ok(queue) = self.device.cast::<ID3D12InfoQueue>() else {
<!-- greyfinch-sync:Marvisak/VIctory:review-comment:4712056937 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2562#discussion_r4712056937). Originally posted by [Victorzinn704](https://github.com/Victorzinn704) on 2026-11-26T18:08:40Z. **Code review location:** `crates/victory-shader/src/emit/host.rs`; line 276 ~~~~diff @@ -196,6 +266,29 @@ impl Host { Host { device, warp } } + /// Makes an object, naming the debug layer's reasons if it is refused: + /// with the layer on (`VICTORY_D3D12_DEBUG=1` in a diagnostics build) the + /// error carries what the layer said, not only the bare code. Creations + /// are then one at a time (the queue is shared, see [`CREATION`]); without + /// the layer they run in parallel. Callers take [`WARP_LOCK`] (if at all) + /// before this, never after. + fn made<T>(&self, make: impl FnOnce() -> windows::core::Result<T>) -> Result<T, String> { + let Ok(queue) = self.device.cast::<ID3D12InfoQueue>() else { ~~~~ --- `Host::made` can go straight to the create call when `diagnostics` is absent. This avoids attempting `QueryInterface` for `ID3D12InfoQueue` on every creation in the ordinary build. ```suggestion if !cfg!(feature = "diagnostics") { return make().map_err(err); } let Ok(queue) = self.device.cast::<ID3D12InfoQueue>() else { ```
oni-swr commented 2026-11-26 18:45:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-26T18:45:45Z.


Thanks @Victorzinn704, applied in ff70049: Host::made now returns straight to make() when the diagnostics feature is off, before the ID3D12InfoQueue QueryInterface. This matches the cfg! half of debug_requested(), and the existing doc comment is still accurate.

Verified on WARP (VICTORY_D3D12_WARP=1, dxil.dll on PATH, no physical GPU):

  • debug_layer, debug_layer_off, resource_tracking and the lib host tests pass with --features host and --features host,diagnostics, each with VICTORY_D3D12_DEBUG unset and =1.
  • cargo clippy -p victory-shader --all-targets -- -D warnings is clean with host and with host,diagnostics.
  • cargo run -p xtask -- policy passes.

AI disclosure: this change was made by Claude Code (Claude Sonnet 5.5).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7200822703 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2562#issuecomment-7200822703). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-26T18:45:45Z. --- Thanks @Victorzinn704, applied in ff70049: `Host::made` now returns straight to `make()` when the `diagnostics` feature is off, before the `ID3D12InfoQueue` `QueryInterface`. This matches the `cfg!` half of `debug_requested()`, and the existing doc comment is still accurate. Verified on WARP (`VICTORY_D3D12_WARP=1`, `dxil.dll` on `PATH`, no physical GPU): - `debug_layer`, `debug_layer_off`, `resource_tracking` and the lib `host` tests pass with `--features host` and `--features host,diagnostics`, each with `VICTORY_D3D12_DEBUG` unset and `=1`. - `cargo clippy -p victory-shader --all-targets -- -D warnings` is clean with `host` and with `host,diagnostics`. - `cargo run -p xtask -- policy` passes. AI disclosure: this change was made by Claude Code (Claude Sonnet 5.5).
andrewpozdnakov7-jpg commented 2026-11-28 21:11:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T21:11:32Z.


@oni-swr, I followed up on @reboot0000-cmd's Windows 10 test report. Combined 376ea39 contains this PR at ff70049, the device preflight diagnostics from #3788, and a targeted follow-up for the warning and integration tests.

On Windows 10, the two debug-on tests previously printed the same skip line in both environments. The stock WARP run now identifies Shader Model 6.2 and the 6.6 requirement. With signed app-local WARP 1.0.22 and Agility 1.620.2, WARP initialized and the tests identified the unavailable debug layer. The debug-off test ran and passed with the app-local runtime. The two debug-on pipeline assertions were skipped on this host, including when the matching layer DLL was present. The updated warning also describes where the matching app-local DLL belongs. Microsoft's Agility SDK setup

The Shader Model status test, diagnostics CLI tests, both strict Clippy runs and the asset policy passed. The next verification is the debug-on pair on a machine where the layer loads, such as the reporter's Graphics Tools setup. Please retain the Git authors on cherry-pick or rebase, or include Co-authored-by: andrewpozdnakov7-jpg [email protected] if folding the changes into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7245838217 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2562#issuecomment-7245838217). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T21:11:32Z. --- @oni-swr, I followed up on @reboot0000-cmd's Windows 10 test report. [Combined 376ea39](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/376ea390ab5c83ad509991f1b9bed091ca903e58) contains this PR at ff70049, the device preflight diagnostics from #3788, and a targeted follow-up for the warning and integration tests. On Windows 10, the two debug-on tests previously printed the same skip line in both environments. The stock WARP run now identifies Shader Model 6.2 and the 6.6 requirement. With signed app-local WARP 1.0.22 and Agility 1.620.2, WARP initialized and the tests identified the unavailable debug layer. The debug-off test ran and passed with the app-local runtime. The two debug-on pipeline assertions were skipped on this host, including when the matching layer DLL was present. The updated warning also describes where the matching app-local DLL belongs. [Microsoft's Agility SDK setup](https://devblogs.microsoft.com/directx/gettingstarted-dx12agility/) The Shader Model status test, diagnostics CLI tests, both strict Clippy runs and the asset policy passed. The next verification is the debug-on pair on a machine where the layer loads, such as the reporter's Graphics Tools setup. Please retain the Git authors on cherry-pick or rebase, or include Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the changes into another commit. AI-assisted with OpenAI Codex.
oni-swr commented 2026-11-28 21:35:52 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-28T21:35:52Z.


Thank you @andrewpozdnakov7-jpg for the follow-up and @reboot0000-cmd for the Windows 10 report.

Folded in as 27e4700, cherry-picked from 376ea39 with your authorship kept: the debug-layer warning now also says where a local Agility SDK's matching D3D12SDKLayers.dll goes, and tests/debug_layer.rs now tells "WARP did not initialize" apart from "layer unavailable" when it skips. The device preflight diagnostics from #3788 were left out and stay with that PR.

Checked on software WARP only (VICTORY_WARP=1, VICTORY_D3D12_WARP=1, dxil.dll validator, no physical GPU), --features host,diagnostics:

  • debug_layer: 2 passed; debug_layer_off: 1 passed; resource_tracking: 3 passed (1 ignored). No skip line was printed here, so the layer loaded on this machine.
  • victory-shader lib: 298 passed, 4 failed (a_mask_joined_with_data_at_a_uniform_loop_is_its_number, gathers_at_a_level_match_the_hardware, permutes_mask_high_address_bits_and_divergent_branches, permutes_read_the_lane_named_and_zero_from_lanes_left_out). The same 4 fail on ff70049 without this change, so they are WARP behaviour, not the follow-up. The PR body listed 3; the fourth is new to me on this build.
  • cargo clippy --workspace --all-targets with and without --all-features, -D warnings: clean. Asset policy (repository_passes_policy): passed.

Still open: the debug-on pair on the reporter's Windows 10 setup, where the layer loads but the test binary only gets the in-box runtime; the Windows 10 failure of debug_layer_off from the report is not addressed here.

AI disclosure: Claude Sonnet 5.5.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7246134146 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2562#issuecomment-7246134146). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-28T21:35:52Z. --- Thank you @andrewpozdnakov7-jpg for the follow-up and @reboot0000-cmd for the Windows 10 report. Folded in as `27e4700`, cherry-picked from `376ea39` with your authorship kept: the debug-layer warning now also says where a local Agility SDK's matching `D3D12SDKLayers.dll` goes, and `tests/debug_layer.rs` now tells "WARP did not initialize" apart from "layer unavailable" when it skips. The device preflight diagnostics from #3788 were left out and stay with that PR. Checked on software WARP only (`VICTORY_WARP=1`, `VICTORY_D3D12_WARP=1`, dxil.dll validator, no physical GPU), `--features host,diagnostics`: - `debug_layer`: 2 passed; `debug_layer_off`: 1 passed; `resource_tracking`: 3 passed (1 ignored). No skip line was printed here, so the layer loaded on this machine. - victory-shader lib: 298 passed, 4 failed (`a_mask_joined_with_data_at_a_uniform_loop_is_its_number`, `gathers_at_a_level_match_the_hardware`, `permutes_mask_high_address_bits_and_divergent_branches`, `permutes_read_the_lane_named_and_zero_from_lanes_left_out`). The same 4 fail on `ff70049` without this change, so they are WARP behaviour, not the follow-up. The PR body listed 3; the fourth is new to me on this build. - `cargo clippy --workspace --all-targets` with and without `--all-features`, `-D warnings`: clean. Asset policy (`repository_passes_policy`): passed. Still open: the debug-on pair on the reporter's Windows 10 setup, where the layer loads but the test binary only gets the in-box runtime; the Windows 10 failure of `debug_layer_off` from the report is not addressed here. AI disclosure: Claude Sonnet 5.5.
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/2562:upstream-pr/2562'
git switch 'upstream-pr/2562'

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/2562'
git switch 'upstream-pr/2562'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2562'
git switch 'upstream-pr/2562'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2562'
git switch 'main'
git merge --squash 'upstream-pr/2562'
git switch 'main'
git merge --ff-only 'upstream-pr/2562'
git switch 'main'
git merge 'upstream-pr/2562'
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!2560
No description provided.