Optimize submission write-watch, card_steps planning, range-scoped Batch invalidation, and async landing #2647

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

@⁠piyonchu on GitHub · 2026-11-29 15:32 UTC · original
piyonchu:perf/submission-pipeline-batch-card-steps → main · +1756 −641 · 3 files · 1 commits · open

What it changes

Addresses four CPU bottlenecks on the submission path (#2588-style preparation and after the sending tail) without overlapping existing open PRs:

  1. Range-scoped invalidation & hot-path reductions in Batch and Deferred (crates/victory-gpu/src/host.rs)

    • Added Batch::title_written_range(dst, len) and Deferred::title_written_range(dst, len) for Step::Copy and Step::Placed instead of calling whole-state title_written():
      • Only pending fills, due textures (staging_due + texture_ranges), and refreshes overlapping [dst, dst + len) are flushed/removed (refreshes updated in-place via swap_remove + index fixup), while title_writes tracks sorted non-overlapping written ranges (join_ranges) so disjoint ahead entries remain valid across the frame.
      • Added consecutive-shadow cache (last_add) in Batch::add, forward_cursor monotonic lookup in Batch::find_forward_fill, and deduplicated Batch::copy_spans when asked_first already populated batch.spans (copy_spans_extend when own prepends).
    • Added HELPER_ALIVE + helper_land() (VICTORY_HELPER_LAND=0 opt-out) so send_late can offload non-blocking landing work (land()) to late_helper under a <= 32 queued-list cap.
  2. card_steps planning & RefreshSpans indexing (crates/victory-gpu/src/host/card_steps.rs)

    • Added CardStepsScratch (CARD_STEPS_SCRATCH, capacity capped at 8192) and PlanScratch (plan_with_scratch) reusing per-thread allocations across submissions and replacing boxed iterator trait objects and full-slice rescans with candidates pre-filtering and has_placed && has_slot_fill gating for served_fills_into / behind checks.
    • Excluded ~20k Step::Refresh steps from does via collect_active_into, storing (from, to, shadow) in RefreshSpans with lazy building: <= 4 elsewhere() queries scan linearly with zero sort cost, and >= 5 queries trigger one in-place sort_unstable + dedup + max_end prefix maxes for O(log R) queries.
    • Fused blocked_by + copied_reads into one pass/lock in precheck_runs, and switched FillTo lookup to direct indexing (fill_to_run).
  3. Zero-churn scratch reuse in write-watch asking (crates/victory-gpu/src/watch.rs)

    • Replaced per-call heap allocations in kernel_written, ask_ahead, ask_rest, ask_run, and writes with thread-local AskScratch (ASK_SCRATCH, capacity capped at 8192), merged_into, and kernel_written_into.

How it was tested

  • Equivalence unit tests added:
    • host::card_steps::tests::refresh_spans_matches_linear_elsewhere
    • host::card_steps::tests::active_only_plan_matches_full_does_with_refreshes
    • host::batch::deferred_title_written_range_keeps_disjoint_entries
    • host::batch::batch_range_writes_preserve_disjoint_ahead_and_flush_overlapping_work
  • Release #[ignore = "benchmark"] microbenchmarks added and measured (cargo test --release --locked -j 4 -p victory-gpu --lib <name> -- --ignored --nocapture --test-threads=1):
    • planning_20k_refreshes_before_vs_after: 100 iters x 20000 refreshes + 300 active: 8.79ms before -> 5.22ms after (1.7x)
    • batch_range_writes_before_vs_after: 300 submits, 1500 ahead spans, 150 adds/sub: 123.16ms (495,000 re-queued) before -> 56.75ms (0 re-queued, 2.2x)
  • Checks on final commit:
    • cargo test --locked -j 4 -p victory-gpu --lib -- --test-threads=1: 919 passed, 0 failed, 59 ignored (yes)
    • cargo check --lib -p victory-gpu --locked & cargo clippy -p victory-gpu --lib --tests --locked: passed with 0 warnings in touched code
    • cargo xtask policy --staged: asset policy: 3 files ok

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Verified no overlap with #2587 (card_before/card_record/host/send.rs), #2512 (VICTORY_JOIN_COPIES), #2530 (parts_written(&[])/shadow.rs), or #2529 (descriptor/host.rs/draw.rs).
**@⁠piyonchu** on GitHub · 2026-11-29 15:32 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2647) `piyonchu:perf/submission-pipeline-batch-card-steps` → `main` · +1756 −641 · 3 files · 1 commits · open ## What it changes Addresses four CPU bottlenecks on the submission path (`#2588`-style preparation and `after the sending` tail) without overlapping existing open PRs: 1. **Range-scoped invalidation & hot-path reductions in `Batch` and `Deferred` (`crates/victory-gpu/src/host.rs`)** - Added `Batch::title_written_range(dst, len)` and `Deferred::title_written_range(dst, len)` for `Step::Copy` and `Step::Placed` instead of calling whole-state `title_written()`: - Only pending `fills`, `due` textures (`staging_due` + `texture_ranges`), and `refreshes` overlapping `[dst, dst + len)` are flushed/removed (`refreshes` updated in-place via `swap_remove` + `index` fixup), while `title_writes` tracks sorted non-overlapping written ranges (`join_ranges`) so disjoint `ahead` entries remain valid across the frame. - Added consecutive-shadow cache (`last_add`) in `Batch::add`, `forward_cursor` monotonic lookup in `Batch::find_forward_fill`, and deduplicated `Batch::copy_spans` when `asked_first` already populated `batch.spans` (`copy_spans_extend` when `own` prepends). - Added `HELPER_ALIVE` + `helper_land()` (`VICTORY_HELPER_LAND=0` opt-out) so `send_late` can offload non-blocking landing work (`land()`) to `late_helper` under a `<= 32` queued-list cap. 2. **`card_steps` planning & `RefreshSpans` indexing (`crates/victory-gpu/src/host/card_steps.rs`)** - Added `CardStepsScratch` (`CARD_STEPS_SCRATCH`, capacity capped at `8192`) and `PlanScratch` (`plan_with_scratch`) reusing per-thread allocations across submissions and replacing boxed iterator trait objects and full-slice rescans with `candidates` pre-filtering and `has_placed && has_slot_fill` gating for `served_fills_into` / `behind` checks. - Excluded ~20k `Step::Refresh` steps from `does` via `collect_active_into`, storing `(from, to, shadow)` in `RefreshSpans` with lazy building: `<= 4` `elsewhere()` queries scan linearly with zero sort cost, and `>= 5` queries trigger one in-place `sort_unstable` + `dedup` + `max_end` prefix maxes for `O(log R)` queries. - Fused `blocked_by` + `copied_reads` into one pass/lock in `precheck_runs`, and switched `FillTo` lookup to direct indexing (`fill_to_run`). 3. **Zero-churn scratch reuse in write-watch asking (`crates/victory-gpu/src/watch.rs`)** - Replaced per-call heap allocations in `kernel_written`, `ask_ahead`, `ask_rest`, `ask_run`, and `writes` with thread-local `AskScratch` (`ASK_SCRATCH`, capacity capped at `8192`), `merged_into`, and `kernel_written_into`. ## How it was tested - Equivalence unit tests added: - `host::card_steps::tests::refresh_spans_matches_linear_elsewhere` - `host::card_steps::tests::active_only_plan_matches_full_does_with_refreshes` - `host::batch::deferred_title_written_range_keeps_disjoint_entries` - `host::batch::batch_range_writes_preserve_disjoint_ahead_and_flush_overlapping_work` - Release `#[ignore = "benchmark"]` microbenchmarks added and measured (`cargo test --release --locked -j 4 -p victory-gpu --lib <name> -- --ignored --nocapture --test-threads=1`): - `planning_20k_refreshes_before_vs_after`: `100 iters x 20000 refreshes + 300 active`: **8.79ms before -> 5.22ms after (1.7x)** - `batch_range_writes_before_vs_after`: `300 submits, 1500 ahead spans, 150 adds/sub`: **123.16ms (495,000 re-queued) before -> 56.75ms (0 re-queued, 2.2x)** - Checks on final commit: - `cargo test --locked -j 4 -p victory-gpu --lib -- --test-threads=1`: **919 passed, 0 failed, 59 ignored** (`yes`) - `cargo check --lib -p victory-gpu --locked` & `cargo clippy -p victory-gpu --lib --tests --locked`: passed with 0 warnings in touched code - `cargo xtask policy --staged`: `asset policy: 3 files ok` ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Verified no overlap with `#2587` (`card_before`/`card_record`/`host/send.rs`), `#2512` (`VICTORY_JOIN_COPIES`), `#2530` (`parts_written(&[])`/`shadow.rs`), or `#2529` (`descriptor/host.rs`/`draw.rs`).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 15:35:52 +00:00
Author
Owner

