perf(gpu): cut submitting-thread CPU overhead in refreshes, card_steps, safecopy, and list recycling #1298

Open
opened 2026-11-28 17:03:41 +00:00 by github-bot · 5 comments
Owner

@⁠NexiaMoe on GitHub · 2026-11-28 17:03 UTC · original

Summary

Reduces single-thread CPU overhead on the submitting thread (SUBMIT BUSY) and worker lock contention across crates/victory-gpu/src/, with no intended visual changes.

Tested on Ryzen 7 5800X3D (8C/16T) + RTX 5060 Ti 16 GB (Series S profile, Frame Gen OFF):

  • safecopy::tests::copy_costs (256 B): 13.9 → 23.0 GB/s (+65%) to upload memory; 13.3 → 22.6 GB/s (+70%) plain memory.
  • planning steps done on the card (card_steps): 6.1 ms → 2.7–3.7 ms/frame on ~3,600–4,200 draw scenes.
  • after the sending (land()): 3.6 ms → 0.1 ms/frame on the submitting thread.
  • refreshes: down to 10.2–12.5 ms/frame (from 15+ ms).
  • Overall submitting-thread SUBMIT BUSY: dropped from 45–56 ms down to 32.3–37.0 ms on ~3,600–4,200 draw scenes (22.0–27.5 ms on ~1,000-draw scenes), shifting heavy outdoor scenes from CPU-bound to GPU-bound with zero >100 ms stalls in steady play.

Test Configuration / Launch Args

Measured via scripts\play-foxhound.ps1 (both native -Dlss off and -Dlss balanced, Frame Gen OFF) with worker pools tuned for an 8C/16T CPU:

