Repository navigation
Conversation
|
Verified on Windows: the crate is green with it, and it adds two tests - measured against
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: One thing worth adding to the pull request, since 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 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. |
f47974b to
586d02a
Compare
KelboLive
left a comment
There was a problem hiding this comment.
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 (f64 is 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 with left: 3.5, right: 2.5, and dropping the page floor fails with left: 838860, right: 0.
One thing before merge: merge-tree conflicts on d3d12/docs/switches.md. Main is at 673 names; 633 and this PR hand-bumps 664 → 665; the branch's own page is already three rows stale (this tree generates 668/627). Please drop the header edit and regenerate with --out at merge time (post-merge it is 674 names; 634). Note tools/d3d12_switches.py --check compares 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).
…console's memory (D3D12-TITLE-MEMORY-SCALE) At 3840x2160 with ray tracing and DLSS on Series X the title's own pools no longer hold a frame and it maps its pages one at a time: about 2,900 changes of mapping a frame, 5.6 s of kernel time a frame, 0.1 fps. With 2 the same run reads 2.0 changes a frame and 10.5 fps; without ray tracing nothing changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…saturates on account of it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
586d02a to
b4e0a76
Compare
Claimed in the coordination issue as: D3D12-TITLE-MEMORY-SCALE (#2570 (comment))
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