Batch relay dynamic/shared table releases, reuse RelayScratch, and fast-path Flights::done #2881

Open
github-bot wants to merge 1 commit from github-bot/gh-2881 into main AGit
Owner

@⁠steven-seagull27 on GitHub · 2026-11-29 18:29 UTC · original
steven-seagull27:perf/relay-land-batch-release-and-scratch → main · +794 −106 · 4 files · 1 commits · open

Summary

Eliminates redundant lock acquisitions, per-entry HashMap double-lookups, and per-landing heap allocations on the relay landing thread's COPY_BACK[0] and stat::READ_BACKS hot paths:

  1. Batch landed dynamic slot releases across all flights (draw.rs, list.rs, host.rs):
    • Updated draw::State::release_dynamic_slots and draw::State::reset to call descriptor::release_dynamic_batch instead of looping descriptor::release_dynamic per range.
    • Added State::take_landed_slots / Detached::take_landed_slots and drained all detached lists across all landed flights in Host::relay_land into a reusable scratch Vec before invoking descriptor::release_dynamic_batch once per landing.
  2. Batch SharedTables::let_go, SharedTables::unpark, and SharedTables::give_back (draw.rs, list.rs, host.rs):
    • Added SharedTables::dropped_batch, SharedTables::let_go_batch_into, SharedTables::let_go_batch, and draw::release_tables_batch to acquire SHARED_TABLES once per batch, drop that lock before touching descriptor heaps (preserving exact lock ordering), and issue a single descriptor::release_dynamic_batch call with exact retire_resources semantics.
    • Updated SharedTables::unpark to call HostHeap::release_batch and SharedTables::give_back to call descriptor::release_dynamic_batch.
    • Switched SharedTables::dropped and SharedTables::unparked from separate get/get_mut + remove pairs to HashMap::entry, halving HashMap lookups on removals.
    • Wired State::drop, State::reset, State::tables_done, Host::relay_land (READ_BACKS), and Host::settle to batch shared and remaining dynamic table releases across each flight's detached lists.
  3. Reuse scratch collections in Host::relay_card_back and Host::relay_land (host.rs):
    • Added RelayScratch on RelayFetch reusing seen, fetched, pieces, ordered_pieces, keys, titles, dynamic_slots, and shared_tables.
    • Wrapped relay_card_back_with_scratch with an RAII drop guard so all Arc<Shadow> references are cleared immediately on every exit path (normal return, early return, or unwind) and capacities above RELAY_SCRATCH_MAX_CAP (4096) are trimmed back down so outlier spikes never pin unbounded memory.
  4. Zero-allocation fast path in shadow::Flights::done (shadow.rs):
    • Added FreedRanges (None / One / inline Small up to 4 ranges / sorted Many) and Flights::done_ranges (using single-lookup HashMap::entry), skipping heap allocation and sorting for 0-, 1-, and small-range landings while keeping exact sorted binary_search semantics for larger sets in Shadow::copy_back_done.

Synthetic --release Microbenchmark (Before 55d06914 vs After, 3-run median)

Measured with cargo test --release --locked -j 2 -p victory-gpu --lib using synthetic workloads with std::hint::black_box:

Benchmark Workload Before (55d06914) After Delta
Landed dynamic slot release 400 landings × 24 lists × 24 ranges (230,400 ranges) 11,754 µs 8,466 µs -28.0% (1.39×)
SharedTables release (let_go → release_tables_batch) 400 flights × 256 shared refs (102,400 refs) 15,593 µs 9,131 µs -41.4% (1.71×)
SharedTables::unpark 400 unparks × 200 parked runs (80,000 runs) 9,801 µs 6,228 µs -36.5% (1.57×)
relay_card_back scratch collections (RelayScratch) 10,000 landings × 128 pieces 81,528 µs 46,933 µs -42.4% (1.74×)
Flights::done (0 freed, held by another flight) 200,000 landings 10,567 µs 7,253 µs -31.4% (1.46×)
Flights::done (1 freed, common case) 200,000 landings 9,558 µs 4,469 µs -53.2% (2.14×)
Flights::done (3 freed, inline small buffer) 200,000 landings 17,976 µs 12,267 µs -31.8% (1.47×)
Flights::done (16 freed, Many + Entry) 200,000 landings 88,045 µs 80,198 µs -8.9% (1.10×)

