d3d12: LEONIDA_TITLE_MEMORY_SCALE tells the title it has more of its console's memory (D3D12-TITLE-MEMORY-SCALE) #2851
Code
Clone this repository
Checkout
From your project repository, check out a new branch and test the changes.
git fetch -u origin "github-pr/2851:github-pr/2851" git switch "github-pr/2851"
Open
leonida/mandy
x2Tweek wants to merge 7 commits from
github-pr/2851 into main
pull from: github-pr/2851
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
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
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!2851
Loading…
Reference in a new issue
No description provided.
Delete branch "github-pr/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?
This branch is out-of-date with the base branch
Reviewers 0 approvals
Details
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Claimed in the coordination issue as: D3D12-TITLE-MEMORY-SCALE (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7306421400)
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
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.
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.
Verified b4e0a76f6 on 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.
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).
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).
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).
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
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).
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).