.\scripts\play-foxhound.ps1 `
  -Exe '<path-to-title-exe>' `
  -SeriesS -Dlss off ` # also tested with -Dlss balanced
  -More @{
    VICTORY_THIN = '1'
    VICTORY_THIN_THREADS = '5'
    VICTORY_PASSES_HOT = '1'
    VICTORY_WC_BAR = '1'
    VICTORY_WATER_LIGHT = '0'
    VICTORY_CARD_BUFFERS_MIN_KB = '64'
    VICTORY_WIDE_THREADS = '4'
    VICTORY_VIEW_THREADS = '3'
    VICTORY_UNDER_THREADS = '4'
    VICTORY_HELPER_PRIORITY = '1'
  }

Changes

1. AVX2 32-byte victory_safe_copy fast path (safecopy.rs)

  • Adds a forward 32-byte vmovdqu loop inside victory_safe_copy_at..victory_safe_copy_after for lengths 32..=1024 bytes (preserving rsi/rdi in r10/r11 and executing vzeroupper on both success and victory_safe_copy_failed).
  • Keeps rep movsb for < 32 B and > 1024 B (ERMS).

2. Write-watch & refresh batching (watch.rs, shadow.rs, host.rs)

  • watch.rs:
    • Adds lock-free KEPT: AtomicBool mirroring Journal::kept so ask_ahead / ask_ahead_done and flush callers skip collecting/sorting ranges when ask_once already holds the snapshot.
    • Sorts and merges Journal::ahead (normalize_ahead) and switches containment checks (ahead_contains) from O(N) linear scan to O(log N) partition_point.
    • Fuses ask_once into a single pass (ask_run_all + nested-range dedup): 1× Asking::hold_all(), 1× JOURNAL.write(), and 1× published() scan instead of two separate passes.
    • Exposes JournalRead (read_journal() + is_published()) so chunked refresh filters take JOURNAL.read() once per 32 copies while preserving the PUBLISHED-before-JOURNAL memory ordering.
  • host.rs:
    • Fuses Batch::refresh_front into a reused dense front_ranges buffer and drains self.spans in place (avoiding intermediate Touch vecs, a second hash map, and thousands of Arc<Shadow> clones per frame), plus a 1-entry last_ahead cache in Batch::add.
    • Splits refresh_front and flush_all into two phases: a 32-span parallel parallel_dirty_indices filter under one JOURNAL.read() per chunk, followed by 1-at-a-time work stealing for textures and only the actually dirty copies (eliminating straggler tails when several large dirty buffers share a chunk).

3. Shadow lock contention, parallel thresholds, and VICTORY_WC_BAR_MIN_KB (shadow.rs)

  • Adds has_pending: AtomicBool on Shadow (kept synchronized under pending.lock()) to skip locking pending on the common no-shader-writes path.
  • Merges ranged into copied: Mutex<(Vec<u64>, [(usize, usize, u64); 2])>, halving per-copy mutex acquisitions in nothing_new / copy_stale.
  • Replaces per-worker mutex locking in wide() completion tracking with an AtomicUsize remaining counter so only the final worker acquires the condvar mutex; adds wide_each_chunked.
  • Lowers copy_all and Shadow::take_all parallel thresholds from 4 MiB / 1 MiB to 256 KiB (128 KiB parts).
  • Adds VICTORY_WC_BAR_MIN_KB (defaulting to wc_no_back_min().max(1 MiB)) for VICTORY_WC_BAR=1 so small dynamic write-combined buffers keep two-sided copy-back + send::own snapshots (avoiding geometry/skinning corruption on small WC buffers) while large WC pools still use ReBAR VRAM.

4. card_steps & batched CBV descriptor writes (host/card_steps.rs, descriptor.rs, descriptor/host.rs, host.rs, land.rs)

  • does_of() avoids pushing thousands of Step::Refresh entries into does (scanning runs directly only when a Does::Copy is taken) and caches FillTo per asked fill.
  • Adds fill-only fast paths in plan() (single-pass exit when !has_copy && written.is_empty(), removes Box<dyn Iterator> heap allocations) and an O(1) list.last() dedup fast path in record().
  • Coalesces contiguous/overlapping (and <= 2 KiB mapped-page-bridged) 256-byte-aligned level-0 fills from the same Shadow into bulk CopyBufferRegion spans.
  • Partitions To::Slot fills into under_threads().clamp(1, 8) compact buckets (descriptor::constant_slots_batch / HostHeap::constant_at_batched), acquiring SHADER_HEAPS.read() once per worker bucket, reusing cached base_gpu, skipping redundant buffer.clone() via as_raw(), and retiring replaced resources in one deduplicated lock via host::retire_resources.

5. Offload landed-list recycling & batch IDLE pool locks (host.rs, list.rs)

  • In Host::send_late(), when relay() is active and victory-late-wait (late_helper) is running (with a backpressure fallback if > 64 batches back up), pokes victory-late-wait instead of calling land() synchronously on the submitting thread.
  • Batches IDLE.lock() in list::recycle() (one capacity check + one push per batch instead of two locks per command list) and uses an O(1) u64 bitmask for ran when lists.len() <= 64.

Verification

  • cargo clippy --locked -p victory-gpu -- -D warnings — clean (0 warnings)
  • cargo test --locked -p victory-gpu watch:: — 47 passed, 0 failed
  • cargo test --locked -p victory-gpu shadow:: — 36 passed, 0 failed
  • cargo test --locked -p victory-gpu card_steps — 9 passed, 0 failed (1 ignored)
  • cargo test --locked -p victory-gpu safecopy:: — 8 passed, 0 failed (1 ignored; copy_costs benchmark run separately)
  • cargo build --release --locked -p victory — clean (0 warnings)

Pull request details or commits were not available from GitHub; kept as an issue.

**@⁠NexiaMoe** on GitHub · 2026-11-28 17:03 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1298) ## Summary Reduces single-thread CPU overhead on the submitting thread (`SUBMIT BUSY`) and worker lock contention across `crates/victory-gpu/src/`, with no intended visual changes. Tested on **Ryzen 7 5800X3D (8C/16T) + RTX 5060 Ti 16 GB** (Series S profile, Frame Gen OFF): - **`safecopy::tests::copy_costs` (256 B):** `13.9 → 23.0 GB/s` (+65%) to upload memory; `13.3 → 22.6 GB/s` (+70%) plain memory. - **`planning steps done on the card` (`card_steps`):** `6.1 ms → 2.7–3.7 ms/frame` on ~3,600–4,200 draw scenes. - **`after the sending` (`land()`):** `3.6 ms → 0.1 ms/frame` on the submitting thread. - **`refreshes`:** down to `10.2–12.5 ms/frame` (from `15+ ms`). - **Overall submitting-thread `SUBMIT BUSY`:** dropped from `45–56 ms` down to `32.3–37.0 ms` on ~3,600–4,200 draw scenes (`22.0–27.5 ms` on ~1,000-draw scenes), shifting heavy outdoor scenes from CPU-bound to GPU-bound with zero >100 ms stalls in steady play. ### Test Configuration / Launch Args Measured via scripts\play-foxhound.ps1 (both native -Dlss off and -Dlss balanced, Frame Gen OFF) with worker pools tuned for an 8C/16T CPU: ```powershell .\scripts\play-foxhound.ps1 ` -Exe '<path-to-title-exe>' ` -SeriesS -Dlss off ` # also tested with -Dlss balanced -More @{ VICTORY_THIN = '1' VICTORY_THIN_THREADS = '5' VICTORY_PASSES_HOT = '1' VICTORY_WC_BAR = '1' VICTORY_WATER_LIGHT = '0' VICTORY_CARD_BUFFERS_MIN_KB = '64' VICTORY_WIDE_THREADS = '4' VICTORY_VIEW_THREADS = '3' VICTORY_UNDER_THREADS = '4' VICTORY_HELPER_PRIORITY = '1' } ``` ## Changes ### 1. AVX2 32-byte `victory_safe_copy` fast path (`safecopy.rs`) - Adds a forward 32-byte `vmovdqu` loop inside `victory_safe_copy_at..victory_safe_copy_after` for lengths `32..=1024` bytes (preserving `rsi`/`rdi` in `r10`/`r11` and executing `vzeroupper` on both success and `victory_safe_copy_failed`). - Keeps `rep movsb` for `< 32` B and `> 1024` B (ERMS). ### 2. Write-watch & refresh batching (`watch.rs`, `shadow.rs`, `host.rs`) - **`watch.rs`:** - Adds lock-free `KEPT: AtomicBool` mirroring `Journal::kept` so `ask_ahead` / `ask_ahead_done` and flush callers skip collecting/sorting ranges when `ask_once` already holds the snapshot. - Sorts and merges `Journal::ahead` (`normalize_ahead`) and switches containment checks (`ahead_contains`) from O(N) linear scan to O(log N) `partition_point`. - Fuses `ask_once` into a single pass (`ask_run_all` + nested-range dedup): 1× `Asking::hold_all()`, 1× `JOURNAL.write()`, and 1× `published()` scan instead of two separate passes. - Exposes `JournalRead` (`read_journal()` + `is_published()`) so chunked refresh filters take `JOURNAL.read()` once per 32 copies while preserving the `PUBLISHED`-before-`JOURNAL` memory ordering. - **`host.rs`:** - Fuses `Batch::refresh_front` into a reused dense `front_ranges` buffer and drains `self.spans` in place (avoiding intermediate `Touch` vecs, a second hash map, and thousands of `Arc<Shadow>` clones per frame), plus a 1-entry `last_ahead` cache in `Batch::add`. - Splits `refresh_front` and `flush_all` into two phases: a 32-span parallel `parallel_dirty_indices` filter under one `JOURNAL.read()` per chunk, followed by 1-at-a-time work stealing for textures and only the actually dirty copies (eliminating straggler tails when several large dirty buffers share a chunk). ### 3. `Shadow` lock contention, parallel thresholds, and `VICTORY_WC_BAR_MIN_KB` (`shadow.rs`) - Adds `has_pending: AtomicBool` on `Shadow` (kept synchronized under `pending.lock()`) to skip locking `pending` on the common no-shader-writes path. - Merges `ranged` into `copied: Mutex<(Vec<u64>, [(usize, usize, u64); 2])>`, halving per-copy mutex acquisitions in `nothing_new` / `copy_stale`. - Replaces per-worker mutex locking in `wide()` completion tracking with an `AtomicUsize` `remaining` counter so only the final worker acquires the condvar mutex; adds `wide_each_chunked`. - Lowers `copy_all` and `Shadow::take_all` parallel thresholds from `4 MiB` / `1 MiB` to `256 KiB` (`128 KiB` parts). - Adds `VICTORY_WC_BAR_MIN_KB` (defaulting to `wc_no_back_min().max(1 MiB)`) for `VICTORY_WC_BAR=1` so small dynamic write-combined buffers keep two-sided copy-back + `send::own` snapshots (avoiding geometry/skinning corruption on small WC buffers) while large WC pools still use ReBAR VRAM. ### 4. `card_steps` & batched CBV descriptor writes (`host/card_steps.rs`, `descriptor.rs`, `descriptor/host.rs`, `host.rs`, `land.rs`) - `does_of()` avoids pushing thousands of `Step::Refresh` entries into `does` (scanning `runs` directly only when a `Does::Copy` is taken) and caches `FillTo` per asked fill. - Adds fill-only fast paths in `plan()` (single-pass exit when `!has_copy && written.is_empty()`, removes `Box<dyn Iterator>` heap allocations) and an O(1) `list.last()` dedup fast path in `record()`. - Coalesces contiguous/overlapping (and `<= 2 KiB` mapped-page-bridged) 256-byte-aligned level-0 fills from the same `Shadow` into bulk `CopyBufferRegion` spans. - Partitions `To::Slot` fills into `under_threads().clamp(1, 8)` compact buckets (`descriptor::constant_slots_batch` / `HostHeap::constant_at_batched`), acquiring `SHADER_HEAPS.read()` once per worker bucket, reusing cached `base_gpu`, skipping redundant `buffer.clone()` via `as_raw()`, and retiring replaced resources in one deduplicated lock via `host::retire_resources`. ### 5. Offload landed-list recycling & batch `IDLE` pool locks (`host.rs`, `list.rs`) - In `Host::send_late()`, when `relay()` is active and `victory-late-wait` (`late_helper`) is running (with a backpressure fallback if `> 64` batches back up), pokes `victory-late-wait` instead of calling `land()` synchronously on the submitting thread. - Batches `IDLE.lock()` in `list::recycle()` (one capacity check + one push per batch instead of two locks per command list) and uses an O(1) `u64` bitmask for `ran` when `lists.len() <= 64`. ## Verification - `cargo clippy --locked -p victory-gpu -- -D warnings` — clean (0 warnings) - `cargo test --locked -p victory-gpu watch::` — 47 passed, 0 failed - `cargo test --locked -p victory-gpu shadow::` — 36 passed, 0 failed - `cargo test --locked -p victory-gpu card_steps` — 9 passed, 0 failed (1 ignored) - `cargo test --locked -p victory-gpu safecopy::` — 8 passed, 0 failed (1 ignored; `copy_costs` benchmark run separately) - `cargo build --release --locked -p victory` — clean (0 warnings) *Pull request details or commits were not available from GitHub; kept as an issue.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 17:03:41 +00:00
Author
Owner