Verification

  • Added synthetic unit tests:
    • draw::tests::shared_tables_dropped_batch_matches_single_drop_semantics
    • draw::tests::batched_dynamic_and_shared_release_reclaims_all_host_heap_slots
    • shadow::relay_tests::flights_done_ranges_matches_reference_across_zero_one_small_and_many
    • host::batch::relay_scratch_reuses_buffers_caps_outliers_and_drops_shadows
  • Ran:
    • cargo test --locked -j 2 -p victory-gpu --lib -- draw:: --test-threads=1 — 27 passed, 0 failed (2 ignored)
    • cargo test --locked -j 2 -p victory-gpu --lib -- shadow:: --test-threads=1 — 72 passed, 0 failed (5 ignored)
    • cargo test --locked -j 2 -p victory-gpu --lib -- host:: --test-threads=1 — 213 passed, 0 failed (23 ignored)
    • cargo clippy --locked -j 2 -p victory-gpu --lib --tests — 0 new warnings in touched files
    • git diff --check — clean
**@⁠steven-seagull27** on GitHub · 2026-11-29 18:29 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2881) `steven-seagull27:perf/relay-land-batch-release-and-scratch` → `main` · +794 −106 · 4 files · 1 commits · open ## Summary Eliminates redundant lock acquisitions, per-entry HashMap double-lookups, and per-landing heap allocations on the relay landing thread's `COPY_BACK[0]` and `stat::READ_BACKS` hot paths: 1. **Batch landed dynamic slot releases across all flights (`draw.rs`, `list.rs`, `host.rs`):** - Updated `draw::State::release_dynamic_slots` and `draw::State::reset` to call `descriptor::release_dynamic_batch` instead of looping `descriptor::release_dynamic` per range. - Added `State::take_landed_slots` / `Detached::take_landed_slots` and drained all detached lists across all landed flights in `Host::relay_land` into a reusable scratch `Vec` before invoking `descriptor::release_dynamic_batch` once per landing. 2. **Batch `SharedTables::let_go`, `SharedTables::unpark`, and `SharedTables::give_back` (`draw.rs`, `list.rs`, `host.rs`):** - Added `SharedTables::dropped_batch`, `SharedTables::let_go_batch_into`, `SharedTables::let_go_batch`, and `draw::release_tables_batch` to acquire `SHARED_TABLES` once per batch, drop that lock before touching descriptor heaps (preserving exact lock ordering), and issue a single `descriptor::release_dynamic_batch` call with exact `retire_resources` semantics. - Updated `SharedTables::unpark` to call `HostHeap::release_batch` and `SharedTables::give_back` to call `descriptor::release_dynamic_batch`. - Switched `SharedTables::dropped` and `SharedTables::unparked` from separate `get`/`get_mut` + `remove` pairs to `HashMap::entry`, halving HashMap lookups on removals. - Wired `State::drop`, `State::reset`, `State::tables_done`, `Host::relay_land` (`READ_BACKS`), and `Host::settle` to batch shared and remaining dynamic table releases across each flight's detached lists. 3. **Reuse scratch collections in `Host::relay_card_back` and `Host::relay_land` (`host.rs`):** - Added `RelayScratch` on `RelayFetch` reusing `seen`, `fetched`, `pieces`, `ordered_pieces`, `keys`, `titles`, `dynamic_slots`, and `shared_tables`. - Wrapped `relay_card_back_with_scratch` with an RAII drop guard so all `Arc<Shadow>` references are cleared immediately on every exit path (normal return, early return, or unwind) and capacities above `RELAY_SCRATCH_MAX_CAP` (`4096`) are trimmed back down so outlier spikes never pin unbounded memory. 4. **Zero-allocation fast path in `shadow::Flights::done` (`shadow.rs`):** - Added `FreedRanges` (`None` / `One` / inline `Small` up to 4 ranges / sorted `Many`) and `Flights::done_ranges` (using single-lookup `HashMap::entry`), skipping heap allocation and sorting for 0-, 1-, and small-range landings while keeping exact sorted `binary_search` semantics for larger sets in `Shadow::copy_back_done`. ## Synthetic `--release` Microbenchmark (Before `55d06914` vs After, 3-run median) Measured with `cargo test --release --locked -j 2 -p victory-gpu --lib` using synthetic workloads with `std::hint::black_box`: | Benchmark | Workload | Before (`55d06914`) | After | Delta | |---|---|---:|---:|---:| | Landed dynamic slot release | 400 landings × 24 lists × 24 ranges (230,400 ranges) | 11,754 µs | 8,466 µs | **-28.0%** (1.39×) | | `SharedTables` release (`let_go` → `release_tables_batch`) | 400 flights × 256 shared refs (102,400 refs) | 15,593 µs | 9,131 µs | **-41.4%** (1.71×) | | `SharedTables::unpark` | 400 unparks × 200 parked runs (80,000 runs) | 9,801 µs | 6,228 µs | **-36.5%** (1.57×) | | `relay_card_back` scratch collections (`RelayScratch`) | 10,000 landings × 128 pieces | 81,528 µs | 46,933 µs | **-42.4%** (1.74×) | | `Flights::done` (`0` freed, held by another flight) | 200,000 landings | 10,567 µs | 7,253 µs | **-31.4%** (1.46×) | | `Flights::done` (`1` freed, common case) | 200,000 landings | 9,558 µs | 4,469 µs | **-53.2%** (2.14×) | | `Flights::done` (`3` freed, inline small buffer) | 200,000 landings | 17,976 µs | 12,267 µs | **-31.8%** (1.47×) | | `Flights::done` (`16` freed, `Many` + `Entry`) | 200,000 landings | 88,045 µs | 80,198 µs | **-8.9%** (1.10×) | ## Verification - Added synthetic unit tests: - `draw::tests::shared_tables_dropped_batch_matches_single_drop_semantics` - `draw::tests::batched_dynamic_and_shared_release_reclaims_all_host_heap_slots` - `shadow::relay_tests::flights_done_ranges_matches_reference_across_zero_one_small_and_many` - `host::batch::relay_scratch_reuses_buffers_caps_outliers_and_drops_shadows` - Ran: - `cargo test --locked -j 2 -p victory-gpu --lib -- draw:: --test-threads=1` — **27 passed, 0 failed** (2 ignored) - `cargo test --locked -j 2 -p victory-gpu --lib -- shadow:: --test-threads=1` — **72 passed, 0 failed** (5 ignored) - `cargo test --locked -j 2 -p victory-gpu --lib -- host:: --test-threads=1` — **213 passed, 0 failed** (23 ignored) - `cargo clippy --locked -j 2 -p victory-gpu --lib --tests` — **0 new warnings** in touched files - `git diff --check` — clean
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 18:34:38 +00:00
Author
Owner

