Skip to content

[BUNDLE] GPU pipeline library, shader cache, draw state and frame wait: 5 PRs, #1000 #626 #642 #174 #1279 (rebuilt on main 70564ae) - #1439

Open
MamaLeVrai wants to merge 13 commits into
Marvisak:mainfrom
MamaLeVrai:bundle/gpu-fixes-3
Open

MamaLeVrai wants to merge 13 commits into
Marvisak:mainfrom
MamaLeVrai:bundle/gpu-fixes-3

Conversation

@MamaLeVrai

@MamaLeVrai MamaLeVrai commented Nov 24, 2026 •

Copy link
Copy Markdown

One PR in place of 5. After main moved, this bundle keeps the 5 of its earlier 16 PRs that still merge; the left-out ones are listed below. The earlier description follows, and may mention PRs or measurements that no longer apply. Sixteen GPU PRs on the pipeline library and cache saves, the shader cache, mesh pipeline loading, blending on integer targets, root signature flags, draw state, list recording and the frame wait. Every head is merged unchanged onto main (70564ae, after the maintainer's 28 commits of Nov 24, 22:36 CET), and the result is built and tested together.

For reviewers and for anyone verifying with an agent (Claude, Codex, a person): this is a [BUNDLE] PR. The re-verification commands are below, so one run covers all of it.

What is inside

PR Author Head Title
#1000 TG0000 f821cb9d7 GPU: pipelines of different names load from the library at the same time
#626 LAKSHYA-cmd-tech df9ab3c69 GPU: fall back to standard root signature flags when host runtime rejects 0xC01/0xC00
#642 nathanbzrr bdef690c7 GPU: translate enhanced texture barriers in ID3D12GraphicsCommandList7::Barrier
#174 AndyLatimer 882664e13 GPU: a frame wait takes its tick before it sleeps
#1279 Mumogg 4dd4cfc8c GPU: an argument clamp Wine's compiler builds too

Changes made while bundling

No PR was edited, and there is no hand resolution: a PR that does not merge as it is, is left out (below).

Left out, and why

Rebuilt on the new main. The earlier version of this bundle had 16 PRs; 5 merge here in order, each checked with clippy as it went in.

Verification

Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain):

Check Result
cargo clippy --workspace --all-targets --locked -- -D warnings clean
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings clean
cargo test --workspace --locked 484 passed, 0 failed, 7 ignored (one run; main: 476 passed, 7 ignored)

The title was not run, so this says nothing about in-game effect. No game data is used or committed.

Re-verify in one go

git fetch https://github.com/MamaLeVrai/VIctory.git bundle/gpu-fixes-3
git checkout FETCH_HEAD
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo test --workspace --locked

To confirm that no component PR moved since this was built, compare each Head above with gh pr view <n> --repo Marvisak/VIctory --json headRefOid. If one differs, the branch needs a rebuild: merge the new head in the same order.

If this lands

The component heads are in the history unchanged, so each PR's commits and authorship are kept and GitHub should mark them merged. Merging them one by one instead works too, with the exceptions noted above.

AI-assisted (Claude Code); no game data.

🤖 Generated with Claude Code

AndyLatimer and others added 6 commits November 24, 2026 02:06
frame::wait marked the tick it waited for as taken (LAST) only after
the sleep, outside the clock's lock, so two threads waiting for one
event kind at once both got the same tick and both returned on it,
against the module's once-per-tick rule (an origin wait then begins two
frames in one interval). next_tick now takes the tick under the clock's
lock when the wait comes within its time-out; a time-out takes none, as
before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit dropped the tick next_tick returns, but the
diagnostics build's tracing::debug! still names it (E0425). Bind it
again; it is unused without the feature, so that lint is allowed there.
Reported by Sunkiller-qc and r4tedx. cargo check -p victory-gpu passes
with and without --features diagnostics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pipeline workers held the library's lock while a pipeline loaded. A
load is not always a lookup: an AMD driver's library holds about 140 bytes
per pipeline, and what the driver's own cache lacks is compiled inside the
load, for up to seconds. All eight workers then waited for the one that
held the lock.

The library is documented as thread-safe but for loads of one pipeline on
several threads (ID3D12Device1::CreatePipelineLibrary, "Thread Safety"),
so only those exclude each other now: a name is held by one thread at a
time, and loads run without the library's lock. Stores and serialising
keep it.

Measured on an RX 6800 and a Ryzen 9 5900X (sampled stacks, diagnostics
build, the same start from a kept pipeline library):
- worker CPU while a backlog is made: 1.05 cores -> 7.8; samples blocked on
  the lock: 481 -> 0
- in the world, two runs each: pipelines still being made 1219-1315 -> 43-54,
  draws run per frame 3-20 -> 1860-2086, time per frame outside preparing,
  GPU and copy-back 196-303 ms -> 24-37 ms

