GPU diagnostics: skip host pipeline creation by shader hash #1320

Manually merged
github merged 1 commit from gh-pr/1320/head into gh-pr/1320/base 2026-11-26 04:27:24 +00:00
Owner

@⁠gurvancampion on GitHub · 2026-11-24 17:24 UTC · original
gurvancampion:topic/skip-pipeline-compile → main · +97 −21 · 3 files · 1 commits · merged 2026-11-25 21:50 UTC

Summary

VICTORY_SKIP_PIPELINES filters commands during recording, after an early cache hit or a host lookup can already send the matching pipeline to a worker. Pending::new now records the matching hash and marks the host result complete and absent. early and ready leave it off the queue. Draw and dispatch diagnostics keep reporting skipped shader {hash}.

  Matching title pipeline
-   early / ready → queue → Pending::make → HostPipeline::new
+   Pending::new → completed without a host pipeline
+   early / ready → return without queueing
  Recording drops matching work before the indirect argument clamp

This extends the diagnostic used to isolate pipeline compilation crashes. Issue #144

Evidence

  • pipeline::make::tests::skipped_pipeline_stays_off_the_queue failed on base with both queue flags set (0 passed, 1 failed). It passed on head (1 passed, 0 failed) and checked that both pipelines were complete and the synthetic shader was untranslated. Run with cargo xwin test -p victory-gpu --features diagnostics --locked --target x86_64-pc-windows-msvc pipeline::make::tests::skipped_pipeline_stays_off_the_queue.
  • cargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings passed on both revisions.
  • cargo xwin clippy --workspace --all-targets --all-features --locked --target x86_64-pc-windows-msvc -- -D warnings passed on both revisions.
  • cargo xwin test -p victory-gpu --features diagnostics --locked --target x86_64-pc-windows-msvc passed under GE-Proton with Vulkan disabled. Base had 53 passes. Head had 54 passes. Both had one ignored test.
  • cargo xwin test --workspace --locked --target x86_64-pc-windows-msvc --no-fail-fast recorded 322 passes on each revision. With --all-features, base recorded 326 passes and head recorded 327. Both modes had the same 20 failures on base and head under no-GPU Wine, plus six ignored tests. The runs passed with those 20 cases filtered. The cases require a shader-model-6.6 device or Wine support for windows, a networking export, a nested Cargo build, or Git.
  • cargo test -p xtask --locked repository_passes_policy passed natively on both revisions. cargo xtask policy --staged passed for all three changed files.
  • cargo fmt --all -- --check reported existing formatting differences on both revisions. Changed Rust lines pass against rustfmt.toml. git diff --check origin/main HEAD passed.

Not verified

Native Windows, live D3D12 and the retail title were outside this no-GPU run. Existing platform errors prevent full native Linux workspace tests and Clippy.

Merge Danger

Door Blast radius
Two-way Module

A revert restores record-time filtering for matching Windows diagnostics pipelines. The pipeline cache format stays compatible.

AI disclosure

OpenAI Codex (gpt-6.2-sol) assisted with the implementation, synthetic tests, verification, and PR draft. Antigravity (Gemini 4 Neon) coordinated and reviewed the diff. The author reviewed the diff and description before opening the PR.

