Render-target reserve expires once the targets settle (LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS, off by default) #2589

Merged
MoonEyes merged 12 commits from upstream-pr/2589 into main 2026-12-01 04:36:04 +00:00
MoonEyes commented 2026-11-28 19:47:48 +00:00 (Migrated from github.com)

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.md table).

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_MS set, 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 on main.

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 on main (the functions do not exist), and fails when the settle branch is cut. Passes on this branch merged with main 5cb45921e. Crate-wide, the same 4 tests fail with and without the change (descriptor::host views_off_their_elements_get_a_copy_of_their_bytes, indirect batch_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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5543952475 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589). Originally posted by [MoonEyes](https://github.com/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.md` table). 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_MS` set, 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 on `main`. 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 on `main` (the functions do not exist), and fails when the settle branch is cut. Passes on this branch merged with `main` 5cb45921e. Crate-wide, the same 4 tests fail with and without the change (`descriptor::host` `views_off_their_elements_get_a_copy_of_their_bytes`, `indirect` `batch_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](https://claude.com/claude-code)
MoonEyes commented 2026-11-28 20:03:01 +00:00 (Migrated from github.com)

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 on main 5cb45921e too, already claimed: test_valu_cvt_f16_int16_mods (translator f16), test_the_loader_gets_the_stack_reserve_cmake_gives_it (loader stack) and test_resolve_pools_deduplicates_macos_case_and_accents_and_keeps_case_sensitive (path dedup). None of them touches this diff. The ERROR: lines in those logs come from tests that pass.

AI-assisted (Claude Code, Claude Opus 5.5), posted for MoonEyes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7244997428 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7244997428). Originally posted by [MoonEyes](https://github.com/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 on `main` 5cb45921e too, already claimed: `test_valu_cvt_f16_int16_mods` (translator f16), `test_the_loader_gets_the_stack_reserve_cmake_gives_it` (loader stack) and `test_resolve_pools_deduplicates_macos_case_and_accents_and_keeps_case_sensitive` (path dedup). None of them touches this diff. The `ERROR:` lines in those logs come from tests that pass. AI-assisted (Claude Code, Claude Opus 5.5), posted for MoonEyes.
lixonik commented 2026-11-28 20:10:24 +00:00 (Migrated from github.com)

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_MS knob defaults to 0 (off, preserving existing behavior), and the pure targets_seen / targets_kept helpers 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).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6099900688 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#pullrequestreview-6099900688). Originally posted by [lixonik](https://github.com/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_MS` knob defaults to `0` (off, preserving existing behavior), and the pure `targets_seen` / `targets_kept` helpers 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).
MoonEyes commented 2026-11-28 20:24:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T20:24:48Z.


TEST-WANTED | 2026-11-28 UTC | from: MoonEyes | to: any | AI-assisted: Claude Code (Claude Opus 5.5)
NEEDS:      NVIDIA card with 8-12 GB, leonida.exe (d3d12/) | ~30 min (2 runs x 900 s) | game files: yes
BUILD:      same executable for A and B: #2589 at 2058ecb5b, merged onto main
VARIABLE:   LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS | A = 0 | B = 20000
FIXED:      d3d12/README.md recipe (no running.md section for leonida.exe yet) + DEVIATIONS: none
CACHES:     keep (same warm caches for A and B)
SEND BACK:  B: every "render-target reserve (...)" line (time, targets MB, MB freed or kept); A and B: dedicated video memory used at 300 s and 900 s; how the run ended (time, cause); END + duration, one RUN block per run
PREDICTED:  A: no such line, as main. B: "given up" once the targets settle, with 160-990 MB freed for textures (upstream's 1440p measurement), and more video memory used by textures than A at 300 s
REFUTED IF: B writes no "given up" line in 900 s, or B uses no more video memory than A, or B ends earlier than A
EXPIRES:    2026-12-05 UTC

Answer with TAKEN | <handle> | ETA <time UTC> before starting and DONE | <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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7245267629 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7245267629). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T20:24:48Z. --- ``` TEST-WANTED | 2026-11-28 UTC | from: MoonEyes | to: any | AI-assisted: Claude Code (Claude Opus 5.5) NEEDS: NVIDIA card with 8-12 GB, leonida.exe (d3d12/) | ~30 min (2 runs x 900 s) | game files: yes BUILD: same executable for A and B: #2589 at 2058ecb5b, merged onto main VARIABLE: LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS | A = 0 | B = 20000 FIXED: d3d12/README.md recipe (no running.md section for leonida.exe yet) + DEVIATIONS: none CACHES: keep (same warm caches for A and B) SEND BACK: B: every "render-target reserve (...)" line (time, targets MB, MB freed or kept); A and B: dedicated video memory used at 300 s and 900 s; how the run ended (time, cause); END + duration, one RUN block per run PREDICTED: A: no such line, as main. B: "given up" once the targets settle, with 160-990 MB freed for textures (upstream's 1440p measurement), and more video memory used by textures than A at 300 s REFUTED IF: B writes no "given up" line in 900 s, or B uses no more video memory than A, or B ends earlier than A EXPIRES: 2026-12-05 UTC ``` Answer with `TAKEN | <handle> | ETA <time UTC>` before starting and `DONE | <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.
zmasi commented 2026-11-28 20:50:42 +00:00 (Migrated from github.com)

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 2058ecb5b4d5774943f9fec64f7a0781308a0505 cleanly merged (no-commit) onto origin/main (1bc055e6c2dedaa0de23ec79d8c4007c1dff1fb3; git merge-tree --write-tree rc=0, and also conflict-free against #2588 and #2587).

Red -> Green Verification

  • Red (origin/main 1bc055e6c2): targets_room_kept() unconditionally reserves most.saturating_sub(targets) for the entire session; compiling #2589's room_for_targets_is_given_up_once_they_settle test against origin/main fails (E0425: targets_kept, targets_seen, targets_line absent).
  • Green (origin/main + 2058ecb5b4):
    • cargo test --locked -p leonida-gpu --lib resource::tests:: -- --test-threads=4: 19/19 passed on NVIDIA GeForce RTX 3090 (including resource::tests::room_for_targets_is_given_up_once_they_settle: pre-world < 50% keep, initial growth window keep, settled >= 20,000 ms release to 0, default SETTLE_MS=0 unchanged, 64 MiB growth clock reset, >= 64 MiB drop 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), and python -I scripts/check_no_game_data.py d3d12/README.md d3d12/crates/leonida-gpu/src/resource.rs (0 issues) all pass.

Code Review Notes

  • Default behavior (LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS unset or 0) short-circuits before reading now_ms() or touching GREW / GIVEN_UP, preserving existing behavior identically when disabled.
  • GREW[0..2] and GIVEN_UP use relaxed atomics without a mutex across callers of targets_room_kept(), which is benign for a coarse 64 MiB / multi-second watermark heuristic. No blockers found.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7245583144 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7245583144). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T20:50:42Z. --- ### Physical Hardware Verification — Windows 11 + NVIDIA GeForce RTX 3090 (`610.88`) Verified head commit `2058ecb5b4d5774943f9fec64f7a0781308a0505` cleanly merged (no-commit) onto `origin/main` (`1bc055e6c2dedaa0de23ec79d8c4007c1dff1fb3`; `git merge-tree --write-tree` `rc=0`, and also conflict-free against `#2588` and `#2587`). #### Red -> Green Verification - **Red (`origin/main` `1bc055e6c2`)**: `targets_room_kept()` unconditionally reserves `most.saturating_sub(targets)` for the entire session; compiling `#2589`'s `room_for_targets_is_given_up_once_they_settle` test against `origin/main` fails (`E0425`: `targets_kept`, `targets_seen`, `targets_line` absent). - **Green (`origin/main` + `2058ecb5b4`)**: - `cargo test --locked -p leonida-gpu --lib resource::tests:: -- --test-threads=4`: **19/19 passed** on NVIDIA GeForce RTX 3090 (including `resource::tests::room_for_targets_is_given_up_once_they_settle`: pre-world `< 50%` keep, initial growth window keep, settled `>= 20,000 ms` release to `0`, default `SETTLE_MS=0` unchanged, `64 MiB` growth clock reset, `>= 64 MiB` drop 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`), and `python -I scripts/check_no_game_data.py d3d12/README.md d3d12/crates/leonida-gpu/src/resource.rs` (`0` issues) all pass. #### Code Review Notes - Default behavior (`LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS` unset or `0`) short-circuits before reading `now_ms()` or touching `GREW` / `GIVEN_UP`, preserving existing behavior identically when disabled. - `GREW[0..2]` and `GIVEN_UP` use relaxed atomics without a mutex across callers of `targets_room_kept()`, which is benign for a coarse `64 MiB` / multi-second watermark heuristic. No blockers found. AI-assisted.
