Skip to content

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

Merged
Marvisak merged 1 commit into
Marvisak:mainfrom
gurvancampion:topic/skip-pipeline-compile
Nov 25, 2026
Merged

Marvisak merged 1 commit into
Marvisak:mainfrom
gurvancampion:topic/skip-pipeline-compile

Conversation

@gurvancampion

Copy link
Copy Markdown
Contributor

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.

@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.

Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; this is source review plus the PR's own Windows tests.

VICTORY_SKIP_PIPELINES now skips host pipeline creation, not just draws: Pending::new computes skipped_shader once, pre-publishes made=None so ready() answers immediately, and early()/queueing are bypassed (made.get().is_none() guard). Draw/dispatch accounting (is_skipped, note_drop) reads the stored hash instead of recomputing. parse_skip_hashes moved to cfg(all(feature=diagnostics, any(windows, test))) so the parsing test runs anywhere the crate does. The new skipped_pipeline_stays_off_the_queue test verifies neither cold nor warm pipelines queue workers. Sound; diagnostics-only feature.

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

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

@ghost

ghost commented Nov 25, 2026

Copy link
Copy Markdown

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.

@gurvancampion
gurvancampion force-pushed the topic/skip-pipeline-compile branch from 3d87d02 to d5fe304 Compare November 25, 2026 16:36
@Marvisak
Marvisak merged commit 57f13cf into Marvisak:main Nov 25, 2026
1 check passed
crashbashash added a commit to crashbashash/VIctory-proton that referenced this pull request Nov 25, 2026
Upstream's VICTORY_SKIP_PIPELINES (Marvisak#1320) works in diagnostics builds
only. Under GE-Proton11-14 22 compute shaders crash vkd3d-proton while
their pipelines are made (its dxil-spirv crashes on each; dxil-spirv's
non-recursive CFG passes from 2026-11-23 convert them): the worker
making one dies and what waits for it waits forever, or the process
ends. Players run release builds, so the skip must work there too.

The skip is now in every build: VICTORY_SKIP_PIPELINES if set (set and
empty: none), else under Wine the 22 (WINE_SKIPPED), unless
VICTORY_PROTON is set (our Proton build, whose vkd3d-proton has the
fix). A skipped pipeline counts as made without a host pipeline, as
Marvisak#1320 does it; `skips_shader` tells the pre-build to leave it out too.
`on_wine` moves from victory-hle's xmem into victory-gpu, one copy for
both.
crashbashash added a commit to crashbashash/VIctory-proton that referenced this pull request Nov 25, 2026
…1320