**@⁠gurvancampion** on GitHub · 2026-11-24 17:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/1320) `gurvancampion:topic/skip-pipeline-compile` → `main` · +97 −21 · 3 files · 1 commits · merged 2026-11-25 21:50 UTC ## Summary `VICTORY_SKIP_PIPELINES` filters commands during recording, after an early cache hit or a host lookup can already send the matching pipeline to a worker. `Pending::new` now records the matching hash and marks the host result complete and absent. `early` and `ready` leave it off the queue. Draw and dispatch diagnostics keep reporting `skipped shader {hash}`. ```diff Matching title pipeline - early / ready → queue → Pending::make → HostPipeline::new + Pending::new → completed without a host pipeline + early / ready → return without queueing Recording drops matching work before the indirect argument clamp ``` This extends the diagnostic used to isolate pipeline compilation crashes. [Issue #144](https://git.gtahub.st/github/Marvisak--VIctory/issues/144) ## Evidence - `pipeline::make::tests::skipped_pipeline_stays_off_the_queue` failed on base with both queue flags set (`0 passed, 1 failed`). It passed on head (`1 passed, 0 failed`) and checked that both pipelines were complete and the synthetic shader was untranslated. Run with `cargo xwin test -p victory-gpu --features diagnostics --locked --target x86_64-pc-windows-msvc pipeline::make::tests::skipped_pipeline_stays_off_the_queue`. - `cargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings` passed on both revisions. - `cargo xwin clippy --workspace --all-targets --all-features --locked --target x86_64-pc-windows-msvc -- -D warnings` passed on both revisions. - `cargo xwin test -p victory-gpu --features diagnostics --locked --target x86_64-pc-windows-msvc` passed under GE-Proton with Vulkan disabled. Base had 53 passes. Head had 54 passes. Both had one ignored test. - `cargo xwin test --workspace --locked --target x86_64-pc-windows-msvc --no-fail-fast` recorded 322 passes on each revision. With `--all-features`, base recorded 326 passes and head recorded 327. Both modes had the same 20 failures on base and head under no-GPU Wine, plus six ignored tests. The runs passed with those 20 cases filtered. The cases require a shader-model-6.6 device or Wine support for windows, a networking export, a nested Cargo build, or Git. - `cargo test -p xtask --locked repository_passes_policy` passed natively on both revisions. `cargo xtask policy --staged` passed for all three changed files. - `cargo fmt --all -- --check` reported existing formatting differences on both revisions. Changed Rust lines pass against `rustfmt.toml`. `git diff --check origin/main HEAD` passed. ### Not verified Native Windows, live D3D12 and the retail title were outside this no-GPU run. Existing platform errors prevent full native Linux workspace tests and Clippy. ## Merge Danger | Door | Blast radius | | --- | --- | | Two-way | Module | A revert restores record-time filtering for matching Windows diagnostics pipelines. The pipeline cache format stays compatible. ## AI disclosure OpenAI Codex (`gpt-6.2-sol`) assisted with the implementation, synthetic tests, verification, and PR draft. Antigravity (`Gemini 4 Neon`) coordinated and reviewed the diff. The author reviewed the diff and description before opening the PR.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:27:23 +00:00
github manually merged commit d5fe304ddd into gh-pr/1320/base 2026-11-26 04:27:24 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:22 UTC · original · edited 2026-11-25 20:19 UTC

Automated triage for the maintainers.

Merge candidate (unchanged). The new head d5fe304 is a rebase onto main (67e8ae1). Compared with the previously reviewed 3d87d02, the only difference is README context: main's longer VICTORY_TRACE_SHADERS row is kept, and this PR's VICTORY_SKIP_PIPELINES wording sits on top. The code in crates/victory-gpu/src/pipeline.rs and pipeline/make.rs is the same as before. A pipeline whose shader hash is listed is completed without a host pipeline in Pending::new and never queued by early / ready. Every Pending::new call site on main passes the new argument, and nothing in pipeline/ changed on main since the last review. Everything stays behind the diagnostics feature, with no dependency changes.

CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/1320#issuecomment-7149478356) · edited 2026-11-25 20:19 UTC <!-- victory-triage v1 head=d5fe304ddd7b2c5c6a7bcb26cb1fccca9f95035b verdict=merge-candidate at=2026-11-25T20:18:54Z --> Automated triage for the maintainers. **Merge candidate (unchanged).** The new head `d5fe304` is a rebase onto `main` (67e8ae1). Compared with the previously reviewed `3d87d02`, the only difference is README context: `main`'s longer `VICTORY_TRACE_SHADERS` row is kept, and this PR's `VICTORY_SKIP_PIPELINES` wording sits on top. The code in `crates/victory-gpu/src/pipeline.rs` and `pipeline/make.rs` is the same as before. A pipeline whose shader hash is listed is completed without a host pipeline in `Pending::new` and never queued by `early` / `ready`. Every `Pending::new` call site on `main` passes the new argument, and nothing in `pipeline/` changed on `main` since the last review. Everything stays behind the `diagnostics` feature, with no dependency changes. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠BaggyALPHA on GitHub · 2026-11-25 06:09 UTC · original