The frame itself is not shorter on its own: the draws that used to be
dropped now run (750-799 -> 1090-1379 ms per frame).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The clamp of indirect arguments is HLSL compiled at run time by the
system's compiler. Under Wine that is vkd3d-shader's, which has no
methods on byte address buffers and ignores the RootSignature attribute:

    argument clamp: clamp:19:27: E5005: Method 'Load' is not defined on
    type 'RWByteAddressBuffer'.

Without the clamp every indirect execution is dropped ("not bounded"),
which is most of the world's draws and dispatches.

The buffers become structured buffers of uint, indexed in words (the
caller already refuses addresses and strides that are not multiples of
4), and the root signature is serialized beside the shader instead of
read from it. The bounds and the budget are unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 18:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

yourmomsbasement pushed a commit to yourmomsbasement/VIctory_Dev that referenced this pull request Nov 24, 2026
draw.rs keeps both the breadcrumb user-data arm (Marvisak#1081) and the past-host-heap drop (Marvisak#550). indirect.rs takes the bundle's Wine-compiler clamp (Marvisak#1279), the same fix Marvisak#994 carried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yourmomsbasement pushed a commit to yourmomsbasement/VIctory_Dev that referenced this pull request Nov 24, 2026
indirect.rs is the bundle's file: Marvisak#994 and Marvisak#1279 carry the same Wine-compiler clamp, and both root_signature functions had landed. The bundle's frame-wait test uses budget(), the function main made of BUDGET for VICTORY_PIPELINE_WAIT_MS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
edsuuu referenced this pull request in edsuuu/VI-BR-PORT Nov 24, 2026
…ame wait bundle

Taken from the bundle: 64 MB stacks for pipeline workers (#1129), no
blending on integer render targets (#1152), root signature flag fallback
(#626), read-only depth read states (#485, on our stored rtvs/dsv and
bind_targets), enhanced texture barrier translation (#642, on our
recording_list so continuation segments get it), indirect mesh dispatch
(#24), the frame wait taking its tick before it sleeps (#174), and the
make.rs unit tests (#1203).

Kept from our side:
- pipeline/make.rs: early() starts every compute pipeline at creation
  (b4e8419); the per-pipeline wake pair, per-frame budget, wait_compute
  and copystat counters. The bundle's the_wait_budget_is_spent_once_per_frame
  test is dropped (written for its fixed BUDGET; our FrameBudget tests
  cover it); a_pipeline_is_made_once now holds the tests' serial lock.
- indirect.rs: our whole file (#40's overflow-safe clamp, DXC fallback for
  Wine, rectangle pass). #1279's structured-buffer clamp and its readback
  test (written for the old bound/done API) are left out.
- draw.rs: NOT_MADE counter, user_dword, typed table nulls
  (table_view_props, mirror_for_draw); the depth test calls readable()
  directly since our tables() needs a host pipeline.
- frame.rs: our `_tick` (the diagnostics log already names it).
- list.rs: execute_indirect's DISPATCH_SINGLE mapping in one place; our
  tests beside the bundle's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sinan-cmyk

Copy link
Copy Markdown

Runtime boot check on real hardware with a retail dump

Result: no difference from main in this test.

I merged head f9eb979 onto main ffe310e (clean merge), built it (release), and ran victory run <title exe> --execute with an empty data folder for 100 s, without any input. I compared the run with main built and run the same way.

main ffe310e this PR
Reaches the first-boot screens yes yes
Caption at 100 s (one sample) 30 fps, 12 draws/frame 36 fps, 12 draws/frame
Frames presented 2,048 2,048
crashes.log entries 0 0
Committed memory 11.1 GB 11.1 GB

Warnings: 7, the same kinds and counts as on main. 0 errors.

Limits. Without input, the title stays on the first-boot screens. This run does not exercise saves, the intro video, the start screen, loading or the world. It shows only that the change does not break startup or the first menus on this machine. I did not run the PR's tests.

Machine: Ryzen 7 7800X3D, RTX 4070 SUPER, Windows 11 25H2, game 1.0.2.1. AI-assisted (Claude Code).

MamaLeVrai added a commit to MamaLeVrai/VIctory that referenced this pull request Nov 24, 2026
…erlaps with the GPU bundles

Marvisak#189 (wave64 on 32-lane hosts) and the GPU bundles Marvisak#1426 and Marvisak#1439 overlap
in three places:

- host.rs, where the host is built: Marvisak#208 (Marvisak#1426) logs the capabilities
  summary, Marvisak#189 chooses the Wave64 mode. Both lines are kept.
- host.rs, after the device helpers: Marvisak#208's adapter and capability probe and
  Marvisak#189's recommended_wave64_mode are two new functions at the same spot.
  Both are kept.
- shader_cache.rs: Marvisak#189 prefixes the translation input with a mode byte
  (input[33..]), Marvisak#358 (Marvisak#1439) records that a translation ran
  (self.translated). Both are kept; the two tests of Marvisak#358 that call
  cached() pass Wave64Mode::Native, as Marvisak#189's own tests do.

cargo clippy --workspace --all-targets --locked -- -D warnings, with and
without --all-features, is clean and cargo test --workspace --locked passes
(725 passed, 11 ignored, two runs).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
edsuuu referenced this pull request in edsuuu/VI-BR-PORT Nov 24, 2026
…ield

The lib tests did not build with --features diagnostics since #1439.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KainanP added a commit to KainanP/VIctory that referenced this pull request Nov 24, 2026
…e, frame wait) onto Marvisak#1426 + Marvisak#1418 + shader stack

Conflict in crates/victory-gpu/src/pipeline/host.rs, mesh pipeline stream: the stack
only reformatted the blend and sample-mask subobjects; Marvisak#1439 passes the blend through
`host_blend(&g.blend, &g.targets)` (which it brings and already uses for the other
pipeline kinds). Took Marvisak#1439's blend, kept the formatting.
KainanP added a commit to KainanP/VIctory that referenced this pull request Nov 24, 2026
…+ Marvisak#1418) + shader stack

No textual conflict; checked with cargo check --workspace --all-targets and the full
test suite (RTX, WARP, all features) when first merged on the previous Marvisak#1511
head (289f241); this replay with cargo check --workspace --all-targets
--all-features, and the full suite at the end of the line.
KainanP added a commit to KainanP/VIctory that referenced this pull request Nov 24, 2026
…+ Marvisak#1418) + shader stack

No textual conflict; checked with cargo check --workspace --all-targets and the full
test suite (RTX, WARP, all features) when first merged on the previous Marvisak#1511
head (289f241); this replay with cargo check --workspace --all-targets
--all-features, and the full suite at the end of the line.
KainanP added a commit to KainanP/VIctory that referenced this pull request Nov 24, 2026
…visak#320, Marvisak#439) with the GPU line

Both lines start from the Marvisak#160 merge (b821b31). One conflict, in
crates/victory-gpu/src/shader_cache.rs tests: the GPU line (Marvisak#1439) adds
`a_cache_that_cannot_keep_an_entry_still_gives_the_translation`, the wave64 line (Marvisak#439)
adds `keys_tell_hosts_wave_sizes_apart`, at the same place. Both kept as separate
tests (the shared text holds the closing brace and the `#[test]` attribute).
KainanP added a commit to KainanP/VIctory that referenced this pull request Nov 24, 2026
…shader writes and reads) onto integ/next

Conflicts:
1. crates/victory-gpu/src/draw.rs, `State::bind`: the stack (Marvisak#1439's depth
   sampling) resets `self.depth_sampled`, Marvisak#334 starts a buffer-state command
   (`list.begin_command()`). Independent; both kept, reset first.
2. crates/victory-gpu/src/host.rs tests: the stack adds
   `warp_device_creation_and_caps_probe`, Marvisak#334 adds
   `buffer_states_transition_between_writes_and_reads`,
   `buffer_states_keep_a_command_writing` and
   `debug_layer_accepts_buffers_written_then_read_as_vertices` (with its
   helpers) at the same place. The shared text holds the `#[test]` before
   and the closing brace after, so neither side's body closes inside the
   hunk: the stack's test is closed and Marvisak#334's follow as separate items
   (not nested).

Non-textual fixes:
- draw.rs `root_srv_table` (Marvisak#493, bounded root SRVs as one-view tables)
  reads a host copy without going through `root_view`, so it never asked
  Marvisak#334's tracker for the read state. It now calls
  `list.buffer_state(&s.buffer, BUFFER_READ)` after its refresh, on cache
  hits too, as Marvisak#334's author and Hiiva noted on Marvisak#334
  (Marvisak#334 (comment),
  Marvisak#334 (comment)).
- indirect.rs test `clamp_preserves_record_offsets_and_shared_budget`
  (Marvisak#1279, via Marvisak#1439) called `indirect::done`, which Marvisak#334 removes (the clamp
  now asks the tracker for the write state and `close` returns the copy to
  COMMON). The call is dropped; the next `bound` asks for the write state
  again, so no transition is missing.
@MamaLeVrai MamaLeVrai changed the title [BUNDLE] GPU pipeline library, shader cache, draw state and frame wait: 16 PRs, #72 #347 #1000 #358 #352 #626 #1152 #1129 #1203 #24 #642 #427 #485 #550 #174 #1279 [BUNDLE] GPU pipeline library, shader cache, draw state and frame wait: 5 PRs, #1000 #626 #642 #174 #1279 (rebuilt on main 70564ae) Nov 24, 2026

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Needs rebase. This pull request conflicts with main (conflicting: crates/victory-gpu/src/indirect.rs, crates/victory-gpu/src/list.rs). It will be reviewed once it is rebased onto the current main.

Note for the maintainers: the description has a section addressed to reviewing agents ("Re-verify in one go"), with commands to fetch and check out another branch and run cargo on it. The triage routine did not run them, and never runs code from a pull request.


Generated by Claude Code

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.

9 participants