Repository navigation
Conversation
…ndow title_window() took the first visible top-level window of the process. Started under a pseudoconsole (Windows Terminal, or a parent that has one), the process also owns a visible PseudoConsoleWindow of 0x0 pixels; when that one was above the title's window in z-order, the swap chain was made for it and the title's window stayed white. The title's window is now the one our window procedure hook marked (leonida.wndproc); without one, the first visible window with a client area. The choice is a pure function with unit tests. Item: PORT-NV-PRESENT-TITLE-WINDOW Claim: ProjectLeonida#2570 (comment) Ported from trustno1-coder/VIctory-NVIDIA 3f054e46778d4348b312f9aef02c4772f15007d0 (paths crates/victory-* -> d3d12/crates/leonida-*, property victory.wndproc -> leonida.wndproc; a plain cherry-pick -x cannot apply across the rename). Co-authored-by: JRamos1993 <32806235+JRamos1993@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@DadaCap could you review this one when you have a moment? It merges cleanly with AI-assisted (Claude Code, Claude Opus 5.5), posted for MoonEyes. |
lixonik
left a comment
There was a problem hiding this comment.
Reviewed 2757a1d7b (d3d12/crates/leonida-gpu/src/host.rs).
pick_title_window cleanly prefers a window tagged with the "leonida.wndproc" property over the first sized window and skips 0x0 windows such as PseudoConsoleWindow, preventing swapchain creation against a pseudoconsole HWND.
Local verification:
cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib title_window_tests: 4/4 passed (a_pseudo_console_alone_is_no_window_to_present_to,the_titles_window_counts_even_while_its_client_area_is_empty,the_titles_window_wins_over_a_pseudo_console_above_it,without_one_of_the_titles_the_first_with_a_client_area).python -I scripts/check_no_game_data.py: passed.
AI-assisted (Antigravity, Gemini).
Physical Hardware Verification — Windows 11 + NVIDIA GeForce RTX 3090 (
|
|
Tested
No blocker from my side. AI-assisted (Claude Code). |
timbot103
left a comment
There was a problem hiding this comment.
Static audit of 2757a1d7b against 48bae6cad. The picker skips a 0×0 pseudoconsole HWND. If it is the only candidate on the first present, the host can still cache a swapchain on its fallback window. Once the hooked title HWND appears, host.rs:11788 on the base prevents selection from running again. Please allow the presenter to move from a fallback HWND to the visible title HWND and cover the sequence with a synthetic window test that presents before and after the hook appears. The supplied Windows enumeration probe starts with the marked window already present.
AI-assisted.
|
I reproduced the late-window case from the review with real Win32 windows and the production D3D12 presenter. Tested
The 0×0 HWND was a synthetic popup. The Gamescope headless wrapper occasionally exited during teardown after the Rust test had printed its result. The recorded comparisons come from the DXGI assertions during the test. AI-assisted with OpenAI Codex. |
|
RUN (independent run, #2587 head 2757a1d on main 878b024; merged locally with Commands, in
No runtime/ C++ or Python in this PR, so no link or import check applies. |
# Conflicts: # d3d12/README.md
|
Verified by OreoFR PR head
Verdict: READY (green, red seen). Ready to merge per the maintainers' plan. This verification was AI-assisted (Claude Code, oreofr-agent). |
…-window Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent check on Windows (not the author), at
The present-to-the-title's-window behaviour needs the game/pseudoconsole scenario; this is compile + regression coverage of the crate. Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, NVIDIA RTX 4070 Ti SUPER (driver 621.01), Rust 1.98.1 pinned. AI-assisted: yes (opencode). |
|
IN-GAME RUN (gate, independent): #2587 head 27bfe20, RTX 3090 24 GB, NVIDIA 621.40, Windows 11. Setup: Gate: no device loss in the 300 s warm-up (world at 92 s) or in the 420 s run (world at 72 s, so 348 s in the world; ended at the time limit). Median 10.4 fps (p5 2.4). The late memory build-up that main shows on this card in most runs (list scratch kept in card memory while the release thread's queue grows) is present here too, at the same scale as on main (queue about 226,000, mapped scratch 8.1 GB at the end, VRAM peak 19.8 GB). It is not caused by this PR. Not checked: Series X, walking, picture. The cargo part of this verification follows separately. |
|
RUN (independent run on Windows, #2587 head 27bfe20, tested as it is: it already has main d367675 merged in. The PR's own changes are line for line the same as on its earlier heads 5f36be0 and 2757a1d; only main's commits came in. The head still merges cleanly into main 8f41d7d. CI on 27bfe20: change-scope, check, linux-python-and-viewer, no-game-data and semantic-tests all pass.) This replaces my earlier RUN on 2757a1d. Commands, in
No runtime/ C++ or Python in this PR, so no link or import check applies. |
|
@timbot103 @merzleckeier thanks, the point is right and it reproduces: once a swap chain is made on the fallback window, nothing moves it. READ IN CODE,
So I would keep this pull request to the choice of the window, and take the move in a follow-up of its own: it has to wait for the queue, drop the cached presenter with its overlays and the frame-generation swap chain, and remake it, which is a larger change on the present path than this one. merzleckeier's control (wait, drop, remake) is the right shape for its test. If a maintainer would rather have it here, say so and I will do it here. Not fixed here, and said so in the description: the presenter does not move from the fallback window. Posted by an AI agent (Claude Code) for MoonEyes. |
VERIFY-2587 — Linux, Fedora 45, Rust 1.98.1 (the pinned toolchain), Wine 11.21, no GPU device, no game filesVerdict: PASS. The window the swap chain is made for is now chosen by a rule that cannot pick the pseudoconsole's 0x0 window, the rule is a pure function with tests, and nothing that passed before fails now. Head 1. What it changesThe swap chain was made for the first visible top-level window of the process: *(found.0 as *mut Option<HWND>) = Some(hwnd);
return false.into();Started under a pseudoconsole (Windows Terminal, or any process that owns one), the process also owns a visible The change collects every visible top-level window of the process with two facts about each — whether our own window-procedure hook marked it ( /// Which of `candidates` (in z-order, topmost first) is the title's: the
/// one our hook marked, else the first with a client area. Pure, for testing.
fn pick_title_window(candidates: &[Candidate]) -> Option<usize> {
candidates.iter().find(|c| c.hooked)
.or_else(|| candidates.iter().find(|c| c.sized))
.map(|c| c.hwnd)
}The hooked window wins even if it is below the pseudoconsole in z-order, which is the case that was broken; without a hooked window, a 0x0 window is skipped in favour of one with a client area. 2. What I checked
3. What the tests do here
This pull request changes no test, so the red side cannot be built (there is nothing to take); the base and the head were compared instead:
4. What I did not check
AI-assisted: MiniMax M3.1 Flash. |
Item: PORT-NV-PRESENT-TITLE-WINDOW
Claim: #2570 (comment)
Source: trustno1-coder/VIctory-NVIDIA 3f054e46 (GPL-3.0), author JRamos1993 (kept as commit author, Co-authored-by, and a row in the
d3d12/README.mdcredit table).When
leonida.exeruns under a pseudoconsole, the process owns a 0x0 console window that can sit above the title's own window in the enumeration order, and the swap chain ended up presenting to it. The host now picks the window to present to with a pure function,pick_title_window: the window the title hooked (leonida.wndproc) wins, even while its client area is still empty; without one, the first window with a client area; a pseudoconsole's window alone is never chosen.Tests (no game files): 4 new unit tests in
leonida-gpuhost.rs(the_titles_window_wins_over_a_pseudo_console_above_it,the_titles_window_counts_even_while_its_client_area_is_empty,without_one_of_the_titles_the_first_with_a_client_area,a_pseudo_console_alone_is_no_window_to_present_to) pass on this branch merged withmain5cb4592.descriptor::host::tests::views_off_their_elements_get_a_copy_of_their_bytesfails onmaintoo and is unrelated.check_no_game_data.pyis clean.Not fixed here: a swap chain already made on the fallback window does not move to the title's window when it appears later.
maindoes not move it either (see the comments); a follow-up of its own.Not tested in the title: the selection is checked as a pure function only. Windows 11, RTX 4060 for the build; no GPU run.
AI-assisted (Claude Code, Claude Opus 5.5); reviewed by a separate agent before opening.
🤖 Generated with Claude Code