fix(gpu): present to the title's window, not a pseudoconsole's 0x0 window (white window) #49

Closed
JRamos1993 wants to merge 1 commit from upstream-pr/49 into main
JRamos1993 commented 2026-11-27 14:26:01 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by JRamos1993 on 2026-11-27T14:26:01Z.


Problem

title_window() in victory-gpu/src/host.rs takes the first visible top-level window of the process for the swap chain. When victory is started under a pseudoconsole (from Windows Terminal, or by a parent process that has one, such as a script or tool started from it), the process also owns a visible PseudoConsoleWindow of 0x0 pixels. That is the window GetConsoleWindow returns under ConPTY. Whenever it is above the title's window in z-order when the swap chain is made, the swap chain is made for it. The title then runs and presents, but its own window is never presented to and stays white. The frame-rate caption goes to the invisible window too.

On an RTX 5090 it happened in 1 of 7 starts of d12eb1b, with the play defaults (DLSS Quality, frame generation ready). It looked like a frame generation problem, but it is not one: forcing the same z-order turns the window white with --dlss off as well (below).

Fix

  • The title's window is the one our window procedure hook marked (victory.wndproc, set by lifecycle::hook). Without one, it is the first visible window with a non-empty client area. A pseudoconsole's window alone gives none, so our own window is made, as before when the title had made no window.
  • The choice is a pure function (pick_title_window) with four unit tests.
  • A log line when no window of the title's is found.
  • A comment at TITLE_PROC in lifecycle.rs, since the property is now looked up by name from victory-gpu too.

Verification

RTX 5090 (driver 621.24), Windows 11 build 26200, Series X profile at 2560x1440.

Forced repro: for the first 10 s after the start, a helper script raises the process's PseudoConsoleWindow to the top of the z-order every 20 ms (SetWindowPos(HWND_TOP, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE)). The game window was captured with PrintWindow every 5 s.

Build Settings Game window
d12eb1b play --dlss off white for the whole run; the frame-rate caption never appears
this branch play --dlss off the title's frames; the caption updates
this branch play (DLSS Quality, frame generation ready) the title's frames; the caption updates

Without the helper, this branch also ran normally (frames and caption) with the default play settings.

CI commands, this branch against d12eb1b:

  • Clippy fails on d12eb1b already: the workspace run stops at an operator precedence lint in victory-formats (lib test) in both configurations. Run on the two crates this touches (cargo clippy -p victory-gpu -p victory-hle --all-targets --locked -- -D warnings), d12eb1b and this branch both give 39 errors. None of them is in the changed lines.
  • cargo test --workspace --locked: the four new tests pass. victory-gpu lib: 418 passed, 2 failed, 35 ignored. The two failures, indirect::tests::host_list_budget_starts_empty_at_each_submission and indirect::tests::warp_batch_charges_every_execution, fail the same way on d12eb1b.

AI use

