d3d12: high residency priority for memory the card writes, opt-in (D3D12-RESIDENCY-PRIORITY) #3290
Open
github-bot
wants to merge 4 commits from
github-bot/gh-3290 into main
AGit
pull from: github-bot/gh-3290
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!3290
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3290"
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?
@OreoFR on GitHub · 2026-12-03 04:01 UTC · original
OreoFR:perf/residency-priority→main· +118 −0 · 2 files · 4 commits · openItem: D3D12-RESIDENCY-PRIORITY (claimed in #2570).
What and why
On an 8 GB card past its DXGI budget, Windows pages memory out without knowing what matters, and render targets can go too. This change gives committed render targets, depth and UAV memory in the card's own heaps
D3D12_RESIDENCY_PRIORITY_HIGHwhen they are made (host::resident). Past the budget, Windows then pages the title's plain textures out first. It is a hint only: nothing is read or written differently.LEONIDA_RESIDENCY_PRIORITY=1, off by default.d3d12/docs/switches.mdis regenerated.DARNER_RESIDENCY_PRIORITY(codefloe.com/TrustNo1/Darner, GPL-3.0-or-later like this repository), credited in the code.Tested
cargo test -q -p leonida-gpu: 718 passed, 0 failed, 59 ignored. This includes the unit tests for the priority rule.cargo clippy -q -p leonida-gpu --all-targets -- -D warnings: clean.python -I tools/d3d12_switches.py --check d3d12/docs/switches.md: OK.scripts/check_no_game_data.pyon the changed files: OK.516c9eaab.LEONIDA_RESIDENCY_PRIORITY=1against unset, the same session, median frame ms over the last 240 s, and device losses.AI-assisted (oreofr-agent, Claude Code).
🤖 Generated with Claude Code
@merzleckeier on GitHub · 2026-12-03 04:08 UTC · original · reviewed
Reviewed
5a016881on516c9eaa.LEONIDA_RESIDENCY_PRIORITYrow, while the header still says 684 names with 644 documented. Running--outproduces 685 and 645, with the header as the only diff. The current--checkpasses because it checks the set of names. The checker in #3270 correctly rejects the stale header. A clean merge with #3291 also needs a regeneration, since the combined table has 686 names.GetHeapPropertiesworks on placed and committed resources and fails for reserved resources. The currentresidentresource call sites I traced use committed resources, so please document that caller invariant whereprioritiserelies on it. The heap-properties call alone would not exclude a placed resource if a caller were added later.Catalog checks and call-site review only. AI-assisted with OpenAI Codex.
@OreoFR on GitHub · 2026-12-03 04:13 UTC · original
Thanks @merzleckeier, both fixed in
898de93c2.tools/d3d12_switches.py --out. The header now reads 685 names, 645 documented, and that is the only diff.--checkpasses. Whichever of #3290 and #3291 merges second needs one more regeneration, since the combined table has 686 names.GetHeapPropertiesfails for placed resources: it answers for placed and committed resources alike, and fails only for reserved ones. The doc ofprioritisenow states the caller invariant.resident()is handed committed resources, heaps (not anID3D12Resource, left alone) and reserved textures (skipped, sinceGetHeapPropertiesfails for them) today. A caller that passes a placed resource must not go through it. No behaviour change.cargo test -p leonida-gpu: 718 passed, 59 ignored.clippy -D warnings: clean.(oreofr-agent, AI-assisted)
@fiestorra on GitHub · 2026-12-03 04:46 UTC · original
VERIFY-3290 — 717/1: el 1 es el de la iGPU, y el cambio es opt-in, que es lo que quiero acreditar
717 contra los 715 de
main— dos tests nuevos, y la falla es la conocida de esta máquina.Lo que el cambio hace, por su título y su etiqueta:
ResidencyPriorityalta para la memoria que escribe la tarjeta, con un interruptor —opt-in, y ese es el detalle que quiero acreditar.Un cambio de política de residencia que está siempre encendido es un cambio que puede empeorar una máquina que iba bien — prioridad alta para un recurso empuja a otros fuera de la memoria, y cuáles son «otros» depende del juego. Que sea
opt-insignifica que el valor por defecto no cambia y el jugador que lo pruebe puede volver.Y la razón de que importe en este repositorio en particular: aquí cada cambio de memoria se mide en la misma máquina con el mismo título, y un cambio siempre-encendido invalida la comparación con las medidas anteriores, que es justo lo que
gpu-test-results/guarda. Un interruptor es lo que permite añadir una fila en vez de romper la tabla.Lo que no verifiqué: que la residencia alta gane algo — necesita el título, la GPU y una medida de fps o de consumo de memoria, y el test sólo comprueba que el interruptor pone la prioridad donde dice.
Written with an AI assistant.
@MoonEyes on GitHub · 2026-12-03 05:01 UTC · original
RUN (in game, batch of three pull requests), each head merged with
git merge --no-ffonto maind9b618f10, in one build: #3290898de93c2, #3293fae5bd4b5, #32949582059a2. 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. Two heads moved during the run: #3293 to
2abd0c4c4, which only regeneratesd3d12/docs/switches.md(git diff fae5bd4b5 2abd0c4c4outside*.mdis empty), and #3294 toac8af63e1, which only merges maind9b618f10, the same main this batch was built on (git diff d9b618f10 ac8af63e1is the same one-file change tolower.rsthat was tested). This run therefore also stands for those two new heads.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. #3290's switch is opt-in and was left off. #3293 targets AMD: on this NVIDIA card it shows no regression on the default path only, and the run on an RDNA4 card is still needed. The precompile before the world took 538 s against about 155 s for most batches tonight: the translator change leaves the pipeline cache cold.AI-assisted (Claude Code).
@OreoFR on GitHub · 2026-12-03 05:02 UTC · original
RUN: #3290
LEONIDA_RESIDENCY_PRIORITY=1, A/B over the VRAM budget, RTX 4070 Laptop 8 GB (Verified by OreoFR)898de93c29eb1e9a8d0794d9880ef9f344c4da7f, which already contains main516c9eaab.d3d12\scripts\build-nvidia.ps1(diag).scripts\play-d3d12.ps1on the Series X profile,-NoDlss -NoFrameGen -PrecompileUsed -Log,LEONIDA_WINDOWS_BAR_MB=0;LEONIDA_RESIDENCY_PRIORITY=1.LEONIDA_TEXTURE_BUDGET_MB=1024the process stayed under budget: a peak of 5666 MB of 6988 MB, 81 %, at 20.16 fps. That run is not in the table.LEONIDA_TEXTURE_ROOM_PERCENT=97andLEONIDA_CARD_ROOM_FOR_TARGETS_MB=0.Window: the last 240 s in the world.
Verdict: MEASURED n=2, PROVISIONAL.
AI-assisted (oreofr-agent)
@MoonEyes on GitHub · 2026-12-03 15:04 UTC · original
Run in game on an RTX 4060 8 GB (Series S 1080, FG 2x, main
b053a1813with this PR), A B B A, 330 s each, A =LEONIDA_RESIDENCY_PRIORITY=0, B ==1. Median fps over the last 240 s:No device lost in the four runs. With the setting: +0.85 fps (15.65 → 16.5, +5 %) and 19 % fewer frames over 100 ms. A2 is 0.9 fps above A1, so part of the gap can be drift; the A B B A order offsets some of it. This card runs at its budget (~6.8 GB), so a modest gain is what we expected, far from the large gain reported on a card well over its budget. Prediction written before the runs: −0.5 to +1.5 fps and 10-40 % fewer long frames; it held.
@MoonEyes on GitHub · 2026-12-03 15:30 UTC · original
In-game gate run on an RTX 4060 8 GB (driver 610.88, Windows 11), in a batch of #3290, #3291, #3293, #3296 and #3297 merged into main
b053a1813; this PR tested at its current head3c9213202. Series S 1080, DLSS FG 2x,play-nvidia.ps1 -SeriesS -Resolution 1080 -FrameGen 2 -PrecompileUsed, scripted walk, 330 s, no extra switch set.AI-assisted (Claude Opus 5.5), run and read by MoonEyes' agent.
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.