fix(gpu): present to the title's window, not a pseudoconsole's 0x0 window #2587
Open
MoonEyes wants to merge 4 commits from
upstream-pr/2587 into main
pull from: upstream-pr/2587
merge into: ProjectLeonida:main
ProjectLeonida:main
ProjectLeonida:claude/loop-total
ProjectLeonida:claude/pops-collision-seed
ProjectLeonida:claude/dstorage-hold-page-reads
ProjectLeonida:claude/host-image-copy-switch
ProjectLeonida:feat/gdk-lifecycle-window-hook
ProjectLeonida:claude/d16s8-uav-nvidia-fallback
ProjectLeonida:feat/mfplat-offline-shim
ProjectLeonida:claude/gameinput-slow-reader
ProjectLeonida:fix/rt-null-barrier-clear
ProjectLeonida:claude/depth-resolve-sample-positions
ProjectLeonida:integration/palmetto-parity
ProjectLeonida:claude/valu-literal-sext
ProjectLeonida:claude/slot74-pool-handle
ProjectLeonida:claude/rgb9e5-uint-alias-view
ProjectLeonida:claude/fssm-root-layout-tables
ProjectLeonida:feat/gdk-speech-display-lifecycle
ProjectLeonida:asset-audio-skip-current
ProjectLeonida:qemmhd/old-9940-rectangle-quad-lists
ProjectLeonida:feat/ws2-offline-shim
ProjectLeonida:qemmhd/rt-d16-unorm-uav
ProjectLeonida:feat/xs-device-stops-7-9
ProjectLeonida:qemmhd/rt-depth-same-base-shapes
ProjectLeonida:qemmhd/rt-lazy-attachment-variant
ProjectLeonida:feat/acphal-xma2-decoder
ProjectLeonida:asset-audio-skip
ProjectLeonida:codex/coord-claim-check-20261124-7e48
ProjectLeonida:feat/xs-frame-pacing-presentx
ProjectLeonida:feat/xs-device-vm-options
ProjectLeonida:old-pr/9844
ProjectLeonida:old-pr/9978
ProjectLeonida:old-pr/9815
ProjectLeonida:old-pr/10057
ProjectLeonida:old-pr/9874
ProjectLeonida:old-pr/9965
ProjectLeonida:old-pr/9863
ProjectLeonida:old-pr/10068
ProjectLeonida:old-pr/10066
ProjectLeonida:old-pr/10067
ProjectLeonida:old-pr/10007
ProjectLeonida:old-pr/10061
ProjectLeonida:old-pr/10065
ProjectLeonida:old-pr/10059
ProjectLeonida:old-pr/10063
ProjectLeonida:old-pr/10055
ProjectLeonida:old-pr/10062
ProjectLeonida:old-pr/10042
ProjectLeonida:old-pr/10041
ProjectLeonida:old-pr/10049
ProjectLeonida:old-pr/10047
ProjectLeonida:old-pr/10046
ProjectLeonida:old-pr/10045
ProjectLeonida:old-pr/10056
ProjectLeonida:old-pr/10043
ProjectLeonida:old-pr/10036
ProjectLeonida:old-pr/10034
ProjectLeonida:old-pr/9984
ProjectLeonida:old-pr/10052
ProjectLeonida:old-pr/10038
ProjectLeonida:old-pr/10033
ProjectLeonida:old-pr/10028
ProjectLeonida:old-pr/10050
ProjectLeonida:old-pr/9891
ProjectLeonida:old-pr/9889
ProjectLeonida:old-pr/10051
ProjectLeonida:old-pr/10019
ProjectLeonida:old-pr/10027
ProjectLeonida:old-pr/10029
ProjectLeonida:old-pr/10031
ProjectLeonida:old-pr/10026
ProjectLeonida:old-pr/9941
ProjectLeonida:old-pr/10030
ProjectLeonida:old-pr/10040
ProjectLeonida:old-pr/9990
ProjectLeonida:old-pr/10021
ProjectLeonida:old-pr/9962
ProjectLeonida:old-pr/10022
ProjectLeonida:old-pr/10020
ProjectLeonida:old-pr/10015
ProjectLeonida:old-pr/10025
ProjectLeonida:old-pr/9886
ProjectLeonida:old-pr/10048
ProjectLeonida:old-pr/10014
ProjectLeonida:old-pr/10011
ProjectLeonida:old-pr/9861
ProjectLeonida:old-pr/10010
ProjectLeonida:old-pr/10008
ProjectLeonida:old-pr/9860
ProjectLeonida:old-pr/10006
ProjectLeonida:old-pr/9920
ProjectLeonida:old-pr/9995
ProjectLeonida:old-pr/10000
ProjectLeonida:old-pr/10016
ProjectLeonida:old-pr/10004
ProjectLeonida:old-pr/10023
ProjectLeonida:old-pr/9982
ProjectLeonida:old-pr/9981
ProjectLeonida:old-pr/9983
ProjectLeonida:old-pr/9970
ProjectLeonida:old-pr/9969
ProjectLeonida:old-pr/9968
ProjectLeonida:old-pr/9971
ProjectLeonida:old-pr/9972
ProjectLeonida:old-pr/9942
ProjectLeonida:old-pr/9963
ProjectLeonida:old-pr/9960
ProjectLeonida:old-pr/9964
ProjectLeonida:old-pr/9985
ProjectLeonida:old-pr/9973
ProjectLeonida:old-pr/9862
ProjectLeonida:old-pr/9953
ProjectLeonida:old-pr/10017
ProjectLeonida:old-pr/9952
ProjectLeonida:old-pr/9955
ProjectLeonida:old-pr/9946
ProjectLeonida:old-pr/9954
ProjectLeonida:old-pr/9938
ProjectLeonida:old-pr/9956
ProjectLeonida:old-pr/9856
ProjectLeonida:old-pr/9947
ProjectLeonida:old-pr/9924
ProjectLeonida:old-pr/9961
ProjectLeonida:old-pr/9927
ProjectLeonida:old-pr/9979
ProjectLeonida:old-pr/10032
ProjectLeonida:old-pr/9926
ProjectLeonida:old-pr/5237
ProjectLeonida:old-pr/9951
ProjectLeonida:old-pr/9931
ProjectLeonida:old-pr/9902
ProjectLeonida:old-pr/9921
ProjectLeonida:old-pr/9994
ProjectLeonida:old-pr/9775
ProjectLeonida:old-pr/9768
ProjectLeonida:old-pr/9905
ProjectLeonida:old-pr/9936
ProjectLeonida:old-pr/9901
ProjectLeonida:old-pr/9904
ProjectLeonida:old-pr/9906
ProjectLeonida:old-pr/9988
ProjectLeonida:old-pr/9908
ProjectLeonida:old-pr/9909
ProjectLeonida:old-pr/9911
ProjectLeonida:old-pr/9912
ProjectLeonida:old-pr/9913
ProjectLeonida:old-pr/9887
ProjectLeonida:old-pr/9916
ProjectLeonida:old-pr/9919
ProjectLeonida:old-pr/9925
ProjectLeonida:old-pr/9933
ProjectLeonida:old-pr/9935
ProjectLeonida:old-pr/9918
ProjectLeonida:old-pr/9879
ProjectLeonida:old-pr/9880
ProjectLeonida:old-pr/9881
ProjectLeonida:old-pr/9996
ProjectLeonida:old-pr/9876
ProjectLeonida:old-pr/9892
ProjectLeonida:old-pr/9899
ProjectLeonida:old-pr/9915
ProjectLeonida:old-pr/9914
ProjectLeonida:old-pr/9872
ProjectLeonida:old-pr/9869
ProjectLeonida:old-pr/9866
ProjectLeonida:old-pr/9819
ProjectLeonida:old-pr/10012
ProjectLeonida:old-pr/9857
ProjectLeonida:old-pr/9893
ProjectLeonida:old-pr/9897
ProjectLeonida:old-pr/9928
ProjectLeonida:old-pr/9868
ProjectLeonida:old-pr/9917
ProjectLeonida:old-pr/9940
ProjectLeonida:old-pr/9873
ProjectLeonida:old-pr/9816
ProjectLeonida:old-pr/10009
ProjectLeonida:old-pr/9900
ProjectLeonida:old-pr/9966
ProjectLeonida:old-pr/9859
ProjectLeonida:old-pr/9843
ProjectLeonida:old-pr/9991
ProjectLeonida:old-pr/10058
ProjectLeonida:old-pr/9883
ProjectLeonida:old-pr/9838
ProjectLeonida:old-pr/9835
ProjectLeonida:old-pr/9959
ProjectLeonida:old-pr/9895
ProjectLeonida:old-pr/9837
ProjectLeonida:old-pr/9858
ProjectLeonida:old-pr/9865
ProjectLeonida:old-pr/9864
ProjectLeonida:old-pr/9840
ProjectLeonida:old-pr/9820
ProjectLeonida:old-pr/4669
ProjectLeonida:old-pr/9848
ProjectLeonida:old-pr/9850
ProjectLeonida:old-pr/9810
ProjectLeonida:old-pr/9799
ProjectLeonida:old-pr/9853
ProjectLeonida:old-pr/9875
ProjectLeonida:old-pr/9831
ProjectLeonida:old-pr/9796
ProjectLeonida:old-pr/9801
ProjectLeonida:old-pr/9813
ProjectLeonida:old-pr/9794
ProjectLeonida:old-pr/7417
ProjectLeonida:old-pr/9781
ProjectLeonida:old-pr/9806
ProjectLeonida:old-pr/9958
ProjectLeonida:old-pr/9809
ProjectLeonida:old-pr/9791
ProjectLeonida:old-pr/9792
ProjectLeonida:old-pr/10053
ProjectLeonida:old-pr/9784
ProjectLeonida:old-pr/9789
ProjectLeonida:old-pr/9849
ProjectLeonida:old-pr/9846
ProjectLeonida:old-pr/9773
ProjectLeonida:old-pr/9785
ProjectLeonida:old-pr/9803
ProjectLeonida:old-pr/9826
ProjectLeonida:old-pr/9839
ProjectLeonida:old-pr/9922
ProjectLeonida:old-pr/9948
ProjectLeonida:old-pr/7189
ProjectLeonida:old-pr/9957
ProjectLeonida:old-pr/9823
ProjectLeonida:old-pr/9807
ProjectLeonida:old-pr/9851
ProjectLeonida:old-pr/9774
ProjectLeonida:old-pr/9830
ProjectLeonida:old-pr/9836
ProjectLeonida:old-pr/9822
ProjectLeonida:old-pr/9783
ProjectLeonida:old-pr/9833
ProjectLeonida:old-pr/9890
ProjectLeonida:old-pr/9770
ProjectLeonida:old-pr/9769
ProjectLeonida:old-pr/9772
ProjectLeonida:old-pr/9787
ProjectLeonida:old-pr/9852
ProjectLeonida:old-pr/9834
ProjectLeonida:old-pr/9845
ProjectLeonida:old-pr/9871
ProjectLeonida:old-pr/9771
ProjectLeonida:old-pr/9776
ProjectLeonida:old-pr/10005
ProjectLeonida:old-pr/9949
ProjectLeonida:old-pr/9923
ProjectLeonida:old-pr/9805
ProjectLeonida:old-pr/9829
ProjectLeonida:old-pr/9790
ProjectLeonida:old-pr/9827
ProjectLeonida:old-pr/9929
ProjectLeonida:old-pr/9855
ProjectLeonida:old-pr/9934
ProjectLeonida:old-pr/9907
ProjectLeonida:old-pr/9910
ProjectLeonida:old-pr/9779
ProjectLeonida:old-pr/9780
ProjectLeonida:old-pr/9885
ProjectLeonida:old-pr/9882
ProjectLeonida:old-pr/9877
ProjectLeonida:old-pr/9998
ProjectLeonida:old-pr/4251
ProjectLeonida:old-pr/9987
ProjectLeonida:old-pr/9989
ProjectLeonida:old-pr/9950
ProjectLeonida:old-pr/9777
ProjectLeonida:old-pr/10044
ProjectLeonida:old-pr/9884
ProjectLeonida:old-pr/2906
ProjectLeonida:old-pr/5076
ProjectLeonida:old-pr/9937
ProjectLeonida:old-pr/9986
ProjectLeonida:old-pr/3014
ProjectLeonida:old-pr/9943
ProjectLeonida:old-pr/9939
ProjectLeonida:old-pr/4682
ProjectLeonida:old-pr/4765
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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
ProjectLeonida/mandy!2587
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2587"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T19:47:42Z.
Item: PORT-NV-PRESENT-TITLE-WINDOW
Claim: https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7244604592
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 withmain5cb45921e.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
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T20:02:53Z.
@DadaCap could you review this one when you have a moment? It merges cleanly with
main. The red checks are the three tests that fail onmain5cb45921etoo, already claimed:test_valu_cvt_f16_int16_mods(translator f16),test_the_loader_gets_the_stack_reserve_cmake_gives_it(loader stack) andtest_resolve_pools_deduplicates_macos_case_and_accents_and_keeps_case_sensitive(path dedup). None of them touches this diff. TheERROR:lines in those logs come from tests that pass.AI-assisted (Claude Code, Claude Opus 5.5), posted for MoonEyes.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T20:10:26Z.
Review: APPROVED
Reviewed
2757a1d7b(d3d12/crates/leonida-gpu/src/host.rs).pick_title_windowcleanly prefers a window tagged with the"leonida.wndproc"property over the first sized window and skips0x0windows such asPseudoConsoleWindow, 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).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T20:50:45Z.
Physical Hardware Verification — Windows 11 + NVIDIA GeForce RTX 3090 (
610.88)Verified head commit
2757a1d7bedba7fedba62284eb8daf9da9d0abebcleanly merged (no-commit) ontoorigin/main(1bc055e6c2dedaa0de23ec79d8c4007c1dff1fb3;git merge-tree --write-treerc=0).#2587merges cleanly with#2589, and has a trivial 1-line adjacent table-row conflict at the end of the settings table ind3d12/README.mdwith#2588(git merge-treerc=1ond3d12/README.mdonly).Red -> Green Verification
origin/main1bc055e6c2):#2587'stitle_window_testsonorigin/mainfails (E0432:Candidateandpick_title_windowabsent).EnumWindowsprobe creating a64x64visible process window marked withSetPropW(..., w!("leonida.wndproc"), ...)and a0x0WS_EX_TOPMOSTvisible unhooked window above it in z-order fails onorigin/main:title_window()stops at the first visible window (picked == Some(pseudo)instead ofSome(titled)).origin/main+2757a1d7be):cargo test --locked -p leonida-gpu --lib title_window -- --test-threads=4: 4/4 unit tests passed (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), plus the live Win32EnumWindowsprobe now selectsSome(titled)over the topmost0x0unhooked window.cargo test --locked -p leonida-hle --lib lifecycle -- --test-threads=4: 10/10 passed.python -I tests/test_docs_encoding.py(1/1),python -I tests/test_docs_links.py(17/17),python -I tests/test_docs_env_vars.py(5/5), andpython -I scripts/check_no_game_data.py d3d12/README.md d3d12/crates/leonida-gpu/src/host.rs d3d12/crates/leonida-hle/src/modules/lifecycle.rs(0issues) all pass.Code Review Notes
TITLE_HOOK(w!("leonida.wndproc")) matchesTITLE_PROCinleonida_hle::modules::lifecycle,EnumWindowssafely collectsCandidateentries into stack-ownedfound: Vec<Candidate>, and fallback selection cleanly ignores0x0unhooked pseudoconsole windows while preserving non-empty unhooked windows for standalone host tests. No blockers found.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-28T21:46:01Z.
Tested
2757a1d7bmerged (no commit) withmainaa918e5d9, Windows 11 10.0.26300, Rust 1.98.1 (NVIDIA GeForce RTX 3080, driver 621.40 in the machine; these are host-side unit tests).cargo test -p leonida-gpu --lib --locked: 519 passed, 0 failed, 46 ignored (plainmain: 515 passed, 0 failed, 46 ignored). The 4title_window_testspass. On currentmainthe 4 crate failures from the description are gone. Theleonida-gputest build gives 10 warnings, the same as onmain.pick_title_windowreduced tomain's rule (candidates.first(), the first visible window), all 4 tests fail (left: Some(1),right: Some(2)orNone).check_no_game_data.pyis clean on the 3 files.No blocker from my side. AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-29T01:07:22Z.
Review: COMMENTED
Static audit of
2757a1d7bagainst48bae6cad. 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:11788on 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.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T13:22:28Z.
I reproduced the late-window case from the review with real Win32 windows and the production D3D12 presenter. Tested
2757a1d7bmerged on3535eb5c4under Wine 11.22 and VKD3D-Proton71cae091on an RTX 4070 SUPER (620.73.04) and Radeon 610M (RADV Mesa 26.3.1). The fixture checksIDXGISwapChain::GetHwndafter each present.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.
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T21:31:44Z.
RUN (independent run, #2587 head
2757a1d7bon main878b024f4; merged locally withgit merge --no-ff, no conflicts; also no conflict with #2566 head7b5cb2941pergit merge-tree --write-tree).Commands, in
d3d12/, target x86_64-pc-windows-msvc, toolchain 1.98.1:cargo check --tests -p leonida-gpu -p leonida-hle: OK on the merged tree.cargo test -p leonida-gpu -p leonida-hle: green. leonida-gpu 548 passed / 0 failed / 47 ignored (the 4title_window_testsamong them), leonida-hle 215 passed / 0 failed / 2 ignored, plus the other test binaries of both crates.pick_title_windowreduced to the old behaviour (the first visible window),cargo test -p leonida-gpu --lib title_windowgives 0 passed / 4 failed.Candidateandpick_title_windowunresolved). That alone proves little, hence the behavioural run above.EnumWindows/GetPropWsee the hook's property on a real title window under a pseudoconsole (only the pure selection is tested).No runtime/ C++ or Python in this PR, so no link or import check applies.
Machine: Windows 11 Pro 26300, i9-13900K, 64 GB, RTX 3090 24 GB, NVIDIA 621.40.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T22:58:10Z.
Verified by OreoFR
PR head
5f36be0d9(a merge of main on top of the tested2757a1d7b; the PR's own change is the same) merged withgit merge --no-ffonto main060c47160, no conflict. Windows 11 Pro 10.0.26300, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Rust 1.98.1 (host-side unit tests, no GPU used). New here: a red at this head.cargo test -p leonida-gpu -p leonida-hle --lockedind3d12/, own target dir.host::title_window_testspass; leonida-hle 218 passed / 0 failed / 2 ignored (+1 +1 in the other test binaries), the same as main.pick_title_window, a new function, so restoringhost.rsto main does not compile. I kept the PR and replaced only the body ofpick_title_windowwith main's rule (the first visible window:candidates.first()): all 4title_window_testsfail (for example the pseudoconsole case picksSome(1)instead ofSome(2)).--all-targets, leonida-gpu + leonida-hle): no new lint in the files the PR touches.eade9562c) rebase needed after this: no (git merge-treeis clean).Verdict: READY (green, red seen). Ready to merge per the maintainers' plan.
This verification was AI-assisted (Claude Code, oreofr-agent).
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T16:58:56Z.
Independent check on Windows (not the author), at
27bfe203b.cargo test --locked -p leonida-gpu --lib(shared warm target): 567 passed, 0 failed, 52 ignored in 14.1 s.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).
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-30T19:00:07Z.
IN-GAME RUN (gate, independent): #2587 head
27bfe203b, RTX 3090 24 GB, NVIDIA 621.40, Windows 11.Setup:
d3d12/scripts/build-nvidia.ps1(diag profile, no DLSS files),scripts/play-d3d12.ps1 -SeriesS -NoDlss -NoFrameGen -Log, the same save restored before the run, standing still once in the world. Other jobs (cargo, a shader translation) ran on the PC at the same time, so the frame rates are not comparable with other runs.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.
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-30T19:02:19Z.
RUN (independent run on Windows, #2587 head
27bfe203b, tested as it is: it already has maind367675c7merged in. The PR's own changes are line for line the same as on its earlier heads5f36be0d9and2757a1d7b; only main's commits came in. The head still merges cleanly into main8f41d7d01. CI on27bfe203b: change-scope, check, linux-python-and-viewer, no-game-data and semantic-tests all pass.) This replaces my earlier RUN on2757a1d7b.Commands, in
d3d12/, target x86_64-pc-windows-msvc, toolchain 1.98.1, all with--locked, at low priority:cargo test -p leonida-gpu --no-fail-fast: green, 567 passed / 0 failed / 52 ignored. Maind367675c7gives 563 / 0 / 52, so the 4 newtitle_window_testspass.cargo test -p leonida-hle --no-fail-fast: 220 / 0 / 2, as on main.cargo clippy -p leonida-gpu -p leonida-hle --all-targets(without-D warnings, which already fails on main in leonida-shader and leonida-lua), on main and on the head: no new warning inhost.rsorlifecycle.rs(3 already there, the same 3 on the head).pick_title_windowput back to the old rule (the first visible window, whatever its size or mark) and the tests kept,cargo test -p leonida-gpu --lib title_windowgives 0 passed / 4 failed. Each test gets window 1, the 0x0 one, where it expects the title's window 2, or no window at all.EnumWindows/GetPropWsee the hook's property on a real title window under a pseudoconsole. Only the pure selection is tested; the in-game check is the A/B agent's.No runtime/ C++ or Python in this PR, so no link or import check applies.
Machine: Windows 11 Pro 26300, i9-13900K, 64 GB, RTX 3090 24 GB, NVIDIA 621.40.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T07:12:24Z.
@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,
main0d41b0a0cand head27bfe203b:maintoo and this pull request does not change it:host.rsmakes the presenter once, whenpresenter.is_none(), and never askstitle_window()again (mainhost.rs:13233).mainthe chain is made for that window and stays there, so nothing is ever shown. Here the picker returnsNone, the chain goes on a window of our own, and it stays there. Neither moves to the title's window later, as merzleckeier measured.maindoes not.CreateWindowExW/CreateWindowExA, before the title gets its handle back, so every window the title makes through them is marked. I did not measure whether the title can present before one is visible. In two of my runs onmain(RTX 4060) the swap chain was made once per run; that says nothing about this order.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.
Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-02T00:35:26Z.
VERIFY-2587 — Linux, Fedora 45, Rust 1.98.1 (the pinned toolchain), Wine 11.21, no GPU device, no game files
Verdict: 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
27bfe203, base the currentmain85ec1d33, merge based367675c, 3 files, +81/−7:d3d12/crates/leonida-gpu/src/host.rs,d3d12/crates/leonida-hle/src/modules/lifecycle.rs,d3d12/README.md.1. What it changes
The swap chain was made for the first visible top-level window of the process:
Started under a pseudoconsole (Windows Terminal, or any process that owns one), the process also owns a visible
PseudoConsoleWindowof 0 x 0 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 — no frame ever shown.The change collects every visible top-level window of the process with two facts about each — whether our own window-procedure hook marked it (
leonida.wndproc, the propertyleonida_hle::modules::lifecycleputs on the windows the title makes), and whether its client area is not empty — and picks by a rule that is a pure function: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
pick_title_windowreturnsNonefor an empty list, the hooked one when there is one, and otherwise the first with a client area — no path returns a 0x0 window unless every window is 0x0 ✓.TITLE_HOOK = "leonida.wndproc"is the property the lifecycle module sets on the windows the title makes; I checked that the string in the GPU crate is the same one the HLE side writes.GetCurrentProcessId()check andIsWindowVisible✓; the change adds facts to the list instead of taking the first window and stopping.3. What the tests do here
leonida-gpuandleonida-hledo not build on Linux (upstream: "The crates are Windows-only today … Linux follows #2577"), so I cross-compiled them forx86_64-pc-windows-gnuand ran the tests under Wine 11.21.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:
watchtests that need Microsoft'sVirtualAlloc/VirtualQuerybehaviour, which Wine does not have4. What I did not check
EnumWindows,GetClientRectandGetPropWneed a real desktop with the title's window and a pseudoconsole; the pure part (the rule) is what I could run.leonida_hle::modules::lifecycleside (four lines): that the hook marks the title's window and not another one.AI-assisted: MiniMax M3.1 Flash.
Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T14:24:59Z.
Ran natively on Windows 11, head
27bfe203bmerged into currentmain(2fc7383b9, no conflicts), toolchain 1.98.1,--locked. Earlier comments say thatEnumWindows/GetPropWwere not checked on real windows under a pseudoconsole. This run checks that with real Win32 windows and the realtitle_window(), using a throwaway ignored test inhost.rs(not committed).Suites on the merge:
leonida-gpu --lib699 passed / 0 failed / 59 ignored,leonida-hle --lib248 / 0 / 2, the 4title_windowtests pass. Clippy--all-targetshas one warning in these crates (mut hathost.rs:7633), which is outside this diff.Does the process really own a visible 0x0
PseudoConsoleWindow?PseudoConsoleWindowattributed to the processStart-Process), binary as the console's first processcmd /c ... & binaryCreatePseudoConsolehost (no terminal window)So the precondition the PR describes exists natively: when the process is the console's first process, a visible 0x0
PseudoConsoleWindowis attributed to it. With no window of its own yet,main's rule picks it, and this PR returnsNone, so it falls back to our own window. In my runs, windows created after the console always sat above thePseudoConsoleWindowin z-order. I did not reproduce the order where it sits above an existing title window.Picks with real windows, started in a new console window as its first process (both rules run on the same live window list)
main(first visible)PseudoConsoleWindowNone(own window)None: a minimised window's client area is 0x0, so it no longer countsEnumWindowsdoes not list child windowsThe PR's rule holds on real windows, and
GetPropWsees the mark. Two edges to know about, neither a blocker:Not checked: the title itself and the lifecycle hook marking a window that the title creates (no game run), and z-order with a title window that existed before the pseudoconsole window became visible.
GPUs tested: n/a (CPU-only tests).
AI-assisted: yes (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T03:48:20Z.
VERIFY-2587 —
hleverde,hostcon la única falla de esta máquina, y el cambio ataca algo que no había visto en ningún otro PR de la nocheTres ficheros,
host.rs+83,lifecycle.rs+4, nueve días abierto:Esa falla es la de la iGPU de esta máquina, la misma que
#3286hace desaparecer — y no tiene nada que ver con este cambio, que toca el present.Y lo que el cambio hace, que es lo nuevo: presenta en la ventana del título y no en la ventana
0x0que crea un pseudoconsola. El diff lo dice con nombres:title_window, una propiedad que el hook del procedimiento de ventana del título pone en las ventanas que el juego crea (TITLE_PROCenleonida_hle::modules::lifecycle), unhwnd: usize, y una tabla que empieza con:Eso es un problema de presentación que sólo existe cuando el juego se lanza desde un terminal que intercepta, y la solución es encontrar la ventana que el juego creó en vez de la que el lanzador tiene como «propia». Es la misma clase de error que el
D3D12CreateDevice(None, …)de#3286: tomar por buena una suposición del entorno («el proceso tiene una ventana y es esta», «el adaptador predeterminado es el bueno») que es cierta en una máquina de escritorio y falsa en cuanto hay un terminal, una iGPU o un compositor de por medio.Lo que no probé: presentar en la ventana de verdad — necesita el título, y en esta sesión no hay escritorio. Lo que sí verifiqué es que
hlesigue en verde con su cambio enlifecycle.rs, que es donde vive elTITLE_PROCque el PR usa.Y una nota que le ahorra tiempo a quien lo pruebe: su tabla de casos incluye «white window under Windows Terminal», así que la condición para reproducirlo está descrita — es más de lo que la mitad de las PRs de presentación traen.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.