@⁠wojtek2407 on GitHub · 2026-11-28 19:12 UTC · original

Test report for #1298 at b08eab5, A/B against its base 9ce3cf9 (main).

Hardware: RTX 4070 SUPER 12 GB (driver 610.88), i5-12400F (6 cores), Windows 11 26200. Title build v1.0.2.1.

Setup: one worktree per commit, each built with cargo build --release --locked -p victory. Both launched with scripts/play-foxhound.ps1 at its defaults: Series X, 2560x1440, DLSS Quality, no F1 settings file, no extra switches. I did not tune the thread counts the way the PR description does. I stood still at the same spot and camera angle in the boat mission, ~2 min per run, in the order A, B, A, B, with the shader and pipeline caches warm (the pipeline queue was empty every run). The numbers are medians of the frame-rate lines over the last ~75 s of each run.

A1 9ce3cf9 A2 9ce3cf9 B1 b08eab5 B2 b08eab5
fps 22.8 22.8 23.7 24.3
frame 43.9 ms 43.8 ms 42.1 ms 41.1 ms
submitting thread worked 42.0 ms 42.0 ms 38.8 ms 38.3 ms
planning steps done on the card 5.2 ms 5.2 ms 3.9 ms 3.8 ms
the lists' steps (refreshes) 15.8 (9.5) ms 16.0 (9.7) ms 15.0 (9.2) ms 15.0 (9.1) ms
card busy 86 % 85 % 89 % 88 %
draws per frame 3893 3843 3840 3784
  • +5 % fps (24.0 vs 22.8 on average), and the submitting thread does ~3.5 ms less work a frame (−8.5 %). The two A runs came out identical, so this is not run-to-run noise.
  • The biggest single drop is in planning the steps done on the card: −1.3 ms (−25 %). The rest is spread over refreshes and the lists' steps.
  • The card gets busier (85-86 → 88-89 %), so the frame moves towards being bound by the card.
  • No crash, no visible picture problems, the same 77 draws a frame dropped for want of a host pipeline in all four runs.
  • cargo test --release --locked -p victory-gpu --lib: 454 passed, 0 failed, 36 ignored on both commits.

