Card awake: only through frames of many submissions, not in menus (fixes #771) #825

Manually merged
github merged 1 commit from github-bot/gh-825 into main 2026-11-29 08:21:26 +00:00 AGit
Owner

@⁠kibagami-nc on GitHub · 2026-11-28 07:16 UTC · original
kibagami-nc:fix/card-awake-only-in-busy-frames → main · +95 −6 · 2 files · 1 commits · merged 2026-11-29 08:16 UTC

Fixes #771.

What happens

VICTORY_CARD_AWAKE=1 is set by the launcher. It keeps one group of 64 threads counting on a compute queue while the title submits. It exists for the gaps between some thirty submissions a frame: a captured frame went from 37.8 ms to 28.6 ms with it (86694b5). In a menu, it ran just the same.

On 1bit0's RTX 3060, the title's menu runs at three submissions a frame:

Run (#771) Menu, focused Menu, unfocused
default (card kept awake) 15-45 fps 600-650 fps
frame generation off 15-45 fps 600-650 fps
fullscreen about the same -
VICTORY_CARD_AWAKE=0 600+ fps 600+ fps

Focused, the card counted as 100% busy, and the frames waited about 68 ms each for it. Vertical sync was off in the NVIDIA Control Panel. A 5070 Ti laptop did not show it (ChenmouXu), so it depends on the card or setup. But a frame of three submissions has no gaps for the awake work to fill anyway.

The change

  • crate::host::awake counts the title's submissions frame by frame. The frame count is crate::queue::presented, now readable in every build.
  • The card is kept awake only after a frame of at least MANY (8) submissions. Gameplay, at some thirty a frame, keeps it; a menu does not.
  • The decision is a pure function, wanted_at, so the rule is tested.
  • With VICTORY_CARD_AWAKE unset nothing runs, as before.

Tests

  • New host::awake::tests::submissions_are_counted_frame_by_frame: three submissions in a frame count as three, thirty as thirty, and a frame without submissions is skipped.

  • New host::awake::tests::the_card_is_kept_awake_only_through_busy_frames:

    • kept awake at thirty submissions a frame and at MANY;
    • not at three, nor at MANY - 1;
    • not once the title is quiet, nor before its first submission;
    • in turns mode, only on its turns.

    With the MANY rule taken out, it fails on "a menu's frame".

  • cargo test -p victory-gpu --lib --locked: 455 passed.

  • With --features diagnostics: 508 passed. One run had watch::tests::what_the_kernel_writes_through_is_not_guarded_for_another_view fail. That is the known flake of the watch view tests, which #724 fixes, and it passed on two reruns.

  • Clippy (default and --all-features): nothing in the changed files. Main's own lints are fixed in #665.

Not run in the game here. Gameplay on the RTX 3060 with the card kept awake is not measured yet; I asked for that on #771.

Checked by others

Yoshi-233 (RTX 4070 Ti SUPER, driver 617.42) measured the gameplay side with the existing VICTORY_CARD_AWAKE=turns, frame generation on. A boat was held still facing a bridge, with five off/on pairs of 20 s phases in one process:

  • Frame rate: 19.0 frames a second with the helper off, 17.4 with it on. Every off phase was faster than the on phases next to it.
  • Card: the clock was 2,775 MHz either way, and the card's work inside the submissions took 37.8 ms off, 42.1 ms on.
  • Submissions: 17 a frame. That is above this change's threshold of 8, so with this change the helper stays on in that scene and costs the same.

nick0451 (RTX 3090 24 GB, Series S, DLSS Performance) ran it in the world against main, three runs each with a frozen save, about 6,000 draws a frame: a median of 24.4 frames a second with this change, 24.6 without, within the setup's own 2-3% noise. With many submissions a frame the card is kept awake as before, as it should be. No crash and no ERROR line. The menu case of #771 could not be run there (scripted keys, the window not focused).

This change still keeps the helper out of menus (#771). #927 goes further and turns it off by default in the launchers.

No game files, dumps or extracted data are included.

**@⁠kibagami-nc** on GitHub · 2026-11-28 07:16 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/825) `kibagami-nc:fix/card-awake-only-in-busy-frames` → `main` · +95 −6 · 2 files · 1 commits · merged 2026-11-29 08:16 UTC Fixes #771. ## What happens `VICTORY_CARD_AWAKE=1` is set by the launcher. It keeps one group of 64 threads counting on a compute queue while the title submits. It exists for the gaps between some thirty submissions a frame: a captured frame went from 37.8 ms to 28.6 ms with it (86694b5). In a menu, it ran just the same. On 1bit0's RTX 3060, the title's menu runs at three submissions a frame: | Run (#771) | Menu, focused | Menu, unfocused | |---|---|---| | default (card kept awake) | 15-45 fps | 600-650 fps | | frame generation off | 15-45 fps | 600-650 fps | | fullscreen | about the same | - | | `VICTORY_CARD_AWAKE=0` | 600+ fps | 600+ fps | Focused, the card counted as 100% busy, and the frames waited about 68 ms each for it. Vertical sync was off in the NVIDIA Control Panel. A 5070 Ti laptop did not show it (ChenmouXu), so it depends on the card or setup. But a frame of three submissions has no gaps for the awake work to fill anyway. ## The change - `crate::host::awake` counts the title's submissions frame by frame. The frame count is `crate::queue::presented`, now readable in every build. - The card is kept awake only after a frame of at least `MANY` (8) submissions. Gameplay, at some thirty a frame, keeps it; a menu does not. - The decision is a pure function, `wanted_at`, so the rule is tested. - With `VICTORY_CARD_AWAKE` unset nothing runs, as before. ## Tests - **New** `host::awake::tests::submissions_are_counted_frame_by_frame`: three submissions in a frame count as three, thirty as thirty, and a frame without submissions is skipped. - **New** `host::awake::tests::the_card_is_kept_awake_only_through_busy_frames`: - kept awake at thirty submissions a frame and at `MANY`; - not at three, nor at `MANY - 1`; - not once the title is quiet, nor before its first submission; - in `turns` mode, only on its turns. With the `MANY` rule taken out, it fails on "a menu's frame". - **`cargo test -p victory-gpu --lib --locked`:** 455 passed. - **With `--features diagnostics`:** 508 passed. One run had `watch::tests::what_the_kernel_writes_through_is_not_guarded_for_another_view` fail. That is the known flake of the watch view tests, which #724 fixes, and it passed on two reruns. - **Clippy** (default and `--all-features`): nothing in the changed files. Main's own lints are fixed in #665. Not run in the game here. Gameplay on the RTX 3060 with the card kept awake is not measured yet; I asked for that on #771. ## Checked by others **Yoshi-233** (RTX 4070 Ti SUPER, driver 617.42) measured the gameplay side with the existing `VICTORY_CARD_AWAKE=turns`, frame generation on. A boat was held still facing a bridge, with five off/on pairs of 20 s phases in one process: - **Frame rate:** 19.0 frames a second with the helper off, 17.4 with it on. Every off phase was faster than the on phases next to it. - **Card:** the clock was 2,775 MHz either way, and the card's work inside the submissions took 37.8 ms off, 42.1 ms on. - **Submissions:** 17 a frame. That is above this change's threshold of 8, so with this change the helper stays on in that scene and costs the same. **nick0451** (RTX 3090 24 GB, Series S, DLSS Performance) ran it in the world against `main`, three runs each with a frozen save, about 6,000 draws a frame: a median of 24.4 frames a second with this change, 24.6 without, within the setup's own 2-3% noise. With many submissions a frame the card is kept awake as before, as it should be. No crash and no `ERROR` line. The menu case of #771 could not be run there (scripted keys, the window not focused). This change still keeps the helper out of menus (#771). #927 goes further and turns it off by default in the launchers. No game files, dumps or extracted data are included.
VICTORY_CARD_AWAKE=1, which the launcher sets, keeps one group of
threads counting on a compute queue while the title submits. It exists
for the gaps between some thirty submissions a frame (a captured frame:
37.8 ms -> 28.6 ms). In a menu, it ran just the same.

On an RTX 3060 with the window in front, the title's menu (three
submissions a frame) ran at 15-45 fps instead of 600. The card counted
as 100% busy, and the frames waited about 68 ms each. Unfocused, and in
every case with VICTORY_CARD_AWAKE=0, the menu ran at 600+ fps (#771,
1bit0's runs).

The title's submissions are now counted frame by frame (frames
presented, queue::presented, now in every build). The card is kept
awake only after a frame of at least eight, so gameplay keeps it and a
menu does not.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 14:28:29 +00:00
Author
Owner

@⁠Yoshi-233 on GitHub · 2026-11-28 08:32 UTC · original

I measured the gameplay side of the 8-submission threshold on a desktop RTX 4070 Ti SUPER (16 GB, driver 617.42). This was the existing VICTORY_CARD_AWAKE=turns on the November 28 .01 base, with frame generation on. I held the boat still facing the same bridge and used one process for five successive off/on pairs. Each phase lasted 20 seconds; I left the first 5.5 seconds and final second out of the measurements. Screenshots and the runtime’s transition log identify each phase.

Median of five phase medians Helper off Helper on
Rendered FPS 19.0 17.4
Frame time 52.6 ms 57.6 ms
GPU work inside submission timestamps 37.8 ms 42.1 ms
Time between those brackets 14.9 ms 15.5 ms
Submissions/frame 17 17
Graphics clock 2,775 MHz 2,775 MHz

All five off phases rendered faster than their adjacent on phases (off 18.75–19.1, on 17.1–17.55 FPS). This scene sits above the proposed threshold. The threshold still addresses the three-submission menu case in #771. For this particular gameplay workload, submission count alone would leave the helper active, so retaining the user override is valuable. I have not run the new menu logic on this card.

**@⁠Yoshi-233** on GitHub · 2026-11-28 08:32 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/825#issuecomment-7236647886) I measured the gameplay side of the 8-submission threshold on a desktop RTX 4070 Ti SUPER (16 GB, driver 617.42). This was the existing `VICTORY_CARD_AWAKE=turns` on the November 28 .01 base, with frame generation on. I held the boat still facing the same bridge and used one process for five successive off/on pairs. Each phase lasted 20 seconds; I left the first 5.5 seconds and final second out of the measurements. Screenshots and the runtime’s transition log identify each phase. | Median of five phase medians | Helper off | Helper on | | --- | ---: | ---: | | Rendered FPS | 19.0 | 17.4 | | Frame time | 52.6 ms | 57.6 ms | | GPU work inside submission timestamps | 37.8 ms | 42.1 ms | | Time between those brackets | 14.9 ms | 15.5 ms | | Submissions/frame | 17 | 17 | | Graphics clock | 2,775 MHz | 2,775 MHz | All five off phases rendered faster than their adjacent on phases (off 18.75–19.1, on 17.1–17.55 FPS). This scene sits above the proposed threshold. The threshold still addresses the three-submission menu case in #771. For this particular gameplay workload, submission count alone would leave the helper active, so retaining the user override is valuable. I have not run the new menu logic on this card.
Author
Owner

@⁠nick0451 on GitHub · 2026-11-28 10:01 UTC · original

Tested in the game: RTX 3090 24 GB (driver 610.88), i9-14900K, Windows 11. A release build of this PR merged onto main at 63b902f. Series S, DLSS Performance, frame generation off.

This covers play in the world only. Main and this PR were run in turn, three rounds each, after one warm-up start each. Every run used the same frozen save, outdoors, about 6,000 draws a frame, 40 s to settle and 60 s measured.

Build fps, 3 runs median frame preparing card busy
main 24.6, 24.1, 25.4 24.6 40.6 ms 25.7 ms 94%
this PR 22.8, 24.4, 24.7 24.4 41.0 ms 26.0 ms 94%

In the world, with its many submissions a frame, the card is kept awake as before. The frame rate is within the 2-3% noise of this setup (main against itself). No crashes or ERROR lines.

Not tested: the menu case of #771 (frame rate with the window focused in a menu). My runs drive the game with scripted keys and cannot keep its window focused, so I cannot reproduce the "focused" column here.

Tested with an AI assistant (Claude Code); results are from this PC.

**@⁠nick0451** on GitHub · 2026-11-28 10:01 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/825#issuecomment-7237619438) Tested in the game: RTX 3090 24 GB (driver 610.88), i9-14900K, Windows 11. A release build of this PR merged onto main at `63b902f`. Series S, DLSS Performance, frame generation off. This covers play in the world only. Main and this PR were run in turn, three rounds each, after one warm-up start each. Every run used the same frozen save, outdoors, about 6,000 draws a frame, 40 s to settle and 60 s measured. | Build | fps, 3 runs | median | frame | preparing | card busy | |---|---|---|---|---|---| | main | 24.6, 24.1, 25.4 | 24.6 | 40.6 ms | 25.7 ms | 94% | | this PR | 22.8, 24.4, 24.7 | 24.4 | 41.0 ms | 26.0 ms | 94% | In the world, with its many submissions a frame, the card is kept awake as before. The frame rate is within the 2-3% noise of this setup (main against itself). No crashes or `ERROR` lines. **Not tested:** the menu case of #771 (frame rate with the window focused in a menu). My runs drive the game with scripted keys and cannot keep its window focused, so I cannot reproduce the "focused" column here. Tested with an AI assistant (Claude Code); results are from this PC.
github manually merged commit 7328f2089c into main 2026-11-29 08:21:26 +00:00
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!825
No description provided.