host: use the high-performance card when the default is integrated #3049
Open
tharun-37 wants to merge 1 commit from
upstream-pr/3049 into main
pull from: upstream-pr/3049
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!3049
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3049"
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 tharun-37 on 2026-12-02T05:32:40Z.
Fixes #3034.
On a hybrid laptop Windows' default adapter is often the integrated GPU, and
D3D12CreateDevice(None)made the host device there: #3034's runs on a 512 MB Radeon 610M (15,683 MB shared budget) ended in a device removal, where-Adapter 4060ran. The shader host already asks DXGI for the highest-performance adapter in its tests (leonida-shader/src/emit/host.rs); the runtime now agrees with it.When
LEONIDA_ADAPTERnames no card,create()triesdefault_adapter(): if adapter 0 is an integrated GPU (under 1 GiB of its own memory) and DXGI's highest-performance adapter is a different, non-software card with memory of its own, the host device is made on that card, and the start logs both names and the card's memory. Everything else is unchanged: a validLEONIDA_ADAPTERstill wins, a default card with memory of its own stays, an iGPU-only system stays, and if the preferred card cannot make a device the run falls back toD3D12CreateDevice(None)with a warning naming the card.The rule is a pure predicate (
takes_fast_card) with unit tests covering the 1 GiB boundary, the same LUID, a software fast card, a software/Basic Render Driver default, and no fast card. A red control that forces the predicate off makes the new test fail on its first assertion.-Adapter's help and the menu's unset value ("AUTOMATIC") now describe the automatic choice.This addresses items 1 and 2 of #3034 (the start names the card when it switches; the general adapter log is #2948). Item 3, refusing or flagging a budget larger than the card's dedicated memory, is a separate memory-plan decision and is not changed here.
Not repeated on a laptop whose default card is the integrated GPU: on this machine adapter 0 is already the discrete card (RTX 4060 Laptop + Intel UHD) and a DXGI probe shows
default_adapter()returningNone, so the default is untouched. The integrated-default case is covered by the unit rule.Tests (Windows 11, RTX 4060 Laptop, driver 32.0.16.2140; no game files):
cargo test -p leonida-gpu --lib host::tests --locked: 69 passed, 1 ignoredcargo test -p leonida-gpu --lib --locked: 670 passed, 0 failed, 59 ignoredcargo clippy -p leonida-gpu --lib --tests --locked: no new warnings (the oneunused_mutonhost.rsis already on main)python -I scripts/check_no_game_data.py: passpython -I tools/d3d12_switches.py --check d3d12/docs/switches.md: passAI-assisted (OpenCode). An independent read-only reviewer agent audited the full diff before this was opened.
Imported from ubiquitarianism/leonida. Originally posted by dannyhashim08 on 2026-12-02T08:40:28Z.
Verified this approach on a hybrid-graphics laptop where DXGI adapter 0 is the integrated GPU (Intel(R) Graphics + NVIDIA GeForce RTX 5080 Laptop GPU, driver 621.47, Windows 11):
D3D12CreateDevice(None, ...)): silently pickedIntel(R) Graphics(wave lanesmin=8 max=32, UMA VRAM budget17581 MB/ shared0 MB, Streamline/DLSS-G failing withunsupported hw detected), resulting in multi-second GPU frame times andDXGI_ERROR_DEVICE_HUNG (0x887A0006)within a few minutes.IDXGIFactory6::EnumAdapterByGpuPreference(0, DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE)on229d352ee):NVIDIA GeForce RTX 5080 Laptop GPU(0x10de,16003 MBdedicated VRAM), wave lanesmin=32 max=32, Streamline/DLSS-G starts cleanly (sl::Result::eOk).DEVICE_HUNG/ errors; GPU wait dropped to0.2–8.6 ms/frame(10–31% busy).cargo test -p leonida-gpu --lib host::tests: 67 passed, 0 failed.(Note: AI-assisted testing/comment.)
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T11:14:35Z.
Verified locally on Windows 10 22H2 + NVIDIA GeForce RTX 5070 12 GB (single discrete GPU, driver
621.40), PR head4d96edeaemerged cleanly ontomaina252854a2:cargo test -p leonida-gpu --locked --lib host::tests:: -- --skip depth_bounds_pipeline_loads_and_filters_draws-- 68 passed, 0 failed, 1 ignored (skipping only the pre-existing Win10 inbox-d3d12 depth-bounds test).host::tests::the_discrete_card_is_taken_only_in_place_of_an_integrated_default(PASS) andhost::tests::a_card_with_little_memory_of_its_own_is_integrated(PASS).python -I tools/d3d12_switches.py --check d3d12/docs/switches.md-- exit0.python -I scripts/check_no_game_data.py d3d12/README.md d3d12/crates/leonida-gpu/src/host.rs d3d12/crates/leonida-gpu/src/host/menu.rs d3d12/scripts/play-nvidia.ps1-- exit0.default_adapter()cleanly preserves existing behavior on single-dGPU desktops and explicitLEONIDA_ADAPTERoverrides, safely falls back toD3D12CreateDevice(None, ...)if the high-performance adapter fails device creation, and avoids switching to/from WARP/Microsoft Basic Render Driver (VendorId == 0x1414 && DeviceId == 0x8c).< 1 GiBdedicated-VRAM heuristic is clearly documented in code and README (covers standard 128-512 MiB iGPUs such as #3034's 512 MB Radeon 610M; a BIOS UMA reservation >= 1 GiB stays on the previous behavior unless-Adapteris set or DXCoreIsIntegratedis used later).Result: PASS (non-regression + unit tests + clean-room verified on desktop RTX 5070; complements
@dannyhashim08's hybrid-laptop verification).AI-assisted: yes (Antigravity).
Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T15:16:46Z.
Ran natively on Windows 11, head
4d96edeaemerged into currentmain(43fc605ed, merges cleanly), toolchain 1.98.1,--locked, on a desktop with a discrete card and an integrated adapter both enabled (plus the Basic Render Driver).cargo test -p leonida-gpu --lib --lockedcargo clippy -p leonida-gpu --lib --tests --lockedunused_mutinhost.rs, already on main; nothing newWhat DXGI reports here (from a throwaway
#[ignore]probe inhost::tests, not pushed):integrated()ARCHITECTURE1.UMAEnumAdapterByGpuPreference(HIGH_PERFORMANCE)returns the discrete card,MINIMUM_POWERthe integrated one.Adapter the host device is made on, calling
create()from the probe:main(by reading:D3D12CreateDevice(None)= adapter 0)default_adapter()=NoneLEONIDA_D3D12_WARP=1(diagnostics build)LEONIDA_ADAPTER=#1LEONIDA_ADAPTER=#0LEONIDA_ADAPTER=nomatchSo on this machine the PR changes nothing, as on the author's laptop: adapter 0 is already the discrete card. I did not change Windows' graphics preference to make the integrated adapter the default.
The finding: this integrated adapter would not be caught by the 1 GiB rule. It reports 1876 MB of dedicated memory (presumably the firmware UMA carve-out), so
integrated()is false for it, andtakes_fast_card(<integrated adapter>, Some(<discrete card>))with the real descriptors from this machine returnsfalse. If it were the default adapter, the run would stay on it, which is the #3034 situation. The code comment already names this case ("an integrated GPU that reserves 1 GiB or more passes for a card"); this is a real adapter that does it, on current hardware. The same adapter reportsUMA = trueinD3D12_FEATURE_DATA_ARCHITECTURE1, and the discrete card reportsfalse, so that flag, or DXCore'sIsIntegratedthat the comment mentions, separates the two here where dedicated memory does not.UMAneeds a device on the default adapter first; DXCore does not.A side effect of the same case: the shader host (
leonida-shader/src/emit/host.rs) always takes the high-performance adapter, so with such an integrated adapter as default the runtime and the shader host would sit on different adapters, against the "the run and its shaders agree" note indefault_adapter()'s comment.Other checks, by reading:
IDXGIFactory6:high_performance_adapter()returnsNonethrough.ok()?,default_adapter()returnsNone, and the run falls back toD3D12CreateDevice(None)as on main. Not run: the interface exists on every Windows 10 1803+ install, so it could not be removed here.IDXGIAdapter3(memory budget) is found withEnumAdapterByLuid(device.GetAdapterLuid()), as areplaces.rs,indirect.rs,replay/gpu.rs,fg.rs(Streamline). None of the runtime paths assumes adapter 0. The remainingD3D12CreateDevice(None)andEnumAdapters(0)calls are in tests (trainer.rs,dlss.rs,indirect.rsbenchmarks), which stay on the default adapter.d3d12/README.md: "On a laptop with an integrated and a discrete GPU, the default is usually the discrete one, and the switch is logged" reads against the sentence before it and the PR description (the default is often the integrated one). Probably "the card taken is usually the discrete one" was meant.Not checked: a machine where the integrated adapter is DXGI's adapter 0, a device-creation failure on the high-performance card, a title run, Linux/Proton.
GPUs tested: one NVIDIA desktop card, one integrated adapter + WARP.
AI-assisted: yes (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:12:06Z.
Reviewed #3049 (Rust not built here: Windows-only DXGI code). The rule is a sound, well-tested predicate, and the launcher tests pass on Linux. It conflicts with #3141 and leaves #2999's new launcher note wrong, and the model disclosure is incomplete.
4d96edeaedmain45dc41f95c(clean merge treeb93e734122; merge base8422def759, 206 commits behind)43fc605ed)Ran (Linux, Python 3.13.18, on an export of the merge tree)
Review
takes_fast_cardswitches only when adapter 0 is non-software with under 1 GiB of its own memory, and DXGI'sHIGH_PERFORMANCEadapter is a different, non-software card with at least 1 GiB. If that card cannot make a device, it warns and falls back toD3D12CreateDevice(None). A validLEONIDA_ADAPTERstill wins. The unit tests cover the 1 GiB edge, same LUID, a software fast card, the Basic Render Driver stub (0x1414:0x8c) and no fast card. This is the root cause of #3034's device removal, handled where the device is made.software()now also treats the Basic Render Driver as software inchosen_adapter, soLEONIDA_ADAPTER=#0on a hosted runner no longer picks it. That is a small behaviour change outside the default path; worth one line in the description.integrated()); DXCoreIsIntegratedwould be exact. Fine as a first step.Overlaps
git merge-tree pr/3049 pr/3141givesCONFLICT (content)ind3d12/crates/leonida-gpu/src/host.rs. Both rewrite the no-adapter branch ofcreate(), and #3141's warning ("name the card with LEONIDA_ADAPTER") is moot once this switch is automatic.d3d12/scripts/play-nvidia.ps1: "No -Adapter: Windows' default card is used, which may not be the NVIDIA one". It merges cleanly with this PR, but after this PR the statement is wrong for the integrated-default case. Whichever lands second should reword it.Process. No claim ID (only
Fixes #3034). The AI line says "OpenCode" without the model, and CONTRIBUTING.md asks for the specific models, including the reviewer's.Verdict: defects (process and coordination, not code). Add the claim ID and model names, and agree the order with #3141 and #2999. The code itself I would merge.
AI-assisted: Claude Opus 5.5 (Claude Code), review only.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T22:01:15Z.
This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).
Could you, or anyone with a working setup, post a run report on the current head merged onto current
main:mainSHA it was merged onto;mainalone for comparison, if you can.Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T22:25:31Z.
VERIFY-3049 — Windows nativo: los dos tests pasan, y el control muerde la heurística
(this PR)8422def75(behindmainb41763227)main—merge-treeclean,git merge --no-ffclean (auto-mergedREADME.md,host.rs,host/menu.rs,play-nvidia.ps1)Ran
Negative control (synthetic): I inverted the heuristic (
DedicatedVideoMemory > 1 << 30), rebuilt and ran:Both bite.
What the change is: on a machine whose default D3D12 adapter is an integrated GPU, the runtime now asks DXGI for the highest-performance card and makes the device there, falling back to Windows' default if that creation fails — and it logs which card answered. The "integrated" test is a heuristic with its caveat written next to it (
DedicatedVideoMemory < 1 GiB, and the doc says DXCore'sIsIntegratedsays it for certain, which this does not use) — I would rather see the caveat than a claim of certainty, and it is there.A fact worth recording for whoever merges: this is the runtime half of the problem my #2995 addresses in the test half (
test_adapterpicking the high-performance card so the crate's tests stop making their device on the integrated one). They do not conflict — different functions, and #2995 ispub(crate)inplaces/tests.rs— and merged together they would make this machine agree with itself: the runtime on the 4090, the tests on the 4090.What I could not test
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T07:08:31Z.
#3286y#3049son el mismo arreglo por dos vías, y los dos estánBLOCKEDesperando una aprobaciónLo encontré siguiendo una nota de mi propio
#2999, que dice literalmente en un comentario del código: «If#3049lands, the no-adapter case picks the high-performance card and the sentence below becomes wrong for exactly the case it warns about; reword it there.»Así que miré
#3049, y es esto:Los dos cambian la misma decisión en
host.rs: cuando el adaptador por defecto es la integrada, usar el de alto rendimiento.#3049es más grande y más explícito (165 líneas contra 72, y documenta el interruptor enswitches.md);#3286trae ademáswide_eachsin bloqueo y el-Builddel script.Y lo que eso significa para el merge, que es lo único que importa aquí: si entran los dos, el segundo va a chocar en
host.rs— y si sólo entra uno, el otro queda obsoleto.La recomendación, con los números delante:
#3286primero, porque es el que he medido (716/0 en el crate entero) y el que menos toca;#3049después, reducido a lo que#3286no hace — su documentación deswitches.mdy el caso del laptop;#2999, mío, reescribir su aviso cuando el que entre lo haga: hoy su frase es verdad (Windows usa la tarjeta por defecto, que puede no ser la NVIDIA), y después del merge sería mentira para el caso exacto que avisa. El comentario ya lo dice y por eso lo dejo aquí, no en un cambio de código.Y una nota sobre el "BLOCKED" de los dos:
MERGEABLEconBLOCKEDy sin checks rojos es una aprobación que falta, no un problema técnico. Dos PRs del mismo autor bloqueados por lo mismo es exactamente lo que se resuelve en una conversación de treinta segundos y no con más revisiones.Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T07:26:26Z.
Reviewed
4d96edeaond9b618f1. The adapter tests and background-processing regression pass in a Windows MSVC build with #3301 (670df262) and #3303 (5942d059) merged. I also checked the actual device selected under Wine 11.22 / VKD3D-Proton 3.1 by reading its DXGI adapter. Automatic selection and an unrecognized name used the RTX 4070 SUPER. The explicitRadeonand#1both used AMD Raphael. Both DXGI orders put the NVIDIA card first on this machine, so the iGPU-first decision is covered here by the synthetic predicate test.The heads of #3049 and #3286 conflict in
host.rs. Their policies overlap on the hybrid case and differ with two discrete GPUs. #3049 preserves a discrete default under its memory heuristic. #3286 tries the high-performance candidate even when the default is discrete. #3286 also includes separate worker and launcher changes, with the launcher profile issues still open. AI-assisted with OpenAI Codex.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.