I also read the safecopy AVX2 path. ymm0 is volatile in the Windows x64 ABI, both exits run vzeroupper, and a fault anywhere in the new path still falls inside victory_safe_copy_at..victory_safe_copy_after, so it leaves through the failing exit with rsi/rdi restored. The overlapping last 32-byte block is fine for non-overlapping buffers. I have not reviewed the locking changes in host.rs, card_steps.rs, shadow.rs and watch.rs in depth.

Not tested: driving or other moving scenes, Series S, frame generation, AMD, other CPUs, long sessions. Rare races from the lock changes would not show in 2-minute runs.

AI use: Claude Code (Claude Opus 5.5) set up the A/B, read the logs, reviewed the safecopy change and wrote this report. The runs were made on the PC above; the numbers come from their logs.

**@⁠wojtek2407** on GitHub · 2026-11-28 19:12 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1298#issuecomment-7244372167) Test report for #1298 at `b08eab5`, A/B against its base `9ce3cf9` (main). **Hardware**: RTX 4070 SUPER 12 GB (driver 610.88), i5-12400F (6 cores), Windows 11 26200. Title build v1.0.2.1. **Setup**: one worktree per commit, each built with `cargo build --release --locked -p victory`. Both launched with `scripts/play-foxhound.ps1` at its defaults: Series X, 2560x1440, DLSS Quality, no F1 settings file, no extra switches. I did not tune the thread counts the way the PR description does. I stood still at the same spot and camera angle in the boat mission, ~2 min per run, in the order A, B, A, B, with the shader and pipeline caches warm (the pipeline queue was empty every run). The numbers are medians of the frame-rate lines over the last ~75 s of each run. | | A1 `9ce3cf9` | A2 `9ce3cf9` | B1 `b08eab5` | B2 `b08eab5` | |---|---|---|---|---| | fps | 22.8 | 22.8 | **23.7** | **24.3** | | frame | 43.9 ms | 43.8 ms | 42.1 ms | 41.1 ms | | submitting thread worked | 42.0 ms | 42.0 ms | **38.8 ms** | **38.3 ms** | | planning steps done on the card | 5.2 ms | 5.2 ms | 3.9 ms | 3.8 ms | | the lists' steps (refreshes) | 15.8 (9.5) ms | 16.0 (9.7) ms | 15.0 (9.2) ms | 15.0 (9.1) ms | | card busy | 86 % | 85 % | 89 % | 88 % | | draws per frame | 3893 | 3843 | 3840 | 3784 | - **+5 % fps** (24.0 vs 22.8 on average), and the submitting thread does **~3.5 ms less work a frame (−8.5 %)**. The two A runs came out identical, so this is not run-to-run noise. - The biggest single drop is in planning the steps done on the card: −1.3 ms (−25 %). The rest is spread over refreshes and the lists' steps. - The card gets busier (85-86 → 88-89 %), so the frame moves towards being bound by the card. - No crash, no visible picture problems, the same 77 draws a frame dropped for want of a host pipeline in all four runs. - `cargo test --release --locked -p victory-gpu --lib`: 454 passed, 0 failed, 36 ignored on both commits. I also read the `safecopy` AVX2 path. `ymm0` is volatile in the Windows x64 ABI, both exits run `vzeroupper`, and a fault anywhere in the new path still falls inside `victory_safe_copy_at..victory_safe_copy_after`, so it leaves through the failing exit with `rsi`/`rdi` restored. The overlapping last 32-byte block is fine for non-overlapping buffers. I have not reviewed the locking changes in `host.rs`, `card_steps.rs`, `shadow.rs` and `watch.rs` in depth. **Not tested**: driving or other moving scenes, Series S, frame generation, AMD, other CPUs, long sessions. Rare races from the lock changes would not show in 2-minute runs. **AI use**: Claude Code (Claude Opus 5.5) set up the A/B, read the logs, reviewed the `safecopy` change and wrote this report. The runs were made on the PC above; the numbers come from their logs.
Author
Owner

