perf(watch): single-pass ask_once with hoisted OWNED/tell_watch and KEPT fast-path skips #2604

Manually merged
github merged 1 commit from github-bot/gh-2604 into gh-pr/2604/base 2026-11-29 22:59:13 +00:00 AGit
Owner

@⁠qlfu on GitHub · 2026-11-29 14:53 UTC · original
qlfu:pr/perf-single-pass-ask-once → main · +148 −10 · 1 files · 1 commits · merged 2026-11-29 22:54 UTC

Summary

Replaces the two-pass watch::ask_once (ask_ahead + ask_rest) with a single-pass ask_once + ask_run_all, hoisting invariant lookups and fast-pathing idle journal operations:

  • Hoists tell_watch() and owned_snapshot() once per ask_once call instead of re-acquiring OWNED.read() and checking tell_watch() per range (~14,400×/frame).
  • Merges ask_ahead + ask_rest into a single pass so Askings and journal_mut() are acquired once per submission instead of twice.
  • Uses an atomic KEPT flag to fast-path ask_once_end(), ask_ahead_done(), ask_ahead(), and wrote() without locking JOURNAL when no asking is held.
  • Uses binary search (ahead_contains) in would_wait.

Verification

  • Unit tests: cargo test -p victory-gpu --lib --locked watch:: -- --test-threads=1 (all watch:: tests pass, including new single_pass_ask_once_caches_mixed_clustered_lone_and_unwatched_ranges).
  • Full crate tests: cargo test -p victory-gpu --lib --locked -- --test-threads=1 --quiet (926 passed; 0 failed; 57 ignored).
  • cargo clippy -p victory-gpu --lib --tests --locked: 0 new warnings.
  • 90s live release run (1440p DLSS Balanced, RTX 4070 Ti + Ryzen 7 5700X): 0 WARNs, 0 ERRORs, watch p95 7.20 -> 6.50 ms.
**@⁠qlfu** on GitHub · 2026-11-29 14:53 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2604) `qlfu:pr/perf-single-pass-ask-once` → `main` · +148 −10 · 1 files · 1 commits · merged 2026-11-29 22:54 UTC ## Summary Replaces the two-pass `watch::ask_once` (`ask_ahead` + `ask_rest`) with a single-pass `ask_once` + `ask_run_all`, hoisting invariant lookups and fast-pathing idle journal operations: - Hoists `tell_watch()` and `owned_snapshot()` once per `ask_once` call instead of re-acquiring `OWNED.read()` and checking `tell_watch()` per range (~14,400×/frame). - Merges `ask_ahead` + `ask_rest` into a single pass so `Askings` and `journal_mut()` are acquired once per submission instead of twice. - Uses an atomic `KEPT` flag to fast-path `ask_once_end()`, `ask_ahead_done()`, `ask_ahead()`, and `wrote()` without locking `JOURNAL` when no asking is held. - Uses binary search (`ahead_contains`) in `would_wait`. ## Verification - Unit tests: `cargo test -p victory-gpu --lib --locked watch:: -- --test-threads=1` (all `watch::` tests pass, including new `single_pass_ask_once_caches_mixed_clustered_lone_and_unwatched_ranges`). - Full crate tests: `cargo test -p victory-gpu --lib --locked -- --test-threads=1 --quiet` (`926 passed; 0 failed; 57 ignored`). - `cargo clippy -p victory-gpu --lib --tests --locked`: `0` new warnings. - 90s live release run (`1440p DLSS Balanced`, RTX 4070 Ti + Ryzen 7 5700X): `0 WARNs`, `0 ERRORs`, `watch` p95 `7.20 -> 6.50 ms`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 14:56:17 +00:00
github-bot changed target branch from main to gh-pr/2604/base 2026-11-29 22:58:35 +00:00
github manually merged commit 5c604fec1e into gh-pr/2604/base 2026-11-29 22:58:38 +00:00
Author
Owner

@⁠fvrvxvlyy on GitHub · 2026-11-29 23:20 UTC · original

does any one see any character in the game just glitches and goes back normal for 1 sec that makes the fps drop hard

**@⁠fvrvxvlyy** on GitHub · 2026-11-29 23:20 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2604#issuecomment-7264389771) does any one see any character in the game just glitches and goes back normal for 1 sec that makes the fps drop hard
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!2604
No description provided.