test: the crate's device tests ask the card with memory of its own, not the default one #2995
Closed
github-bot
wants to merge 4 commits from
github-bot/gh-2995 into main
AGit
pull from: github-bot/gh-2995
merge into: github:main
github:main
github:perf/darner-title-priority-ceiling
github:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
github:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
github:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
github:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
github:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
github:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github:fix/runtime-test-conservative-fixtures
github:ci/shard-semantic-linux
github:docs/fg-limit-fps-switch
github:fix/runtime-test-fixture-paths
github:fix/runtime-test-fixture-readers
github:fix/read-file-hard-link
github:fix/book-slot-heap-never-read
github:fix/depth-resolve-spv-path
github:fix/indirect-unused-batched
github:gh-pr/3358/base
github:fix/xmem-refusal-diagnostics
github:gh-pr/3357/base
github:ci/shorten-ci-time
github:fix/alias-later-queued-submissions
github:claude/gallant-sagan-aamatr
github:gh-pr/3342/base
github:gh-pr/3341/base
github:d3d12/agility-sdk-621
github:gh-pr/3293/base
github:gh-pr/3319/base
github:gh-pr/3318/base
github:gh-pr/3315/base
github:gh-pr/3313/base
github:gh-pr/3314/base
github:claude/fervent-curie-m19lnr
github:gh-pr/3216/base
github:gh-pr/3272/base
github:gh-pr/3276/base
github:gh-pr/3279/base
github:gh-pr/3257/base
github:gh-pr/3258/base
github:gh-pr/3271/base
github:codex/skip-no-hit-ray-passes
github:gh-pr/3230/base
github:gh-pr/3266/base
github:gh-pr/3247/base
github:gh-pr/3246/base
github:gh-pr/3244/base
github:claude/sharp-sagan-1jqnp3
github:t3/preserve-fsr-sdk-restart-path
github:t3/propagate-host-failure-hresult
github:t3/launcher-custom-parameters
github:t3/series-x-2160-startup
github:codex/d3d12-uncapped-simulation
github:ci/less-to-run
github:perf/native-compute-shader-forms
github:claude/blissful-franklin-ukp7ag
github:codex/full-precompile-default
github:gh-pr/3166/base
github:gh-pr/3148/base
github:gh-pr/3138/base
github:gh-pr/3106/base
github:gh-pr/3057/base
github:gh-pr/2756/base
github:gh-pr/2812/base
github:gh-pr/3032/base
github:gh-pr/2992/base
github:notes/card-time-and-plant-flicker
github:gh-pr/2986/base
github:gh-pr/3000/base
github:gh-pr/2966/base
github:gh-pr/2924/base
github:gh-pr/726/base
github:gh-pr/2761/base
github:gh-pr/2663/base
github:gh-pr/2861/base
github:gh-pr/2862/base
github:gh-pr/2820/base
github:gh-pr/2811/base
github:gh-pr/2803/base
github:rt-call-trace
github:gh-pr/2802/base
github:gh-pr/2766/base
github:perf/ahead-split
github:gh-pr/2589/base
github:gh-pr/2699/base
github:gh-pr/2696/base
github:docs/readme-runtime-proposal
github:gh-pr/1346/base
github:codex/coord-claim-check-20261124-7e48
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
area: ci
.github/ workflows and settings
area: d3d12
The D3D12 runtime in d3d12/ (Rust: leonida.exe and its crates)
area: docs
Documentation
area: launcher
The launcher (launcher/)
area: runtime (legacy)
The earlier Vulkan runtime in runtime/
area: shader translator
The shader translator (leonida-shader, tools/rdna2spirv) and its tests
area: tools
tools/ and scripts/
area: viewer
The map viewer (viewer/)
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs in-game run
Changes the code a frame runs through: needs the 300 s in-game gate (docs/game_gate.md)
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
wontfix
This will not be worked on
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
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.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!2995
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@fiestorra on GitHub · 2026-12-01 22:48 UTC · original
fiestorra:test-device-on-the-card→main· +61 −4 · 2 files · 4 commits · closed without mergingtest: 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.
Every `#[test]` in this crate that makes a D3D12 device goes through `host()`, which called `D3D12CreateDevice(None, ..)` - "Windows' default card". On a machine whose monitor 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 a 7800X3D + RTX 4090 they printed `vendor=1002` (AMD's) and `not an NVIDIA card`; * `dlss_starts_on_this_card` asked that Radeon whether it can start DLSS, got `FeatureNotSupported` - 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()` returns `None` and the runtime keeps choosing as it did (`LEONIDA_ADAPTER`, else the default card). In a test build it picks the adapter with the most `DedicatedVideoMemory` that is not software - the card a game would be run on, whatever its vendor. Measured on `main`1fff69129+ 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 as it 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]`d `pipeline::places` tests 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.@andrew-ai on GitHub · 2026-12-01 22:53 UTC · original
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.
@fiestorra on GitHub · 2026-12-01 22:58 UTC · original
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.
@andrew-ai on GitHub · 2026-12-01 23:00 UTC · original
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.
@fiestorra on GitHub · 2026-12-01 23:01 UTC · original
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.
@merzleckeier on GitHub · 2026-12-01 23:09 UTC · original
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.@upipibi on GitHub · 2026-12-02 09:31 UTC · original
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).
@MoonEyes on GitHub · 2026-12-02 12:34 UTC · original
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).
@MoonEyes on GitHub · 2026-12-02 15:53 UTC · original
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).
@MoonEyes on GitHub · 2026-12-02 18:02 UTC · original
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
@fiestorra on GitHub · 2026-12-02 18:16 UTC · original
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.
Two defects the review named, both fixed and both checked on a machine with two cards. **1. The selector picked a card the runtime cannot use.** It took the adapter with the most `DedicatedVideoMemory`, so on a PC with an RTX 3070 driving the display and an RX 580, the RX 580 won - and the runtime refuses that card (no mesh shaders), so `views_are_made_beside_the_heap_and_copied_in` failed with no override set where `main` passes. It now asks DXGI for `DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE`, which is the card `D3D12CreateDevice(None, ..)` gets - the one the OS would use for a high-performance app. Measured on this machine (integrated Radeon + RTX 4090): cargo test -p leonida-gpu --lib -- views_are_made_beside before: 1 failed after: 1 passed cargo test -p leonida-gpu --lib before: 1 failed after: 644 passed, 0 failed, 59 ignored **2. The `places` child still split the devices.** `pipeline/places/tests.rs`'s `a_run` made its `make=` steps with `D3D12CreateDevice(None, ..)`, which uses neither the `LEONIDA_ADAPTER` the host honours nor this selector, so with two cards the steps landed on one and `host` on the other. The child now asks for the same adapter, and falls back to `None` when there is none. `test_adapter` becomes `pub(crate)` for that second call. Outside `cfg!(test)` it is still `None`, so the runtime's own choice is untouched. Written with an AI assistant.@MoonEyes on GitHub · 2026-12-02 22:01 UTC · original
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).
@MoonEyes on GitHub · 2026-12-03 00:38 UTC · original
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).
@fiestorra on GitHub · 2026-12-03 03:42 UTC · original
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.@fiestorra on GitHub · 2026-12-03 06:19 UTC · original
#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.
@fiestorra on GitHub · 2026-12-03 06:29 UTC · original
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