@⁠Yuanzer on GitHub · 2026-11-29 19:43 UTC · original

In-game fixed-clock A/B on the reporter's Windows 11 machine (AI-assisted local runs):

  • i7-14700KF, 32 GB RAM; RTX 5060 Ti 8 GB, driver 621.40.
  • Fresh main 55d06914 and fresh PR head 65e11b31, each built in a separate clean worktree with the same toolchain and release profile.
  • Series S, internal 1280x720, DLSS Quality preset M, frame generation off, ray tracing off.
  • World clock held at 12:00; same saved F1 settings. Both logs used VICTORY_LOG=victory_gpu::host=info,warn.
  • Four runs in the order base -> PR -> PR -> base, 60 samples after the world loaded and settled.
run FPS median frame median P90 submit thread avg list steps avg relay landing avg
base 1 19 54.1 ms 56.6 38.98 ms 22.29 ms 14.41 ms
PR 1 18 56.8 ms 62.0 36.94 ms 21.02 ms 13.42 ms
PR 2 19 52.8 ms 59.2 35.55 ms 20.19 ms 12.58 ms
base 2 18 54.5 ms 58.0 35.06 ms 19.73 ms 13.17 ms

Aggregate: the PR reduced submit-thread work from about 37.0 to 36.2 ms, list steps from 21.0 to 20.6 ms, and relay landing from 13.8 to 13.0 ms. The frame median was 54.2 ms on base versus 54.8 ms on PR, and median FPS was unchanged within this scene. Draw counts were similar (5,272-5,408); there were no OOMs or device removals in any run.