Our skip commit becomes 'skipped pipelines in every build, and the Wine
list by default', on top of upstream's VICTORY_SKIP_PIPELINES (Marvisak#1320);
the crash list's key joins the pre-build's row. Upstream's Marvisak#1430 lets an
idle game pad and the keyboard stand-in work together, so that limit
goes.
desplmfao added a commit to desplmfao/VIctory that referenced this pull request Nov 26, 2026
Upstream main merged Marvisak#2143, Marvisak#2162, Marvisak#158, Marvisak#1906 and Marvisak#1152 and took up what
Marvisak#1769 (LDS bounds, Marvisak#1949) and Marvisak#1763 (typed UAV formats, Marvisak#2462) did; main's
code is kept for those.
- emit/lower.rs: ds_bpermute within each half (main's Marvisak#573, same as
  Marvisak#439's); LDS bounds as main's Marvisak#1949 (Marvisak#1769's test-only counter kept, its
  and_guard dropped); title-memory marks: main's straddling-write lookup
  (Marvisak#2484) with Marvisak#2167's current head (3cb308d, rebased on 63bcca4): guarded
  dirty atomics, raw_dword2, memory_null, synthetic_mark_dxil in
  lower/mark_tests.rs; the old Marvisak#2167 head taken out first.
- emit/host.rs: main's shared WARP device and lock (Marvisak#244) with Marvisak#439's
  adapter list and Host::on (create_device takes an optional adapter).
- descriptor/host.rs: main's Marvisak#2462 format checks; Marvisak#1763's tests kept.
- gpu host.rs: main's multi-plane present with Marvisak#2310's crumbed copy.
- pipeline.rs: Marvisak#2118/Marvisak#2311's builder and BVH checks with main's skip
  hashes (Marvisak#1320); draw.rs, shadow.rs, main.rs: both sides.
- Tests main added since get Marvisak#439's Parts fields and emit's Target.
- README: base 63bcca4; rows of PRs merged upstream, superseded or closed
  taken out, with a note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
r4tedx added a commit to r4tedx/VIctory that referenced this pull request Nov 26, 2026
…s do

Main's Marvisak#1320 gave `Pending::new` the diagnostics build's shader hashes to
skip; the test passes none, as the module's other tests do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
crashbashash added a commit to crashbashash/VIctory-proton that referenced this pull request Nov 26, 2026
Upstream's VICTORY_SKIP_PIPELINES (Marvisak#1320) works in diagnostics builds
only. Under GE-Proton11-14 22 compute shaders crash vkd3d-proton while
their pipelines are made (its dxil-spirv crashes on each; dxil-spirv's
non-recursive CFG passes from 2026-11-23 convert them): the worker
making one dies and what waits for it waits forever, or the process
ends. Players run release builds, so the skip must work there too.

The skip is now in every build: VICTORY_SKIP_PIPELINES if set (set and
empty: none), else under Wine the 22 (WINE_SKIPPED), unless
VICTORY_PROTON is set (our Proton build, whose vkd3d-proton has the
fix). A skipped pipeline counts as made without a host pipeline, as
Marvisak#1320 does it; `skips_shader` tells the pre-build to leave it out too.
`on_wine` moves from victory-hle's xmem into victory-gpu, one copy for
both.
crashbashash added a commit to crashbashash/VIctory-proton that referenced this pull request Nov 26, 2026
…1320

Our skip commit becomes 'skipped pipelines in every build, and the Wine
list by default', on top of upstream's VICTORY_SKIP_PIPELINES (Marvisak#1320);
the crash list's key joins the pre-build's row. Upstream's Marvisak#1430 lets an
idle game pad and the keyboard stand-in work together, so that limit
goes.
notquiteog pushed a commit to notquiteog/VIctory that referenced this pull request Nov 27, 2026
…tables' slots back (Marvisak#1320)

`submit_split` runs the lists before its first unmet wait at once with
`host.execute`, as `submit_cut` does. `submit_cut` then calls
`list::tables_done` for those lists; its comment says why: the lists are
not detached on that path, so nothing gives their fresh per-draw tables'
dynamic slots back until the title resets them, and the ring of 262,144
slots ran out (run 45: 3,143 of 15,942 tables refused in one frame).
`submit_split` had no such call: with `VICTORY_CUT_WAITS=0` (the
documented switch that holds whole lists, as before) every submission
leaks the slots of its first lists the same way, and later draws are
dropped once the ring is full.

The call is added after the same `host.execute`, mirroring `submit_cut`.

`cargo test -p victory-gpu --lib`: 217 passed, 0 failed, 6 ignored;
`cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. No
game run: the two branches differ only in that call, and nothing without
a host GPU drives `submit_split`.

(cherry picked from commit af23c65)
jennydeth pushed a commit to jennydeth/Hail-to-the-Thief that referenced this pull request Nov 27, 2026
…tables' slots back (Marvisak#1320)

`submit_split` runs the lists before its first unmet wait at once with
`host.execute`, as `submit_cut` does. `submit_cut` then calls
`list::tables_done` for those lists; its comment says why: the lists are
not detached on that path, so nothing gives their fresh per-draw tables'
dynamic slots back until the title resets them, and the ring of 262,144
slots ran out (run 45: 3,143 of 15,942 tables refused in one frame).
`submit_split` had no such call: with `VICTORY_CUT_WAITS=0` (the
documented switch that holds whole lists, as before) every submission
leaks the slots of its first lists the same way, and later draws are
dropped once the ring is full.

The call is added after the same `host.execute`, mirroring `submit_cut`.

`cargo test -p victory-gpu --lib`: 217 passed, 0 failed, 6 ignored;
`cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. No
game run: the two branches differ only in that call, and nothing without
a host GPU drives `submit_split`.
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.

3 participants