@⁠jptorres96 on GitHub · 2026-11-28 19:15 UTC · original

Checked at b08eab5 on 9300875 (current main), Windows build 26300, rustc 1.98.1:

  • cargo test -p victory-gpu --lib -- --test-threads=1: 454 passed, 0 failed. The landing stress tests (frame_of_refreshes ×10, refresh_tests ×3 at --test-threads=4) pass, with no hang.
  • cargo clippy -p victory-gpu --all-targets --no-deps -- -D warnings fails on two functions this PR leaves unused, with and without --all-features. main gives neither.
    error: function `constant_slot` is never used
       --> crates\victory-gpu\src\descriptor.rs:882:15
    error: function `nothing_new` is never used
       --> crates\victory-gpu\src\watch.rs:925:15
    
    Removing them, or the callers' old path if it is meant to stay, would keep CI's clippy step green once main's own lints are fixed (#1290).

On the no-op refresh benchmark from #1138 this PR is among the fastest: -10% at 16 KiB copies and the best at 256 KiB (-9%). Numbers are in #1138.

**@⁠jptorres96** on GitHub · 2026-11-28 19:15 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1298#issuecomment-7244411061) Checked at `b08eab5` on `9300875` (current `main`), Windows build 26300, rustc 1.98.1: - `cargo test -p victory-gpu --lib -- --test-threads=1`: 454 passed, 0 failed. The landing stress tests (`frame_of_refreshes` ×10, `refresh_tests` ×3 at `--test-threads=4`) pass, with no hang. - **`cargo clippy -p victory-gpu --all-targets --no-deps -- -D warnings` fails on two functions this PR leaves unused**, with and without `--all-features`. `main` gives neither. ``` error: function `constant_slot` is never used --> crates\victory-gpu\src\descriptor.rs:882:15 error: function `nothing_new` is never used --> crates\victory-gpu\src\watch.rs:925:15 ``` Removing them, or the callers' old path if it is meant to stay, would keep CI's clippy step green once `main`'s own lints are fixed (#1290). On the no-op refresh benchmark from #1138 this PR is among the fastest: -10% at 16 KiB copies and the best at 256 KiB (-9%). Numbers are in #1138.
Author
Owner