@⁠BitWuehler on GitHub · 2026-11-29 16:41 UTC · original

Tested on Linux (CachyOS) / GE-Proton 11-14 (vkd3d-proton master) / Ryzen 7 9800X3D / RTX 5080 16 GB (driver 620.73.04, ReBAR active) on top of 829188e9 (Series X profile, 1440p, DLSS Quality, VICTORY_WAVE_FOLDED=0, VICTORY_CODE_TABLE_AFTER=1, VICTORY_SAMPLED_MARKS=0):

  • Applied cleanly with zero conflicts and zero visual regressions.
  • after_sending dropped from 2.93 ms avg (34.4 ms max) to 0.40 ms avg (~7–9x reduction).
  • In-world median FPS improved from ~18.5–22.4 fps to 26.5 fps (max 43.6 fps).

(Test summary compiled with AI assistance.)

**@⁠BitWuehler** on GitHub · 2026-11-29 16:41 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2647#issuecomment-7259099702) Tested on **Linux (CachyOS) / GE-Proton 11-14 (`vkd3d-proton master`) / Ryzen 7 9800X3D / RTX 5080 16 GB (driver 620.73.04, ReBAR active)** on top of `829188e9` (Series X profile, 1440p, DLSS Quality, `VICTORY_WAVE_FOLDED=0`, `VICTORY_CODE_TABLE_AFTER=1`, `VICTORY_SAMPLED_MARKS=0`): - Applied cleanly with zero conflicts and zero visual regressions. - `after_sending` dropped from **2.93 ms avg (34.4 ms max)** to **0.40 ms avg** (~7–9x reduction). - In-world median FPS improved from ~18.5–22.4 fps to **26.5 fps** (max **43.6 fps**). *(Test summary compiled with AI assistance.)*
Author
Owner