This validates the targeted code paths and matches the direction of the synthetic result, but not the synthetic magnitude. At this ~5.3k-draw scene the reduced CPU work is under the run-to-run frame noise. I would report it as a low-risk CPU-overhead reduction rather than a gameplay FPS gain until it is measured on a scene with more landings or slower release work.

One process note: GitHub currently shows this PR as CONFLICTING, although its head is one commit above 55d06914 and built cleanly here from the head itself. It will need a rebase/merge before it can be tested as a merge result.

Runs and readings are from the reporter's machine; analysis and wording are AI-assisted.

**@⁠Yuanzer** on GitHub · 2026-11-29 19:43 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2881#issuecomment-7261500478) In-game fixed-clock A/B on the reporter's Windows 11 machine (AI-assisted local runs): - i7-14700KF, 32 GB RAM; RTX 5060 Ti 8 GB, driver 621.40. - Fresh main 55d06914 and fresh PR head 65e11b31, each built in a separate clean worktree with the same toolchain and release profile. - Series S, internal 1280x720, DLSS Quality preset M, frame generation off, ray tracing off. - World clock held at 12:00; same saved F1 settings. Both logs used VICTORY_LOG=victory_gpu::host=info,warn. - Four runs in the order base -> PR -> PR -> base, 60 samples after the world loaded and settled. | run | FPS median | frame median | P90 | submit thread avg | list steps avg | relay landing avg | |---|---:|---:|---:|---:|---:|---:| | base 1 | 19 | 54.1 ms | 56.6 | 38.98 ms | 22.29 ms | 14.41 ms | | PR 1 | 18 | 56.8 ms | 62.0 | 36.94 ms | 21.02 ms | 13.42 ms | | PR 2 | 19 | 52.8 ms | 59.2 | 35.55 ms | 20.19 ms | 12.58 ms | | base 2 | 18 | 54.5 ms | 58.0 | 35.06 ms | 19.73 ms | 13.17 ms | Aggregate: the PR reduced submit-thread work from about 37.0 to 36.2 ms, list steps from 21.0 to 20.6 ms, and relay landing from 13.8 to 13.0 ms. The frame median was 54.2 ms on base versus 54.8 ms on PR, and median FPS was unchanged within this scene. Draw counts were similar (5,272-5,408); there were no OOMs or device removals in any run. This validates the targeted code paths and matches the direction of the synthetic result, but not the synthetic magnitude. At this ~5.3k-draw scene the reduced CPU work is under the run-to-run frame noise. I would report it as a low-risk CPU-overhead reduction rather than a gameplay FPS gain until it is measured on a scene with more landings or slower release work. One process note: GitHub currently shows this PR as CONFLICTING, although its head is one commit above 55d06914 and built cleanly here from the head itself. It will need a rebase/merge before it can be tested as a merge result. *Runs and readings are from the reporter's machine; analysis and wording are AI-assisted.*
Author
Owner

@⁠Yuanzer on GitHub · 2026-11-29 19:53 UTC · original

Series X / higher-load addendum: two order-reversed pairs on the same machine (AI-assisted local runs).

  • Series X, internal 2560x1440, DLSS Quality preset M, frame generation off, ray tracing off.
  • Fixed world clock 12:00; base main55d06914 and head 65e11b31; logs at the same host-info filter.
run FPS median frame median P90 P99 median draws ms per 1,000 draws
base 1 16 61.1 80.3 84.3 5,884 10.384
PR 1 17 59.7 65.0 75.6 5,694 10.485
PR 2 16 62.5 77.2 88.6 5,705 10.955
base 2 16 64.3 75.3 96.4 5,796 11.094

