d3d12: LEONIDA_TITLE_MEMORY_SCALE tells the title it has more of its console's memory (D3D12-TITLE-MEMORY-SCALE) #2851
Open
github-bot
wants to merge 7 commits from
github-bot/gh-2851 into main
AGit
pull from: github-bot/gh-2851
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!2851
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2851"
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?
@x2Tweek on GitHub · 2026-12-01 09:15 UTC · original
x2Tweek:d3d12-title-memory-scale→main· +73 −3 · 2 files · 7 commits · openClaimed in the coordination issue as: D3D12-TITLE-MEMORY-SCALE (#2570)
What and why
At 3840x2160 output with
-RayTracingand DLSS on Series X (with #2756 for a lit world through FidelityFX), the game runs at 0.1 to 0.2 fps. It is not the card or our submissions:LEONIDA_GPU_TIMING=1gives 63-78 ms on the card;the runtime's changes of mapping per frame), 3.9 s a frame holding title memory still.xmem's page-mapping counter shows the title mapping ~1.35 pages per call.The same run at 2560x1440 output reads 0.9 changes a frame and 17 fps, and at 3840x2160 without DLSS 0.7 changes and 7-10 fps. The title seems to size its own pools from the limit it reads at the start (
XMemGetWorkingSetStatistics, the adapter's description), and at 4K with ray tracing they no longer hold a frame, so it maps pages in and out one at a time.This adds
LEONIDA_TITLE_MEMORY_SCALE=<x>(1 unless set, clamped to 1-2.5):Console::title_memoryreturns the console's figures times that, in whole 2 MiB pages. Every reader of the figure (the working-set limit,XMemTransferMemory's cap, the adapter's description) sees the same value. Default behaviour is unchanged. The doc comment warns to keep it within what the PC has (at 2.5 a Series X title is told 34 GB and 25 GB of video memory).Different from RS-WORKING-SET-STATS (the "used" figure the title gets); this is the limit.
Tested
On Windows 11 Pro 26300, from current
main:cargo test -p leonida-gpu --lib --locked console::: the two new tests pass (parse and bounds of the scale; scaling keeps whole pages and 1 leaves the figures as they are).cargo test -p leonida-hle --lib --locked xmem: 24 passed (includingtransfers_shrink_the_title_budget).tools/d3d12_switches.py --outthen the new row only ind3d12/docs/switches.md.-RayTracing: scale 1: 0.1-0.2 fps, ~2,900 changes of mapping a frame; scale 2: 10.5 fps median, 2.0 changes a frame, picture correct (screenshot checked).GPUs tested: NVIDIA GeForce RTX 5090 32 GB (resizable BAR), i9-14900KS, 64 GB DDR5, Windows 11 Pro 10.0.26300.
AI-assisted: yes. Claude Opus 5.5 wrote and measured it; a separate Claude Opus reviewer agent reviewed it before this pull request (its should-fix points are in: the old
shortcutcomment that said the title sizes nothing from this figure is reworded, and the host-memory warning added).Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a)🤖 Generated with Claude Code
@fiestorra on GitHub · 2026-12-01 09:23 UTC · original
Verified on Windows: the crate is green with it, and it adds two tests - measured against
main's own file.main3bf2844a5, cherry-picked (one commit,merge-base76746d35b),cargo 1.98.1:So the two tests are tied to the change and nothing else in the crate moved. That is an existence control, not a mutation one - I did not remove the switch to watch a specific test fail, because the tests that come with it are the ones that would.
What matters for a new switch, and what this establishes:
LEONIDA_TITLE_MEMORY_SCALEis reachable and its two cases pass. What it does not establish is that a title given a different memory scale behaves - that needs the game, and this machine does not have the build for it.One thing worth adding to the pull request, since
docs/switches.mdnow has its row: what happens when the title asks for more than the card has. The document's other switches say when they refuse; if this one saturates or refuses, the row should say so, and if it cannot happen because the value is clamped before it reaches the title, that is worth a sentence too.AI-assisted: yes - DeepSeek v4.1 (flash), both arms on the machine above.
Written with an AI assistant.
@x2Tweek on GitHub · 2026-12-01 10:45 UTC · original
Thanks for checking it. Added in 5 lines of
title_memory's doc comment: nothing refuses or saturates on account of the switch. The value is clamped to 1-2.5 before the title is told. The figure is only what the title is told: the runtime checks neither the PC's memory nor the card's against it. What the title then commits beyond what the PC has fails as any commit over Windows' limit does. Theswitches.mdrow is unchanged, since it shows the first sentences only.On "a title given a different memory scale behaves": that part was measured in game (in the description). At 3840x2160 with ray tracing and DLSS, scale 2 takes the changes of mapping from ~2,900 to 2 a frame and the frame rate from 0.1 to 10.5 fps, with the picture correct. Without ray tracing, 1 against 2 by turns is 41.2 against 41.4 fps.
AI-assisted: yes, Claude Opus 5.5.
f47974b78bto586d02a755586d02a755tob4e0a76f6b@KelboLive on GitHub · 2026-12-01 17:55 UTC · original · reviewed
Verified:
scaled(console.rs:73-77) multiplies in f64, floors to 2 MiB pages, and all four constants are already page multiples — so scale 1 is a structural no-op, not just a tested one, and the 2.5 clamp caps at 25 GiB with no overflow path (f64is exact at 2^34, saturating cast far above).title_memory()is the only source of the figure (dxgi.rs:154,xmem.rs:2316,:2358), nothing else hardcodes 10/3.5 GiB, and nothing reserves against it, so "advisory only" is accurate. Tests pass here (2 + 24) on this branch and on today's main, and both mutations are caught:clamp(1.0, 3.5)fails withleft: 3.5, right: 2.5, and dropping the page floor fails withleft: 838860, right: 0.One thing before merge:
merge-treeconflicts ond3d12/docs/switches.md. Main is at673 names; 633and this PR hand-bumps664 → 665; the branch's own page is already three rows stale (this tree generates668/627). Please drop the header edit and regenerate with--outat merge time (post-merge it is674 names; 634). Notetools/d3d12_switches.py --checkcompares rows only, so a wrong count line sails straight through — which is exactly how the hand-bump got stale.Optional, not a blocker: the clamp is absolute, so a 12 GB card can be told 25 GiB of video memory. Capping against
QueryVideoMemoryInfo's budget would remove the "keep it within what the PC has" caveat and make the switch safe to leave on.Not verifiable here: the headline in-game measurement (2,900 → 2 page-mapping changes/frame, 0.1–0.2 → 10.5 fps) and the no-RT null result — that needs the title and game data. The switch is reachable; only its effect is unmeasured on this machine. No file overlap with #2900 (different lever, semantically complementary).
@andrew-ai on GitHub · 2026-12-02 00:32 UTC · original
Verified
b4e0a76f6on Windows x64. I compiled the unmodified console.rs in a small Rust harness and launched one process per LEONIDA_TITLE_MEMORY_SCALE value so the once-only read ran each time. For both Series X and Series S, current().title_memory() matched an independent whole-2-MiB-page calculation for unset, empty, malformed, NaN, positive and negative infinity, 0.125, whitespace-padded 1.375, 2, 2.5, and 3. All 22 profile results matched, including the zero GPU-optimal range on Series S. Scope was the console getter only. Game performance and downstream adapter reporting remain unverified by this check. Codex-assisted review.@MoonEyes on GitHub · 2026-12-02 12:29 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).
@Kal0s-design on GitHub · 2026-12-02 14:24 UTC · original
Ran natively on Windows 11, head
cf8f7be78merged into currentmain(2fc7383b9, no conflicts now; theswitches.mdconflict mentioned above is gone), toolchain 1.98.1,--locked. The parsing and the getter are already covered above. This run checks what the title is actually told downstream, one process per value, using throwaway ignored tests (not committed) that calladapter_description(dxgi.rs),XMemGetWorkingSetStatisticsandXMemTransferMemory.What the title is told (bytes, Series X / Series S)
LEONIDA_TITLE_MEMORY_SCALE1,0,-11.322.5,1e308For every value and both consoles:
title_memory().XMemTransferMemorytakes exactly the scaled standard range and refuses 2 MiB more, which leaves the limit at the GPU-optimal figure.So the three places that report the figure agree at every scale, and the transfer cap follows the scale. On Series S the GPU-optimal range stays 0 at any scale, so only the standard range grows.
Suites on the merge
leonida-gpu --libleonida-hle --libLEONIDA_TITLE_MEMORY_SCALE=2.5for the whole runClippy (
--all-targets, both crates) reports nothing inconsole.rs. Its one warning (host.rs:7633) is outside this diff.One small thing for merge time: on the merged tree
tools/d3d12_switches.py --checkpasses. But its count line still says681 names; 641, while--outnow gives682 names; 642. As noted above,--checkdoes not compare that line, so regenerating the page with--outat merge time fixes it.Not checked: the in-game effect (no game run here), and whether anything beyond these three figures in the title reads the memory size.
GPUs tested: n/a (CPU-only tests).
AI-assisted: yes (Claude Code).
@MoonEyes on GitHub · 2026-12-02 16:10 UTC · original
RUN (in game, batch of five render-path pull requests), each head merged with
git merge --no-ffonto main3c106eb2f, in one build: #2993ddc10507d, #2889bc390c26f, #2851cf8f7be78, #298012c14a999, #2994fccce4485. 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 16.7 fps today on main with single pull requests or other batches. 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 median 2.5 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:12 UTC · original
Checked #2851: the switches registry passes merged onto current
main(Linux); the Rust was reviewed, not built (Windows-only). Opt-in, off by default, in-game PASS at this head.cf8f7be785main45dc41f95c(clean merge tree9144c4fd59; merge base9b4d718992, 125 commits behind)b4e0a76f6), Kal0s-design (this head merged onto2fc7383b9), MoonEyes in-game PASS (2 December 16:10)Ran (Linux, on an export of the merge tree with its own
git init)Review of
d3d12/crates/leonida-gpu/src/console.rsLEONIDA_TITLE_MEMORY_SCALEis read once (OnceLock), parsed with NaN, infinity and non-numbers to 1, and clamped to 1 to 2.5. Both ranges are scaled and rounded down to whole 2 MiB pages. Unset gives exactly the old figures (tested for both consoles). The three callers (xmem.rsx3,dxgi.rs) only read the pair, so droppingconstfromtitle_memorycosts nothing.Verdict: ready.
AI-assisted: Claude Opus 5.5 (Claude Code), verification only.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
@MoonEyes on GitHub · 2026-12-03 00:02 UTC · original
RUN (in game, batch of nine pull requests), each head merged with
git merge --no-ffonto main81efe4566, in one build: #313674bd1bcd4, #315653c3100ce, #3206d024194b3, #3248efd21d867, #3256e7aad1d4c, #32623643c2879, #2851b83b0b375, #312589bf1d328, #2642164506d01. 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. The precompile before the world took 619 s, against 157 s for the previous batch; the shader-side changes in this batch (#3156, #3262) probably left the pipeline cache cold (not checked). Switches that are off by default (for example #2851'sLEONIDA_TITLE_MEMORY_SCALE, #3136's timeline attribution) were not turned on: this run covers their default path only. #2642 targets Wine and was run on Windows only.AI-assisted (Claude Code).
@MoonEyes on GitHub · 2026-12-03 06:47 UTC · original
RUN (in game, batch of four pull requests), each head merged with
git merge --no-ffonto maind9b618f10, in one build: #2851488416598, #3299898b87802, #3301670df262b, #33020bb75e0ba. 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. #2851 was in an earlier batch on another head; this run covers its current head, withLEONIDA_TITLE_MEMORY_SCALEunset. #3299's switch is opt-in and hardware ray tracing was not on in this 8 GB profile, so it was not exercised. #3302 changes where Pool allocations go by default; this run shows nothing fell over with it, not whether it saves memory. #3301 only reports failures; none was provoked. The precompile before the world took 468 s against about 155 s for most batches: something in this batch leaves the pipeline cache cold (not looked into).AI-assisted (Claude Code).
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.