@⁠icdmkg2 on GitHub · 2026-11-29 18:20 UTC · original

An in-game data point from an 8 GB laptop. It covers this PR together with four others, so it can't attribute the gain to this one alone.

Setup: RTX 5060 Laptop GPU (8 GB), Ryzen 7 H 260 (8 cores), 32 GB, Windows 11, driver 621.24. main at 55d06914, release build, Series S, DLSS performance, VICTORY_LEVELS_ON_DEMAND=0 and VICTORY_COMMIT_FLOOR_MB=1024 in both builds (see #1411 for why). Same save (the prologue's cell), driven by a script: 60 s measured after a 30 s settle, warm shader cache, two alternating pairs.

Combo: main + #2549 + #2783 + #2647 + #2665 + #2795. These merge cleanly together. #2796, #2656, #2604 and #2587 conflict with that set, so they weren't tested.

median frame time frames >50 ms per 5 s submitting thread, ms per frame
main 60.7 / 56.7 ms 15.2 / 15.4 52 / 60
combo 49.3 / 48.6 ms 7.6 / 5.8 47 / 44

That's about 15–18 % shorter frames and half the slow frames, with no crash and no device removal. A frame capture of the combo (diagnostics build, VICTORY_CAPTURE_WORLD) matched main's brightness (mean luma 66.4 against 66.2), with no black holes.

One thing for the diagnostics build: with these merged together, --features diagnostics no longer compiles. A local timing in submit shadows host::timing() at three call sites, and copystat::log_heap_elsewhere uses an mb helper it doesn't define. Both are one-line fixes; mentioning it in case whichever lands second hits it.

**@⁠icdmkg2** on GitHub · 2026-11-29 18:20 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2647#issuecomment-7260398593) An in-game data point from an 8 GB laptop. It covers this PR **together with four others**, so it can't attribute the gain to this one alone. **Setup:** RTX 5060 Laptop GPU (8 GB), Ryzen 7 H 260 (8 cores), 32 GB, Windows 11, driver 621.24. `main` at `55d06914`, release build, Series S, DLSS performance, `VICTORY_LEVELS_ON_DEMAND=0` and `VICTORY_COMMIT_FLOOR_MB=1024` in both builds (see #1411 for why). Same save (the prologue's cell), driven by a script: 60 s measured after a 30 s settle, warm shader cache, two alternating pairs. **Combo:** `main` + #2549 + #2783 + #2647 + #2665 + #2795. These merge cleanly together. #2796, #2656, #2604 and #2587 conflict with that set, so they weren't tested. | | median frame time | frames >50 ms per 5 s | submitting thread, ms per frame | |---|---|---|---| | `main` | 60.7 / 56.7 ms | 15.2 / 15.4 | 52 / 60 | | **combo** | **49.3 / 48.6 ms** | **7.6 / 5.8** | **47 / 44** | That's about 15–18 % shorter frames and half the slow frames, with no crash and no device removal. A frame capture of the combo (diagnostics build, `VICTORY_CAPTURE_WORLD`) matched `main`'s brightness (mean luma 66.4 against 66.2), with no black holes. One thing for the diagnostics build: with these merged together, `--features diagnostics` no longer compiles. A local `timing` in `submit` shadows `host::timing()` at three call sites, and `copystat::log_heap_elsewhere` uses an `mb` helper it doesn't define. Both are one-line fixes; mentioning it in case whichever lands second hits it.
Author
Owner

@⁠POMXARK on GitHub · 2026-11-30 10:39 UTC · original

Hi @⁠piyonchu — sharing two orthogonal git am-ready patches rebased onto v2026.11.29.05 (41adb55) in #3556 (https://github.com/trustno1-coder/VIctory-NVIDIA/discussions/3556#discussioncomment-20023964) that complement #2647's submission write-watch work:

  1. xmem.rs (VICTORY_LOW_PRIVATE_WATCH): backs the 185 MiB 32-bit graphics reservation with MEM_PRIVATE | MEM_WRITE_WATCH (-86.6% VirtualProtect, -71.3% VEH, 4 KiB hardware GetWriteWatch granularity).
  2. watch.rs (VICTORY_WIDE_WATCH): parallelizes ask_ahead / ask_once across disjoint reservations via wide_each_scoped.

Not opening separate PRs — feel free to fold or test if helpful.

**@⁠POMXARK** on GitHub · 2026-11-30 10:39 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2647#issuecomment-7275910191) Hi @⁠piyonchu — sharing two orthogonal `git am`-ready patches rebased onto `v2026.11.29.05` (`41adb55`) in #3556 (https://github.com/trustno1-coder/VIctory-NVIDIA/discussions/3556#discussioncomment-20023964) that complement #2647's submission write-watch work: 1. **`xmem.rs` (`VICTORY_LOW_PRIVATE_WATCH`):** backs the `185 MiB` 32-bit graphics reservation with `MEM_PRIVATE | MEM_WRITE_WATCH` (`-86.6%` `VirtualProtect`, `-71.3%` VEH, 4 KiB hardware `GetWriteWatch` granularity). 2. **`watch.rs` (`VICTORY_WIDE_WATCH`):** parallelizes `ask_ahead` / `ask_once` across disjoint reservations via `wide_each_scoped`. Not opening separate PRs — feel free to fold or test if helpful.
github-bot force-pushed github-bot/gh-2647 from 3f71782436 to 9599936aa4 2026-11-30 19:22:53 +00:00 Compare
Author
Owner

@⁠piyonchu on GitHub · 2026-11-30 19:22 UTC · original

Rebased #2647 onto latest main (e1251c31, head 9599936a), integrating cleanly with upstream submission/watch changes (ask_once, not_write_watched/refusals, join_copies, Batch::front_dirty, constant_slots_batch, and later_uav):

  • Adapted Batch::join_copy in crates/victory-gpu/src/host.rs to invalidate title_written_range(next.0, next.2) per joined contiguous copy and kept nvidia/main's .get(at..at + len) guard for find_forward_fill.
  • Extended AskScratch + merged_into + kernel_written_into reuse in crates/victory-gpu/src/watch.rs to ask_once and ask_run_all while preserving tell_watch, not_write_watched, refusals, and covered_to.
  • Preserved later_uav multi-level barrier batching, constant_slots_batch, and late::forget() in crates/victory-gpu/src/host/card_steps.rs.

Thanks @BitWuehler, @icdmkg2, and @POMXARK for testing and feedback:

  • --features diagnostics: verified cargo check --lib -p victory-gpu --features diagnostics --locked compiles cleanly on 9599936a.
  • @POMXARK: kept #2647 scoped cleanly to victory-gpu submission-path scratch/planning/range-invalidation/helper_land (separately from victory-hle/xmem.rs and VICTORY_WIDE_WATCH) so each change can be reviewed and validated independently.

Rebased checks (9599936a)

  • cargo check --lib -p victory-gpu --locked & cargo check --lib -p victory-gpu --features diagnostics --locked: passed (0 warnings in touched files)
  • cargo clippy -p victory-gpu --lib --tests --locked: passed (0 warnings in touched files)
  • cargo xtask policy --staged: asset policy: 3 files ok
  • cargo test --locked -j 4 -p victory-gpu --lib -- --test-threads=1: 1135 passed, 68 ignored, all watch::*, host::*, host::card_steps::*, and host::batch::* tests passed (only the 2 pre-existing e1251c31 failures in list::thin::tests::bindings_record_no_work and shader_cache::tests::every_switch_of_the_translator_is_in_the_key)
  • Release benchmarks (cargo test --release --locked -j 4 -p victory-gpu --lib <name> -- --ignored --nocapture --test-threads=1):
    • planning_20k_refreshes_before_vs_after: 6.9819ms -> 4.1214ms (1.7x)
    • batch_range_writes_before_vs_after: 73.0686ms (495000 re-queued) -> 43.6873ms (0 re-queued, 1.7x)
**@⁠piyonchu** on GitHub · 2026-11-30 19:22 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2647#issuecomment-7289287255) Rebased `#2647` onto latest `main` (`e1251c31`, head `9599936a`), integrating cleanly with upstream submission/watch changes (`ask_once`, `not_write_watched`/`refusals`, `join_copies`, `Batch::front_dirty`, `constant_slots_batch`, and `later_uav`): - Adapted `Batch::join_copy` in `crates/victory-gpu/src/host.rs` to invalidate `title_written_range(next.0, next.2)` per joined contiguous copy and kept `nvidia/main`'s `.get(at..at + len)` guard for `find_forward_fill`. - Extended `AskScratch` + `merged_into` + `kernel_written_into` reuse in `crates/victory-gpu/src/watch.rs` to `ask_once` and `ask_run_all` while preserving `tell_watch`, `not_write_watched`, `refusals`, and `covered_to`. - Preserved `later_uav` multi-level barrier batching, `constant_slots_batch`, and `late::forget()` in `crates/victory-gpu/src/host/card_steps.rs`. Thanks `@BitWuehler`, `@icdmkg2`, and `@POMXARK` for testing and feedback: - `--features diagnostics`: verified `cargo check --lib -p victory-gpu --features diagnostics --locked` compiles cleanly on `9599936a`. - `@POMXARK`: kept `#2647` scoped cleanly to `victory-gpu` submission-path scratch/planning/range-invalidation/`helper_land` (separately from `victory-hle`/`xmem.rs` and `VICTORY_WIDE_WATCH`) so each change can be reviewed and validated independently. ### Rebased checks (`9599936a`) - `cargo check --lib -p victory-gpu --locked` & `cargo check --lib -p victory-gpu --features diagnostics --locked`: passed (0 warnings in touched files) - `cargo clippy -p victory-gpu --lib --tests --locked`: passed (0 warnings in touched files) - `cargo xtask policy --staged`: `asset policy: 3 files ok` - `cargo test --locked -j 4 -p victory-gpu --lib -- --test-threads=1`: **1135 passed, 68 ignored**, all `watch::*`, `host::*`, `host::card_steps::*`, and `host::batch::*` tests passed (only the 2 pre-existing `e1251c31` failures in `list::thin::tests::bindings_record_no_work` and `shader_cache::tests::every_switch_of_the_translator_is_in_the_key`) - Release benchmarks (`cargo test --release --locked -j 4 -p victory-gpu --lib <name> -- --ignored --nocapture --test-threads=1`): - `planning_20k_refreshes_before_vs_after`: **6.9819ms -> 4.1214ms (1.7x)** - `batch_range_writes_before_vs_after`: **73.0686ms (495000 re-queued) -> 43.6873ms (0 re-queued, 1.7x)**
Author
Owner

@⁠paales on GitHub · 2026-11-30 21:45 UTC · original

Written by 🤖:

In-game numbers for the write-watch part of this PR. PC: RTX 5070 Ti 16 GB, Ryzen 9 5900X, 32 GB, Windows 11. Series X, 1440p, DLSS Performance, frame generation off, 30 fps cap. Each run: a new game (settings save, no story save), one A press, the first cutscene for 60 s.

The whole PR conflicts with #4207 (its range-scoped invalidation), which my build has. So I applied only the crates/victory-gpu/src/watch.rs part of 9599936a, onto main 84bd61e2 with #3918, #1727, #3553, #3043, #4207, #4138 and #720 (branch next on paales/VIctory-NVIDIA).

without with the watch.rs part
asking the write watch, the submitting thread, per frame 3.3 to 3.4 ms (3 runs) 3.4 to 3.6 ms (5 runs)

The time to ask the write watch did not change measurably in this scene. Other changes between the runs were in other parts of the frame, and the write-watch figure is from the layer's own line ("preparing per frame, the submitting thread: … asking the write watch"). I did not measure the other three parts of this PR.

**@⁠paales** on GitHub · 2026-11-30 21:45 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2647#issuecomment-7292844955) _Written by 🤖:_ In-game numbers for the write-watch part of this PR. PC: RTX 5070 Ti 16 GB, Ryzen 9 5900X, 32 GB, Windows 11. Series X, 1440p, DLSS Performance, frame generation off, 30 fps cap. Each run: a new game (settings save, no story save), one A press, the first cutscene for 60 s. The whole PR conflicts with #4207 (its range-scoped invalidation), which my build has. So I applied only the `crates/victory-gpu/src/watch.rs` part of 9599936a, onto `main` 84bd61e2 with #3918, #1727, #3553, #3043, #4207, #4138 and #720 (branch `next` on paales/VIctory-NVIDIA). | | without | with the `watch.rs` part | | --- | --- | --- | | asking the write watch, the submitting thread, per frame | 3.3 to 3.4 ms (3 runs) | 3.4 to 3.6 ms (5 runs) | The time to ask the write watch did not change measurably in this scene. Other changes between the runs were in other parts of the frame, and the write-watch figure is from the layer's own line ("preparing per frame, the submitting thread: … asking the write watch"). I did not measure the other three parts of this PR.
Author
Owner

@⁠BitWuehler on GitHub · 2026-12-01 00:41 UTC · original

Re-tested the rebased PR (9599936a) on Linux (CachyOS) / GE-Proton 11-14 (vkd3d-proton master) / Ryzen 7 9800X3D / RTX 5080 16 GB (driver 620.73.04) on top of 7d93ee07 (Series X profile, 1440p, DLSS Balanced + DLSS Frame Generation 2x):

  • Clean cherry-pick onto main, 0 crashes and 0 host pipeline failures over a 22-minute session (188 in-world intervals, avg 5,191 draws/frame).
  • Worst-case frame times stayed remarkably tight: frame_ms 43.4 ms avg / 39.9 ms med / 156.1 ms max, prep_ms 28.4 ms avg / 60.6 ms max, gpu_ms 0.64 ms avg.
  • DLSS Frame Generation 2x ran at an exact 2.00x across 1,018 active seconds (51.6 avg / 52.0 med / 82 max shown fps).

(Test summary compiled with AI assistance.)

**@⁠BitWuehler** on GitHub · 2026-12-01 00:41 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2647#issuecomment-7296631841) Re-tested the rebased PR (`9599936a`) on **Linux (CachyOS) / GE-Proton 11-14 (`vkd3d-proton master`) / Ryzen 7 9800X3D / RTX 5080 16 GB (driver 620.73.04)** on top of `7d93ee07` (Series X profile, 1440p, DLSS Balanced + DLSS Frame Generation 2x): - Clean cherry-pick onto `main`, **0 crashes** and **0 host pipeline failures** over a 22-minute session (188 in-world intervals, avg 5,191 draws/frame). - Worst-case frame times stayed remarkably tight: `frame_ms` **43.4 ms avg / 39.9 ms med / 156.1 ms max**, `prep_ms` **28.4 ms avg / 60.6 ms max**, `gpu_ms` **0.64 ms avg**. - DLSS Frame Generation 2x ran at an exact **2.00x** across 1,018 active seconds (**51.6 avg / 52.0 med / 82 max shown fps**). *(Test summary compiled with AI assistance.)*
github-bot force-pushed github-bot/gh-2647 from 9599936aa4 to 5a028f2e59 2026-12-01 02:14:28 +00:00 Compare
Author
Owner

@⁠piyonchu on GitHub · 2026-12-01 02:09 UTC · original

Rebased #2647 cleanly onto latest main (f5c3d243, head 5a028f2e) and added multi-view physical-alias invalidation:

  • Alias-safe range invalidation (watch::elsewhere_blocks, with_write_ranges, title_written_ranges): Batch::title_written_range and Deferred::title_written_range now also invalidate any 64 KiB view alias blocks mapping the same physical pages (crate::watch::elsewhere_blocks) via stack fast-path &[(dst, end)] when unaliased (zero extra allocation when !view_guard() or no aliases exist). Added unit test host::batch::title_written_ranges_invalidates_multiple_alias_spans.
  • Re @paales: Thanks for isolating and measuring the watch.rs subset — on current main, single-pass ask_once already runs once per submission (kernel wait dominates that metric at ~3.3–3.6 ms), so watch.rs's AskScratch change mainly removes per-submission Vec churn rather than kernel time, whereas the measurable latency reductions come from card_steps planning/RefreshSpans, range-scoped Batch invalidation, and helper_land. Note also #4206 was opened after #2647 and touches 30+ files; #2647 keeps its range invalidation alias-safe (elsewhere_blocks) while staying strictly within watch.rs, host/card_steps.rs, and host.rs.
  • Re @BitWuehler: Thank you for the 22-minute Series X + DLSS FG 2x verification on 9599936a.

Verification on 5a028f2e

  • cargo xtask policy --staged: asset policy: 2 files ok
  • cargo check --lib -p victory-gpu --locked & cargo check --lib -p victory-gpu --features diagnostics --locked: passed (0 warnings in touched files)
  • cargo clippy -p victory-gpu --lib --tests --locked: passed (0 warnings in touched files)
  • cargo test --locked -j 4 -p victory-gpu --lib -- --test-threads=1: 1100 passed, 0 failed, 68 ignored
  • Release benchmarks (cargo test --release --locked -j 4 -p victory-gpu --lib <name> -- --ignored --nocapture --test-threads=1):
    • planning_20k_refreshes_before_vs_after: 7.9913ms -> 5.1906ms (1.5x)
    • batch_range_writes_before_vs_after: 99.8658ms (495,000 re-queued) -> 51.9939ms (0 re-queued, 1.9x)
**@⁠piyonchu** on GitHub · 2026-12-01 02:09 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2647#issuecomment-7298309796) Rebased `#2647` cleanly onto latest `main` (`f5c3d243`, head `5a028f2e`) and added multi-view physical-alias invalidation: - **Alias-safe range invalidation (`watch::elsewhere_blocks`, `with_write_ranges`, `title_written_ranges`)**: `Batch::title_written_range` and `Deferred::title_written_range` now also invalidate any 64 KiB view alias blocks mapping the same physical pages (`crate::watch::elsewhere_blocks`) via stack fast-path `&[(dst, end)]` when unaliased (zero extra allocation when `!view_guard()` or no aliases exist). Added unit test `host::batch::title_written_ranges_invalidates_multiple_alias_spans`. - Re `@paales`: Thanks for isolating and measuring the `watch.rs` subset — on current `main`, single-pass `ask_once` already runs once per submission (kernel wait dominates that metric at ~3.3–3.6 ms), so `watch.rs`'s `AskScratch` change mainly removes per-submission `Vec` churn rather than kernel time, whereas the measurable latency reductions come from `card_steps` planning/`RefreshSpans`, range-scoped `Batch` invalidation, and `helper_land`. Note also `#4206` was opened after `#2647` and touches 30+ files; `#2647` keeps its range invalidation alias-safe (`elsewhere_blocks`) while staying strictly within `watch.rs`, `host/card_steps.rs`, and `host.rs`. - Re `@BitWuehler`: Thank you for the 22-minute Series X + DLSS FG 2x verification on `9599936a`. ### Verification on `5a028f2e` - `cargo xtask policy --staged`: `asset policy: 2 files ok` - `cargo check --lib -p victory-gpu --locked` & `cargo check --lib -p victory-gpu --features diagnostics --locked`: passed (0 warnings in touched files) - `cargo clippy -p victory-gpu --lib --tests --locked`: passed (0 warnings in touched files) - `cargo test --locked -j 4 -p victory-gpu --lib -- --test-threads=1`: **1100 passed, 0 failed, 68 ignored** - Release benchmarks (`cargo test --release --locked -j 4 -p victory-gpu --lib <name> -- --ignored --nocapture --test-threads=1`): - `planning_20k_refreshes_before_vs_after`: **7.9913ms -> 5.1906ms (1.5x)** - `batch_range_writes_before_vs_after`: **99.8658ms (495,000 re-queued) -> 51.9939ms (0 re-queued, 1.9x)**
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host.rs
  • crates/victory-gpu/src/host/card_steps.rs
  • crates/victory-gpu/src/watch.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/2647/head:github-bot/gh-2647'
git switch 'github-bot/gh-2647'

Merge

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