@⁠NotADonky43 on GitHub · 2026-11-28 23:57 UTC · original

I isolated only the 32-span journal filter for the existing small (<=256-span) scalar refresh batches on a d4b5d517-based cumulative. No prefiltering across a write-watch ask; no changes to large-batch worker scheduling, stamp storage, card planner, safecopy or recycling. On contention the adaptation retains the span rather than waiting for a shadow lock while holding JOURNAL. 37 watch and 5 refresh tests passed on both switch settings, including a partial-page 67-span comparison against the scalar path and concurrent landing/title-write checks.

RTX 5070 Ti, Series X, DLSS Quality 1440p, no FG: same release executable and same precompiled shader/pipeline seeds, 7 settled heavy windows per side. Median refresh wall time 16.5 ms off / 17.3 ms on, median prepare 39.6/40.6 ms, median of reported present p95s 58.8/63.9 ms. Not shot-matched (median 43.7/48.2 MB of copies per frame). This subset alone did not demonstrate a gain on our workload. This is not a test or rejection of the entire PR, particularly the >256-span scheduling and planner changes. We left the subset out of the cumulative.

**@⁠NotADonky43** on GitHub · 2026-11-28 23:57 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1298#issuecomment-7247773231) I isolated **only the 32-span journal filter for the existing small (<=256-span) scalar refresh batches** on a d4b5d517-based cumulative. No prefiltering across a write-watch ask; no changes to large-batch worker scheduling, stamp storage, card planner, safecopy or recycling. On contention the adaptation retains the span rather than waiting for a shadow lock while holding JOURNAL. 37 watch and 5 refresh tests passed on both switch settings, including a partial-page 67-span comparison against the scalar path and concurrent landing/title-write checks. RTX 5070 Ti, Series X, DLSS Quality 1440p, no FG: same release executable and same precompiled shader/pipeline seeds, 7 settled heavy windows per side. Median refresh wall time **16.5 ms off / 17.3 ms on**, median prepare **39.6/40.6 ms**, median of reported present p95s **58.8/63.9 ms**. Not shot-matched (median 43.7/48.2 MB of copies per frame). This subset alone did not demonstrate a gain on our workload. This is **not a test or rejection of the entire PR**, particularly the >256-span scheduling and planner changes. We left the subset out of the cumulative.
Author
Owner

@⁠Revens2 on GitHub · 2026-11-29 12:24 UTC · original

Frame rate only, measured on your branch head, no code change on our side.

Setup. worktrees/pr-1298 at b08eab5 against worktrees/main-latest at 9300875. The only commit main has that the branch lacks is 9300875, a .github/workflows file, so the binary difference is this PR alone. Same save, same duration, DLSS quality (the player config), limiter off, 90 s of stabilisation then 180 s of measurement, one sample per second, alternating main/branch, gameplay samples only (draws above 7500 excluded), runs with fewer than 90 valid gameplay samples dropped. Hardware: RTX 5070 12 GB, i5-14600KF, 32 GB, 1080p.

Result. 4 valid runs against 3: 27.89 +- 0.33 fps (main) against 28.84 +- 0.32 fps (branch), +0.95 fps, se 0.25, 2 sigma 0.50 -> gain, about +3.4 %.

Three independent pairings agree: +0.99 (main-b / branch-b), +0.75 (branch-a / main-d), +0.95 (main-f / branch-d). Four runs were rejected for validity (85, 76, 79 and 69 valid samples) and none of them is counted; the rejected main/PR neighbours (28.13 against 29.26) lean the same way.