Raw median frame time was 1.6 ms lower on the PR, but it also drew about 135 fewer objects per frame. Normalized to draws, the result is effectively neutral: 10.74 ms per 1,000 draws on base versus 10.72 on the PR. The aggregate P90 and P99 are lower on the PR, but the run order still matters and this is one pair per order.

Taken with the 720p four-run result, the evidence supports a small CPU/relay work reduction and a possible tail improvement, not a normalized FPS gain in these scenes. No OOMs or device removals occurred.

Runs and readings are from the reporter's machine; analysis and wording are AI-assisted.

**@⁠Yuanzer** on GitHub · 2026-11-29 19:53 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2881#issuecomment-7261637529) Series X / higher-load addendum: two order-reversed pairs on the same machine (AI-assisted local runs). - Series X, internal 2560x1440, DLSS Quality preset M, frame generation off, ray tracing off. - Fixed world clock 12:00; base main55d06914 and head 65e11b31; logs at the same host-info filter. | run | FPS median | frame median | P90 | P99 | median draws | ms per 1,000 draws | |---|---:|---:|---:|---:|---:|---:| | base 1 | 16 | 61.1 | 80.3 | 84.3 | 5,884 | 10.384 | | PR 1 | 17 | 59.7 | 65.0 | 75.6 | 5,694 | 10.485 | | PR 2 | 16 | 62.5 | 77.2 | 88.6 | 5,705 | 10.955 | | base 2 | 16 | 64.3 | 75.3 | 96.4 | 5,796 | 11.094 | Raw median frame time was 1.6 ms lower on the PR, but it also drew about 135 fewer objects per frame. Normalized to draws, the result is effectively neutral: 10.74 ms per 1,000 draws on base versus 10.72 on the PR. The aggregate P90 and P99 are lower on the PR, but the run order still matters and this is one pair per order. Taken with the 720p four-run result, the evidence supports a small CPU/relay work reduction and a possible tail improvement, not a normalized FPS gain in these scenes. No OOMs or device removals occurred. *Runs and readings are from the reporter's machine; analysis and wording are AI-assisted.*
github-bot force-pushed github-bot/gh-2881 from 65e11b319c to fca85edf04 2026-11-29 20:46:14 +00:00 Compare
Author
Owner

@⁠steven-seagull27 on GitHub · 2026-11-29 20:42 UTC · original

Thanks @⁠Yuanzer for running both fixed-clock A/B series (720p and 1440p) and flagging the rebase conflict!

Rebased cleanly onto latest main (cec481f4, new head fca85edf) while preserving all recent upstream fixes in the touched paths:

  • Kept 1b4b6cd4's Host::resize_fetch (and membench::RELAY_FETCH) inside relay_card_back_with_scratch, detached.release_scratch() at landing in both relay and non-relay landing loops, and idle list trimming in list.rs.
  • Compatible with b214e008 (plain next-fit scan default) and d7c2d8a7 (393,216 dynamic slots), as batched slot release routes through DynamicSlots::release_batch for both plain and bitmap modes.

Verification (rebased on cec481f4)

  • cargo test --locked -j 3 -p victory-gpu --lib -- descriptor:: --test-threads=1 — 102 passed, 0 failed (2 ignored)
  • cargo test --locked -j 3 -p victory-gpu --lib -- host:: --test-threads=1 — 213 passed, 0 failed (26 ignored), including host::batch::relay_scratch_reuses_buffers_caps_outliers_and_drops_shadows
  • cargo test --locked -j 3 -p victory-gpu --lib -- draw:: --test-threads=1 — 27 passed, 0 failed (2 ignored), including draw::tests::batched_dynamic_and_shared_release_reclaims_all_host_heap_slots
  • cargo test --locked -j 3 -p victory-gpu --lib -- shadow::relay_tests:: --test-threads=1 — 8 passed, 0 failed, including shadow::relay_tests::flights_done_ranges_matches_reference_across_zero_one_small_and_many
  • cargo test --locked -j 3 -p victory-gpu --lib -- list:: --test-threads=1 — 20 passed, 0 failed
  • cargo check --locked -j 3 -p victory-gpu --lib and cargo clippy --locked -j 3 -p victory-gpu --lib --tests — 0 new warnings in touched files (--features diagnostics has pre-existing unrelated errors on main in copystat.rs and host.rs:9355, with 0 errors/warnings in lines touched by this PR)
  • git diff --check origin/main..HEAD — clean