This change was made with Claude Code (Claude Opus 5.5): the diagnosis, the patch, the tests and the runs above. It was reviewed and run on my PC (RTX 5090) before being sent.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5528251595 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/49). Originally posted by [JRamos1993](https://github.com/JRamos1993) on 2026-11-27T14:26:01Z. --- ### Problem `title_window()` in `victory-gpu/src/host.rs` takes the first visible top-level window of the process for the swap chain. When victory is started under a pseudoconsole (from Windows Terminal, or by a parent process that has one, such as a script or tool started from it), the process also owns a visible `PseudoConsoleWindow` of 0x0 pixels. That is the window `GetConsoleWindow` returns under ConPTY. Whenever it is above the title's window in z-order when the swap chain is made, the swap chain is made for it. The title then runs and presents, but its own window is never presented to and stays white. The frame-rate caption goes to the invisible window too. On an RTX 5090 it happened in 1 of 7 starts of d12eb1b, with the `play` defaults (DLSS Quality, frame generation ready). It looked like a frame generation problem, but it is not one: forcing the same z-order turns the window white with `--dlss off` as well (below). ### Fix - The title's window is the one our window procedure hook marked (`victory.wndproc`, set by `lifecycle::hook`). Without one, it is the first visible window with a non-empty client area. A pseudoconsole's window alone gives none, so our own window is made, as before when the title had made no window. - The choice is a pure function (`pick_title_window`) with four unit tests. - A log line when no window of the title's is found. - A comment at `TITLE_PROC` in `lifecycle.rs`, since the property is now looked up by name from `victory-gpu` too. ### Verification RTX 5090 (driver 621.24), Windows 11 build 26200, Series X profile at 2560x1440. Forced repro: for the first 10 s after the start, a helper script raises the process's `PseudoConsoleWindow` to the top of the z-order every 20 ms (`SetWindowPos(HWND_TOP, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE)`). The game window was captured with `PrintWindow` every 5 s. | Build | Settings | Game window | |---|---|---| | d12eb1b | `play --dlss off` | white for the whole run; the frame-rate caption never appears | | this branch | `play --dlss off` | the title's frames; the caption updates | | this branch | `play` (DLSS Quality, frame generation ready) | the title's frames; the caption updates | Without the helper, this branch also ran normally (frames and caption) with the default `play` settings. CI commands, this branch against d12eb1b: - Clippy fails on d12eb1b already: the workspace run stops at an `operator precedence` lint in `victory-formats` (lib test) in both configurations. Run on the two crates this touches (`cargo clippy -p victory-gpu -p victory-hle --all-targets --locked -- -D warnings`), d12eb1b and this branch both give 39 errors. None of them is in the changed lines. - `cargo test --workspace --locked`: the four new tests pass. `victory-gpu` lib: 418 passed, 2 failed, 35 ignored. The two failures, `indirect::tests::host_list_budget_starts_empty_at_each_submission` and `indirect::tests::warp_batch_charges_every_execution`, fail the same way on d12eb1b. ### AI use This change was made with Claude Code (Claude Opus 5.5): the diagnosis, the patch, the tests and the runs above. It was reviewed and run on my PC (RTX 5090) before being sent.
cloph-dsp commented 2026-11-28 02:35:13 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cloph-dsp on 2026-11-28T02:35:13Z.


Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):

  • PR #49 at head 6cd5231aedd2e2636a1cd2b849c8ce3000369a36, merge base d12eb1b23da4cad2f551a3dd49e82a87e564122a.
  • Exact module-qualified tests, each 1 passed / 0 failed / 454 filtered, exit 0:
    • cargo test --locked -p victory-gpu --lib -- host::title_window_tests::the_titles_window_wins_over_a_pseudo_console_above_it --exact --test-threads=1 --quiet
    • cargo test --locked -p victory-gpu --lib -- host::title_window_tests::the_titles_window_counts_even_while_its_client_area_is_empty --exact --test-threads=1 --quiet
    • cargo test --locked -p victory-gpu --lib -- host::title_window_tests::a_pseudo_console_alone_is_no_window_to_present_to --exact --test-threads=1 --quiet
  • git grep -F for these test names on the base returned no hits (tests are new on this PR); git diff --check d12eb1b HEAD clean (2 files, +80/-7).
  • Used a per-worktree CARGO_TARGET_DIR (never shared) with CARGO_BUILD_JOBS=2. Note: the recon-suggested bare filter form (cargo test ... <test> -- --exact) matched 0 tests; the correct form is --lib -- <test> --exact.
  • Only the named synthetic tests were replayed; full workspace suite and clippy were not run locally (no clippy component on this toolchain).
  • GPU/driver: N/A (CPU-only tests). No game data, assets, extracted shaders, DRM or decrypt involved.

AI-assisted (Hy4 flash).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7232462984 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/49#issuecomment-7232462984). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-28T02:35:13Z. --- Independent local verification (Windows, Rust 1.100.0/MSVC, no game data): - PR #49 at head `6cd5231aedd2e2636a1cd2b849c8ce3000369a36`, merge base `d12eb1b23da4cad2f551a3dd49e82a87e564122a`. - Exact module-qualified tests, each 1 passed / 0 failed / 454 filtered, exit 0: - `cargo test --locked -p victory-gpu --lib -- host::title_window_tests::the_titles_window_wins_over_a_pseudo_console_above_it --exact --test-threads=1 --quiet` - `cargo test --locked -p victory-gpu --lib -- host::title_window_tests::the_titles_window_counts_even_while_its_client_area_is_empty --exact --test-threads=1 --quiet` - `cargo test --locked -p victory-gpu --lib -- host::title_window_tests::a_pseudo_console_alone_is_no_window_to_present_to --exact --test-threads=1 --quiet` - `git grep -F` for these test names on the base returned no hits (tests are new on this PR); `git diff --check d12eb1b HEAD` clean (2 files, +80/-7). - Used a per-worktree `CARGO_TARGET_DIR` (never shared) with `CARGO_BUILD_JOBS=2`. Note: the recon-suggested bare filter form (`cargo test ... <test> -- --exact`) matched 0 tests; the correct form is `--lib -- <test> --exact`. - Only the named synthetic tests were replayed; full workspace suite and clippy were not run locally (no clippy component on this toolchain). - GPU/driver: N/A (CPU-only tests). No game data, assets, extracted shaders, DRM or decrypt involved. AI-assisted (Hy4 flash).
trustno1-coder commented 2026-11-28 02:48:45 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-28T02:48:45Z.


Merged into main (8fc2254) and shipped in v2026.11.27.10. The commit keeps you as its author, so it counts toward the contributors list. GitHub shows this as closed rather than merged only because the commits were applied on top of the newest main (new commit IDs). Thank you!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7232609276 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/49#issuecomment-7232609276). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-11-28T02:48:45Z. --- Merged into main (8fc2254) and shipped in [v2026.11.27.10](https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.27.10). The commit keeps you as its author, so it counts toward the contributors list. GitHub shows this as closed rather than merged only because the commits were applied on top of the newest main (new commit IDs). Thank you!

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!49
No description provided.