Repository navigation
Integration branch measured on an RTX 3080 Ti: copy compare, ray tracing off, GPU timing of our own passes - #465
Closed
LeonardoS11 wants to merge 22 commits into
Closed
LeonardoS11 wants to merge 22 commits into
LeonardoS11 wants to merge 22 commits into
Conversation
… RT/depth textures
…alone logged commands=0; the core of upstream #1735)
…th one wait (VICTORY_CARD_BATCH=0: one each, as before)
…ime's, as VICTORY_SKIP_PIPELINES takes)
…atch, list preludes and the card compare (ours: ...)
…opy queue of the relay's own
…es changed (written-but-same pages are not sent up)
…elines, found by name in shaders.rpf, in every build Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… clamping THE BUG. Every ExecuteIndirect call (even when batched via VICTORY_INDIRECT_WINDOW=1) runs a clamp compute shader between two global UAV barriers and state transitions and invalidates cached host compute pipeline/root-signature state. WHY NOT HYPOTHETICAL. In gameplay, thousands of indirect mesh draws per frame pay compute/graphics mode switches, scratch-buffer copies, barrier stalls, and state rebinds even when the title argument buffers are already valid. THE FIX. Add VICTORY_INDIRECT_CLAMP (enabled by default; 0/false/no/off disables clamping). When disabled, draw::State::indirect validates record alignment/stride via indirect::validate_layout, refreshes the argument/count shadow ranges, emits a single UAV barrier (indirect::wait_direct), and executes ExecuteIndirect directly from the title argument buffer without running the clamp shader, scratch copy, state transitions, or pipeline invalidation. SCOPE. Only the indirect argument clamping path in indirect.rs and draw.rs. Default behavior (clamping enabled) is unchanged.
…n copies by size) and of indirect executions with the same state back to back; timing names preludes by what they do Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ut VICTORY_LATE; prelude timing names that survive the command key Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in their list, and stretches of indirect draws between dispatches Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…inct 64 KiB pages, 4 KiB pages per written 64 KiB page, pages flagged after our own copy-backs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # crates/victory-gpu/src/resource.rs # crates/victory-gpu/src/shadow.rs
…ws the host refuses (Series S); diagnostics count why indirect calls miss the clamp window Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LeonardoS11
marked this pull request as draft
November 25, 2026 01:19
LeonardoS11
marked this pull request as ready for review
November 25, 2026 01:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integration branch measured on an NVIDIA card, opened as a draft for discussion: it bundles other contributors' open PRs with new changes, so it is not meant to be merged as one piece. The new parts can be split into small PRs (list at the end).
What is in it
Other people's open PRs, cherry-picked unchanged with their authors (nothing to review here, only measured together): #191, #154, #175, #177, #186, #158, #194, #169.
New in this branch:
VICTORY_COPY_COMPARE=1(shadow.rs,host.rs): a refresh reads the written range and puts in / sends up only the 4 KiB pieces whose bytes changed.VICTORY_RT_OFF(apps/victory/src/rt_off.rs,pipeline.rs): the ray-tracing passes' pipelines (1,052 shaders found by name in the title's shader archive) are not built and their draws/dispatches do not run. On by default in this branch; for upstream it should be opt-in.VICTORY_GPU_TIMINGkeeps command notes without DRED (it loggedcommands=0) and times the layer's own passes asours: indirect / prelude-* / card.Host::card_backfetches the pieces of all flights settled together with one wait (VICTORY_CARD_BATCH=0: as before).VICTORY_RELAY_COPY_QUEUE=1: the relay's fetches on a copy queue of its own (off by default; no measured gain, see below).shader-info --verboseprinting the runtime's hash.Tested
diagprofile withdiagnostics.cargo test --workspace -j 10at0d86f22(everything but the last commit): 516 passed, 0 failed, 9 ignored. The last commit (e220136, the R9G9B9E5 stand-in) was built and run in the title but not through the GPU tests.main2119b0e, defaults, same save (not the still scene)VICTORY_RELAY=2 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024VICTORY_COPY_COMPARE=1, ray tracing offPer change:
VICTORY_SKIP_PIPELINES) gave the same result (269 vs 267 ms, same draw count).card_backin one fetch: waits for the card to fetch changed pieces 94.4 → 11.5 ms a frame (the two runs fetched different amounts: 25 MB and 2.2 MB).ours:61–68 ms (indirect clamp 31–35 ms in 1,930–4,475 commands, preludes 11–26 ms, card compare 13 ms), the title's indirect draws 66–68 ms in about 4,500, its dispatches 30–34 ms. WithVICTORY_INDIRECT_WINDOW=1the clamps fall from 4,475 to 1,930 a frame and their time stays at 35 ms.a803c87(textures looked at again after upload) confirmed by eye on this card: characters' models and textures load.Known defects / not tested
VICTORY_INDIRECT_CLAMP=0(Refuse VICTORY_INDIRECT_CLAMP=0: it kills the run, and hoisting is the answer to the cost #169) crashes the title while loading on this card (write to null); the clamp is needed here.main, and more so with the ray-tracing passes off.AI use
Claude Code (Claude Fable 5.2 and Claude Opus 5.5): wrote the new changes, ran the measurements and wrote this description. Run in the title by the author on the hardware above.
Proposed split
VICTORY_COPY_COMPAREalone onmain(68 lines).VICTORY_GPU_TIMINGfix +ours:timing.card_backin one fetch.VICTORY_RT_OFF, opt-in.