**@⁠steven-seagull27** on GitHub · 2026-11-29 20:42 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2881#issuecomment-7262291665) Thanks @⁠Yuanzer for running both fixed-clock A/B series (720p and 1440p) and flagging the rebase conflict! Rebased cleanly onto latest `main` (`cec481f4`, new head `fca85edf`) while preserving all recent upstream fixes in the touched paths: - Kept `1b4b6cd4`'s `Host::resize_fetch` (and `membench::RELAY_FETCH`) inside `relay_card_back_with_scratch`, `detached.release_scratch()` at landing in both relay and non-relay landing loops, and idle list trimming in `list.rs`. - Compatible with `b214e008` (plain next-fit scan default) and `d7c2d8a7` (393,216 dynamic slots), as batched slot release routes through `DynamicSlots::release_batch` for both plain and bitmap modes. ### Verification (rebased on `cec481f4`) - `cargo test --locked -j 3 -p victory-gpu --lib -- descriptor:: --test-threads=1` — **102 passed, 0 failed** (2 ignored) - `cargo test --locked -j 3 -p victory-gpu --lib -- host:: --test-threads=1` — **213 passed, 0 failed** (26 ignored), including `host::batch::relay_scratch_reuses_buffers_caps_outliers_and_drops_shadows` - `cargo test --locked -j 3 -p victory-gpu --lib -- draw:: --test-threads=1` — **27 passed, 0 failed** (2 ignored), including `draw::tests::batched_dynamic_and_shared_release_reclaims_all_host_heap_slots` - `cargo test --locked -j 3 -p victory-gpu --lib -- shadow::relay_tests:: --test-threads=1` — **8 passed, 0 failed**, including `shadow::relay_tests::flights_done_ranges_matches_reference_across_zero_one_small_and_many` - `cargo test --locked -j 3 -p victory-gpu --lib -- list:: --test-threads=1` — **20 passed, 0 failed** - `cargo check --locked -j 3 -p victory-gpu --lib` and `cargo clippy --locked -j 3 -p victory-gpu --lib --tests` — **0 new warnings** in touched files (`--features diagnostics` has pre-existing unrelated errors on `main` in `copystat.rs` and `host.rs:9355`, with 0 errors/warnings in lines touched by this PR) - `git diff --check origin/main..HEAD` — clean
Author
Owner

@⁠DoubleD17 on GitHub · 2026-11-30 07:58 UTC · original · edited 2026-11-30 09:57 UTC

We ran a test of this PR on current main (41adb551 with this PR merged), on a CPU-bound machine.

We compare only the seconds where the idle camera shows the same lighter views (about 7,500 draws a frame). Its heavier view (about 15,000 draws, half the frame rate) takes 10 to 60 s of each 150 s run, and it moved whole-run means by several ms.

CPU prep (ms/frame) main at that point fps main at that point
round 1 62.5 60.4 14.6 14.9
round 2 64.9 60.1 14.1 15.1
mean difference +3.5 ms −4.3 %

No difference we can measure. The five main runs of the session agreed within 1.3 ms on these seconds. But we also ran main again, built in another folder, eight times: it ranged from 57.5 to 65.5 ms. Its first four runs were 2.4 ms slower than main on average, and the last four 4.2 ms faster. All nine PRs we tested in this session came out 0.4 to 3.9 ms slower than main, and fps moved with it. So we read the difference as a newly built executable, not as this PR.

The relay thread was landing 32.8 and 36.1 ms a frame, against 30.9 to 38.0 on main.

Picture: 0 defects in 160 frames.

