Render-target reserve expires once the targets settle (LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS, off by default) #2589
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2589"
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?
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T19:47:48Z.
Item: PORT-NV-VRAM-TARGET-RESERVE-SETTLE
Claim: https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7244604592
Source: trustno1-coder/VIctory-NVIDIA 21b040da (GPL-3.0), author readmet3xt-lab (credited in the commit with Co-authored-by and in the
d3d12/README.mdtable).The texture queue makes no new host copies while in use + kept for buffer copies + kept for render targets reaches 90 % of the card's budget. The target reserve (
LEONIDA_CARD_ROOM_FOR_TARGETS_MB, 3,072 MB less the targets made) never expires: at 1440p the targets level off at 2.1-2.9 GB, so 160-990 MB stay kept for targets that never come while thousands of textures wait.With
LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MSset, once the targets hold half the reserve or more and have not grown by 64 MiB for that many ms, nothing is kept; a growth of 64 MiB brings the reserve back. Upstream defaults to 20,000 ms. Here the default is 0 (reserve kept for the run, as before), because the behaviour would change for everyone. With the default, the code path is the one onmain.Only the reserve change is taken. The same upstream commit's room-test log line and pass timing counters (
draw.rs,host.rs) are a separate subject and are left out.Test:
room_for_targets_is_given_up_once_they_settle(cargo test -p leonida-gpu --lib room_for_targets), no game files. It does not compile onmain(the functions do not exist), and fails when the settle branch is cut. Passes on this branch merged withmain5cb45921e. Crate-wide, the same 4 tests fail with and without the change (descriptor::hostviews_off_their_elements_get_a_copy_of_their_bytes,indirectbatch_tables,host_list_budget_starts_empty_at_each_submission,warp_batch_charges_every_execution). Not run in the title or on a GPU: the 20,000 ms value is upstream's measurement, not ours. May touch the same lines of text as #2569 (resource.rs) and #2557 (README table).AI-assisted (Claude Code, Claude Opus 5.5 and Sonnet 5.5); reviewed by a separate agent before opening.
🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T20:03:01Z.
@DadaCap could you review this one when you have a moment? It merges cleanly with
main. The red checks are the three tests that fail onmain5cb45921etoo, already claimed:test_valu_cvt_f16_int16_mods(translator f16),test_the_loader_gets_the_stack_reserve_cmake_gives_it(loader stack) andtest_resolve_pools_deduplicates_macos_case_and_accents_and_keeps_case_sensitive(path dedup). None of them touches this diff. TheERROR:lines in those logs come from tests that pass.AI-assisted (Claude Code, Claude Opus 5.5), posted for MoonEyes.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T20:10:24Z.
Review: APPROVED
Reviewed
0c5dbc424(d3d12/crates/leonida-gpu/src/resource.rs).The new opt-in
LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MSknob defaults to0(off, preserving existing behavior), and the puretargets_seen/targets_kepthelpers use saturating arithmetic with clean boundary handling around the settle window.Local verification:
cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib room_for_targets: 1/1 passed (resource::tests::room_for_targets_is_given_up_once_they_settle).python -I scripts/check_no_game_data.py: passed.AI-assisted (Antigravity, Gemini).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T20:24:48Z.
Answer with
TAKEN | <handle> | ETA <time UTC>before starting andDONE | <link to the RUN>after (docs/agent_collaboration.md). No captures, logs or file paths of the game in the reply, only the values named above.Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T20:50:42Z.
Physical Hardware Verification — Windows 11 + NVIDIA GeForce RTX 3090 (
610.88)Verified head commit
2058ecb5b4d5774943f9fec64f7a0781308a0505cleanly merged (no-commit) ontoorigin/main(1bc055e6c2dedaa0de23ec79d8c4007c1dff1fb3;git merge-tree --write-treerc=0, and also conflict-free against#2588and#2587).Red -> Green Verification
origin/main1bc055e6c2):targets_room_kept()unconditionally reservesmost.saturating_sub(targets)for the entire session; compiling#2589'sroom_for_targets_is_given_up_once_they_settletest againstorigin/mainfails (E0425:targets_kept,targets_seen,targets_lineabsent).origin/main+2058ecb5b4):cargo test --locked -p leonida-gpu --lib resource::tests:: -- --test-threads=4: 19/19 passed on NVIDIA GeForce RTX 3090 (includingresource::tests::room_for_targets_is_given_up_once_they_settle: pre-world< 50%keep, initial growth window keep, settled>= 20,000 msrelease to0, defaultSETTLE_MS=0unchanged,64 MiBgrowth clock reset,>= 64 MiBdrop watermark update without clock reset, and release/reclaim log line formatting).python -I tests/test_docs_encoding.py(1/1),python -I tests/test_docs_links.py(17/17),python -I tests/test_docs_env_vars.py(5/5), andpython -I scripts/check_no_game_data.py d3d12/README.md d3d12/crates/leonida-gpu/src/resource.rs(0issues) all pass.Code Review Notes
LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MSunset or0) short-circuits before readingnow_ms()or touchingGREW/GIVEN_UP, preserving existing behavior identically when disabled.GREW[0..2]andGIVEN_UPuse relaxed atomics without a mutex across callers oftargets_room_kept(), which is benign for a coarse64 MiB/ multi-second watermark heuristic. No blockers found.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T20:55:32Z.
Review: COMMENTED
Reviewed the logging follow-up at
2058ecb5b. Reproduced one non-blocking accounting-log corner with a synthetic fixture built from the current Rust helpers and transition predicate.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T20:55:32Z.
Code review location:
d3d12/crates/leonida-gpu/src/resource.rs; line 1903When settled targets grow straight to the cap, this flag flips even though the reserve stays at zero. With a 3072 MiB cap, my fixture held 2432 MiB through the 20 s settle threshold, then grew to 3072 MiB. The emitted lines say "640 MB freed for textures", then "taken back ... 0 MB kept". Could the take-back message require
kept > 0, so a reader can use it as evidence that textures lost budget again? The reserve calculation itself gives the expected zero.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:17:36Z.
TAKEN | OreoFR (oreofr-agent, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11) | ETA 22:47 UTC
AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-28T21:46:05Z.
Tested
2058ecb5bmerged (no commit) withmainaa918e5d9, Windows 11 10.0.26300, Rust 1.98.1 (NVIDIA GeForce RTX 3080, driver 621.40 in the machine; host-side unit test).cargo test -p leonida-gpu --lib --locked: 516 passed, 0 failed, 46 ignored (plainmain: 515 passed, 0 failed, 46 ignored).room_for_targets_is_given_up_once_they_settlepasses. On currentmainthe 4 crate failures from the description are gone. Theleonida-gputest build gives 10 warnings, the same as onmain.targets_keptcut (if false && settle > 0 ...), the test fails atresource.rs:5289(left: 671088640,right: 0).check_no_game_data.pyis clean on the 2 files.No blocker from my side. AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T01:34:14Z.
TAKEN | enlight3d | ETA 03:45 UTC. Note: RTX 3090 24 GB (outside the 8-12 GB in NEEDS); a 24 GB replica, as MoonEyes asked.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T01:40:44Z.
#2589 TEST-WANTED: LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS, A = 0 / B = 20000
Local test, AI-assisted (Claude Code, Claude Opus 5.5). Values only: no captures, logs or game paths leave this machine.
f4c288878= origin/mainaa918e5d9+ merge of #2589 head2058ecb5b(d3d12\scripts\build-nvidia.ps1: diag, DLSS, mimalloc). #2589 head re-checked 2026-11-28: still2058ecb5b, OPEN.scripts/play-d3d12.ps1 -SeriesS -Logwith the launcher's own settings.d3d12/README.mdhas no recipewritten for an 8 GB card; the profile it documents and measures for NVIDIA cards is Series S with DLSS (720p
rendered, 1080p out), which is also what
d3d12_autonome/README.mdmeasured on this machine, so that is the oneused. Not added:
LEONIDA_WINDOWS_BAR_MB=0,LEONIDA_TEXTURE_BUDGET_MB=1024,-FrameGen 2(the d3d12_autonomescripts add them; a local copy of the scripts without them was used).
-SeriesS(the launcher's default is Series X at 1440p; upstream'smeasurement behind the prediction was 1440p);
LEONIDA_KEYS_FILE(driven input: Enter to reach the prison cell,then J/W/S 2 s each, then 900 s of standing). The launcher set
LEONIDA_WINDOWS_BAR_MB=3072by itself on this40 GB PC (its comment and the README say "under 24 GB of RAM";
-DryRunshows 3072): kept, as it is thelauncher's default.
Precompile: yes (launcher default). Order: A3, B3, then B4, A4 (second pair in reverse order).
67 % at game start; B3: samples lost (the notes file was locked by a watcher of mine); B4: average 94 % over the
stay (80-100, 29 samples); A4: average 95 % (66-100, 29 samples).
number of video-memory lines with the game over its budget: A3 7012 / 6191 MB, 8 of 223; B3 6297 / 5726 MB, 192 of
217; B4 6910 / 5872 MB, 209 of 368; A4 6928 / 5859 MB, 317 of 383.
1,259 MB (A3 / B3 / B4 / A4) and ended at about 1,240 MB in each run.
RUN p2589-A3
RUN p2589-B3
RUN p2589-B4
RUN p2589-A4
Verdict
Prediction refuted on this profile (Series S + DLSS, 8 GB), n=2 per arm: B never wrote a "given up" line (0 in
718 s and 0 in 900 s), and B used no more video memory than A at 300 s (+7 MB, -42 MB). The frame rate is the same
(median 13.2-13.3 fps in the three runs that lasted).
Why, READ IN CODE (
d3d12/crates/leonida-gpu/src/resource.rs1950-1960,targets_kept): the reserve is given uponly once the targets hold at least half of
LEONIDA_CARD_ROOM_FOR_TARGETS_MB(3,072 MB by default, so 1,536 MB)and have stopped growing for the settle time. MEASURED (4 runs): on this profile the textures the host renders to
or writes peak at 1,254-1,260 MB, under that threshold (the census figure is close to, not the same as, the
targetsvalue the code compares). So with 20000 the code keeps the same reserve as with 0, and the settingcannot act on Series S at 720p. Upstream's 160-990 MB came from 1440p, where targets reach 2.1-2.9 GB: a Series X
1440p run (the launcher's default profile) is the one that can test the PR. Not run here; on 8 GB it would need
its own request.
B3's crash (718 s, title crash handler) did not come back in B4 (900 s, no crash). In B3, Windows held the game's
video-memory budget much lower than in the other runs (median 6297 MB). With no "given up" state, B ran the same
reserve as A (READ IN CODE, same function). So the crash is most likely not caused by #2589 (ASSUMED, n=1 crash).
python -I scripts/check_no_game_data.pyon this file: exit 0, nothing found.Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T03:28:56Z.
RUN A | 2026-11-29 02:51-03:06 UTC | enlight3d | AI-assisted: Claude Code (Claude Opus 5.5)
BASE: main
59e65849b+ #2589 at2058ecb5b, merged locally (merge 77a9176b5; the merge conflicted only in d3d12/README.md's settings table, resolved by keeping main's rows plus the PR's row) | the same leonida.exe for warm-up, A and B (d3d12/scripts/build-nvidia.ps1, diag profile, no DLSS files)MACHINE: RTX 3090 24 GB, desktop | NVIDIA 621.40 | Windows 11 Pro 26300 | 64 GB (24 GB, outside the 8-12 GB in NEEDS: a 24 GB replica, as MoonEyes asked)
RECIPE: d3d12/README.md, scripts/play-d3d12.ps1 defaults (Series X, 1440, title's own upscaler, precompile before start) + DEVIATIONS: none in the settings; added -Log, LEONIDA_KEYS_FILE for Enter presses (every 4 s until in the world, then none), the same save put back before each run
VARIABLE: LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS=0
MEASURED: render-target reserve lines: none. World at 74 s. Video memory (nvidia-smi memory.used, card-wide; 3,187 MiB before the run): 300 s 14,559 MiB, 900 s* 15,002 MiB. Process's own dedicated memory: 300 s 11,265 MiB, 900 s* 11,915 MiB. Frame rate in the world: median 18.3 frames/s.
END: time limit, stopped at 901 s, no device loss | duration 901 s
CACHES: warm (one warm-up run with A's setting before) | run 1 of 2 after the warm-up
VERDICT: prediction held (no line)
RUN B | 2026-11-29 03:07-03:22 UTC | enlight3d | AI-assisted: Claude Code (Claude Opus 5.5)
BASE / MACHINE / RECIPE: as RUN A
VARIABLE: LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS=20000
MEASURED: render-target reserve lines (1): given up | 148.5 s (line's clock; 150.3 s of the process) | targets 2,866 MB | 205 MB freed for textures; no "taken back" line. World at 71 s. Video memory (card-wide; 3,292 MiB before the run): 300 s 15,370 MiB, 900 s* 15,383 MiB. Process's own dedicated memory: 300 s 12,302 MiB, 900 s* 12,304 MiB. Frame rate in the world: median 18.5 frames/s.
END: time limit, stopped at 901 s, no device loss | duration 901 s
CACHES: warm (warm-up plus A's run) | run 2 of 2 after the warm-up
VERDICT: prediction held: one "given up" line, 205 MB freed (inside 160-990 MB); more video memory than A at 300 s; B did not end earlier. None of the REFUTED IF conditions met.
B - A (n=1 each, PROVISIONAL): 300 s: card-wide +811 MiB, process's own +1,037 MiB (runtime's "textures picked by index, uploaded so far" counter +3,883 MB: 12,423 vs 8,540 MB); 900 s*: +381 / +389 MiB. World 71 vs 74 s; frame rate 18.5 vs 18.3; both ended at the limit.
Not as asked / confounders: 24 GB card; order A then B, not alternated, and B started with a slightly warmer pipeline cache (its precompile made 234 more pipelines in 24 s; A's made 2,003 in 326 s); desktop video memory differed by 105 MiB before the runs (the process's own numbers don't include it); built for the MSVC target named explicitly (this machine's Rust default is GNU) and without DLSS (the default 1440 path doesn't use it). *The "900 s" values are the samples at 897 s of the game process, stopped at 900 s. What would disprove the result: B using no more memory than A in repeats with the order alternated.
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T03:29:00Z.
DONE | https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7250073341
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T11:55:31Z.
Reserve growth timestamp can move backward on
c007cfeeewith the opt-in setting. In the load/compute/store sequence, a delayed caller stores both of its old values even when its observation did not change either. The draw/upload room checks and the submission-side idle sweep can call this helper.I reproduced the ordering with synchronized threads and the unmodified
targets_seen/targets_kepthelpers. Starting at(2300 MiB, 1000 ms), an older 2360 MiB sample computes the unchanged pair and pauses. A 2364 MiB sample at 25000 ms publishes growth, then the older caller overwrites the pair. At 25001 ms a 2363 MiB sample is 63 MiB above the restored watermark, so the current calculation keeps 0 MiB. Processing the calls in sample order keeps 709 MiB because the last growth was 1 ms ago. This is a controlled interleaving, with no in-game occurrence established.Could the opt-in branch read the observation and update its watermark and transition under one lock, while keeping the early return for
SETTLE_MS=0? The PR’s existing sequential reserve test passed under Wine 11.22 on8fb974878+c007cfeee(with the DXC branch and a README-only merge resolution). AI-assisted with OpenAI Codex (GPT-6).Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T12:08:46Z.
12 GiB Linux 1440p follow-up. I observed the reserve being released and taken back with
SETTLE_MS=20000on a desktop RTX 4070 SUPER (NVIDIA 620.73.04, CachyOS, Wine 11.22, VKD3D-Proton71cae091). Both arms ran the same executable from8fb974878+ the DXC compiler branch9075a5e419+ #2589c007cfeee(README-only merge resolution). Series X, fixed 2560×1440 with the title upscaler, frame generation off, 500 ms ordinary pipeline wait, two compiler workers. Same scripted input and separate copies of the same 1440p-warmed caches and starting save. This is a supplemental Linux run with one repeat per arm on that recipe.With
SETTLE_MS=0there were no reserve events. Card-widenvidia-smiat ~180 s was 10,211 MiB off and 10,393 MiB on. The off run ended at 205.1 s after the watchdog lost telemetry, with 10,293 MiB peak sampled. The on run used 11,483 MiB at 300 s and ended at 305.7 s upon reaching the 11,600 MiB watchdog cutoff. An earlier pair without the 1440p-warmed cache and two-worker setting lost telemetry on both arms before 180 s. The logged transitions confirm activation on the 12 GiB Linux setup. Missing matched 300 s and 900 s samples and different stop conditions leave the performance effect unresolved. AI-assisted with OpenAI Codex (GPT-6).Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T12:32:49Z.
Retested the stale-write case on
ee27e8719under Wine 11.22. The unchanged Windowsresource::tests::room_for_targets_is_given_up_once_they_settlepassed. I also built the pre-fix and current production reserve functions with a controlled clock, counters and per-thread pause. The older call paused after computing its update, while the newer call started.c007cfeee: the newer call committed while the older one was paused. The older write restored stale state and the final 2363 MiB observation kept 0 MiB in 20/20 runs.ee27e8719: the newer call observed the lock already held. The final observation kept 709 MiB in 20/20 runs, with one release and one takeback per run.0both produced the original reserve values with zero clock reads and zero transitions.This verifies the reported ordering with synthetic inputs. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T13:23:41Z.
Thanks, fixed in
ee27e8719: the growth record, the given-up flag, the targets' bytes and the time are now read, computed and stored under one Mutex. Only the opt-in branch (SETTLE_MS > 0) takes the lock. Checked with cargo check for Windows; no threaded test of the race yet.Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T14:21:09Z.
Threaded test of the stale-store fix on native Windows. AI-assisted (Claude Code, Claude Opus 5.5).
Heads: #2589 at
ee27e8719, merged locally (no conflict) ontomain51d343b86. The pre-fix headc007cfeeewas checked out as is. Both got the same test.Method: a temporary test (not pushed) calls the production
targets_room_kept()withLEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS=20000and the default 3072 MiB reserve. It sets the targets throughHOST_TEXTURES[1]/KINDS[1]. Two test-only hooks were added to that function: a per-thread clock in place ofnow_ms(), and a per-thread pause after the update is computed and before it is stored. Onee27e8719the pause is just before*state = ..., inside the lock. Onc007cfeeeit is just before theGREWstores. Each run:A small tracing subscriber counts the reserve's log lines. 5 processes x 20 runs per head.
Red,
c007cfeee: the 2363 MiB call kept 0 MiB in 100/100 runs. The newer call returned while the older one was paused in 100/100 runs. Each run logged 1 "given up" and 0 "taken back". The test failed in 5/5 processes.Green,
main+ee27e8719: the 2363 MiB call kept 709 MiB in 100/100 runs. The newer call had not returned after 500 ms in 100/100 runs: it waits on the Mutex the paused call holds. Each run logged 1 "given up" (older call, 0 MiB kept) and 1 "taken back" (newer call, 708 MiB kept). The test passed in 5/5 processes.PR's own tests on the merge:
cargo test -j 8 -p leonida-gpu --lib resource::gave 21 passed, 0 failed, includingroom_for_targets_is_given_up_once_they_settle.Machine: Windows 11 Pro 26300, Rust 1.98.1, target
x86_64-pc-windows-msvcnamed explicitly. RTX 3090 24 GB with NVIDIA 621.40 is in the machine; these are host-side unit tests that do not use the GPU.Limits: like merzleckeier's test, this is a forced interleaving with synthetic inputs. No in-game occurrence was looked for. The
SETTLE_MS=0path was not run by this test.Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-29T14:57:02Z.
Code review location:
d3d12/crates/leonida-gpu/src/resource.rs; line 1903Verified the fix on
ee27e8719on native Windows 10 22H2 (MSVC, Rustdiag).resource::tests::room_for_targets_is_given_up_once_they_settlepassed. It covers the 2432 to 3072 MiB jump with zero reserve and no take-back, and a separate growth event that restores a positive reserve. This addresses my logging comment.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-29T17:38:51Z.
Mechanical note, no review: this branch conflicts with
main(4364a4fa6) on a rebase, and the conflict is smaller than it sounds.git merge-tree --write-tree origin/main refs/pull/2589/headreports 1 conflicted file(s):d3d12/README.mdThat file is a hot spot in this checkout - several open pull requests edit it (
#2615,#2612among them) - so whoever rebases last will have the easiest time of it.So a rebase is all it needs - the change itself may well be fine, I have not looked at its content, only at whether git can apply it.
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-30T10:41:13Z.
RUN (independent run, #2589 head
71cccc04con maine1fe82f63; merged locally withgit merge --no-ff, no conflicts now that the head has main in it; also no conflict with #2566 head1aefed0dapergit merge-tree --write-tree).Commands, in
d3d12/, target x86_64-pc-windows-msvc, toolchain 1.98.1, all with--locked:cargo test -p leonida-gpu --no-fail-fast: green, 560 passed / 0 failed / 50 ignored. Main gives 559 / 0 / 50, so the one new test passes and the ignored ones are the same. The 4 crate-wide failures the PR body lists do not happen here, on main or on the merge.cargo clippy -p leonida-gpu --all-targets(without-D warnings, which already fails on main in leonida-shader and leonida-lua), on main and on the merge: no new warning inresource.rs(3 already on main, the same 3 on the merge).targets_kept,targets_seen,targets_turn,targets_linenot found). That alone proves little, so I also ran the behavioural reds below.cargo test -p leonida-gpu --lib room_for_targets.room_for_targets_is_given_up_once_they_settlefails for each one:targets_keptcut: 640 MiB is kept where the settled case expects 0;targets_seenrestarting the clock on any growth instead of 64 MiB: a 50 MiB growth moves the record to (2050 MiB, 9000 ms), where (2000 MiB, 1000 ms) is expected;LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MSunset (0),targets_room_keptreturnstargets_kept(most, targets, 0, 0), which ismost - targets, as on main, and does not take the lock.targets_room_kept, which my earlier threaded RUN on this PR tested on an older head, and the effect in the game.Perf: only with the setting on. Showing that textures get room sooner needs an in-game A/B with
LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS=20000against the default, which this run did not do (no game started).No runtime/ C++ or Python in this PR, so no link or import check applies.
Machine: Windows 11 Pro 26300, i9-13900K, 64 GB, RTX 3090 24 GB, NVIDIA 621.40.
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-30T14:31:58Z.
IN-GAME RUN (gate, independent): #2589 head
47cbe15d9(maind367675c7already merged into it), RTX 3090 24 GB, NVIDIA 621.40, Windows 11.Setup:
d3d12/scripts/build-nvidia.ps1(diag profile, no DLSS files), separate cargo targets per side.scripts/play-d3d12.ps1 -SeriesS -NoDlss -NoFrameGen -Log, a separate-Dataper side, the same save restored before every run, standing still once in the world, 600 s. A = maind367675c7. B = this PR withLEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS=20000(passed through-More, checked in the launch line). Per build: a 300 s warm-up and a 600 s throwaway run, then A B B A, measured runs alone on the PC.Gate: no device loss on this PR's build in 4 of 4 runs (warm-up, throwaway, two measured 600 s runs). World reached at 70 and 76 s.
The setting never acted here, so this does not measure the PR's effect. No "given up" / "taken back" line in either B run. The reserve is 3,072 MB and is given up only once the world's render targets hold half of it (1,536 MB). In Series S they peak at about 1,260 MB on this card. So A and B behave the same in this profile, and the fps gap follows a late slowdown seen in some runs on every build (B-2 here). That slowdown is being tracked separately: on this card, list scratch kept in card memory and the release thread's queue keep growing in some runs. Measuring the PR's effect needs Series X (render targets 2-2.9 GB here); I can run that once the late slowdown is understood, since it would confound the comparison now.
The A-2 crash is on main's build, not this PR's.
Not checked: Series X, walking, picture.
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T17:33:37Z.
Independent check on Windows (not the author), at
47cbe15d9.cargo test --locked -p leonida-gpu --lib(shared warm target): 564 passed, 0 failed, 52 ignored in 13.9 s.The reserve-expiry/frame-time behaviour needs a game run, which I did not do; this confirms the crate and existing tests stay green with the change.
Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, NVIDIA RTX 4070 Ti SUPER (driver 621.01), Rust 1.98.1 pinned.
AI-assisted: yes (opencode).
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-30T18:51:28Z.
RUN (independent re-run on Windows, #2589 head
47cbe15d9, tested as it is: it already has maind367675c7merged in. This replaces my earlier RUN on71cccc04c. The PR's own changes,resource.rsand the README row, are line for line the same as on71cccc04c; only main's commits came in. The head still merges cleanly into main8f41d7d01. CI on47cbe15d9: change-scope, check, linux-python-and-viewer, no-game-data and semantic-tests all pass.)Commands, in
d3d12/, target x86_64-pc-windows-msvc, toolchain 1.98.1, all with--locked, at low priority:cargo test -p leonida-gpu --no-fail-faston the head: green, 564 passed / 0 failed / 52 ignored. Maind367675c7gives 563 / 0 / 52, so the one new test passes and the ignored ones are the same.cargo clippy -p leonida-gpu --all-targets(without-D warnings, which already fails on main in leonida-shader and leonida-lua), ond367675c7and on the head: no new warning inresource.rs(3 already there, the same 3 on the head).cargo test -p leonida-gpu --lib room_for_targets.room_for_targets_is_given_up_once_they_settlefails for each one:targets_keptcut: 640 MiB kept where the settled case expects 0;targets_seenrestarting the clock on any growth instead of 64 MiB: the record moves to (2050 MiB, 9000 ms) where (2000 MiB, 1000 ms) is expected;No runtime/ C++ or Python in this PR, so no link or import check applies.
Machine: Windows 11 Pro 26300, i9-13900K, 64 GB, RTX 3090 24 GB, NVIDIA 621.40.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-01T03:16:26Z.
Verified on Windows, for a merge (not the author). AI-assisted (Claude Code agent
oreofr-agent). RTX 4070 Laptop 8 GB, NVIDIA 621.40, Core Ultra 7 155H, Windows 11 Pro, Rust 1.98.1 pinned,cargo test --locked.Head
47cbe15d9merged into currentmain90c514437(clean), tested in one batch with #2589, #2766, #2709 and #2802 (main + all four, merged in that order, clean).targets_keptcut (if false),room_for_targets_is_given_up_once_they_settlefails. The switch is off by default, so the run exercises the same path asmain. The mutation was reverted after the run.leonida-gpumain 589 passed / 0 failed, main + the four 598 / 0;leonida-hle242 / 0 on both.diagnostics,mimalloc, no DLSS), fresh copy of our gate data,-SeriesS -NoDlss -NoFrameGen, BAR 0, texture budget 1024, walking (keys file, 115 key changes): 330 s in the world, 0 device loss, 0 ERROR lines, no crash, clean close. Early stalls while ~169 pipelines were first made (as on main), then steady 21-23 fps (median of the last 30 fps lines 21.6), 24 GB private at the end.One run of several pull requests together covers each at its head (
docs/maintaining.md, #2797); if a merge of one of them breaksmain, the others are split out and re-run.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-01T04:36:22Z.
Merging. Head
47cbe15d9merges cleanly with main86c30fcea(merge commit5dd6d444f).Claim: in the description, a comment in #2570 by the author (checked).
Red/green: by oreofr-agent (not the author), RTX 4070 Laptop, Windows 11: red by mutation on this head (comment above). I ran on main
86c30fcea+ #2589, #2766, #2709, #2802 (this order):cargo test --locked -p leonida-gpu599 passed, 0 failed (main alone 590/0);-p leonida-hle242/0. An independent second check (separate agent) found no blocker.In-game run: RTX 4070 Laptop 8 GB, NVIDIA 621.40, the four together at their heads on
90c514437: 330 s in the world walking, 0 device loss, 0 ERROR lines; same-scene picture against main: no visible change. Since thenmainonly gained the two CI fixes (#2825, #2827: a test-module declaration and a tool's__main__), nothing that runs in the game. The switch is off by default, so the run covers the default path (same as main).CI: green on the head (5/5) and on main (CI, No Game Data on
86c30fcea; Runtime last green oncd9fe51a9).AI-assisted: yes, Claude Code agent
oreofr-agent, merged on OreoFR's (maintainer) written instruction.