Draws short of dynamic slots wait for the next landing, not a settle under the submission lock, behind VICTORY_DYNAMIC_WAIT (port of fxceless 52dfd12) #821
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!821
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/821/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@xiepeixuan on GitHub · 2026-11-28 07:07 UTC · original
xiepeixuan:codex/dynamic-slot-wait→main· +189 −14 · 3 files · 1 commits · closed without mergingWhen a draw cannot get dynamic descriptor slots, it can settle all outstanding flights while holding the submission lock. That delays new submissions even when the next relay landing could free enough slots for the draw to continue.
Ported from fxceless/victory-fork 52dfd12 (fxceless), GPL-3.0 like this repository.
Measurement by fxceless, in that fork (run 402, 9,000–11,000 draws): 0.64 settles/frame at 19.7 ms each, and 12.4 ms/frame waiting for the submission lock. Frames with a settle took 92.7 ms versus 68.1 ms without one. These are not measurements of this port.
Scope and adaptations
host.rs: the wait and switch with their doc comments, a wait timing span, and the related rate-line counters.draw.rs: only the failed allocations for a bounded root UAV, a table-backed root SRV, and a fresh descriptor table.descriptor/host.rs: the free-slot low-water measurement feeding that line.VICTORY_DYNAMIC_WAIT=1opts in; unset,0, and other values take the original sequence, shown explicitly in the diff: failed allocation →settle_for_fence()→ one retry. The off path does not poll or record new statistics. The parser preserves the source's exact1test; there is noaltmode.relay()already requireslate_stage() > 0and the shadow relay, so no separate worker-start orlate()change is needed. Both submission paths that enqueue flights startlate_threads()first. The relay still waits for the GPU fence, lands the flight and its readbacks, then callsDetached::release_tablesbefore notifyingLINE_LANDED. Upstream's newerwait_host_fencevalidation is unchanged. No list reset or early table release is needed.pipeline/make.rs,memory.rs, andhost/card_steps.rs, the extra card-step diagnostics, theSTOODstats inqueue/behind.rs, and all README changes. This overlaps the wait portion of #83, but does not take that PR's THIN gate, table reuse, or early releases.Locking and fallback
The waiter reads the queue and
Line::settlingunderLINE, drops that guard before calling the allocator (which takes the heap'snextmutex), and sleeps viaLINE_LANDED.wait_timeout, which releasesLINE. It holds neitherLINEnor a heap lock when it calls the old settle. The relay releases a detached list's own draw state, not the title list's recording mutex; it does not take the submission mutex. List recycling and held-queue work remain onlate_helper.With relay off it goes straight to the old settle. With an empty line and no landing in progress, it retries once in case a landing freed slots just before the snapshot; if still short it does not sleep and falls back. An empty line while
settlingis true can still return slots. A missed notification causes at most one requested 1 ms poll before checking again, and a persistently busy, unhelpful relay returns to the old settle after the grace period. If the old settle and retry still return no slots, the existing draw/table failure paths are unchanged.Uses audit
State::root_uav,root_srv_table,tables; newwait_for_slotswait_for_slots. Their callers areState::bind: the UAV branch, both null and addressed SRV branches, and the table-build branch used by graphics and compute. No change to cache hits, first-attempt successes, or the failure return after the fallback.HostHeap::dynamic,free,dynamic,next,too_longmemory.rs(still a single attempt) and descriptor unit tests (same return/reuse rules). Only opt-in telemetry was added on allocator success and failure. Capacity, cursor, fragmentation, and thereleaseupdates to these fields are unchanged.Detached::release_tables,State::tables_done,descriptor::release_dynamic,HostHeap::releaseHost::settlestill release at the same point and from the detached state. Queue-sidelist::tables_donecalls (submission, split/wait and held-list paths) and the draw state'sDropstill release the same slots; heap identity checks, allocator locking and lifetime rules did not change.settle_for_fence,settle_now,Host::settle,Host::submittedflush_for_bake,early_textures,external::finish_submitted, the fence'sset_event_on_completion, and Streamline'scheck_run—retain their original settle. Present / FSR settles and the submission and late-helper lock sites are unchanged.line(),LINE,Line::line,Line::settling,LINE_LANDEDflying,late_blocked,late_signal,late_met_known,late_met_by), the land/recycle helper, relay fetch and worker, and the send/present/submit/settle paths do not change.relay_waitretains its original predicates for full settle, stale/read ranges, and flight count.Host::relay_landis still the notifier, at the same point.late(),relay(),late_threads,relay_worker,Host::relay_landlate_line/dynamic_wait_line,DYNAMIC_WAITS,DYNAMIC_LOW,HostHeap::note_dynamic_low,timeline::spanlate_lineis still called from the frame-rate report; the only new report/reset is for the opt-in wait and allocator sample.DYNAMIC_WAITSis updated only by the waiter;DYNAMIC_LOWis written only by the allocator and reset only by the report. The new wait span is the only change to timeline instrumentation.dynamic_wait,dynamic_wait_mode,DYNAMIC_WAIT_LIMIT,dynamic_wait_delayChecks
Windows workspace check:
cargo check --workspace --lockedpassed on4e99e53ffb3c107606c24181f760440c9564f4b6(fork job). Both the targeted and full fork jobs checked out and asserted that exact source SHA; their workflow-trigger branch is separate and is not part of this PR.Windows GPU library tests:
cargo test -p victory-gpu --lib --locked -- --skip pipeline::host::tests::depth_bounds_pipeline_loads_and_filters_drawspassed: 455 passed, 36 ignored, 1 filtered out. Baseline on63b902fewith the same command: 452 passed, 36 ignored, 1 filtered out. All three added tests passed (exact switch parsing, empty versus landing line, and the grace-period cutoff). In the unfiltered comparison, the only failure on both revisions was the same depth-bounds assertion inpipeline/host.rs:1466:9; that one test alone was excluded in the rerun.Full Windows CI: the fork workflow stopped at the same two Clippy errors as upstream main
63b902fe:clippy::let_and_return–crates/victory-shader/src/emit/mod.rs:2768:9clippy::manual_is_multiple_of–crates/victory-gpu/src/shadow.rs:1708:32No new diagnostic in any changed file. As on main, that Clippy failure skipped the later diagnostics build and workspace tests. No workspace-wide formatting.
Refs #756 (intra-frame settles) and #699 (submission-thread pacing).
AI-assisted (Codex). Not run in the game here. Off by default; needs a run with VICTORY_DYNAMIC_WAIT=1 in a busy scene (9,000+ draws) against =0.
Pull request closed