Setup:

  • Ryzen 7 5800X (8 cores, 16 threads), RTX 5070 12 GB (DXGI budget 11,175 MB), 64 GB RAM, Windows 11;
  • Series X, 1440p with DLAA (DLSS at native resolution; corrected, this line said DLSS Performance at first), frame generation and ray tracing off;
  • the PR merged locally onto main 41adb551 (only its own commits on top), against 41adb551 itself;
  • a warm-up run per build, then 150 s runs in two rounds (the second in reverse order), with five main runs spread through the session;
  • every run starts from the same save, restored before each run;
  • CPU prep is the median of the submitting thread's 5 s lines, fps the median of the host's 5 s lines, on the light-view seconds after the first 20 s; each run is compared with main's runs interpolated in time.

Picture check: a burst of 10 captures a second at the end of each run (80 frames), looked at frame by frame.

AI Assisted

**@⁠DoubleD17** on GitHub · 2026-11-30 07:58 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2881#issuecomment-7272340126) · edited 2026-11-30 09:57 UTC We ran a test of this PR on current main (41adb551 with this PR merged), on a CPU-bound machine. We compare only the seconds where the idle camera shows the same lighter views (about 7,500 draws a frame). Its heavier view (about 15,000 draws, half the frame rate) takes 10 to 60 s of each 150 s run, and it moved whole-run means by several ms. | | CPU prep (ms/frame) | main at that point | fps | main at that point | |---|---|---|---|---| | round 1 | 62.5 | 60.4 | 14.6 | 14.9 | | round 2 | 64.9 | 60.1 | 14.1 | 15.1 | | **mean difference** | **+3.5 ms** | | **−4.3 %** | | No difference we can measure. The five main runs of the session agreed within 1.3 ms on these seconds. But we also ran main again, built in another folder, eight times: it ranged from 57.5 to 65.5 ms. Its first four runs were 2.4 ms slower than main on average, and the last four 4.2 ms faster. All nine PRs we tested in this session came out 0.4 to 3.9 ms slower than main, and fps moved with it. So we read the difference as a newly built executable, not as this PR. The relay thread was landing 32.8 and 36.1 ms a frame, against 30.9 to 38.0 on main. **Picture:** 0 defects in 160 frames. **Setup:** - Ryzen 7 5800X (8 cores, 16 threads), RTX 5070 12 GB (DXGI budget 11,175 MB), 64 GB RAM, Windows 11; - Series X, 1440p with DLAA (DLSS at native resolution; corrected, this line said DLSS Performance at first), frame generation and ray tracing off; - the PR merged locally onto main 41adb551 (only its own commits on top), against 41adb551 itself; - a warm-up run per build, then 150 s runs in two rounds (the second in reverse order), with five main runs spread through the session; - every run starts from the same save, restored before each run; - CPU prep is the median of the submitting thread's 5 s lines, fps the median of the host's 5 s lines, on the light-view seconds after the first 20 s; each run is compared with main's runs interpolated in time. Picture check: a burst of 10 captures a second at the end of each run (80 frames), looked at frame by frame. AI Assisted
Author
Owner

@⁠steven-seagull27 on GitHub · 2026-11-30 11:52 UTC · original

Thanks @⁠DoubleD17 for running the two-round interpolated comparison on 41adb551 and checking the 160 captured frames for visual defects! Good to have independent confirmation that the batched descriptor-slot/shared-table releases and RelayScratch reuse are defect-free under 1440p DLAA load.

**@⁠steven-seagull27** on GitHub · 2026-11-30 11:52 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2881#issuecomment-7277638433) Thanks @⁠DoubleD17 for running the two-round interpolated comparison on `41adb551` and checking the 160 captured frames for visual defects! Good to have independent confirmation that the batched descriptor-slot/shared-table releases and `RelayScratch` reuse are defect-free under 1440p DLAA load.
github-bot force-pushed github-bot/gh-2881 from fca85edf04 to ef735ec9f0 2026-11-30 18:28:45 +00:00 Compare
Author
Owner

@⁠steven-seagull27 on GitHub · 2026-11-30 18:27 UTC · original