Rebased this onto main 940d32f locally and tested it: the behaviour it claims is real and I measured it, but the rebase needs one change beyond the two conflicting files — main has since added three call sites of Pending::new that the new signature does not compile against.

Triage asked for a rebase, so I did one to see what it would take. Setup: RTX 3080 (driver 621.24), Ryzen 7 5800X, 32 GB, Windows 11 26300, pinned main 940d32f, separate CARGO_TARGET_DIR per tree.

What the rebase runs into

  1. README.md — trivial: keep your new VICTORY_SKIP_PIPELINES wording, keep main's newer VICTORY_GPU_TIMING row (it gained "a device removal names the list it happened in...") and its new VICTORY_TRACE_SHADERS row.
  2. pipeline/make.rs — main moved the key into a key() helper, added a log("created", &key, ...) call, added the now / taken fields, and early() now starts with super::library::note_created(&p.key). Your three pieces layer on top cleanly: the skip_hashes parameter, skipped_shader plus the pre-set made, and the p.made.get().is_none() guard in early() (keeping note_created before it).
  3. Not a conflict, but it breaks the build: main added draws_go_ahead_of_early_starts, which calls Pending::new(Vec::new(), None) three times. Those need the third argument (#[cfg(feature = "diagnostics")] &[]). Worth writing them in the same multi-line shape you used in first_use_is_made_by_a_worker — on one line they cost six rustfmt diffs; multi-line, the tree's rustfmt --check output is identical to main's.

Checks on the rebased tree

check rebased #1320 main 940d32f control
cargo test -p victory-gpu --features diagnostics --locked 145 passed, 2 failed 144 passed, the same 2 failed
same without diagnostics 141 passed, same 2 failed –
clippy --all-targets -- -D warnings, with and without the feature clean –
rustfmt --check diff count per file identical to control (main is not rustfmt-clean)
cargo xtask policy 182 files ok –

The two failures are descriptor::host::tests::dynamic_slots_are_held_until_released and memory::tests::lists_share_a_table_and_copies_keep_their_views — the capped-view-heap pair (FIND-9), failing identically on the control, so nothing here. Net effect is one extra passing test. Your skipped_pipeline_stays_off_the_queue and skip_hashes_accepts_full_hashes_only both pass, and the former is a good test: asserting the shader is never even translated is the part that matters.

The claim itself, measured. Three short boot-only runs with the local title, one compute program created early in boot used as the probe (same warm cache, same scripted input):

run probe's shader translated host pipeline made for it
rebased #1320, nothing skipped yes yes
rebased #1320, probe skipped no no
main 940d32f, same probe skipped yes yes

So on main a skipped pipeline is still translated and still made and only its commands are dropped, and with this PR it is never created at all. That is exactly the difference the description claims, and it is the capability #1972 needs for the 61 pipelines that crash AMD's shader compiler on creation — worth linking them.

One half I could not verify. "Draw and dispatch diagnostics keep reporting skipped shader {hash}" — I saw no drop reason for the probe in these runs, because a boot-only run on this card ends at the format-115 device removal (#1781/#1753) before that program is dispatched, so nothing exercised the record path for it. Separately, on main I could not get a skipped direct dispatch to report a reason at all in a longer world run, while a skipped indirect one reported 20-30 times (notes on #1968). Since this PR keeps that reporting path, it may be worth a look — a switch whose effect cannot be confirmed from the log is easy to draw a wrong conclusion from, which I did before catching it.

I have not pushed anything; the rebase is local and the resolution is described above so it stays your commit. Nothing from the game here: test counts, log line kinds and timings. Inputs were the local title for the three runs and synthetic for everything else.

AI-assisted (Claude Code); results are from the runs and builds described.

**@⁠BaggyALPHA** on GitHub · 2026-11-25 06:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/1320#issuecomment-7154504549) **Rebased this onto `main` `940d32f` locally and tested it: the behaviour it claims is real and I measured it, but the rebase needs one change beyond the two conflicting files — `main` has since added three call sites of `Pending::new` that the new signature does not compile against.** Triage asked for a rebase, so I did one to see what it would take. Setup: RTX 3080 (driver 621.24), Ryzen 7 5800X, 32 GB, Windows 11 26300, pinned `main` `940d32f`, separate `CARGO_TARGET_DIR` per tree. **What the rebase runs into** 1. `README.md` — trivial: keep your new `VICTORY_SKIP_PIPELINES` wording, keep `main`'s newer `VICTORY_GPU_TIMING` row (it gained "a device removal names the list it happened in...") and its new `VICTORY_TRACE_SHADERS` row. 2. `pipeline/make.rs` — `main` moved the key into a `key()` helper, added a `log("created", &key, ...)` call, added the `now` / `taken` fields, and `early()` now starts with `super::library::note_created(&p.key)`. Your three pieces layer on top cleanly: the `skip_hashes` parameter, `skipped_shader` plus the pre-set `made`, and the `p.made.get().is_none()` guard in `early()` (keeping `note_created` before it). 3. **Not a conflict, but it breaks the build:** `main` added `draws_go_ahead_of_early_starts`, which calls `Pending::new(Vec::new(), None)` three times. Those need the third argument (`#[cfg(feature = "diagnostics")] &[]`). Worth writing them in the same multi-line shape you used in `first_use_is_made_by_a_worker` — on one line they cost six `rustfmt` diffs; multi-line, the tree's `rustfmt --check` output is identical to `main`'s. **Checks on the rebased tree** | check | rebased #1320 | `main` `940d32f` control | |---|---|---| | `cargo test -p victory-gpu --features diagnostics --locked` | 145 passed, 2 failed | 144 passed, **the same 2 failed** | | same without `diagnostics` | 141 passed, same 2 failed | – | | `clippy --all-targets -- -D warnings`, with and without the feature | clean | – | | `rustfmt --check` diff count per file | identical to control | (`main` is not rustfmt-clean) | | `cargo xtask policy` | 182 files ok | – | The two failures are `descriptor::host::tests::dynamic_slots_are_held_until_released` and `memory::tests::lists_share_a_table_and_copies_keep_their_views` — the capped-view-heap pair (`FIND-9`), failing identically on the control, so nothing here. Net effect is one extra passing test. Your `skipped_pipeline_stays_off_the_queue` and `skip_hashes_accepts_full_hashes_only` both pass, and the former is a good test: asserting the shader is never even translated is the part that matters. **The claim itself, measured.** Three short boot-only runs with the local title, one compute program created early in boot used as the probe (same warm cache, same scripted input): | run | probe's shader translated | host pipeline made for it | |---|---|---| | rebased #1320, nothing skipped | yes | yes | | rebased #1320, probe skipped | **no** | **no** | | `main` `940d32f`, same probe skipped | yes | yes | So on `main` a skipped pipeline is still translated and still made and only its commands are dropped, and with this PR it is never created at all. That is exactly the difference the description claims, and it is the capability #1972 needs for the 61 pipelines that crash AMD's shader compiler on creation — worth linking them. **One half I could not verify.** "Draw and dispatch diagnostics keep reporting `skipped shader {hash}`" — I saw no drop reason for the probe in these runs, because a boot-only run on this card ends at the format-115 device removal (#1781/#1753) before that program is dispatched, so nothing exercised the record path for it. Separately, on `main` I could not get a skipped *direct* dispatch to report a reason at all in a longer world run, while a skipped *indirect* one reported 20-30 times ([notes on #1968](https://git.gtahub.st/github/Marvisak--VIctory/issues/1968)). Since this PR keeps that reporting path, it may be worth a look — a switch whose effect cannot be confirmed from the log is easy to draw a wrong conclusion from, which I did before catching it. I have not pushed anything; the rebase is local and the resolution is described above so it stays your commit. Nothing from the game here: test counts, log line kinds and timings. Inputs were the local title for the three runs and synthetic for everything else. AI-assisted (Claude Code); results are from the runs and builds described.
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!1320
No description provided.