Where the time goes (4 main against 3 branch). submit_busy 34.10 -> 32.53 ms (-1.57), card_nothing 5.91 -> 4.52 ms (-1.39), frame 35.80 -> 34.50 ms (-1.30), prep 26.43 -> 25.73, copies_ms 12.57 -> 12.10, presents 6.42 -> 5.54. In exchange the card goes from 83.5 to 86.9 % busy and the submitting thread starts waiting: gpuwait 0.14 -> 1.41 ms, flights 0.23 -> 1.40 ms, submissions in flight 1.2 -> 2.3.

Reading. On this build the submitting thread was the limiter: the PR removes 1.6 ms of CPU work from it, the submission line takes the lead, the card rises from 83 to 87 % and the frame shortens by 1.3 ms. It takes that work off the submitting thread instead of moving it to another one, which is where it differs from #699 (1.7 ms off the same thread, moved to victory-recycle, no frame gained). That comparison runs on a different binary, so the mechanism is a hypothesis, not a proof.

Machine drift. The reference runs of this scene went from 27.21 fps (03:35) to 27.66 (09:24), +0.45 fps in six hours. Every neutral verdict of the campaign sits inside that band; this one is above it, and roughly twice above it. The absolute level also drifts down by ~0.4 fps across the morning while the gap holds, so the paired comparison is what carries the result, not the absolute numbers.

Reserve: one scene. 1136 inserted lines and 283 removed across 9 files of crates/victory-gpu (host.rs, host/card_steps.rs, shadow.rs, watch.rs, descriptor.rs, descriptor/host.rs, list.rs, safecopy.rs, land.rs) do not get validated by 7 runs of a single save: same view, same weather, same draw counts. What the measurement supports is that this path is faster on this scene and stable over 180 s windows; it says nothing about the descriptor, safecopy and watch paths this one scene does not cover. Smoke and upstream CI remain to be done before any merge.

No game data, dump or log attached.

**@⁠Revens2** on GitHub · 2026-11-29 12:24 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1298#issuecomment-7255794793) Frame rate only, measured on your branch head, no code change on our side. **Setup.** `worktrees/pr-1298` at b08eab5 against `worktrees/main-latest` at 9300875. The only commit main has that the branch lacks is `9300875`, a `.github/workflows` file, so the binary difference is this PR alone. Same save, same duration, DLSS quality (the player config), limiter off, 90 s of stabilisation then 180 s of measurement, one sample per second, alternating main/branch, gameplay samples only (draws above 7500 excluded), runs with fewer than 90 valid gameplay samples dropped. Hardware: RTX 5070 12 GB, i5-14600KF, 32 GB, 1080p. **Result.** 4 valid runs against 3: **27.89 +- 0.33 fps (main) against 28.84 +- 0.32 fps (branch), +0.95 fps, se 0.25, 2 sigma 0.50 -> gain**, about +3.4 %. Three independent pairings agree: +0.99 (main-b / branch-b), +0.75 (branch-a / main-d), +0.95 (main-f / branch-d). Four runs were rejected for validity (85, 76, 79 and 69 valid samples) and none of them is counted; the rejected main/PR neighbours (28.13 against 29.26) lean the same way. **Where the time goes (4 main against 3 branch).** `submit_busy` 34.10 -> 32.53 ms (**-1.57**), `card_nothing` 5.91 -> 4.52 ms (**-1.39**), frame 35.80 -> 34.50 ms (**-1.30**), `prep` 26.43 -> 25.73, `copies_ms` 12.57 -> 12.10, `presents` 6.42 -> 5.54. In exchange the card goes from 83.5 to **86.9 %** busy and the submitting thread starts waiting: `gpuwait` 0.14 -> 1.41 ms, `flights` 0.23 -> 1.40 ms, submissions in flight 1.2 -> 2.3. **Reading.** On this build the submitting thread was the limiter: the PR removes 1.6 ms of CPU work from it, the submission line takes the lead, the card rises from 83 to 87 % and the frame shortens by 1.3 ms. It takes that work off the submitting thread instead of moving it to another one, which is where it differs from #699 (1.7 ms off the same thread, moved to `victory-recycle`, no frame gained). That comparison runs on a different binary, so the mechanism is a hypothesis, not a proof. **Machine drift.** The reference runs of this scene went from 27.21 fps (03:35) to 27.66 (09:24), +0.45 fps in six hours. Every neutral verdict of the campaign sits inside that band; this one is above it, and roughly twice above it. The absolute level also drifts down by ~0.4 fps across the morning while the gap holds, so the paired comparison is what carries the result, not the absolute numbers. **Reserve: one scene.** 1136 inserted lines and 283 removed across 9 files of `crates/victory-gpu` (`host.rs`, `host/card_steps.rs`, `shadow.rs`, `watch.rs`, `descriptor.rs`, `descriptor/host.rs`, `list.rs`, `safecopy.rs`, `land.rs`) do not get validated by 7 runs of a single save: same view, same weather, same draw counts. What the measurement supports is that this path is faster on this scene and stable over 180 s windows; it says nothing about the descriptor, safecopy and watch paths this one scene does not cover. Smoke and upstream CI remain to be done before any merge. No game data, dump or log attached.
Author
Owner

