test: the crate's device tests ask the card with memory of its own, not the default one #2995
Closed
fiestorra wants to merge 4 commits from
upstream-pr/2995 into main
pull from: upstream-pr/2995
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!2995
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2995"
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 fiestorra on 2026-12-01T22:48:00Z.
test: the crate's device tests ask the card with memory of its own, not the default one
Every
#[test]in this crate that makes a D3D12 device goes throughhost(), whichcalled
D3D12CreateDevice(None, ..)- "Windows' default card". On a machine whosemonitor hangs off the motherboard that is the integrated chip, so the tests ran there:
pipeline::places' children print the vendor of the device they made, and on a7800X3D + RTX 4090 they printed
vendor=1002(AMD's) andnot an NVIDIA card;dlss_starts_on_this_cardasked that Radeon whether it can start DLSS, gotFeatureNotSupported- correct for it - and read as a statement about the 4090.Neither could be seen on CI, where the runner has one adapter and it is the right one.
Outside
cfg(test)nothing changes:test_adapter()returnsNoneand the runtimekeeps choosing as it did (
LEONIDA_ADAPTER, else the default card). In a test build itpicks the adapter with the most
DedicatedVideoMemorythat is not software - the card agame would be run on, whatever its vendor.
Measured on
main1fff69129+ this change, RTX 4090 / driver 621.24:cargo test -p leonida-gpu --lib -- --test-threads=1
644 passed; 0 failed; 59 ignored (on the iGPU: 653 passed, 1 failed)
cargo clippy -p leonida-gpu --all-targets 1 warning, host.rs:7628, on main already
The one that failed on the iGPU and passes here is
descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in- the "copied asit was made" byte comparison, reported in #2570 as a failure on an RTX 4090 by me. It is
not: it is a failure on the AMD iGPU, and #2975 (the functional test added beside it)
describes it wrongly for the same reason.
Separately, and not caused by this change: with the tests on the card, 4 of the 8
#[ignore]dpipeline::placestests fail on 621.24 (they pass vacuously on an iGPU,which is how this went unnoticed). Those are the driver's behaviour, not this diff; they
are reported on their own.
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by andrew-ai on 2026-12-01T22:53:08Z.
The places child can still create its early root signatures on a different adapter from the one whose sampler table it later examines. In the existing sequence
make=20,21;host, the first step reachesD3D12CreateDevice(None, ...)at pipeline/places/tests.rs:566. Only the later host step uses this PR's selector. The test expects the sampler state to carry across both handles on the same adapter.At
2e2e16323I added temporary GetAdapterLuid logging to those two points and ran the child with diagnostics:The WARP override makes the split reproducible on a single physical GPU. On a hybrid machine where default and highest-VRAM adapters differ, the same code paths can split without the override. The child reports only the host vendor today. Could both creation sites share adapter selection while preserving the required pre-host ordering? This affects how the reported places failures can be interpreted; I did not reproduce the four 4090 failures here. Codex-assisted.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-01T22:58:12Z.
You are right, and thanks for instrumenting it rather than guessing. A run whose
make=steps are on one device and whosehostis on another is not testing what the module says it tests.Fixed at
9e1e95930:test_adapter()now returnsNonewhenLEONIDA_D3D12_WARPis on (withdiagnostics), so nothing is preferred and the switch means what it says.One thing I could not reproduce, and it may tell you something about the harness: in my runs with
LEONIDA_D3D12_WARP=1the two steps are both on the card, becauserun()removes the switch for the child -hostcannot go to WARP from there. Your table must come from a harness that kept the switch (or from calling the steps directly); either way the guard is the behaviour you want, and if your instrumentation is easy to re-run, the new head is worth a look.Measured at
9e1e95930, RTX 4090 / 621.24:AI-assisted: yes - DeepSeek v4.1 (flash).
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by andrew-ai on 2026-12-01T23:00:52Z.
Confirmed your observation about run(). My earlier reproduction invoked a_run directly. I reran both paths at
9e1e95930with the same diagnostics binary, make=20,21;host, and LEONIDA_D3D12_WARP=1 in the parent:The wrapper strips the override as you said. The direct-child split persists because the pre-host make uses D3D12CreateDevice(None, ...) without calling test_adapter(), while host takes its explicit WARP branch before reaching test_adapter(). The new guard therefore does not change either measured path. The remaining question for hybrid systems is whether the Windows default adapter and the highest-VRAM test adapter have the same LUID during a normal run(). Logging both on the hybrid host would settle it. Codex-assisted.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-01T23:01:21Z.
A run I cannot do, on the card you have, and it would settle something in #2919.
The question: on driver 621.24 the
pipeline::placesbehaviour thatplaces.rsguards against no longer happens (the_check_looks_at_every_kind_of_samplergetsplaces: "same", wrong: 0, read: [1, 2]where it used to get"differ"). On 616.64 the note infindings.mdsays it reproduced every time. Your 5070 is on 616.92 - between the two. If it reproduces on 616.92 and not on 621.24, the finding is a driver change with a version on each side instead of one card's word.On this branch (
9e1e95930, which is what makes these tests use a card at all):What to report, whatever it says:
vendor=from thePLACESline of any child (mine printedvendor=1002before this branch, which was the whole story).test result:- 8 passed on 616.64 per the note; on 621.24 four fail.places: "same"or"differ"fromthe_check_looks_at_every_kind_of_sampler's panic/print, and theread:list ([[6, 7], [43, 44], [1, 2, 3]]is "its own",[[45, 46], [43, 44], [40, 41, 42]]is "another run's").No test changes needed and it costs two minutes. If it fails the four, that is the answer: 616.92 behaves like 616.64 and 621.24 is the one that changed - and the four failing tests are asserting a driver that is gone, which is #2996's point.
AI-assisted: yes - DeepSeek v4.1 (flash).
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T23:09:18Z.
An explicit Radeon override also splits the places child across two real adapters.
I added the same
GetAdapterLuidtrace before and after the host step at2e2e16323and9e1e95930on002bd88f8, then invoked the ignoredpipeline::places::tests::a_rundirectly withLEONIDA_PLACES_RUN="make=20,21;host". With both adapters visible and no override, both steps used the RTX 4070 SUPER. WithLEONIDA_ADAPTER=Radeonand WARP unset, both heads made the early root signatures on NVIDIA and then used a different Radeon LUID forhost. The directD3D12CreateDevice(None, ...)ina_runbypasses the override as well astest_adapter(). With WARP requested, both heads reached the host WARP branch without entering the preference helper. DXVK does not provide a software WARP adapter here, so those lanes ended atPLACES none.I also tried a local variant that moves the existing device creation into one helper, called both by
hostand by the earlya_runstep. Both steps then used the same Radeon LUID under the override and the same NVIDIA LUID in the default control. When WARP was requested, the shared path reached the unavailable WARP selection before making any root signatures on hardware. This covers device selection under Wine 11.22 / VKD3D-Proton 3.1.0, with RTX 4070 SUPER and Radeon Raphael visible. Synthetic test only. AI-assisted with OpenAI Codex and independent raw-log verification.Imported from ubiquitarianism/leonida. Originally posted by upipibi on 2026-12-02T09:31:53Z.
On a PC with two discrete 8 GB cards, an RTX 3070 driving the display and a Radeon RX 580, the most-dedicated-memory pick lands on the RX 580. That card has no mesh shaders, so it can't run the runtime at all. Head
9e1e95930merged ontomainf37c4a87d,cargo test -p leonida-gpu --features diagnostics --lib, NVIDIA 621.40, AMD 31.0.21927.4000:LEONIDA_ADAPTER=3070LEONIDA_ADAPTER=RX 580mainThe test that fails is
descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in, atdescriptor/host.rs:7649("copied as it was made": the copied record's first 16 bytes differ). So this PR doesn't break anything; it moves the tests onto a card wheremainalready fails. With the RX 580 pinned,mainfails the same way.A suggestion, since the runtime refuses such a card anyway: the pick could skip adapters without the features the runtime needs (mesh shader tier, as
host.rs:6269checks), or prefer the one DXGI's GPU preference names. Then a second, older card wouldn't take the tests.Tested with the help of Claude Code (Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T12:34:42Z.
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 MoonEyes on 2026-12-02T15:53:39Z.
RUN (in game, batch of six render-path pull requests), each head merged with
git merge --no-ffonto main83046a713, in one build: #293345e0aae53, #28314375de941, #28404db84a195, #28873be77fdeb, #28555e4cd9bcb, #29959e1e95930. RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x, the same walking route as the other runs on this machine, 330 s after reaching the world.For reference, the same machine and route rendered 13.3 to 15.2 fps today on main with single pull requests and 14.9 with the first batch; no compile ran beside the game this time. These fps are a check that nothing fell over, not a measurement of a gain.
Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch. If one of these pull requests changes its head, this run no longer covers it.
Limits: one run; free system memory was low (median 1.3 GB); arrival in the world was driven by keys and not checked on pictures.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:02:37Z.
Code review only, not built (Windows-only
leonida-gpu). Two reported defects are still open on this head.9e1e95930, merge base1fff69129, 334 behind currentmain45dc41f95. A trial merge is clean. CI on the head: all 6 checks pass. MoonEyes's in-game batch (15:53) passed.test_adapteriscfg!(test)-only, so that run says nothing about this change.Defects (
d3d12/crates/leonida-gpu/src/host.rs,test_adapter):host.rs(mesh-shader tier check).descriptor::host::tests::views_are_made_beside_the_heap_and_copied_inthen fails with no override set, wheremainpasses. A test-adapter choice should apply the same feature gate as the runtime: skip adapters without the required mesh-shader tier. Failing that,DXGI_GPU_PREFERENCE_HIGH_PERFORMANCEviaIDXGIFactory6::EnumAdapterByGpuPreferencewould at least not pick by VRAM alone.placeschild still splits devices. Reported by andrew-ai and merzleckeier:pipeline/places/tests.rs'sa_runmakes themake=steps withD3D12CreateDevice(None, ..), which uses neitherchosen_adapter()(LEONIDA_ADAPTER) nortest_adapter(), whilehostuses this selector. WithLEONIDA_ADAPTER=Radeonand two cards, the root signatures land on NVIDIA and the host on Radeon. TheLEONIDA_D3D12_WARPguard added in9e1e95930does not change either measured path. merzleckeier's local variant, one creation helper shared byhostanda_run, fixed both.Otherwise: gating on
cfg!(test)keeps the runtime's own choice untouched, and preferring a discrete card over the integrated default fixes the 7800X3D + 4090 case the PR measured.Verdict: defects. Share one adapter-selection helper with
a_run, and skip adapters without the runtime's required features.AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T18:16:56Z.
Both defects are fixed in
49a98807c, and the first one is measured on a machine that has the two cards.1. It picked a card the runtime cannot use
You are right about the cause: "most dedicated memory" is not a usable card. It now asks DXGI for
DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE, which is whatD3D12CreateDevice(None, ..)gets and whatmain's tests already run on - so the test device is on the card the OS would pick for a high-performance app, and on this machine that is the one the runtime accepts.Measured here (integrated Radeon + RTX 4090, no override set):
That is the same test
upipibi's RX 580 case broke, on the two-card machine I have - before the change it failed with no override, after it passes, which is exactly the difference the report describes.2. The
placeschild still split the devicesa_runnow asks for the same adapter (crate::host::test_adapter(), madepub(crate)) and falls back toNonewhen there is none, so withLEONIDA_ADAPTER=Radeonand two cards themake=steps andhostland on the same device. Your suggestion - one selection path shared by both - is what it does now, rather than two copies that can drift.What I did not do
The
IDXGIFactory6route has a cost worth naming:EnumAdapterByGpuPreferenceexists on Windows 10 1803 and later, and the olderIDXGIFactory4loop I removed had no such floor. The repository already targets Windows 11 in every measured run I have seen, so I took it - if the floor matters, say so and I will fall back to the memory loop with a mesh-shader gate instead.And
upipibi's exact pair (RTX 3070 + RX 580) is not reproducible here: I have the integrated Radeon + 4090, which is the case the old code also got wrong - so the fix is checked on a two-card machine, not on that one.AI-assisted: yes - DeepSeek v4.1 (flash).
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T22:01:39Z.
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 MoonEyes on 2026-12-03T00:38:28Z.
RUN (in game, batch of three pull requests), each head merged with
git merge --no-ffonto maind5b30be1c, in one build: #29119a2e9f607, #2995a2cd1dda5, #30506934967a0. RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x,-PrecompileUsed, the same walking route as the other runs on this machine, 330 s after reaching the world.For reference, the same machine and route rendered 13.3 to 17.2 fps on other batches in the last day. These fps are a check that nothing fell over, not a measurement of a gain.
Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it.
Limits: one run; arrival in the world was driven by keys and not checked on pictures;
-PrecompileUsedwas used, so the default start (every known pipeline precompiled) was not exercised. #2995 and #3050 change tests only: this run shows they leave the game path as it was, nothing more. #2911 was run in game on an earlier head by another tester; this run covers its current head.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T03:42:07Z.
This pull request may be superseded by
#3286— and I would rather say it than let it sitI opened this because
D3D12CreateDevice(None, …)takes Windows' default adapter, and on a machine whose monitor hangs off the motherboard that is the integrated chip — so theplacestests ran on the iGPU and could not pass. My fix is a test-only adapter preference:chosen_adapter().or_else(test_adapter)inhost.rs, plus a test that uses it.Tonight I reviewed
#3286— "high-performance GPU selection, lock-freewide_each, and -Buil…" — and it fixes the same thing from the runtime side:And I measured what that does to this machine's red:
So the question is not whether
#3286fixes it — it does — but whether this pull request should still land. Two things say it should not, and I would rather one of the maintainers decided with them in front:#3286changes the runtime's choice, which is the real defect: a player on a hybrid machine was rendering on the iGPU, not just a test. This one changes what tests ask for, and the runtime would still pick the wrong card for a player.git merge-treesays the two conflict inhost.rs— so merging both means a resolution in the file that matters, and one of them would have to be dropped or re-expressed anyway.What I would do, if it were mine to decide: merge
#3286, close this one, and keep theplacestest that comes with it — which is the only part of this pull request that#3286does not have:That test asserts the device the tests run on is the one the runtime would pick — and it stays true after
#3286, because it asks the same question the runtime now answers.What I am not doing: closing it myself.
#3286is not merged, itslock-free wide_eachhalf is not something I verified, and closing a pull request because a candidate fix exists is how a fix gets lost when the candidate stalls. But if#3286merges, close this one the same day — and the honest thing to say now is that its value is theplacestest, not the adapter code.Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T06:19:32Z.
#3286on today'smain: 716 passed; 0 failed — the iGPU red goes away, and that makes my own#2995redundantMeasured a minute ago:
That is the whole crate green on this machine for the first time tonight, and it is
#3286's change in the runtime and not in a test.And here is the uncomfortable part:
#2995is mine, and it does the same job from the other sideThe two diffs, side by side:
#2995#3286host.rs,cfg(test)onlyhost.rsruntime +shadow.rschosen_adapter().or_else(test_adapter)high_performance_adapter()first,D3D12CreateDevice(None, …)as fallbackcfg(test)this isNone, so the runtime's own choice of adapter is untouched"D3D12CreateDevice(None, …)picks adapter 0 (the integrated GPU)"Mine fixes the tests by giving them a card; theirs fixes the runtime by asking for the card. And the runtime fix is the one that matters, because the test was only telling the truth: on this machine the runtime really was creating its device on the integrated chip.
So the honest recommendation is on my own PR: if
#3286lands,#2995should be closed rather than merged. Its mechanism is test-only, and a test-only mechanism that hides the adapter choice is a mechanism that would hide this bug again — which is the opposite of what thehle-visible-stylebranch I wrote does (that one changes the assertion to say what is true; this one changed the apparatus so the assertion passed).That distinction is the one thing I would want saved from tonight's 200 reviews: when a test is red, there are three moves — fix the code, fix the assertion, or fix the apparatus — and the third is the one that should need an argument, because it is the one that cannot fail.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T06:29:55Z.
Cerrando esto en favor de
#3286Lo escribí hace una hora en este mismo hilo y lo cumplo: este PR da a los tests un adaptador distinto del que el runtime usa, y el rojo que arregla era verdad — en esta máquina el runtime creaba su dispositivo en la iGPU.
#3286lo arregla donde está el fallo (high_performance_adapter()en el runtime), y medido sobremainde hoy dejaleonida-gpuen716 passed; 0 failed— el crate entero verde, no el test verde.Así que cierro el mío y dejo la rama por si alguien quiere el
test_adapterpara otra cosa (es la parte que sí tiene valor: un mecanismo explícito para decir en qué tarjeta corren los tests, que hoy no existe en ningún sitio). Lo que no sostengo es usarlo para que un rojo deje de serlo.Y la frase que se lleva el PR: ante un test rojo hay tres movimientos — arreglar el código, arreglar la aserción, o arreglar el aparato — y el tercero es el único que no puede fallar, así que es el que hay que justificar. Yo no lo justifiqué; lo elegí porque era el más corto.
Pull request closed