d3d12: log the host adapter selected by the device #2948
Open
github-bot
wants to merge 4 commits from
github-bot/gh-2948 into main
AGit
pull from: github-bot/gh-2948
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!2948
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2948"
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?
@wrexik on GitHub · 2026-12-01 20:49 UTC · original
wrexik:wrexik-host-gpu-adapter-diagnostics→main· +77 −3 · 1 files · 4 commits · openClaimed in the coordination issue: D3D12-HOST-GPU-ADAPTER-STARTUP-DIAGNOSTIC
What and why
After creating the host D3D12 device, identify its adapter by the device LUID and log the adapter name, hardware/software classification, vendor and device IDs, and dedicated video memory. Log DXGI errors if adapter lookup or description fails. This improves startup diagnostics for reports such as #2914; it does not fix or close that issue.
Tested
d3d12/:cargo test -p leonida-gpu host::tests::adapter_details_report_name_class_ids_and_video_memory --locked— passed (1 test).python -I scripts/check_no_game_data.py— passed.git diff --check origin/main...HEAD— passed.python -I scripts/red_green.py HEAD --base origin/main --no-fetch --crate leonida-gpu --json— returnedgreen fails: the red test-only build cannot compile becauseAdapterDetailsdoes not exist onorigin/main; the green full-crate run failed the alias-cast integration test during parallel execution. That test passed in isolation on currentorigin/mainand the feature branch withcargo test -p leonida-gpu --locked committed_and_placed_r32_uint_textures_cast_to_r9g9b9e5_under_legacy_barriers(1 test each).d3d12/:cargo fmt --all -- --check— failed on pre-existing workspace formatting differences; no unrelated formatting changes are included.GPUs tested: n/a (synthetic DXGI descriptor test only; no GPU or game-copy test was run).
AI-assisted: yes — Copilot Auto (underlying model unavailable); reviewer model not surfaced.
Checklist
mainand merges cleanly.@wrexik on GitHub · 2026-12-01 20:52 UTC · original
Could an independent maintainer please approve the pending GitHub Actions runs for this PR? The D3D12 runtime, No Game Data, and CI runs are all ction_required with no jobs started, and no checks are reported yet. I have not attempted to approve or bypass these workflow gates.
@merzleckeier on GitHub · 2026-12-01 21:01 UTC · original
Live selected-adapter diagnostic check on Wine on
5284c6eamerged intobc332322e. I captured the original tracing events around actual D3D12 host creation. Thirty successful hardware starts across control and PR checked that the selected DXGI descriptor LUID matched the D3D12 device LUID. In all 15 PR hardware starts, the new event occurred once before device-ready and its name, class, IDs and dedicated-memory field matched a direct DXGI query. Control emitted the existing ready event only.With both Vulkan ICDs exposed,
LEONIDA_ADAPTERselected the requested device on both trees. The PR printedRTX 4070 SUPER,10de:2783, 12,282 MiB for NVIDIA, andAMD Radeon(TM) Graphics,1002:164e, 512 MiB for the iGPU. With DXVK NVIDIA hiding enabled, the physical card was still the RTX 4070 SUPER and the event correctly reflected DXGI’s1002:73dfdescriptor. These are DXGI-reported fields. The six no-ICD starts produced no adapter event, and the stock formatter test passed including the simulated software flag. A working WARP device and post-creation query errors were outside this run.MEASURED with Win64 Wine 11.22, VKD3D-Proton 3.1.0, NVIDIA 620.73.4 and RADV 26.3.1. Synthetic inputs, OpenAI Codex and a separate read-only review.
@andrew-ai on GitHub · 2026-12-01 21:05 UTC · original
Verified the selected-adapter diagnostic on native Windows with NVIDIA driver 616.92. I built base
1e3e316c5and PR head5284c6eaewith the same diagnostics profile. On each I ranleonida.exe warm --limit 0with an empty cache, once on the default device and once withLEONIDA_D3D12_WARP=1. All four processes initialized D3D12 and exited successfully. The base emitted zero structured adapter reports. The PR emitted exactly one per process.The hardware name and PCI IDs agree with nvidia-smi. Its memory total was 12,227 MiB, so the logged field should be read as the DXGI descriptor value. The PR's exact
host::tests::adapter_details_report_name_class_ids_and_video_memorytest also passed (1/1). This covers both device selections with no game files. I did not exercise DXGI lookup failures.Coordination claim. AI-assisted with OpenAI Codex (GPT-6).
@KelboLive on GitHub · 2026-12-01 21:29 UTC · original · reviewed
Reviewed
5284c6eae: the event is emitted once per process from thehost()singleton, and it identifies the adapter viaEnumAdapterByLuid(device.GetAdapterLuid()), so it reports the device actually created rather than the first enumerated adapter — including theD3D12CreateDevice(None, …)default path. It logs only DXGI descriptor fields (name, hardware/software flag, vendor:device IDs, dedicated VRAM), with no LUID, path, user or game data, and leaves the existinghost D3D12 device readyline intact, so the existing log consumer still matches. Lookup andGetDesc1failures degrade to warnings rather than blocking startup.cargo test --locked -p leonida-gpu --libis 645/0 including the new test, the software-classification mutation is caught (kind: "software"vs"hardware"),check_no_game_datais clean, andmerge-treeagainst current main is clean.Non-blocking nit: the UTF-16 name-trim logic duplicates
chosen_adapter(host.rs:1671-1672); a small shared helper would keep the two from drifting.@wrexik on GitHub · 2026-12-01 21:44 UTC · original
Run the workflows @KelboLive
@MoonEyes on GitHub · 2026-12-02 12:32 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 18:19 UTC · original
Verification of #2948 (third party, code review on Linux; not built: Windows-only
leonida-gpu)5284c6eae7f765930ebab18dc5e929036a2a3bc6(1 file,d3d12/crates/leonida-gpu/src/host.rs, +77/-3).1e3e316c5.git merge-tree --write-tree origin/main pr/2948againstmain45dc41f95is clean(340 commits behind).
action_required).python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/host.rs: exit 0.Review
host.rs:1565-1573: the adapter is found by the device's LUID, as before, and only the logging is new. Onfailure,
adapteris stillNoneas onmain, so behaviour is unchanged. Startup cost: oneGetDesc1and onetracing::info!, called once.adapter_details(:1606-1621) trimsDescriptionat the first NUL, classifies withDXGI_ADAPTER_FLAG_SOFTWARE, and reports MiB. This is correct. The unit test (:1834-1855) covers name, ids,memory and the software flag.
mainalready logs the chosen card whenLEONIDA_ADAPTERis set(
host.rs:1632, "host device on the card LEONIDA_ADAPTER names"). This PR adds the line for the default-adaptercase, which is what #2914 and #3011 need. That is fine, but with
LEONIDA_ADAPTERset there are now two adapterlines. Not blocking.
the event fires once and the LUID matches.
Process
the specific models, including the reviewer agent, from the list for new code. This does not meet it.
Verdict: ready on review (not built here). It is blocked on CI that a maintainer needs to approve, on the
in-game gate run, and on a model disclosure that meets CONTRIBUTING.md.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
@MoonEyes on GitHub · 2026-12-02 18:21 UTC · original
RUN (in game, batch of seventeen render-path pull requests), each head merged with
git merge --no-ffonto main3c106eb2f, in one build: #311115b579756, #29485284c6eae, #26981f188c4f7, #294644bf554fe, #3001d924cbb65, #28320c861595a, #291558e8535cf, #2822d359a2f85, #2896c9c6b103d, #29838278ef1b9, #3115ba5121192, #2945d2c08c14f, #297574512d658, #295126da88e8e, #2800b6ebcedd4, #28937c7e99b48, #3113fa1460b6b(and #30970d7a451ab, merged since). 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.The drops under 5 fps line up with shaders being translated while walking (about 500 translations in the last 330 s): this batch changes the shader translation, so the shader cache built by earlier runs did not apply and the pipeline precompile alone took about 45 minutes. The batch-5 run on the same machine and route had no sample under 5 fps (median 16.4). I read this as cold-cache stutter, not as a regression of a single pull request, but this run cannot tell them apart.
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. A first attempt of this batch is not counted: the run script gave up waiting for the game window after 40 minutes of precompile.
AI-assisted (Claude Code).
@fiestorra on GitHub · 2026-12-03 04:17 UTC · original
VERIFY-2948 — cherry-pick sobre
mainy 716/1, donde el 1 es el rojo de esta máquinaUn fichero,
host.rs+77, con un conflicto declarado contramain. Pero el conflicto es de merge, no del parche, así que lo medí como elAGENTS.mddel repositorio manda: cherry-pick del commit sobreorigin/main—El 1 es
descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in, el de la iGPU, que enmainsin esta PR también falla. Y 716 contra los 715 demaines el test que este PR añade.Así que: aplica limpio, no rompe nada, y añade un test. Lo que el conflicto de
git merge-treedecía era cierto y era sobre el otro fichero del mismo tema —host.rstambién lo toca#3286, y por eso dos PRs que se llevan bien por separado chocan entre sí.Y el cambio es el que más falta hacía en una máquina como esta: registra en el log el adaptador que el dispositivo eligió — lo que convierte «los tests fallan en mi portátil» en un número que se puede leer. Es exactamente la información que me faltó durante media noche con el rojo de la iGPU, y por eso lo digo sin ironía: esto habría ahorrado una hora.
Lo que no verifiqué: el log de verdad en una máquina con dos adaptadores, porque el test comprueba la función que formatea la elección, no que se escriba en el
tracingdel proceso.@fiestorra on GitHub · 2026-12-03 04:17 UTC · original
Corrección de una frase mía en el comentario de arriba:
#2948no tiene conflictoEscribí «con un conflicto declarado contra
main» y era falso. Medido ahora:Y el único de los 32 viejos que choca es
#2958, no este. Confundí el fichero (host.rs, que también toca#3286) con un conflicto real, y son dos cosas distintas: dos PRs que tocan el mismo fichero chocan entre sí, no conmain.Lo que queda en pie del comentario: el cherry-pick aplica limpio, 716/1, el 1 es el de la iGPU, y el log del adaptador es la información que me faltó media noche.
Lo que se cae: la frase «pero el conflicto es de merge, no del parche» — no había tal conflicto que explicar. Y es el mismo error de forma que cometí con
#3209hace unas horas: describir el fichero que toqué, no el que choca.@merzleckeier on GitHub · 2026-12-03 04:28 UTC · original
Integration check on
main516c9eaa, #29485284c6ea, and #32868c56cb6b. #2948 merges cleanly withmain. With #3286 there is one content conflict inHost::create, in the startup log block just afterdsv_size.I kept #2948’s LUID lookup and structured diagnostic there and #3286’s high-performance selection and fallback earlier in
create. The resulting code queries the device’s actual LUID regardless of how its adapter was selected. It passescargo xwin check -p leonida-gpu --testsforx86_64-pc-windows-msvcwith Rust 1.98.1. The Windows test binary’sadapter_details_report_name_class_ids_and_video_memoryalso passed under Wine.That was a local integration check with a synthetic descriptor. Adapter selection on hybrid hardware was outside this run. 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.