Repository navigation
Render-target reserve expires once the targets settle (LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS, off by default) - #2589
Conversation
…OOM_FOR_TARGETS_SETTLE_MS, 0 = off by default) PORT-NV-VRAM-TARGET-RESERVE-SETTLE. 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 expired: at 1440p targets level off at 2.1-2.9 GB, so 160-990 MB stayed kept for targets that never came while thousands of textures waited. With LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS set, once targets hold half the reserve or more and have not grown by 64 MiB for that many ms, nothing is kept; growth of 64 MiB brings the reserve back. Upstream defaults to 20,000 ms; here it is 0 (kept for the run, as before) because the behaviour would change for everyone. Ported from trustno1-coder/VIctory-NVIDIA 21b040da (readmet3xt-lab), GPL-3.0. Only the reserve change is taken; the same commit's room-test log line and pass timing counters (draw.rs, host.rs) are a separate subject and are left. Co-authored-by: readmet3xt-lab <238408149+readmet3xt-lab@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@DadaCap could you review this one when you have a moment? It merges cleanly with AI-assisted (Claude Code, Claude Opus 5.5), posted for MoonEyes. |
lixonik
left a comment
There was a problem hiding this comment.
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).
Only with LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS set; the default path returns before it. Lets a run show when the reserve expires and how many MB go to textures, for the A/B test of this setting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Answer with |
Physical Hardware Verification — Windows 11 + NVIDIA GeForce RTX 3090 (
|
lixonik
left a comment
There was a problem hiding this comment.
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.
| // 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; |
There was a problem hiding this comment.
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.
|
TAKEN | OreoFR (oreofr-agent, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11) | ETA 22:47 UTC |
|
Tested
No blocker from my side. AI-assisted (Claude Code). |
|
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. |
#2589 TEST-WANTED: LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS, A = 0 / B = 20000Local test, AI-assisted (Claude Code, Claude Opus 5.5). Values only: no captures, logs or game paths leave this machine.
RUN p2589-A3RUN p2589-B3RUN p2589-B4RUN p2589-A4VerdictPrediction refuted on this profile (Series S + DLSS, 8 GB), n=2 per arm: B never wrote a "given up" line (0 in Why, READ IN CODE ( 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
|
|
RUN A | 2026-11-29 02:51-03:06 UTC | enlight3d | AI-assisted: Claude Code (Claude Opus 5.5) RUN B | 2026-11-29 03:07-03:22 UTC | enlight3d | AI-assisted: Claude Code (Claude Opus 5.5) 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. |
|
DONE | #2589 (comment) |
Item: PORT-NV-VRAM-TARGET-RESERVE-SETTLE
Claim: #2570 (comment)
Source: trustno1-coder/VIctory-NVIDIA 21b040da (GPL-3.0), author readmet3xt-lab (credited in the commit with Co-authored-by and in the
d3d12/README.mdtable).The texture queue makes no new host copies while in use + kept for buffer copies + kept for render targets reaches 90 % of the card's budget. The target reserve (
LEONIDA_CARD_ROOM_FOR_TARGETS_MB, 3,072 MB less the targets made) never expires: at 1440p the targets level off at 2.1-2.9 GB, so 160-990 MB stay kept for targets that never come while thousands of textures wait.With
LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MSset, once the targets hold half the reserve or more and have not grown by 64 MiB for that many ms, nothing is kept; a growth of 64 MiB brings the reserve back. Upstream defaults to 20,000 ms. Here the default is 0 (reserve kept for the run, as before), because the behaviour would change for everyone. With the default, the code path is the one onmain.Only the reserve change is taken. The same upstream commit's room-test log line and pass timing counters (
draw.rs,host.rs) are a separate subject and are left out.Test:
room_for_targets_is_given_up_once_they_settle(cargo test -p leonida-gpu --lib room_for_targets), no game files. It does not compile onmain(the functions do not exist), and fails when the settle branch is cut. Passes on this branch merged withmain5cb4592. Crate-wide, the same 4 tests fail with and without the change (descriptor::hostviews_off_their_elements_get_a_copy_of_their_bytes,indirectbatch_tables,host_list_budget_starts_empty_at_each_submission,warp_batch_charges_every_execution). Not run in the title or on a GPU: the 20,000 ms value is upstream's measurement, not ours. May touch the same lines of text as #2569 (resource.rs) and #2557 (README table).AI-assisted (Claude Code, Claude Opus 5.5 and Sonnet 5.5); reviewed by a separate agent before opening.
🤖 Generated with Claude Code