Rebased cleanly onto latest main:

  • Preserved #3498 (VICTORY_LAND_CAPTURE) and #3480 (batched land::Notes::flush_all) alongside RelayScratch in Host::relay_card_back / Host::relay_land, batched dynamic/shared descriptor releases, and Flights::done_ranges.
  • Verified relay_scratch and flights unit tests, --features diagnostics check, clippy --lib --tests, and xtask policy.
**@⁠steven-seagull27** on GitHub · 2026-11-30 18:27 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2881#issuecomment-7287886347) Rebased cleanly onto latest `main`: - Preserved `#3498` (`VICTORY_LAND_CAPTURE`) and `#3480` (batched `land::Notes::flush_all`) alongside `RelayScratch` in `Host::relay_card_back` / `Host::relay_land`, batched dynamic/shared descriptor releases, and `Flights::done_ranges`. - Verified `relay_scratch` and `flights` unit tests, `--features diagnostics` check, `clippy --lib --tests`, and `xtask policy`.
Author
Owner

@⁠tyr0nsur on GitHub · 2026-12-01 00:09 UTC · original

I isolated dynamic slot release on current 7d93ee07, motivated by the landing profile in #4592. The raw merge currently conflicts in the inherited xmem.rs history, but a three-way application of your single commit ef735ec9 to 7d93ee07 is clean and touches just the four files in its diff.

On Windows with a Ryzen 7 5800X and a live D3D12 host heap, I compared the current per-range release loop with release_dynamic_batch for one heap, all one-slot ranges and retirement enabled. Nine paired runs of 1,000 landings per size, alternating execution order, optimized test profile (opt-level=2). Allocation and free-count checks were outside the timed interval. Median ns per landing:

Ranges Per-range loop Batch
1 46.0 60.9
24 549.3 478.7
128 2770.8 1795.5

Every landing restored the initial slot count, and the existing wrong-ID/stale-heap batch test passed. The measurement isolates slot release and does not include populated descriptors, allocation, or the rest of the relay. The 24- and 128-range results support checking just the landing-side batching in the #4592 gameplay comparison.

**@⁠tyr0nsur** on GitHub · 2026-12-01 00:09 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2881#issuecomment-7296000993) I isolated dynamic slot release on current `7d93ee07`, motivated by the landing profile in #4592. The raw merge currently conflicts in the inherited `xmem.rs` history, but a three-way application of your single commit `ef735ec9` to `7d93ee07` is clean and touches just the four files in its diff. On Windows with a Ryzen 7 5800X and a live D3D12 host heap, I compared the current per-range release loop with `release_dynamic_batch` for one heap, all one-slot ranges and retirement enabled. Nine paired runs of 1,000 landings per size, alternating execution order, optimized test profile (`opt-level=2`). Allocation and free-count checks were outside the timed interval. Median ns per landing: | Ranges | Per-range loop | Batch | | --- | ---: | ---: | | 1 | 46.0 | 60.9 | | 24 | 549.3 | 478.7 | | 128 | 2770.8 | 1795.5 | Every landing restored the initial slot count, and the existing wrong-ID/stale-heap batch test passed. The measurement isolates slot release and does not include populated descriptors, allocation, or the rest of the relay. The 24- and 128-range results support checking just the landing-side batching in the #4592 gameplay comparison.
github-bot changed title from [pr-perf] Batch relay dynamic/shared table releases, reuse RelayScratch, and fast-path Flights::done to Batch relay dynamic/shared table releases, reuse RelayScratch, and fast-path Flights::done 2026-12-01 00:58:04 +00:00
github-bot force-pushed github-bot/gh-2881 from ef735ec9f0 to a1b0257ab7 2026-12-01 00:58:05 +00:00 Compare
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/draw.rs
  • crates/victory-gpu/src/host.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2881/head:github-bot/gh-2881'
git switch 'github-bot/gh-2881'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2881'
git switch 'github-bot/gh-2881'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2881'
git switch 'github-bot/gh-2881'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2881'
git switch 'main'
git merge --squash 'github-bot/gh-2881'
git switch 'main'
git merge --ff-only 'github-bot/gh-2881'
git switch 'main'
git merge 'github-bot/gh-2881'
git push origin 'main'
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/trustno1-coder--VIctory-NVIDIA!2881
No description provided.