d3d12: high-performance GPU selection, lock-free wide_each, and -Buil… #3286
Open
github-bot
wants to merge 1 commit from
github-bot/gh-3286 into main
AGit
pull from: github-bot/gh-3286
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!3286
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3286"
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?
@dannyhashim08 on GitHub · 2026-12-03 03:24 UTC · original
dannyhashim08:perf/seriesx-rtx5080→main· +72 −19 · 4 files · 1 commits · open…d play support
Claimed in the coordination issue as:
Depends on:
Fixes:
What and why
Tested
GPUs tested:
AI-assisted:
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.@merzleckeier on GitHub · 2026-12-03 03:30 UTC · original · reviewed
Reviewed
8c56cb6bmerged onto516c9eaa.scripts/play-d3d12.ps1entry point with a synthetic Cargo process and runtime. With a clean target directory,-Build playand-Build releaseboth invokedcargo build --profile diag, reported that the requested executable was missing, and returned 0 without starting it. With an existingplaybuild,-Build play -Rebuildstill builtdiagand launched the oldplaybinary. The defaultdiagflow and a prebuiltplaylaunch worked. Please pass the selected profile to the builder and return a failure if the requested executable is still absent.chosen_adapter()still logs that Windows’ default card will be used when an explicit selector matches nothing. That now enters the high-performance selection path first. Please align the warning and option documentation with that behavior.The Windows MSVC build passed under Wine 11.22. The five existing shadow worker tests passed, and a scratch test verified that four concurrent callers each visited every index exactly once before returning with 1, 3 and 7 helpers. The adapter change still needs a hybrid-GPU run. The profile probe used Linux PowerShell 7.7.0.
Please link the coordination claim and split the adapter, worker and launcher changes so each can be verified independently. AI-assisted with OpenAI Codex.
@fiestorra on GitHub · 2026-12-03 03:41 UTC · original
VERIFY-3286 — y esto es lo que más me ha sorprendido esta noche: su PR arregla el rojo de esta máquina
La suite entera, en su head:
Cero fallos. Y
maintiene 715 y uno. Así que fui a mirar el test concreto, en los dos árboles, con el mismo comando:El título lo dice: "high-performance GPU selection, lock-free wide_each, and -Buil…" — y
host.rs+shadow.rsson la selección de adaptador. El test que falla en esta máquina desde la primera hora de la noche es el que comprueba que un recurso se crea junto al montículo y se copia; aquí falla porqueD3D12CreateDevice(None, …)elige la Radeon integrada, y con esta PR la elección cambia.Lo que eso significa para el repositorio, y es lo que importa más que la PR: ese rojo no era un defecto del test ni del código del port — era una elección de adaptador que asumía «el predeterminado de Windows es la tarjeta buena». En una máquina de escritorio con una sola GPU eso es cierto; en esta —RTX 4090 e iGPU—, no. Y es la razón por la que mi
#2995propone lo mismo desde el lado del test (EnumAdapterByGpuPreference): dos arreglos del mismo supuesto, uno en el runtime y otro en la prueba.Lo que verifiqué y lo que no: que la suite entera queda verde en esta máquina con su cambio — y que el resto de su diff (
lock-free wide_each,-Buil…) no lo he mirado con la misma atención, porque 716 verdes no dicen nada de ununsafeque no se ejecuta en los tests.Lo que le pediría al autor, en una línea: si
#2995y esta entran las dos, el test quedaría pasando por dos razones a la vez — y eso es aceptable, pero conviene saberlo antes de que alguien atribuya el verde a una sola de ellas.Written with an AI assistant.
@MoonEyes on GitHub · 2026-12-03 03:43 UTC · original
RUN (in game, batch of three pull requests), each head merged with
git merge --no-ffonto main516c9eaab, in one build: #30314e59d46e8, #3284f9c588760, #32868c56cb6b9. 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. #3031 was in an earlier batch on another head; this run covers its current head. #3284 changes what is written to the pipeline book; whether a later start reuses it was not checked. #3286's card selection only matters when the PC has more than one card to pick from, and its build-script change was not exercised: this run covers the default path on one dedicated card.AI-assisted (Claude 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:27 UTC · original
#3286estáBLOCKEDpor una aprobación y no por CI, y es la que deja el crate entero verdeEstado medido ahora:
Sin checks y
BLOCKEDsignifica una sola cosa aquí: la protección demainpide una revisión aprobatoria, y no hay ninguna registrada. No es un conflicto (MERGEABLE), no es CI, no es un borrador.Y lo que aporta, medido esta tarde:
Es el único cambio de la cola que convierte el rojo de
leonida-gpuen verde, y el rojo es el que se come el CI de cada PR que toca ese crate. Mientras no entre, cada autor que toqueleonida-gpuva a ver un fallo que no es suyo — y el de esta noche lo ha visto en ocho PRs distintos.Y la pregunta que contesta de paso:
#2995(mío) hace lo mismo desde el aparato de test, así que si esto entra, aquel se cierra. Lo digo porque el orden importa: si se fusiona el mío primero, el rojo desaparece sin que nadie arregle el runtime, que es justo lo que el test estaba señalando.@merzleckeier on GitHub · 2026-12-03 06:37 UTC · original
I checked the descriptor test separately on
main(d9b618f1) and with8c56cb6bmerged in. Both Windows MSVC diag builds ran under Wine 11.22 / VKD3D-Proton 3.1 on an RTX 4070 SUPER and an AMD Raphael iGPU. I made the device/heap setup fail loudly and logged the device LUID's adapter, so none of these runs silently skipped the test.views_are_made_beside_the_heap_and_copied_incopied as it was madeLEONIDA_ADAPTER=4070LEONIDA_ADAPTER=RadeonBoth DXGI enumeration methods ranked the NVIDIA adapter first under this Wine setup. A Windows machine that defaults to its iGPU can give a different result. The failed assertion reads and compares 32 bytes at CPU descriptor handles. D3D12 specifies those handles as opaque, with layouts that can vary even on one device. A GPU readback of a known value through the copied view would test whether the copy works. Microsoft's descriptor heap docs
The two launcher profile failures in the earlier review are still present at this head.
@merzleckeier on GitHub · 2026-12-03 11:51 UTC · original
Integration check on
b053a181with #32868c56cb6band #33250162194c. The combination conflicts in the startup logging block. I kept this PR’s adapter preference and #3325’s singlelog_card()call. In a synthetic D3D12 startup under Wine/vkd3d-proton, automatic selection used the RTX 4070 SUPER andLEONIDA_ADAPTER=Radeonselected the iGPU. The adapter LUID in the metadata matched the actual D3D12 device in both cases. The unrecognized-selector fallback also chose the RTX. Two Wine runs aborted during process teardown after that test had passed.For the earlier launcher finding, I tested a local fix that passes
-Buildtobuild-nvidia.ps1and uses it for the Cargo profile andbuilt-with.txtpath. All five mocked PowerShell cases launched the freshly rebuilt profile, including both pre-existing and missingplayandreleaseexecutables and the defaultdiagcase.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.