@⁠birdneststream on GitHub · 2026-11-29 14:08 UTC · original

A data point for the landing path this PR rewrites, from Linux/Proton (RTX 5090, i9-13900KF, GE-Proton 11 + vkd3d-proton master, Series X, DLSS quality, FG 4x, ray tracing off), medians over the frame lines of 6,000+ draws, same kinds of scenes, 11-29:

build fps ms/frame preparing GPU copying back
main 568c5e5d + a few PRs (the 11-28 build, ~12 min in the world) 21.6 46.3 33.1 1.2 5.5
main 829188e9 + the same PRs (the 11-29 waves, two sessions) 19.1 / 17.8 52.4 / 56.3 37.2 / 39.8 4.2 / 6.0 23.1 / 22.5
the same with VICTORY_RELAY_COPY=1 17.8 56.3 39.8 6.0 22.5

So between the 11-28 and 11-29 mains the frame's "copying back" (COPY_BACK, the relay worker's landing span including the relay_card_back fence wait) went from 5 to 22–23 ms a frame while the CPU preparing moved only 33 → 37 and the card 1 → 4–6 ms; VICTORY_RELAY_COPY=1 does not move it. Your land() 3.6 → 0.1 ms is the kind of cut this needs — but your branch is based on the 11-28 main (9ce3cf9), and the landing path changed in the waves, so whoever merges this should expect the conflict in host.rs/land.rs and re-measure on the current main; the before/after there is now ~23 ms, not 3.6.

(The safecopy AVX2 loop alone, measured here on the 13900KF with safecopy::tests::copy_costs: 256 B 11.6 → 11.5 GB/s, 4 KiB 22.4 → 22.3 — nothing on this CPU; the gain in your table is on CPUs whose rep movsb pays a startup cost.)

**@⁠birdneststream** on GitHub · 2026-11-29 14:08 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1298#issuecomment-7257068077) A data point for the landing path this PR rewrites, from Linux/Proton (RTX 5090, i9-13900KF, GE-Proton 11 + vkd3d-proton master, Series X, DLSS quality, FG 4x, ray tracing off), medians over the frame lines of 6,000+ draws, same kinds of scenes, 11-29: | build | fps | ms/frame | preparing | GPU | **copying back** | |---|---:|---:|---:|---:|---:| | main 568c5e5d + a few PRs (the 11-28 build, ~12 min in the world) | 21.6 | 46.3 | 33.1 | 1.2 | **5.5** | | main 829188e9 + the same PRs (the 11-29 waves, two sessions) | 19.1 / 17.8 | 52.4 / 56.3 | 37.2 / 39.8 | 4.2 / 6.0 | **23.1 / 22.5** | | the same with `VICTORY_RELAY_COPY=1` | 17.8 | 56.3 | 39.8 | 6.0 | **22.5** | So between the 11-28 and 11-29 mains the frame's "copying back" (`COPY_BACK`, the relay worker's landing span including the `relay_card_back` fence wait) went from 5 to 22–23 ms a frame while the CPU preparing moved only 33 → 37 and the card 1 → 4–6 ms; `VICTORY_RELAY_COPY=1` does not move it. Your `land()` 3.6 → 0.1 ms is the kind of cut this needs — but your branch is based on the 11-28 main (`9ce3cf9`), and the landing path changed in the waves, so whoever merges this should expect the conflict in `host.rs`/`land.rs` and re-measure on the current main; the before/after there is now ~23 ms, not 3.6. (The safecopy AVX2 loop alone, measured here on the 13900KF with `safecopy::tests::copy_costs`: 256 B 11.6 → 11.5 GB/s, 4 KiB 22.4 → 22.3 — nothing on this CPU; the gain in your table is on CPUs whose `rep movsb` pays a startup cost.)
This discussion has been locked. Commenting is limited to contributors.
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#1298
No description provided.