d3d12: lists' scratch stays in the PC's memory by default for now (D3D12-SCRATCH-CARD-OFF-BY-DEFAULT) #2819

Merged
TheGeogeo merged 1 commit from upstream-pr/2819 into main 2026-12-01 02:28:37 +00:00
TheGeogeo commented 2026-12-01 01:40:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-12-01T01:40:47Z.


Claimed in the coordination issue as: D3D12-SCRATCH-CARD-OFF-BY-DEFAULT (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7297701069), part of enlighted's D3D12-REAPER-BOUNDED-QUEUE (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7293629499), agreed with them.

What and why

Lists' scratch memory goes into the card's own memory, where the CPU maps it, on cards whose budget is 9 GiB or more at the first ask and that have a GPU upload heap (resizable BAR). This came with 7b907de52. On those cards it churns chunks:

  • SPARE_CARD keeps 256 MiB in all and gives back an exact size only (Spare::take/give).
  • Once 4 MiB chunks fill it, the chunks of other sizes are let go in the list resets, on the reaper thread. They are then made again on the recording threads, behind a blocking MakeResident.
  • The reaper falls behind, and the lists and memory it holds pile up. That ends in a device loss, or worse.

Measured by enlighted on an RTX 3090 24 GB with a resizable BAR, standing 600 s, with LEONIDA_AB on this switch over 23 pairs:

Card scratch PC scratch
Frame median 64.6 ms 33.3 ms
Chunks made a second 1,158 0
MakeResident per frame 35.4 ms 0.01 ms
Card busy per frame 34.3 ms 32.9 ms

This turns it off by default for now, until enlighted's pool that keeps the card's spare chunks by size lands. That pool will turn it back on.

  • LEONIDA_SCRATCH_CARD=1 still puts the scratch in the card, and LEONIDA_AB still switches it.
  • A card that used to get it by default says so once in the log, with the switch to use.
  • The doc comment says the change is provisional. It cites both measurements: the one above, and the gain card scratch was made for (-0.9 to -1.7 ms of card time on a 4060 Ti 16 GB on PCIe 4.0 x8), which is lost meanwhile.
  • d3d12/docs/switches.md is regenerated. Only that switch's row changes.

Tested

On Windows 11 Pro 10.0, Rust 1.98.1 pinned:

  • cargo test -p leonida-gpu --lib --locked scratch_card: host::scratch_card_tests::card_scratch_is_off_unless_asked_for passes. It checks that nothing, 0 or another value means off, and that 1 means on.
  • Red on main: the test needs the new scratch_card_chosen, so it does not build there. The behaviour it pins is the default flip, read in scratch_card(). The behavioural proof is enlighted's gate on the 3090, which they will run on this head.
  • cargo clippy -p leonida-gpu --all-targets --locked adds no warning in the changed lines; the existing warnings elsewhere are as on main.
  • tools/d3d12_switches.py --check d3d12/docs/switches.md, the docs tests and scripts/check_no_game_data.py are clean. It merges cleanly with current main.

GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 32.0.16.2140: build and unit test only. This card has no GPU upload heap, so the change has no effect on it in game.

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5577193449 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2819). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-12-01T01:40:47Z. --- Claimed in the coordination issue as: D3D12-SCRATCH-CARD-OFF-BY-DEFAULT (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7297701069), part of enlighted's D3D12-REAPER-BOUNDED-QUEUE (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7293629499), agreed with them. ### What and why Lists' scratch memory goes into the card's own memory, where the CPU maps it, on cards whose budget is 9 GiB or more at the first ask and that have a GPU upload heap (resizable BAR). This came with 7b907de52. On those cards it churns chunks: - `SPARE_CARD` keeps 256 MiB in all and gives back an exact size only (`Spare::take`/`give`). - Once 4 MiB chunks fill it, the chunks of other sizes are let go in the list resets, on the reaper thread. They are then made again on the recording threads, behind a blocking `MakeResident`. - The reaper falls behind, and the lists and memory it holds pile up. That ends in a device loss, or worse. Measured by enlighted on an RTX 3090 24 GB with a resizable BAR, standing 600 s, with `LEONIDA_AB` on this switch over 23 pairs: | | Card scratch | PC scratch | | --- | --- | --- | | Frame median | 64.6 ms | 33.3 ms | | Chunks made a second | 1,158 | 0 | | `MakeResident` per frame | 35.4 ms | 0.01 ms | | Card busy per frame | 34.3 ms | 32.9 ms | This turns it off by default for now, until enlighted's pool that keeps the card's spare chunks by size lands. That pool will turn it back on. - `LEONIDA_SCRATCH_CARD=1` still puts the scratch in the card, and `LEONIDA_AB` still switches it. - A card that used to get it by default says so once in the log, with the switch to use. - The doc comment says the change is provisional. It cites both measurements: the one above, and the gain card scratch was made for (-0.9 to -1.7 ms of card time on a 4060 Ti 16 GB on PCIe 4.0 x8), which is lost meanwhile. - `d3d12/docs/switches.md` is regenerated. Only that switch's row changes. ### Tested On Windows 11 Pro 10.0, Rust 1.98.1 pinned: - `cargo test -p leonida-gpu --lib --locked scratch_card`: `host::scratch_card_tests::card_scratch_is_off_unless_asked_for` passes. It checks that nothing, `0` or another value means off, and that `1` means on. - Red on `main`: the test needs the new `scratch_card_chosen`, so it does not build there. The behaviour it pins is the default flip, read in `scratch_card()`. The behavioural proof is enlighted's gate on the 3090, which they will run on this head. - `cargo clippy -p leonida-gpu --all-targets --locked` adds no warning in the changed lines; the existing warnings elsewhere are as on `main`. - `tools/d3d12_switches.py --check d3d12/docs/switches.md`, the docs tests and `scripts/check_no_game_data.py` are clean. It merges cleanly with current `main`. GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 32.0.16.2140: build and unit test only. This card has no GPU upload heap, so the change has no effect on it in game. AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change)
OreoFR commented 2026-12-01 01:42:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-01T01:42:18Z.


Verified by OreoFR on macOS 27.2.1, Apple M5, head f8ad7e245, main d920d850d. This is a type-check plus a code read: leonida-gpu does not build natively on macOS, so the Mac can't run the new unit test or a gate.

MEASURED

  • git merge-tree onto main gives no conflicts.
  • cargo check --target x86_64-pc-windows-msvc (no MSVC; the cc build steps are replaced with stand-ins), main vs main + this PR, exit 0 on both sides. The sorted warning lists are byte-identical: 19 / 19 default, 11 / 11 diagnostics, 24 / 24 --tests (this compiles scratch_card_tests), and 19 / 19 for leonida-hle --tests.