lixonik commented 2026-11-28 20:55:32 +00:00 (Migrated from github.com)

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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6100052363 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#pullrequestreview-6100052363). Originally posted by [lixonik](https://github.com/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.
lixonik commented 2026-11-28 20:55:32 +00:00 (Migrated from github.com)

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 1903

@@ -1853,19 +1853,110 @@ pub(crate) fn room(memory: Option<[u64; 4]>) -> bool {
 /// 238), and the queue was refused from the first world frame on. With
 /// their room kept, the queue stops that much earlier while the world
 /// loads and gets it back as the targets are made.
+///
+/// With `LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS` set (0, the default: kept
+/// for the run, as before; 20,000 is the value measured), nothing is kept
+/// once the world's targets are made (half of the reserve or more) and have
+/// not grown by 64 MiB for that many ms: at 1440p the targets level off at
+/// 2.1-2.9 GB, and the rest of the 3,072 MB (990 MB at the first world
+/// frame, 160-640 MB in play) stayed reserved for targets that never came
+/// while thousands of textures waited for room (VIctory-NVIDIA's
+/// 2026-11-26 diag run 16:28, 10:59:54: 8,722 MB in use + 836 MB kept for
+/// targets against a line of 9,527 MB). The reserve comes back when the
+/// targets grow by 64 MiB again (a new scene's), for as long again.
+/// Ported from trustno1-coder/VIctory-NVIDIA 21b040da (readmet3xt-lab),
+/// GPL-3.0; there the setting is on at 20,000, here it is off.
 #[cfg(windows)]
 pub(crate) fn targets_room_kept() -> u64 {
-    use std::sync::atomic::Ordering::Relaxed;
+    use std::sync::atomic::{AtomicU64, Ordering::Relaxed};
     static MOST: std::sync::OnceLock<u64> = std::sync::OnceLock::new();
     let most = *MOST.get_or_init(|| {
         std::env::var("LEONIDA_CARD_ROOM_FOR_TARGETS_MB")
             .ok()
             .and_then(|v| v.trim().parse::<u64>().ok())
             .map_or(3072 << 20, |mb| mb.min(8192) << 20)
     });
+    static SETTLE: std::sync::OnceLock<u64> = std::sync::OnceLock::new();
+    let settle = *SETTLE.get_or_init(|| {
+        std::env::var("LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS")
+            .ok()
+            .and_then(|v| v.trim().parse::<u64>().ok())
+            .unwrap_or(0)
+    });
     // Every host texture's bytes less those of the copies the title fills.
     let targets = HOST_TEXTURES[1].load(Relaxed).saturating_sub(KINDS[1].load(Relaxed));
-    most.saturating_sub(targets)
+    if settle == 0 {
+        return targets_kept(most, targets, 0, 0);
+    }
+    // The targets' bytes at their last change of 64 MiB or more, and when
+    // they last grew by that much.
+    static GREW: [AtomicU64; 2] = [const { AtomicU64::new(0) }; 2];
+    let now = crate::host::now_ms();
+    let (last, since) = (GREW[0].load(Relaxed), GREW[1].load(Relaxed));
+    let (last, since) = targets_seen(last, since, targets, now);
+    GREW[0].store(last, Relaxed);
+    GREW[1].store(since, Relaxed);
+    let kept = targets_kept(most, targets, now.saturating_sub(since), settle);
+    // One line each time the reserve is given up or taken back, for a run to
+    // show when and how much (none with the setting at 0).
+    static GIVEN_UP: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
+    let given_up = kept == 0 && targets < most;

When 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review-comment:4728773414 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#discussion_r4728773414). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-28T20:55:32Z. **Code review location:** `d3d12/crates/leonida-gpu/src/resource.rs`; line 1903 ~~~~diff @@ -1853,19 +1853,110 @@ pub(crate) fn room(memory: Option<[u64; 4]>) -> bool { /// 238), and the queue was refused from the first world frame on. With /// their room kept, the queue stops that much earlier while the world /// loads and gets it back as the targets are made. +/// +/// With `LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS` set (0, the default: kept +/// for the run, as before; 20,000 is the value measured), nothing is kept +/// once the world's targets are made (half of the reserve or more) and have +/// not grown by 64 MiB for that many ms: at 1440p the targets level off at +/// 2.1-2.9 GB, and the rest of the 3,072 MB (990 MB at the first world +/// frame, 160-640 MB in play) stayed reserved for targets that never came +/// while thousands of textures waited for room (VIctory-NVIDIA's +/// 2026-11-26 diag run 16:28, 10:59:54: 8,722 MB in use + 836 MB kept for +/// targets against a line of 9,527 MB). The reserve comes back when the +/// targets grow by 64 MiB again (a new scene's), for as long again. +/// Ported from trustno1-coder/VIctory-NVIDIA 21b040da (readmet3xt-lab), +/// GPL-3.0; there the setting is on at 20,000, here it is off. #[cfg(windows)] pub(crate) fn targets_room_kept() -> u64 { - use std::sync::atomic::Ordering::Relaxed; + use std::sync::atomic::{AtomicU64, Ordering::Relaxed}; static MOST: std::sync::OnceLock<u64> = std::sync::OnceLock::new(); let most = *MOST.get_or_init(|| { std::env::var("LEONIDA_CARD_ROOM_FOR_TARGETS_MB") .ok() .and_then(|v| v.trim().parse::<u64>().ok()) .map_or(3072 << 20, |mb| mb.min(8192) << 20) }); + static SETTLE: std::sync::OnceLock<u64> = std::sync::OnceLock::new(); + let settle = *SETTLE.get_or_init(|| { + std::env::var("LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS") + .ok() + .and_then(|v| v.trim().parse::<u64>().ok()) + .unwrap_or(0) + }); // Every host texture's bytes less those of the copies the title fills. let targets = HOST_TEXTURES[1].load(Relaxed).saturating_sub(KINDS[1].load(Relaxed)); - most.saturating_sub(targets) + if settle == 0 { + return targets_kept(most, targets, 0, 0); + } + // The targets' bytes at their last change of 64 MiB or more, and when + // they last grew by that much. + static GREW: [AtomicU64; 2] = [const { AtomicU64::new(0) }; 2]; + let now = crate::host::now_ms(); + let (last, since) = (GREW[0].load(Relaxed), GREW[1].load(Relaxed)); + let (last, since) = targets_seen(last, since, targets, now); + GREW[0].store(last, Relaxed); + GREW[1].store(since, Relaxed); + let kept = targets_kept(most, targets, now.saturating_sub(since), settle); + // One line each time the reserve is given up or taken back, for a run to + // show when and how much (none with the setting at 0). + static GIVEN_UP: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false); + let given_up = kept == 0 && targets < most; ~~~~ --- When 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.
OreoFR commented 2026-11-28 21:17:36 +00:00 (Migrated from github.com)

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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7245912110 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7245912110). Originally posted by [OreoFR](https://github.com/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).
TheGeogeo commented 2026-11-28 21:46:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-28T21:46:05Z.


Tested 2058ecb5b merged (no commit) with main aa918e5d9, Windows 11 10.0.26300, Rust 1.98.1 (NVIDIA GeForce RTX 3080, driver 621.40 in the machine; host-side unit test).

  • Green: cargo test -p leonida-gpu --lib --locked: 516 passed, 0 failed, 46 ignored (plain main: 515 passed, 0 failed, 46 ignored). room_for_targets_is_given_up_once_they_settle passes. On current main the 4 crate failures from the description are gone. The leonida-gpu test build gives 10 warnings, the same as on main.
  • Red: with the settle branch of targets_kept cut (if false && settle > 0 ...), the test fails at resource.rs:5289 (left: 671088640, right: 0).
  • check_no_game_data.py is clean on the 2 files.
  • Not checked: the VRAM behaviour in the title (no game run).

No blocker from my side. AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246256671 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7246256671). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-28T21:46:05Z. --- Tested `2058ecb5b` merged (no commit) with `main` `aa918e5d9`, Windows 11 10.0.26300, Rust 1.98.1 (NVIDIA GeForce RTX 3080, driver 621.40 in the machine; host-side unit test). - Green: `cargo test -p leonida-gpu --lib --locked`: 516 passed, 0 failed, 46 ignored (plain `main`: 515 passed, 0 failed, 46 ignored). `room_for_targets_is_given_up_once_they_settle` passes. On current `main` the 4 crate failures from the description are gone. The `leonida-gpu` test build gives 10 warnings, the same as on `main`. - Red: with the settle branch of `targets_kept` cut (`if false && settle > 0 ...`), the test fails at `resource.rs:5289` (`left: 671088640`, `right: 0`). - `check_no_game_data.py` is clean on the 2 files. - Not checked: the VRAM behaviour in the title (no game run). No blocker from my side. AI-assisted (Claude Code).
enlight3d commented 2026-11-29 01:34:14 +00:00 (Migrated from github.com)

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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248869845 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7248869845). Originally posted by [enlight3d](https://github.com/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.
OreoFR commented 2026-11-29 01:40:44 +00:00 (Migrated from github.com)

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.

  • Machine: RTX 4070 Laptop 8 GB (ReBAR), NVIDIA 621.40, Windows 11, Intel Core Ultra 7 155H, 40 GB RAM
  • Build (same executable for A and B, all four runs): f4c288878 = origin/main aa918e5d9 + merge of #2589 head
    2058ecb5b (d3d12\scripts\build-nvidia.ps1: diag, DLSS, mimalloc). #2589 head re-checked 2026-11-28: still
    2058ecb5b, OPEN.
  • Recipe: scripts/play-d3d12.ps1 -SeriesS -Log with the launcher's own settings. d3d12/README.md has no recipe
    written 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.md measured on this machine, so that is the one
    used. Not added: LEONIDA_WINDOWS_BAR_MB=0, LEONIDA_TEXTURE_BUDGET_MB=1024, -FrameGen 2 (the d3d12_autonome
    scripts add them; a local copy of the scripts without them was used).
  • Remaining deviations, the same for A and B: -SeriesS (the launcher's default is Series X at 1440p; upstream's
    measurement 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=3072 by itself on this
    40 GB PC (its comment and the README say "under 24 GB of RAM"; -DryRun shows 3072): kept, as it is the
    launcher's default.
  • Caches: warm (shader and pipeline caches from earlier #2589 attempts on the same build), kept between runs.
    Precompile: yes (launcher default). Order: A3, B3, then B4, A4 (second pair in reverse order).
  • CPU load: other agents built C++ in parallel during every run. A3: 100 % at start (7 compiler/ctest processes),
    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).
  • Video memory: the card budget Windows gave the game moved during every run. Median / min of the budget, and the
    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.
  • Render targets: the host's census of "textures the host renders to or writes" peaked at 1,254 / 1,260 / 1,260 /
    1,259 MB (A3 / B3 / B4 / A4) and ended at about 1,240 MB in each run.

RUN p2589-A3

RUN p2589-A3 | 2026-11-28 UTC | OreoFR | AI-assisted: Claude Code (Claude Opus 5.5)
BASE:        aa918e5d9 + #2589 (2058ecb5b) = f4c288878 | shaders: launcher precompile (leonida shaders + warm --used)
MACHINE:     RTX 4070 Laptop 8 GB, laptop | NVIDIA 621.40 | Windows 11 | 40 GB
RECIPE:      documented (d3d12/README.md, Series S + DLSS, play-d3d12.ps1 defaults) + DEVIATIONS: -SeriesS, LEONIDA_KEYS_FILE, LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS=0 | precompile: yes
OS/DRIVER:   defaults; launcher-set LEONIDA_WINDOWS_BAR_MB=3072
TARGET:      "render-target reserve" lines; card video memory at 300 s and 900 s | PREDICTED: no such line, as main
MEASURED:    reserve lines: none | card in use/budget: 6817/7012 MB at 300 s, 6868/7046 MB at 900 s | duration 1024 s from game start (900 s stay) | median 13.2 fps in the stay (n=168, 3.7-16.0)
END:         time limit (closed by the driver script); no device removed, no panic, no title crash report
CACHES:      warm | RUN 1 of 2 for A, same recipe
INSTRUMENTS: none (the launcher's -Log only)
VERDICT:     prediction held

RUN p2589-B3

RUN p2589-B3 | 2026-11-28 UTC | OreoFR | AI-assisted: Claude Code (Claude Opus 5.5)
BASE:        aa918e5d9 + #2589 (2058ecb5b) = f4c288878 | shaders: launcher precompile (leonida shaders + warm --used)
MACHINE:     RTX 4070 Laptop 8 GB, laptop | NVIDIA 621.40 | Windows 11 | 40 GB
RECIPE:      documented (d3d12/README.md, Series S + DLSS, play-d3d12.ps1 defaults) + DEVIATIONS: -SeriesS, LEONIDA_KEYS_FILE, LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS=20000 | precompile: yes
OS/DRIVER:   defaults; launcher-set LEONIDA_WINDOWS_BAR_MB=3072
TARGET:      "render-target reserve" lines; card video memory at 300 s and 900 s | PREDICTED: "given up" once the targets settle, 160-990 MB freed, more video memory used than A at 300 s
MEASURED:    reserve lines: none in 718 s | card in use/budget: 6824/6739 MB at 300 s, no 900 s value (6876/5810 MB at 684 s, the last line) | duration 718 s from game start | 13.6-13.9 fps to 360 s, then 4.0 (360-480 s), 1.4 (480-600 s), 7.0 (600-718 s)
END:         process crash: the title's own crash handler at 718 s from game start (frame 6303); its report upload was blocked by the runtime, nothing went online. After the kill the process stayed in teardown for about 20 minutes and nvidia-smi hung meanwhile; both cleared by themselves
CACHES:      warm | RUN 1 of 2 for B, same recipe
INSTRUMENTS: none (the launcher's -Log only)
VERDICT:     prediction missed: no "given up" line; +7 MB against A3 at 300 s; ended earlier than A3

RUN p2589-B4

RUN p2589-B4 | 2026-11-29 UTC | OreoFR | AI-assisted: Claude Code (Claude Opus 5.5)
BASE:        aa918e5d9 + #2589 (2058ecb5b) = f4c288878 | shaders: launcher precompile (leonida shaders + warm --used)
MACHINE:     RTX 4070 Laptop 8 GB, laptop | NVIDIA 621.40 | Windows 11 | 40 GB
RECIPE:      documented (d3d12/README.md, Series S + DLSS, play-d3d12.ps1 defaults) + DEVIATIONS: -SeriesS, LEONIDA_KEYS_FILE, LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS=20000 | precompile: yes
OS/DRIVER:   defaults; launcher-set LEONIDA_WINDOWS_BAR_MB=3072
TARGET:      "render-target reserve" lines; card video memory at 300 s and 900 s | PREDICTED: "given up" once the targets settle, 160-990 MB freed, more video memory used than A at 300 s
MEASURED:    reserve lines: none in 900 s | card in use/budget: 6945/7070 MB at 300 s, 7000/7025 MB at 900 s | duration 1024 s from game start (900 s stay) | median 13.3 fps in the stay (n=167, 1.8-17.3)
END:         time limit (closed by the driver script); no device removed, no panic, no title crash report
CACHES:      warm | RUN 2 of 2 for B, same recipe
INSTRUMENTS: none (the launcher's -Log only)
VERDICT:     prediction missed: no "given up" line in 900 s; 42 MB less than A4 at 300 s

RUN p2589-A4

RUN p2589-A4 | 2026-11-29 UTC | OreoFR | AI-assisted: Claude Code (Claude Opus 5.5)
BASE:        aa918e5d9 + #2589 (2058ecb5b) = f4c288878 | shaders: launcher precompile (leonida shaders + warm --used)
MACHINE:     RTX 4070 Laptop 8 GB, laptop | NVIDIA 621.40 | Windows 11 | 40 GB
RECIPE:      documented (d3d12/README.md, Series S + DLSS, play-d3d12.ps1 defaults) + DEVIATIONS: -SeriesS, LEONIDA_KEYS_FILE, LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS=0 | precompile: yes
OS/DRIVER:   defaults; launcher-set LEONIDA_WINDOWS_BAR_MB=3072
TARGET:      "render-target reserve" lines; card video memory at 300 s and 900 s | PREDICTED: no such line, as main
MEASURED:    reserve lines: none | card in use/budget: 6987/6700 MB at 300 s, 7030/7024 MB at 900 s | duration 1023 s from game start (900 s stay) | median 13.3 fps in the stay (n=168, 7.9-17.1)
END:         time limit (closed by the driver script); no device removed, no panic, no title crash report
CACHES:      warm | RUN 2 of 2 for A, same recipe
INSTRUMENTS: none (the launcher's -Log only)
VERDICT:     prediction held

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.rs 1950-1960, targets_kept): the reserve is given up
only 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
targets value the code compares). So with 20000 the code keeps the same reserve as with 0, and the setting
cannot 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.py on this file: exit 0, nothing found.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248942529 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7248942529). Originally posted by [OreoFR](https://github.com/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. - Machine: RTX 4070 Laptop 8 GB (ReBAR), NVIDIA 621.40, Windows 11, Intel Core Ultra 7 155H, 40 GB RAM - Build (same executable for A and B, all four runs): `f4c288878` = origin/main `aa918e5d9` + merge of #2589 head `2058ecb5b` (`d3d12\scripts\build-nvidia.ps1`: diag, DLSS, mimalloc). #2589 head re-checked 2026-11-28: still `2058ecb5b`, OPEN. - Recipe: `scripts/play-d3d12.ps1 -SeriesS -Log` with the launcher's own settings. `d3d12/README.md` has no recipe written 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.md` measured on this machine, so that is the one used. Not added: `LEONIDA_WINDOWS_BAR_MB=0`, `LEONIDA_TEXTURE_BUDGET_MB=1024`, `-FrameGen 2` (the d3d12_autonome scripts add them; a local copy of the scripts without them was used). - Remaining deviations, the same for A and B: `-SeriesS` (the launcher's default is Series X at 1440p; upstream's measurement 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=3072` by itself on this 40 GB PC (its comment and the README say "under 24 GB of RAM"; `-DryRun` shows 3072): kept, as it is the launcher's default. - Caches: warm (shader and pipeline caches from earlier #2589 attempts on the same build), kept between runs. Precompile: yes (launcher default). Order: A3, B3, then B4, A4 (second pair in reverse order). - CPU load: other agents built C++ in parallel during every run. A3: 100 % at start (7 compiler/ctest processes), 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). - Video memory: the card budget Windows gave the game moved during every run. Median / min of the budget, and the 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. - Render targets: the host's census of "textures the host renders to or writes" peaked at 1,254 / 1,260 / 1,260 / 1,259 MB (A3 / B3 / B4 / A4) and ended at about 1,240 MB in each run. ## RUN p2589-A3 ``` RUN p2589-A3 | 2026-11-28 UTC | OreoFR | AI-assisted: Claude Code (Claude Opus 5.5) BASE: aa918e5d9 + #2589 (2058ecb5b) = f4c288878 | shaders: launcher precompile (leonida shaders + warm --used) MACHINE: RTX 4070 Laptop 8 GB, laptop | NVIDIA 621.40 | Windows 11 | 40 GB RECIPE: documented (d3d12/README.md, Series S + DLSS, play-d3d12.ps1 defaults) + DEVIATIONS: -SeriesS, LEONIDA_KEYS_FILE, LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS=0 | precompile: yes OS/DRIVER: defaults; launcher-set LEONIDA_WINDOWS_BAR_MB=3072 TARGET: "render-target reserve" lines; card video memory at 300 s and 900 s | PREDICTED: no such line, as main MEASURED: reserve lines: none | card in use/budget: 6817/7012 MB at 300 s, 6868/7046 MB at 900 s | duration 1024 s from game start (900 s stay) | median 13.2 fps in the stay (n=168, 3.7-16.0) END: time limit (closed by the driver script); no device removed, no panic, no title crash report CACHES: warm | RUN 1 of 2 for A, same recipe INSTRUMENTS: none (the launcher's -Log only) VERDICT: prediction held ``` ## RUN p2589-B3 ``` RUN p2589-B3 | 2026-11-28 UTC | OreoFR | AI-assisted: Claude Code (Claude Opus 5.5) BASE: aa918e5d9 + #2589 (2058ecb5b) = f4c288878 | shaders: launcher precompile (leonida shaders + warm --used) MACHINE: RTX 4070 Laptop 8 GB, laptop | NVIDIA 621.40 | Windows 11 | 40 GB RECIPE: documented (d3d12/README.md, Series S + DLSS, play-d3d12.ps1 defaults) + DEVIATIONS: -SeriesS, LEONIDA_KEYS_FILE, LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS=20000 | precompile: yes OS/DRIVER: defaults; launcher-set LEONIDA_WINDOWS_BAR_MB=3072 TARGET: "render-target reserve" lines; card video memory at 300 s and 900 s | PREDICTED: "given up" once the targets settle, 160-990 MB freed, more video memory used than A at 300 s MEASURED: reserve lines: none in 718 s | card in use/budget: 6824/6739 MB at 300 s, no 900 s value (6876/5810 MB at 684 s, the last line) | duration 718 s from game start | 13.6-13.9 fps to 360 s, then 4.0 (360-480 s), 1.4 (480-600 s), 7.0 (600-718 s) END: process crash: the title's own crash handler at 718 s from game start (frame 6303); its report upload was blocked by the runtime, nothing went online. After the kill the process stayed in teardown for about 20 minutes and nvidia-smi hung meanwhile; both cleared by themselves CACHES: warm | RUN 1 of 2 for B, same recipe INSTRUMENTS: none (the launcher's -Log only) VERDICT: prediction missed: no "given up" line; +7 MB against A3 at 300 s; ended earlier than A3 ``` ## RUN p2589-B4 ``` RUN p2589-B4 | 2026-11-29 UTC | OreoFR | AI-assisted: Claude Code (Claude Opus 5.5) BASE: aa918e5d9 + #2589 (2058ecb5b) = f4c288878 | shaders: launcher precompile (leonida shaders + warm --used) MACHINE: RTX 4070 Laptop 8 GB, laptop | NVIDIA 621.40 | Windows 11 | 40 GB RECIPE: documented (d3d12/README.md, Series S + DLSS, play-d3d12.ps1 defaults) + DEVIATIONS: -SeriesS, LEONIDA_KEYS_FILE, LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS=20000 | precompile: yes OS/DRIVER: defaults; launcher-set LEONIDA_WINDOWS_BAR_MB=3072 TARGET: "render-target reserve" lines; card video memory at 300 s and 900 s | PREDICTED: "given up" once the targets settle, 160-990 MB freed, more video memory used than A at 300 s MEASURED: reserve lines: none in 900 s | card in use/budget: 6945/7070 MB at 300 s, 7000/7025 MB at 900 s | duration 1024 s from game start (900 s stay) | median 13.3 fps in the stay (n=167, 1.8-17.3) END: time limit (closed by the driver script); no device removed, no panic, no title crash report CACHES: warm | RUN 2 of 2 for B, same recipe INSTRUMENTS: none (the launcher's -Log only) VERDICT: prediction missed: no "given up" line in 900 s; 42 MB less than A4 at 300 s ``` ## RUN p2589-A4 ``` RUN p2589-A4 | 2026-11-29 UTC | OreoFR | AI-assisted: Claude Code (Claude Opus 5.5) BASE: aa918e5d9 + #2589 (2058ecb5b) = f4c288878 | shaders: launcher precompile (leonida shaders + warm --used) MACHINE: RTX 4070 Laptop 8 GB, laptop | NVIDIA 621.40 | Windows 11 | 40 GB RECIPE: documented (d3d12/README.md, Series S + DLSS, play-d3d12.ps1 defaults) + DEVIATIONS: -SeriesS, LEONIDA_KEYS_FILE, LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS=0 | precompile: yes OS/DRIVER: defaults; launcher-set LEONIDA_WINDOWS_BAR_MB=3072 TARGET: "render-target reserve" lines; card video memory at 300 s and 900 s | PREDICTED: no such line, as main MEASURED: reserve lines: none | card in use/budget: 6987/6700 MB at 300 s, 7030/7024 MB at 900 s | duration 1023 s from game start (900 s stay) | median 13.3 fps in the stay (n=168, 7.9-17.1) END: time limit (closed by the driver script); no device removed, no panic, no title crash report CACHES: warm | RUN 2 of 2 for A, same recipe INSTRUMENTS: none (the launcher's -Log only) VERDICT: prediction held ``` ## 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.rs` 1950-1960, `targets_kept`): the reserve is given up only 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 `targets` value the code compares). So with 20000 the code keeps the same reserve as with 0, and the setting cannot 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.py` on this file: exit 0, nothing found.
enlight3d commented 2026-11-29 03:28:56 +00:00 (Migrated from github.com)

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 at 2058ecb5b, 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7250073341 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7250073341). Originally posted by [enlight3d](https://github.com/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 at 2058ecb5b, 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.
enlight3d commented 2026-11-29 03:29:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T03:29:00Z.


DONE | https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7250073341

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7250074067 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7250074067). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-29T03:29:00Z. --- DONE | https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7250073341
merzleckeier commented 2026-11-29 11:55:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T11:55:31Z.


Reserve growth timestamp can move backward on c007cfeee with 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_kept helpers. 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 on 8fb974878 + c007cfeee (with the DXC branch and a README-only merge resolution). AI-assisted with OpenAI Codex (GPT-6).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7255442727 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7255442727). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-11-29T11:55:31Z. --- Reserve growth timestamp can move backward on `c007cfeee` with the opt-in setting. In [the load/compute/store sequence](https://github.com/ProjectLeonida/mandy/blob/c007cfeee39ac3a46b6a153d5f856e3d9c747261/d3d12/crates/leonida-gpu/src/resource.rs#L1964-L1972), 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_kept` helpers. 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 on `8fb974878` + `c007cfeee` (with the DXC branch and a README-only merge resolution). AI-assisted with OpenAI Codex (GPT-6).
merzleckeier commented 2026-11-29 12:08:46 +00:00 (Migrated from github.com)

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=20000 on a desktop RTX 4070 SUPER (NVIDIA 620.73.04, CachyOS, Wine 11.22, VKD3D-Proton 71cae091). Both arms ran the same executable from 8fb974878 + the DXC compiler branch 9075a5e419 + #2589 c007cfeee (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.

Runtime clock Host targets (MiB) Reserve event (MiB)
178.0 s 2298 released 773
183.8 s 2375 took back 696
204.0 s 2413 released 659
232.4 s 2595 took back 476
262.8 s 2700 released 371

With SETTLE_MS=0 there were no reserve events. Card-wide nvidia-smi at ~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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7255599169 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7255599169). Originally posted by [merzleckeier](https://github.com/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=20000` on a desktop RTX 4070 SUPER (NVIDIA 620.73.04, CachyOS, Wine 11.22, VKD3D-Proton `71cae091`). Both arms ran the same executable from `8fb974878` + the DXC compiler branch `9075a5e419` + #2589 `c007cfeee` (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. | Runtime clock | Host targets (MiB) | Reserve event (MiB) | | ---: | ---: | --- | | 178.0 s | 2298 | released 773 | | 183.8 s | 2375 | took back 696 | | 204.0 s | 2413 | released 659 | | 232.4 s | 2595 | took back 476 | | 262.8 s | 2700 | released 371 | With `SETTLE_MS=0` there were no reserve events. Card-wide `nvidia-smi` at ~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).
merzleckeier commented 2026-11-29 12:32:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T12:32:49Z.


Retested the stale-write case on ee27e8719 under Wine 11.22. The unchanged Windows resource::tests::room_for_targets_is_given_up_once_they_settle passed. 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.
  • Unset and explicit 0 both 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7255889851 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7255889851). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-11-29T12:32:49Z. --- Retested the stale-write case on `ee27e8719` under Wine 11.22. The unchanged Windows `resource::tests::room_for_targets_is_given_up_once_they_settle` passed. 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. - Unset and explicit `0` both 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.
MoonEyes commented 2026-11-29 13:23:41 +00:00 (Migrated from github.com)

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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7256504937 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7256504937). Originally posted by [MoonEyes](https://github.com/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.
enlight3d commented 2026-11-29 14:21:09 +00:00 (Migrated from github.com)

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) onto main 51d343b86. The pre-fix head c007cfeee was checked out as is. Both got the same test.

  • Method: a temporary test (not pushed) calls the production targets_room_kept() with LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS=20000 and the default 3072 MiB reserve. It sets the targets through HOST_TEXTURES[1] / KINDS[1]. Two test-only hooks were added to that function: a per-thread clock in place of now_ms(), and a per-thread pause after the update is computed and before it is stored. On ee27e8719 the pause is just before *state = ..., inside the lock. On c007cfeee it is just before the GREW stores. Each run:

    1. The state is reset to (2300 MiB, 1000 ms) through the function itself.
    2. Thread 1 calls with 2360 MiB at 24999 ms and pauses (channels).
    3. Thread 2 calls with 2364 MiB at 25000 ms and gets 500 ms to return.
    4. Thread 1 is released and both threads are joined.
    5. A call with 2363 MiB at 25001 ms must keep 709 MiB.

    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, including room_for_targets_is_given_up_once_they_settle.

  • Machine: Windows 11 Pro 26300, Rust 1.98.1, target x86_64-pc-windows-msvc named 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=0 path was not run by this test.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257235923 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7257235923). Originally posted by [enlight3d](https://github.com/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) onto `main` `51d343b86`. The pre-fix head `c007cfeee` was checked out as is. Both got the same test. - **Method:** a temporary test (not pushed) calls the production `targets_room_kept()` with `LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS=20000` and the default 3072 MiB reserve. It sets the targets through `HOST_TEXTURES[1]` / `KINDS[1]`. Two test-only hooks were added to that function: a per-thread clock in place of `now_ms()`, and a per-thread pause after the update is computed and before it is stored. On `ee27e8719` the pause is just before `*state = ...`, inside the lock. On `c007cfeee` it is just before the `GREW` stores. Each run: 1. The state is reset to (2300 MiB, 1000 ms) through the function itself. 2. Thread 1 calls with 2360 MiB at 24999 ms and pauses (channels). 3. Thread 2 calls with 2364 MiB at 25000 ms and gets 500 ms to return. 4. Thread 1 is released and both threads are joined. 5. A call with 2363 MiB at 25001 ms must keep 709 MiB. 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, including `room_for_targets_is_given_up_once_they_settle`. - **Machine:** Windows 11 Pro 26300, Rust 1.98.1, target `x86_64-pc-windows-msvc` named 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=0` path was not run by this test.
lixonik commented 2026-11-29 14:57:02 +00:00 (Migrated from github.com)

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 1903

@@ -1853,19 +1853,110 @@ pub(crate) fn room(memory: Option<[u64; 4]>) -> bool {
 /// 238), and the queue was refused from the first world frame on. With
 /// their room kept, the queue stops that much earlier while the world
 /// loads and gets it back as the targets are made.
+///
+/// With `LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS` set (0, the default: kept
+/// for the run, as before; 20,000 is the value measured), nothing is kept
+/// once the world's targets are made (half of the reserve or more) and have
+/// not grown by 64 MiB for that many ms: at 1440p the targets level off at
+/// 2.1-2.9 GB, and the rest of the 3,072 MB (990 MB at the first world
+/// frame, 160-640 MB in play) stayed reserved for targets that never came
+/// while thousands of textures waited for room (VIctory-NVIDIA's
+/// 2026-11-26 diag run 16:28, 10:59:54: 8,722 MB in use + 836 MB kept for
+/// targets against a line of 9,527 MB). The reserve comes back when the
+/// targets grow by 64 MiB again (a new scene's), for as long again.
+/// Ported from trustno1-coder/VIctory-NVIDIA 21b040da (readmet3xt-lab),
+/// GPL-3.0; there the setting is on at 20,000, here it is off.
 #[cfg(windows)]
 pub(crate) fn targets_room_kept() -> u64 {
-    use std::sync::atomic::Ordering::Relaxed;
+    use std::sync::atomic::{AtomicU64, Ordering::Relaxed};
     static MOST: std::sync::OnceLock<u64> = std::sync::OnceLock::new();
     let most = *MOST.get_or_init(|| {
         std::env::var("LEONIDA_CARD_ROOM_FOR_TARGETS_MB")
             .ok()
             .and_then(|v| v.trim().parse::<u64>().ok())
             .map_or(3072 << 20, |mb| mb.min(8192) << 20)
     });
+    static SETTLE: std::sync::OnceLock<u64> = std::sync::OnceLock::new();
+    let settle = *SETTLE.get_or_init(|| {
+        std::env::var("LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS")
+            .ok()
+            .and_then(|v| v.trim().parse::<u64>().ok())
+            .unwrap_or(0)
+    });
     // Every host texture's bytes less those of the copies the title fills.
     let targets = HOST_TEXTURES[1].load(Relaxed).saturating_sub(KINDS[1].load(Relaxed));
-    most.saturating_sub(targets)
+    if settle == 0 {
+        return targets_kept(most, targets, 0, 0);
+    }
+    // The targets' bytes at their last change of 64 MiB or more, and when
+    // they last grew by that much.
+    static GREW: [AtomicU64; 2] = [const { AtomicU64::new(0) }; 2];
+    let now = crate::host::now_ms();
+    let (last, since) = (GREW[0].load(Relaxed), GREW[1].load(Relaxed));
+    let (last, since) = targets_seen(last, since, targets, now);
+    GREW[0].store(last, Relaxed);
+    GREW[1].store(since, Relaxed);
+    let kept = targets_kept(most, targets, now.saturating_sub(since), settle);
+    // One line each time the reserve is given up or taken back, for a run to
+    // show when and how much (none with the setting at 0).
+    static GIVEN_UP: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
+    let given_up = kept == 0 && targets < most;

Verified the fix on ee27e8719 on native Windows 10 22H2 (MSVC, Rust diag). resource::tests::room_for_targets_is_given_up_once_they_settle passed. 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review-comment:4731879971 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#discussion_r4731879971). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-29T14:57:02Z. **Code review location:** `d3d12/crates/leonida-gpu/src/resource.rs`; line 1903 ~~~~diff @@ -1853,19 +1853,110 @@ pub(crate) fn room(memory: Option<[u64; 4]>) -> bool { /// 238), and the queue was refused from the first world frame on. With /// their room kept, the queue stops that much earlier while the world /// loads and gets it back as the targets are made. +/// +/// With `LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS` set (0, the default: kept +/// for the run, as before; 20,000 is the value measured), nothing is kept +/// once the world's targets are made (half of the reserve or more) and have +/// not grown by 64 MiB for that many ms: at 1440p the targets level off at +/// 2.1-2.9 GB, and the rest of the 3,072 MB (990 MB at the first world +/// frame, 160-640 MB in play) stayed reserved for targets that never came +/// while thousands of textures waited for room (VIctory-NVIDIA's +/// 2026-11-26 diag run 16:28, 10:59:54: 8,722 MB in use + 836 MB kept for +/// targets against a line of 9,527 MB). The reserve comes back when the +/// targets grow by 64 MiB again (a new scene's), for as long again. +/// Ported from trustno1-coder/VIctory-NVIDIA 21b040da (readmet3xt-lab), +/// GPL-3.0; there the setting is on at 20,000, here it is off. #[cfg(windows)] pub(crate) fn targets_room_kept() -> u64 { - use std::sync::atomic::Ordering::Relaxed; + use std::sync::atomic::{AtomicU64, Ordering::Relaxed}; static MOST: std::sync::OnceLock<u64> = std::sync::OnceLock::new(); let most = *MOST.get_or_init(|| { std::env::var("LEONIDA_CARD_ROOM_FOR_TARGETS_MB") .ok() .and_then(|v| v.trim().parse::<u64>().ok()) .map_or(3072 << 20, |mb| mb.min(8192) << 20) }); + static SETTLE: std::sync::OnceLock<u64> = std::sync::OnceLock::new(); + let settle = *SETTLE.get_or_init(|| { + std::env::var("LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS") + .ok() + .and_then(|v| v.trim().parse::<u64>().ok()) + .unwrap_or(0) + }); // Every host texture's bytes less those of the copies the title fills. let targets = HOST_TEXTURES[1].load(Relaxed).saturating_sub(KINDS[1].load(Relaxed)); - most.saturating_sub(targets) + if settle == 0 { + return targets_kept(most, targets, 0, 0); + } + // The targets' bytes at their last change of 64 MiB or more, and when + // they last grew by that much. + static GREW: [AtomicU64; 2] = [const { AtomicU64::new(0) }; 2]; + let now = crate::host::now_ms(); + let (last, since) = (GREW[0].load(Relaxed), GREW[1].load(Relaxed)); + let (last, since) = targets_seen(last, since, targets, now); + GREW[0].store(last, Relaxed); + GREW[1].store(since, Relaxed); + let kept = targets_kept(most, targets, now.saturating_sub(since), settle); + // One line each time the reserve is given up or taken back, for a run to + // show when and how much (none with the setting at 0). + static GIVEN_UP: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false); + let given_up = kept == 0 && targets < most; ~~~~ --- Verified the fix on `ee27e8719` on native Windows 10 22H2 (MSVC, Rust `diag`). `resource::tests::room_for_targets_is_given_up_once_they_settle` passed. 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.
fiestorra commented 2026-11-29 17:38:51 +00:00 (Migrated from github.com)

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/head reports 1 conflicted file(s):

  • d3d12/README.md

That file is a hot spot in this checkout - several open pull requests edit it (#2615, #2612 among 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7259854378 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7259854378). Originally posted by [fiestorra](https://github.com/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/head` reports **1** conflicted file(s): - `d3d12/README.md` That file is a hot spot in this checkout - several open pull requests edit it (`#2615`, `#2612` among 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.
enlight3d commented 2026-11-30 10:41:13 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-30T10:41:13Z.


RUN (independent run, #2589 head 71cccc04c on main e1fe82f63; merged locally with git merge --no-ff, no conflicts now that the head has main in it; also no conflict with #2566 head 1aefed0da per git 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 in resource.rs (3 already on main, the same 3 on the merge).
  • Red, build: with the PR's non-test changes reverted and its test kept, the test does not compile (E0425: targets_kept, targets_seen, targets_turn, targets_line not found). That alone proves little, so I also ran the behavioural reds below.
  • Red, behavioural: mutants of the fix with the test kept, run with cargo test -p leonida-gpu --lib room_for_targets. room_for_targets_is_given_up_once_they_settle fails for each one:
    • the settle branch of targets_kept cut: 640 MiB is kept where the settled case expects 0;
    • targets_seen restarting 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;
    • the "half of the reserve" condition dropped: nothing is kept before the world is made, where 2420 MiB is expected.
  • Default path: with LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS unset (0), targets_room_kept returns targets_kept(most, targets, 0, 0), which is most - targets, as on main, and does not take the lock.
  • Not covered here: the locked opt-in path inside 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=20000 against 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7275938758 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7275938758). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-30T10:41:13Z. --- RUN (independent run, #2589 head 71cccc04c on main e1fe82f63; merged locally with `git merge --no-ff`, no conflicts now that the head has main in it; also no conflict with #2566 head 1aefed0da per `git 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 in `resource.rs` (3 already on main, the same 3 on the merge). - Red, build: with the PR's non-test changes reverted and its test kept, the test does not compile (E0425: `targets_kept`, `targets_seen`, `targets_turn`, `targets_line` not found). That alone proves little, so I also ran the behavioural reds below. - Red, behavioural: mutants of the fix with the test kept, run with `cargo test -p leonida-gpu --lib room_for_targets`. `room_for_targets_is_given_up_once_they_settle` fails for each one: - the settle branch of `targets_kept` cut: 640 MiB is kept where the settled case expects 0; - `targets_seen` restarting 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; - the "half of the reserve" condition dropped: nothing is kept before the world is made, where 2420 MiB is expected. - Default path: with `LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS` unset (0), `targets_room_kept` returns `targets_kept(most, targets, 0, 0)`, which is `most - targets`, as on main, and does not take the lock. - Not covered here: the locked opt-in path inside `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=20000` against 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.
enlight3d commented 2026-11-30 14:31:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-30T14:31:58Z.


IN-GAME RUN (gate, independent): #2589 head 47cbe15d9 (main d367675c7 already 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 -Data per side, the same save restored before every run, standing still once in the world, 600 s. A = main d367675c7. B = this PR with LEONIDA_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.

run fps median (p5) after 430 s VRAM peak (MiB)
A-1 16.2 (8.0) 18.3 21,872
B-1 18.4 (8.9) 17.7 19,646
B-2 12.4 (0.4) 3.7 (under 2 fps from 514 s) 23,976
A-2 17.7 (11.3) 18.4 11,935 (the title crashed at about 540 s, exit code 0xC0000005, no device loss)

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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7281523313 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7281523313). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-30T14:31:58Z. --- IN-GAME RUN (gate, independent): #2589 head 47cbe15d9 (main d367675c7 already 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 `-Data` per side, the same save restored before every run, standing still once in the world, 600 s. A = main d367675c7. B = this PR with `LEONIDA_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. | run | fps median (p5) | after 430 s | VRAM peak (MiB) | |---|---|---|---| | A-1 | 16.2 (8.0) | 18.3 | 21,872 | | B-1 | 18.4 (8.9) | 17.7 | 19,646 | | B-2 | 12.4 (0.4) | 3.7 (under 2 fps from 514 s) | 23,976 | | A-2 | 17.7 (11.3) | 18.4 | 11,935 (the title crashed at about 540 s, exit code 0xC0000005, no device loss) | **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.
KelboLive commented 2026-11-30 17:33:37 +00:00 (Migrated from github.com)

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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7286496926 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7286496926). Originally posted by [KelboLive](https://github.com/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).
enlight3d commented 2026-11-30 18:51:28 +00:00 (Migrated from github.com)

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 main d367675c7 merged in. This replaces my earlier RUN on 71cccc04c. The PR's own changes, resource.rs and the README row, are line for line the same as on 71cccc04c; only main's commits came in. The head still merges cleanly into main 8f41d7d01. CI on 47cbe15d9: 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-fast on the head: green, 564 passed / 0 failed / 52 ignored. Main d367675c7 gives 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), on d367675c7 and on the head: no new warning in resource.rs (3 already there, the same 3 on the head).
  • Red, behavioural, redone on this head: mutants of the fix with the test kept, run with cargo test -p leonida-gpu --lib room_for_targets. room_for_targets_is_given_up_once_they_settle fails for each one:
    • the settle branch of targets_kept cut: 640 MiB kept where the settled case expects 0;
    • targets_seen restarting the clock on any growth instead of 64 MiB: the record moves to (2050 MiB, 9000 ms) where (2000 MiB, 1000 ms) is expected;
    • the "half of the reserve" condition dropped: nothing is kept before the world, where 2420 MiB is expected.
  • Not covered here: the effect in the game. That is the in-game A/B's job.

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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7288469840 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7288469840). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-30T18:51:28Z. --- RUN (independent re-run on Windows, #2589 head 47cbe15d9, tested as it is: it already has main d367675c7 merged in. This replaces my earlier RUN on 71cccc04c. The PR's own changes, `resource.rs` and the README row, are line for line the same as on 71cccc04c; only main's commits came in. The head still merges cleanly into main 8f41d7d01. CI on 47cbe15d9: 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-fast` on the head: green, 564 passed / 0 failed / 52 ignored. Main d367675c7 gives 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), on d367675c7 and on the head: no new warning in `resource.rs` (3 already there, the same 3 on the head). - Red, behavioural, redone on this head: mutants of the fix with the test kept, run with `cargo test -p leonida-gpu --lib room_for_targets`. `room_for_targets_is_given_up_once_they_settle` fails for each one: - the settle branch of `targets_kept` cut: 640 MiB kept where the settled case expects 0; - `targets_seen` restarting the clock on any growth instead of 64 MiB: the record moves to (2050 MiB, 9000 ms) where (2000 MiB, 1000 ms) is expected; - the "half of the reserve" condition dropped: nothing is kept before the world, where 2420 MiB is expected. - Not covered here: the effect in the game. That is the in-game A/B's job. 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.
OreoFR commented 2026-12-01 03:16:26 +00:00 (Migrated from github.com)

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 47cbe15d9 merged into current main 90c514437 (clean), tested in one batch with #2589, #2766, #2709 and #2802 (main + all four, merged in that order, clean).

  • Red by mutation: with the settle branch of targets_kept cut (if false), room_for_targets_is_given_up_once_they_settle fails. The switch is off by default, so the run exercises the same path as main. The mutation was reverted after the run.
  • Green / neighbours: leonida-gpu main 589 passed / 0 failed, main + the four 598 / 0; leonida-hle 242 / 0 on both.
  • In-game run of the batch (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 breaks main, the others are split out and re-run.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7299530177 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7299530177). Originally posted by [OreoFR](https://github.com/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 `47cbe15d9` merged into current `main` `90c514437` (clean), tested in one batch with #2589, #2766, #2709 and #2802 (main + all four, merged in that order, clean). - **Red by mutation**: with the settle branch of `targets_kept` cut (`if false`), `room_for_targets_is_given_up_once_they_settle` fails. The switch is off by default, so the run exercises the same path as `main`. The mutation was reverted after the run. - **Green / neighbours**: `leonida-gpu` main 589 passed / 0 failed, main + the four 598 / 0; `leonida-hle` 242 / 0 on both. - **In-game run** of the batch (`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 breaks `main`, the others are split out and re-run.
OreoFR commented 2026-12-01 04:36:22 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-01T04:36:22Z.


Merging. Head 47cbe15d9 merges cleanly with main 86c30fcea (merge commit 5dd6d444f).
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-gpu 599 passed, 0 failed (main alone 590/0); -p leonida-hle 242/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 then main only 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 on cd9fe51a9).
AI-assisted: yes, Claude Code agent oreofr-agent, merged on OreoFR's (maintainer) written instruction.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7300905236 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2589#issuecomment-7300905236). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-12-01T04:36:22Z. --- Merging. Head `47cbe15d9` merges cleanly with main `86c30fcea` (merge commit `5dd6d444f`). 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-gpu` 599 passed, 0 failed (main alone 590/0); `-p leonida-hle` 242/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 then `main` only 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 on `cd9fe51a9`). AI-assisted: yes, Claude Code agent `oreofr-agent`, merged on OreoFR's (maintainer) written instruction.
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!2589
No description provided.