READ IN CODE

  • The LEONIDA_AB pick stays first in scratch_card() under diagnostics, so A/B by turns still works both ways.
  • scratch_card_chosen() is a pure function: on only with Some("1"); unset, 0 and any other value give off. Before, 0 was off, 1 on, and anything else meant "by budget". Now anything else means off. The new test pins all four cases.
  • The one-time tracing::info! fires only where the old default would have been on: a budget of at least 9 GiB, and host.mapped_card_memory() (it exists on main, at host.rs:13734). That matches the real old behavior, where without a GPU upload heap the scratch fell back to PC memory anyway (thegeogeo's analysis, seq 2217).
  • The doc comment and the switches.md row say the new default and why, with enlighted's SC-1 figures, and note that the 7b907de52 gain is given up for now.

ASSUMED

  • No gate run here. The expected effect on a ≥ 9 GiB card with ReBAR is enlighted's SC-1 measurement (3090, 33.3 vs 64.6 ms). Cards under 9 GiB already defaulted to PC memory, so nothing changes for them.

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7297799387 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2819#issuecomment-7297799387). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-12-01T01:42:18Z. --- Verified by OreoFR on macOS 27.2.1, Apple M5, head `f8ad7e245`, main `d920d850d`. This is a type-check plus a code read: `leonida-gpu` does not build natively on macOS, so the Mac can't run the new unit test or a gate. **MEASURED** - `git merge-tree` onto main gives no conflicts. - `cargo check --target x86_64-pc-windows-msvc` (no MSVC; the `cc` build steps are replaced with stand-ins), main vs main + this PR, exit 0 on both sides. The sorted warning lists are byte-identical: 19 / 19 default, 11 / 11 `diagnostics`, 24 / 24 `--tests` (this compiles `scratch_card_tests`), and 19 / 19 for `leonida-hle --tests`. **READ IN CODE** - The `LEONIDA_AB` pick stays first in `scratch_card()` under `diagnostics`, so A/B by turns still works both ways. - `scratch_card_chosen()` is a pure function: on only with `Some("1")`; unset, `0` and any other value give off. Before, `0` was off, `1` on, and anything else meant "by budget". Now anything else means off. The new test pins all four cases. - The one-time `tracing::info!` fires only where the old default would have been on: a budget of at least 9 GiB, **and** `host.mapped_card_memory()` (it exists on main, at `host.rs:13734`). That matches the real old behavior, where without a GPU upload heap the scratch fell back to PC memory anyway (thegeogeo's analysis, seq 2217). - The doc comment and the `switches.md` row say the new default and why, with enlighted's SC-1 figures, and note that the 7b907de52 gain is given up for now. **ASSUMED** - No gate run here. The expected effect on a ≥ 9 GiB card with ReBAR is enlighted's SC-1 measurement (3090, 33.3 vs 64.6 ms). Cards under 9 GiB already defaulted to PC memory, so nothing changes for them. AI-assisted: Claude Code
OreoFR commented 2026-12-01 02:13:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-01T02:13:27Z.


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.

Head f8ad7e245 merged into main d920d850d with git merge --no-ff in a scratch worktree (clean, 2 files: host.rs, switches.md). check_no_game_data.py on both: exit 0.

Tests (cargo test --locked -p leonida-gpu, from d3d12/):

  • main + PR: 583 passed, 1 failed; the one failure is only_what_differs_goes_up, already failing on plain main at the time (582 passed, same 1) and fixed since by #2820. No new failure; +1 is the new card_scratch_is_off_unless_asked_for.
  • Red by mutation: with scratch_card_chosen put back to the old default (on unless 0), the new test fails (host.rs:2494). Reverted, tree clean.

In-game run on the merged build (diagnostics,mimalloc, no DLSS), fresh copy of our gate data, -SeriesS -NoDlss -NoFrameGen, BAR 0, texture budget 1024, walking: the keys file (LEONIDA_KEYS_FILE) held W with turns (L/J) in a 14 s loop; the game logged 100 scripted key changes.

  • 330 s in the world, then a clean close. 0 device loss, 0 ERROR lines, no crash.
  • Steady part: median 20.5 fps over the last 30 fps lines (min 10.2), private memory 23.6 GB at the end (7.6 GB of RAM free).

Limits: this card's budget is under 9 GiB, so it already had the scratch in the PC's memory before this change: the run shows no regression, not the gain. The gain is enlighted's measured A/B on this switch (RTX 3090, 23 pairs), cited in the description; their 3090 gate on this head was announced.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7298377111 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2819#issuecomment-7298377111). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-12-01T02:13:27Z. --- **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. Head `f8ad7e245` merged into `main` `d920d850d` with `git merge --no-ff` in a scratch worktree (clean, 2 files: `host.rs`, `switches.md`). `check_no_game_data.py` on both: exit 0. **Tests** (`cargo test --locked -p leonida-gpu`, from `d3d12/`): - main + PR: **583 passed, 1 failed**; the one failure is `only_what_differs_goes_up`, already failing on plain main at the time (582 passed, same 1) and fixed since by #2820. No new failure; +1 is the new `card_scratch_is_off_unless_asked_for`. - **Red by mutation**: with `scratch_card_chosen` put back to the old default (on unless `0`), the new test fails (`host.rs:2494`). Reverted, tree clean. **In-game run** on the merged build (`diagnostics,mimalloc`, no DLSS), fresh copy of our gate data, `-SeriesS -NoDlss -NoFrameGen`, BAR 0, texture budget 1024, **walking**: the keys file (`LEONIDA_KEYS_FILE`) held W with turns (L/J) in a 14 s loop; the game logged 100 scripted key changes. - **330 s in the world**, then a clean close. **0 device loss, 0 ERROR lines, no crash.** - Steady part: median 20.5 fps over the last 30 fps lines (min 10.2), private memory 23.6 GB at the end (7.6 GB of RAM free). **Limits:** this card's budget is under 9 GiB, so it already had the scratch in the PC's memory before this change: the run shows no regression, not the gain. The gain is enlighted's measured A/B on this switch (RTX 3090, 23 pairs), cited in the description; their 3090 gate on this head was announced.
fiestorra commented 2026-12-01 02:14:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-01T02:14:49Z.


Verified on Windows: the new test passes, and the crate is one test greener with nothing else moved. The one failure in the crate is main's, not this pull request's.

main d920d850d, cherry-picked (the branch is at main, merge-base = d920d850d), cargo 1.98.1, warm target:

cargo test -p leonida-gpu --lib card_scratch_is_off_unless_asked_for
  ok. 1 passed; 0 failed; 636 filtered out

cargo test -p leonida-gpu --lib
  FAILED. 583 passed; 1 failed; 53 ignored
    the failure: host::refresh_tests::only_what_differs_goes_up

That one failure is red on main before this diff, and #2820 fixes it - I checked it on a clean main earlier today, so it is not yours. main has 582 passed and this has 583, which is exactly the one test this adds.

What the change is, from the code and the doc line together: scratch_card_chosen(switch) and a test for it, and LEONIDA_SCRATCH_CARD becomes "off unless asked for" in docs/switches.md. A default flipping is the kind of change that needs the test that arrives with it, and it is here.

What I did not run: the title path itself - lists' scratch actually staying in the PC's memory needs a title with lists to allocate, which needs the game. The switch's decision function and its test are what I can measure, and they are green.

One thing worth checking before merge: #2820 makes the crate green, and this one adds a test to it. Whichever lands second will need the other's context to look green in CI - host::refresh_tests::only_what_differs_goes_up is red on main today, so this branch will show that red until #2820 lands.

AI-assisted: yes - DeepSeek v4.1 (flash), which ran both the new test and the crate.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7298401685 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2819#issuecomment-7298401685). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-01T02:14:49Z. --- **Verified on Windows: the new test passes, and the crate is one test greener with nothing else moved. The one failure in the crate is `main`'s, not this pull request's.** **`main` `d920d850d`, cherry-picked (the branch is at `main`, `merge-base` = `d920d850d`), `cargo 1.98.1`, warm target:** ``` cargo test -p leonida-gpu --lib card_scratch_is_off_unless_asked_for ok. 1 passed; 0 failed; 636 filtered out cargo test -p leonida-gpu --lib FAILED. 583 passed; 1 failed; 53 ignored the failure: host::refresh_tests::only_what_differs_goes_up ``` **That one failure is red on `main` before this diff, and #2820 fixes it** - **I checked it on a clean `main` earlier today, so it is not yours.** **`main` has 582 passed and this has 583, which is exactly the one test this adds.** **What the change is, from the code and the doc line together**: **`scratch_card_chosen(switch)` and a test for it, and `LEONIDA_SCRATCH_CARD` becomes "off unless asked for" in `docs/switches.md`.** **A default flipping is the kind of change that needs the test that arrives with it, and it is here.** **What I did not run**: **the title path itself** - **lists' scratch actually staying in the PC's memory needs a title with lists to allocate**, **which needs the game.** **The switch's decision function and its test are what I can measure, and they are green.** **One thing worth checking before merge**: **#2820 makes the crate green, and this one adds a test to it.** **Whichever lands second will need the other's context to look green in CI** - **`host::refresh_tests::only_what_differs_goes_up` is red on `main` today, so this branch will show that red until #2820 lands.** **AI-assisted:** yes - DeepSeek v4.1 (flash), which ran both the new test and the crate. Written with an AI assistant.
enlight3d commented 2026-12-01 02:26:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-12-01T02:26:18Z.


RUN (independent run on Windows, #2819 head f8ad7e245, merged locally into main d920d850d with git merge --no-ff, no conflicts. The head still merges cleanly into main bf19719ab. CI on the head: 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: main 582 passed / 1 failed / 53 ignored; merge 583 / 1 / 53. card_scratch_is_off_unless_asked_for passes.
  • cargo test -p leonida-gpu --no-fail-fast --features diagnostics: main 663 / 1 / 54; merge 664 / 1 / 54.
  • The one failure is host::refresh_tests::only_what_differs_goes_up (assertion, left []). It fails on main and on the merge alike, in both builds, so it has nothing to do with this PR.
  • Red, build: on main with only the new test module added, it does not compile (E0432, scratch_card_chosen not found). That proves only that the function is new.
  • Red, by assertion: the merge with scratch_card_chosen put back to main's default rule (1 on, 0 off, otherwise on where the card's budget is 9 GiB or more, given this card's 24 GiB). cargo test -p leonida-gpu --lib scratch_card then fails on !scratch_card_chosen(None). So the test pins the new default, and main's rule fails it on a card like the RTX 3090 here.
  • 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: host.rs has the same 5 warnings on both sides, all outside the changed lines. None is new.
  • d3d12/docs/switches.md: python -I tools/d3d12_switches.py --check d3d12/docs/switches.md is clean on the merge. A fresh --out to a scratch file is byte-identical to the committed page, on the merge and on main (each against its own sources). Only the LEONIDA_SCRATCH_CARD row changes.
  • Not covered here: the effect in the game (chunks made, MakeResident, the reaper, frame times). That needs the in-game gate below.

In-game gate on the RTX 3090 (24 GB, NVIDIA 621.40, Windows 11), leonida.exe built from this head (f8ad7e245; d3d12/scripts/build-nvidia.ps1, diag profile, no DLSS files), scripts/play-d3d12.ps1 -SeriesS -NoDlss -NoFrameGen at the launcher's defaults otherwise (no LEONIDA_REAPER=0, no other override), the same save restored, standing still, with LEONIDA_NO_WATCHDOG=1 and a stall-mode timeline; warm-up and a throwaway run first. PASS: 600 s, world at 73 s (527 s in the world), no device loss, no gap over 10 s between frames. The log says scratch stays in the PC's memory by default.

  • The release thread's pile-up is gone on its own: reaper line at most 140 (0 at 180, 300, 420 and 600 s), no mapped scratch in card memory, private memory flat at most 28.9 GB, VRAM at most 12.9 GB. Host lists made ~0.02 a frame, preludes ~0.03 a frame.
  • Frame rate: median 23.3 fps (p5 19.1), frame median 42.9 ms. For comparison, two default runs of main 8f41d7d01 on this machine gave 18.0 fps (p5 12.9) and 12.1 fps (p5 5.2, piled up: line 398,312, mapped scratch 10.9 GB, 112.7 GB private). Caveat: this gate ran beside a cargo build (total CPU 92-100 %), so its frame rate is if anything pessimistic; a measured in-run A/B of LEONIDA_SCRATCH_CARD on this card (23 pairs, standalone) gave 33.3 ms against 64.6 ms per frame.

Not checked: Series X, walking, picture; cards between 9 and 16 GB.

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:7298614145 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2819#issuecomment-7298614145). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-12-01T02:26:18Z. --- RUN (independent run on Windows, #2819 head f8ad7e245, merged locally into main d920d850d with `git merge --no-ff`, no conflicts. The head still merges cleanly into main bf19719ab. CI on the head: 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`: main 582 passed / 1 failed / 53 ignored; merge 583 / 1 / 53. `card_scratch_is_off_unless_asked_for` passes. - `cargo test -p leonida-gpu --no-fail-fast --features diagnostics`: main 663 / 1 / 54; merge 664 / 1 / 54. - The one failure is `host::refresh_tests::only_what_differs_goes_up` (assertion, left `[]`). It fails on main and on the merge alike, in both builds, so it has nothing to do with this PR. - Red, build: on main with only the new test module added, it does not compile (E0432, `scratch_card_chosen` not found). That proves only that the function is new. - Red, by assertion: the merge with `scratch_card_chosen` put back to main's default rule (`1` on, `0` off, otherwise on where the card's budget is 9 GiB or more, given this card's 24 GiB). `cargo test -p leonida-gpu --lib scratch_card` then fails on `!scratch_card_chosen(None)`. So the test pins the new default, and main's rule fails it on a card like the RTX 3090 here. - `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: `host.rs` has the same 5 warnings on both sides, all outside the changed lines. None is new. - `d3d12/docs/switches.md`: `python -I tools/d3d12_switches.py --check d3d12/docs/switches.md` is clean on the merge. A fresh `--out` to a scratch file is byte-identical to the committed page, on the merge and on main (each against its own sources). Only the `LEONIDA_SCRATCH_CARD` row changes. - Not covered here: the effect in the game (chunks made, `MakeResident`, the reaper, frame times). That needs the in-game gate below. In-game gate on the RTX 3090 (24 GB, NVIDIA 621.40, Windows 11), leonida.exe built from this head (f8ad7e245; `d3d12/scripts/build-nvidia.ps1`, diag profile, no DLSS files), `scripts/play-d3d12.ps1 -SeriesS -NoDlss -NoFrameGen` at the launcher's defaults otherwise (no `LEONIDA_REAPER=0`, no other override), the same save restored, standing still, with `LEONIDA_NO_WATCHDOG=1` and a stall-mode timeline; warm-up and a throwaway run first. **PASS**: 600 s, world at 73 s (527 s in the world), no device loss, no gap over 10 s between frames. The log says scratch stays in the PC's memory by default. - **The release thread's pile-up is gone on its own:** reaper line at most 140 (0 at 180, 300, 420 and 600 s), no mapped scratch in card memory, private memory flat at most 28.9 GB, VRAM at most 12.9 GB. Host lists made ~0.02 a frame, preludes ~0.03 a frame. - **Frame rate:** median 23.3 fps (p5 19.1), frame median 42.9 ms. For comparison, two default runs of main 8f41d7d01 on this machine gave 18.0 fps (p5 12.9) and 12.1 fps (p5 5.2, piled up: line 398,312, mapped scratch 10.9 GB, 112.7 GB private). Caveat: this gate ran beside a cargo build (total CPU 92-100 %), so its frame rate is if anything pessimistic; a measured in-run A/B of `LEONIDA_SCRATCH_CARD` on this card (23 pairs, standalone) gave 33.3 ms against 64.6 ms per frame. Not checked: Series X, walking, picture; cards between 9 and 16 GB. 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 02:28:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-01T02:28:55Z.


Merging. Head f8ad7e245 merges cleanly with main d921489d1 (merge commit 90c514437).
Claim: D3D12-SCRATCH-CARD-OFF-BY-DEFAULT, https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7297701069 (author TheGeogeo), part of enlighted's D3D12-REAPER-BOUNDED-QUEUE, agreed by them.
Red/green: by oreofr-agent (not the author), RTX 4070 Laptop, Windows 11: red by mutation (old default put back, the new test fails), green on this head. I ran cargo test --locked -p leonida-gpu on this head merged into the current main d921489d1: 589 passed, 0 failed.
In-game run: RTX 4070 Laptop 8 GB, NVIDIA 621.40, 330 s in the world walking, 0 device loss (comment above). This card already had the PC scratch before the change, so it shows no regression, not the gain. The gain is enlighted's measured A/B on this switch (RTX 3090, 23 pairs); OreoFR chose in writing not to wait for their 3090 gate on this head.
CI: green on the head (all 5 checks) and on main (CI, No Game Data; Runtime last green on cd9fe51a9, not triggered since).
AI-assisted: yes, Claude Code agent oreofr-agent, merged on OreoFR's (maintainer) written instruction.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7298660760 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2819#issuecomment-7298660760). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-12-01T02:28:55Z. --- Merging. Head `f8ad7e245` merges cleanly with main `d921489d1` (merge commit `90c514437`). Claim: D3D12-SCRATCH-CARD-OFF-BY-DEFAULT, https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7297701069 (author TheGeogeo), part of enlighted's D3D12-REAPER-BOUNDED-QUEUE, agreed by them. Red/green: by oreofr-agent (not the author), RTX 4070 Laptop, Windows 11: red by mutation (old default put back, the new test fails), green on this head. I ran `cargo test --locked -p leonida-gpu` on this head merged into the current main `d921489d1`: 589 passed, 0 failed. In-game run: RTX 4070 Laptop 8 GB, NVIDIA 621.40, 330 s in the world walking, 0 device loss (comment above). This card already had the PC scratch before the change, so it shows no regression, not the gain. The gain is enlighted's measured A/B on this switch (RTX 3090, 23 pairs); OreoFR chose in writing not to wait for their 3090 gate on this head. CI: green on the head (all 5 checks) and on main (CI, No Game Data; Runtime last green on `cd9fe51a9`, not triggered since). AI-assisted: yes, Claude Code agent `oreofr-agent`, merged on OreoFR's (maintainer) written instruction.
OreoFR commented 2026-12-01 02:32:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-01T02:32:25Z.


Correction to my merge comment above: enlighted's RTX 3090 gate on this head was posted two minutes before the merge (https://github.com/ProjectLeonida/mandy/pull/2819#issuecomment-7298614145): PASS, 527 s in the world, 0 device loss, at the default settings; the reaper pile-up gone (queue max 140, private memory flat at 28.9 GB), median 23.3 fps against 18.0 and 12.1 on main. So the change was also run on a card where it takes effect. AI-assisted (Claude Code agent oreofr-agent).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7298725701 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2819#issuecomment-7298725701). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-12-01T02:32:25Z. --- Correction to my merge comment above: enlighted's RTX 3090 gate on this head **was** posted two minutes before the merge (https://github.com/ProjectLeonida/mandy/pull/2819#issuecomment-7298614145): PASS, 527 s in the world, 0 device loss, at the default settings; the reaper pile-up gone (queue max 140, private memory flat at 28.9 GB), median 23.3 fps against 18.0 and 12.1 on main. So the change was also run on a card where it takes effect. AI-assisted (Claude Code agent `oreofr-agent`).
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!2819
No description provided.