d3d12: attribute residency pressure using active thresholds #2951

Open
NetZlash wants to merge 3 commits from upstream-pr/2951 into main
NetZlash commented 2026-12-01 21:07:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by NetZlash on 2026-12-01T21:07:44Z.


Claimed in the coordination issue as: D3D12-RESIDENCY-PRESSURE-ATTRIBUTION

What and why

The physical-only counter used the fixed 4 GiB commit entry threshold to attribute every pressured sample. A host that is already under pressure and has 6 GiB free physical memory and 5 GiB commit headroom stays under pressure due to commit. The old diagnostic counted that sample as physical-only.

Derive the pressure decision and the three diagnostic counts from the same physical and commit constraints. Entry still uses inclusive 3 GiB physical and 4 GiB commit thresholds. Retention still applies below 5 GiB physical or below 6 GiB commit. Each pressured sample now records one of three categories under the active thresholds: physical only, commit only, or both. For example, 1 GiB of free physical memory and 5.9 GiB of commit headroom counts as physical only at entry and as both during retention, making the physical constraint visible in both samples. The change is limited to attribution and its log wording. Admission decisions and memory budgets retain their original behavior.

Counts describe successful samples taken roughly once per second. Shorter spikes can fall between samples. The sweep reads commit headroom directly, and the separate critical-commit query uses a 32 ms cache and also considers recent allocation failures.

Tested

  • Red. Ran cargo test -p leonida-gpu --lib --locked residency::tests::physical_only_pressure_uses_the_active_thresholds -- --exact after a behavior-preserving extraction of the original predicate. Exit 101. The assertion for 6 GiB free RAM and 5 GiB commit headroom saw physical_only=true, with false expected.

  • Green. All four residency tests passed with default features and with diagnostics. The regression covers entry and retention, both constraints, physical-only and commit-only pressure, recovery, and single-byte boundaries. Existing admission and prefetch tests also pass.

  • cargo build --workspace --all-targets --locked passed. The original workspace regression run used --no-fail-fast, excluded xtask, and applied the documented depth_bounds_pipeline_loads_and_filters_draws skip. The leonida-gpu unit suite passed 644 tests.

  • On the synchronized branch, leonida-gpu passed 644 unit tests with the same depth-bounds skip (59 ignored). The four residency tests also passed again with diagnostics.

  • Five pre-existing workspace failures. All reproduced on clean upstream 1e3e316c5e7b072bc26a3e3ce78950b9fde84a43, the base of the original workspace run.

    • settings_line::a_run_logs_the_settings_it_starts_with failed with inherited RUST_LOG=warn. It passed on both revisions with RUST_LOG unset for the test process.
    • emit::barycentric_tests::a_masked_pixel_program_reads_the_position_where_the_vertex_program_writes_it
    • emit::barycentric_tests::first_half_values_render_on_hardware_and_warp
    • emit::rect::tests::rectangles_are_drawn_whole
    • emit::rect::tests::the_rectangle_stage_is_a_geometry_shader

    The four leonida-shader tests failed DXIL validation on both revisions with Container part 'Pipeline State Validation' does not match expected for module.

  • cargo test -p leonida-gpu --features diagnostics --test replay --locked -- --nocapture passed again on the synchronized branch. The synthetic D3D12 fixture recorded and replayed a frame with identical picture hashes.

  • All 24 game-gate Python tests passed. git diff --check and the repository-wide python -I scripts/check_no_game_data.py passed. An independent read-only review found no blocking issues.

  • Review follow-up 26da88e8 tested the counter update used by refresh() on a synthetic sample sequence. A mutation that recorded a physical-only sample as mixed made the new test fail. All four targeted tests passed with and without diagnostics after restoring the counter. This includes the reported low-RAM example, both hysteresis states and recovery.

  • The follow-up replay passed, and the 644-test GPU suite passed in both parallel and serial reruns with the same depth-bounds skip. The initial parallel follow-up run had two intermittent failures in unrelated descriptor and alias-cast tests. The reruns and a parallel run of the previously published head passed both cases.

GPUs tested: Windows 11 Pro x64 build 26200 host with an NVIDIA GeForce RTX 4070 SUPER and driver 621.40. Synthetic replay uses the default D3D12 adapter. The residency regression runs on the CPU. The tested scope is diagnostic attribution.

AI-assisted: Yes. GPT-6.2 Sol (gpt-6.2-sol) implemented and tested the change. GPT-6.2 Astra (gpt-6.2-astra) performed the independent read-only review.

Checklist

  • Based on upstream main at 1fff69129529c2f45d2e8f7524278ecefe291e0c and merges cleanly.
  • One topic. Follow-up work goes in a new pull request.
  • No game data, keys or decryption, including in the quoted test output.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5594565747 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2951). Originally posted by [NetZlash](https://github.com/NetZlash) on 2026-12-01T21:07:44Z. --- Claimed in the coordination issue as: [D3D12-RESIDENCY-PRESSURE-ATTRIBUTION](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7324920459) ### What and why The physical-only counter used the fixed 4 GiB commit entry threshold to attribute every pressured sample. A host that is already under pressure and has 6 GiB free physical memory and 5 GiB commit headroom stays under pressure due to commit. The old diagnostic counted that sample as physical-only. Derive the pressure decision and the three diagnostic counts from the same physical and commit constraints. Entry still uses inclusive 3 GiB physical and 4 GiB commit thresholds. Retention still applies below 5 GiB physical or below 6 GiB commit. Each pressured sample now records one of three categories under the active thresholds: physical only, commit only, or both. For example, 1 GiB of free physical memory and 5.9 GiB of commit headroom counts as physical only at entry and as both during retention, making the physical constraint visible in both samples. The change is limited to attribution and its log wording. Admission decisions and memory budgets retain their original behavior. Counts describe successful samples taken roughly once per second. Shorter spikes can fall between samples. The sweep reads commit headroom directly, and the separate critical-commit query uses a 32 ms cache and also considers recent allocation failures. ### Tested - **Red.** Ran `cargo test -p leonida-gpu --lib --locked residency::tests::physical_only_pressure_uses_the_active_thresholds -- --exact` after a behavior-preserving extraction of the original predicate. Exit 101. The assertion for 6 GiB free RAM and 5 GiB commit headroom saw `physical_only=true`, with `false` expected. - **Green.** All four residency tests passed with default features and with `diagnostics`. The regression covers entry and retention, both constraints, physical-only and commit-only pressure, recovery, and single-byte boundaries. Existing admission and prefetch tests also pass. - `cargo build --workspace --all-targets --locked` passed. The original workspace regression run used `--no-fail-fast`, excluded `xtask`, and applied the documented `depth_bounds_pipeline_loads_and_filters_draws` skip. The `leonida-gpu` unit suite passed 644 tests. - On the synchronized branch, `leonida-gpu` passed 644 unit tests with the same depth-bounds skip (59 ignored). The four residency tests also passed again with `diagnostics`. - **Five pre-existing workspace failures.** All reproduced on clean upstream `1e3e316c5e7b072bc26a3e3ce78950b9fde84a43`, the base of the original workspace run. - `settings_line::a_run_logs_the_settings_it_starts_with` failed with inherited `RUST_LOG=warn`. It passed on both revisions with `RUST_LOG` unset for the test process. - `emit::barycentric_tests::a_masked_pixel_program_reads_the_position_where_the_vertex_program_writes_it` - `emit::barycentric_tests::first_half_values_render_on_hardware_and_warp` - `emit::rect::tests::rectangles_are_drawn_whole` - `emit::rect::tests::the_rectangle_stage_is_a_geometry_shader` The four `leonida-shader` tests failed DXIL validation on both revisions with `Container part 'Pipeline State Validation' does not match expected for module`. - `cargo test -p leonida-gpu --features diagnostics --test replay --locked -- --nocapture` passed again on the synchronized branch. The synthetic D3D12 fixture recorded and replayed a frame with identical picture hashes. - All 24 game-gate Python tests passed. `git diff --check` and the repository-wide `python -I scripts/check_no_game_data.py` passed. An independent read-only review found no blocking issues. - Review follow-up `26da88e8` tested the counter update used by `refresh()` on a synthetic sample sequence. A mutation that recorded a physical-only sample as mixed made the new test fail. All four targeted tests passed with and without `diagnostics` after restoring the counter. This includes the reported low-RAM example, both hysteresis states and recovery. - The follow-up replay passed, and the 644-test GPU suite passed in both parallel and serial reruns with the same depth-bounds skip. The initial parallel follow-up run had two intermittent failures in unrelated descriptor and alias-cast tests. The reruns and a parallel run of the previously published head passed both cases. GPUs tested: Windows 11 Pro x64 build 26200 host with an NVIDIA GeForce RTX 4070 SUPER and driver 621.40. Synthetic replay uses the default D3D12 adapter. The residency regression runs on the CPU. The tested scope is diagnostic attribution. AI-assisted: Yes. GPT-6.2 Sol (`gpt-6.2-sol`) implemented and tested the change. GPT-6.2 Astra (`gpt-6.2-astra`) performed the independent read-only review. ### Checklist - [x] Based on upstream `main` at `1fff69129529c2f45d2e8f7524278ecefe291e0c` and merges cleanly. - [x] One topic. Follow-up work goes in a new pull request. - [x] No game data, keys or decryption, including in the quoted test output.
andrew-ai commented 2026-12-01 21:19:04 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by andrew-ai on 2026-12-01T21:19:04Z.


Verified the physical-only counter on native Windows across full pressure transitions on base 1fff69129 and head 89d7808a3. A temporary test supplied synthetic values at the OS memory-status boundary and called the crate's actual refresh(). For each physical/commit pair, I tested entry from a recovered state and retention from a primed state. The grid includes the exact thresholds and their one-byte neighbors.

Replay result Base PR Expected
Successful samples 1,944 1,944 1,944
Under pressure 866 866 866
Physical memory alone 506 416 416
Critical commit 108 108 108

The base overcounted physical-only pressure by 90 in this synthetic sequence. Both trees matched the expected pressure flag, instantaneous headroom, low-water marks, and pressure/critical counts after every successful sample. After each of 648 injected failed reads, the pressure flag, sample count and physical-only count stayed unchanged. I found the old wording in historical findings but no other tracked literal consumer of that wording.

This verifies attribution without inducing real memory pressure. Claim in #2570. AI-assisted with OpenAI Codex (GPT-6).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7326070546 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2951#issuecomment-7326070546). Originally posted by [andrew-ai](https://github.com/andrew-ai) on 2026-12-01T21:19:04Z. --- Verified the physical-only counter on native Windows across full pressure transitions on base `1fff69129` and head `89d7808a3`. A temporary test supplied synthetic values at the OS memory-status boundary and called the crate's actual `refresh()`. For each physical/commit pair, I tested entry from a recovered state and retention from a primed state. The grid includes the exact thresholds and their one-byte neighbors. | Replay result | Base | PR | Expected | | --- | ---: | ---: | ---: | | Successful samples | 1,944 | 1,944 | 1,944 | | Under pressure | 866 | 866 | 866 | | Physical memory alone | 506 | 416 | 416 | | Critical commit | 108 | 108 | 108 | The base overcounted physical-only pressure by 90 in this synthetic sequence. Both trees matched the expected pressure flag, instantaneous headroom, low-water marks, and pressure/critical counts after every successful sample. After each of 648 injected failed reads, the pressure flag, sample count and physical-only count stayed unchanged. I found the old wording in historical findings but no other tracked literal consumer of that wording. This verifies attribution without inducing real memory pressure. [Claim in #2570](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7325981794). AI-assisted with OpenAI Codex (GPT-6).
NetZlash commented 2026-12-01 21:26:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by NetZlash on 2026-12-01T21:26:54Z.


Thanks for running the Windows replay through refresh(). The matching pressure and critical-commit totals across 1,944 samples, together with the failed-read checks, extend the regression coverage to the refresh path. The head's physical-only count matches the expected 416, which supports the diagnostic attribution change. I appreciate the check for other consumers of the log wording.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7326264617 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2951#issuecomment-7326264617). Originally posted by [NetZlash](https://github.com/NetZlash) on 2026-12-01T21:26:54Z. --- Thanks for running the Windows replay through `refresh()`. The matching pressure and critical-commit totals across 1,944 samples, together with the failed-read checks, extend the regression coverage to the refresh path. The head's physical-only count matches the expected 416, which supports the diagnostic attribution change. I appreciate the check for other consumers of the log wording.
KelboLive commented 2026-12-01 21:28:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T21:28:24Z.

Review: COMMENTED


Direction is right: next_pressure (residency.rs:180-190) fixes the 6 GiB free / 5 GiB commit mislabel, and using only .0 at :198 leaves admission behaviour unchanged — the boolean itself is the same expression, so this is attribution only.

Two things to adjust:

  1. The retention thresholds undercount severe physical pressure. Because physical_only uses the retention pair, physical = 1 GiB with commit = 5.9 GiB is labelled not physical-only — which is exactly the low-RAM shape in docs/findings.md:716 ("360–390 MB free … while 5.9 to 7.0 GB are left to commit"). It also means identical (physical, commit) samples are labelled differently on the entry sample vs later ones, and the label flips at exactly 6 GiB. Consider reporting physical-only / commit-only / both, or attributing against the entry thresholds, so the severe-physical case is not hidden.
  2. The counter wiring is untested. Changing if physical_only to if false && physical_only (:202) leaves all four residency tests green — the new test covers only the pure predicate. A refresh()-level assertion (or a seam for the sample) would pin it.

Sampling note: 1 Hz is fine for prevalence over minutes, but these counts are sample-seconds, not pressure episodes, and sub-second spikes are invisible; refresh() also samples commit directly while critical_commit() uses the 32 ms cache, so the two readings can disagree slightly. Worth a sentence in the body.

pipeline::/crate suite is 645/0/59 (the two diagnostics failures under --features diagnostics are the known parallel flakes, green alone). Merge with current main is clean, and #2929/#2658/#2765 are file-disjoint — host RAM/commit attribution vs adapter VRAM budgets, so no double counting.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6140472721 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2951#pullrequestreview-6140472721). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-12-01T21:28:24Z. **Review:** COMMENTED --- Direction is right: `next_pressure` (`residency.rs:180-190`) fixes the 6 GiB free / 5 GiB commit mislabel, and using only `.0` at `:198` leaves admission behaviour unchanged — the boolean itself is the same expression, so this is attribution only. Two things to adjust: 1. **The retention thresholds undercount severe physical pressure.** Because `physical_only` uses the retention pair, `physical = 1 GiB` with `commit = 5.9 GiB` is labelled *not* physical-only — which is exactly the low-RAM shape in `docs/findings.md:716` ("360–390 MB free … while 5.9 to 7.0 GB are left to commit"). It also means identical `(physical, commit)` samples are labelled differently on the entry sample vs later ones, and the label flips at exactly 6 GiB. Consider reporting physical-only / commit-only / both, or attributing against the entry thresholds, so the severe-physical case is not hidden. 2. **The counter wiring is untested.** Changing `if physical_only` to `if false && physical_only` (`:202`) leaves all four residency tests green — the new test covers only the pure predicate. A `refresh()`-level assertion (or a seam for the sample) would pin it. Sampling note: 1 Hz is fine for prevalence over minutes, but these counts are sample-seconds, not pressure episodes, and sub-second spikes are invisible; `refresh()` also samples commit directly while `critical_commit()` uses the 32 ms cache, so the two readings can disagree slightly. Worth a sentence in the body. `pipeline::`/crate suite is 645/0/59 (the two diagnostics failures under `--features diagnostics` are the known parallel flakes, green alone). Merge with current main is clean, and #2929/#2658/#2765 are file-disjoint — host RAM/commit attribution vs adapter VRAM budgets, so no double counting.
NetZlash commented 2026-12-01 22:25:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by NetZlash on 2026-12-01T22:25:44Z.


Thanks for pointing out the 1 GiB / 5.9 GiB case and the unchecked counter write. Commit 26da88e8 reports physical-only, commit-only and mixed samples. The severe physical case is visible at entry and during retention. A new test exercises the same counter update as refresh(), and redirecting the physical-only count to the mixed counter makes it fail. The PR description now covers sample cadence and the separate critical-commit cache.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7327835357 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2951#issuecomment-7327835357). Originally posted by [NetZlash](https://github.com/NetZlash) on 2026-12-01T22:25:44Z. --- Thanks for pointing out the 1 GiB / 5.9 GiB case and the unchecked counter write. Commit `26da88e8` reports physical-only, commit-only and mixed samples. The severe physical case is visible at entry and during retention. A new test exercises the same counter update as `refresh()`, and redirecting the physical-only count to the mixed counter makes it fail. The PR description now covers sample cadence and the separate critical-commit cache.
MoonEyes commented 2026-12-02 12:32:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T12:32:26Z.


This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).

Could you, or anyone with a working setup, post a run report on the current head merged onto current main:

  • the head SHA and the main SHA it was merged onto;
  • GPU, driver and OS;
  • at least 300 s in the world after loading;
  • device lost / crashes (count), and rendered fps (median) if you have them;
  • the same run on main alone for comparison, if you can.

Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7345491658 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2951#issuecomment-7345491658). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T12:32:26Z. --- This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists). Could you, or anyone with a working setup, post a run report on the **current head** merged onto current `main`: - the head SHA and the `main` SHA it was merged onto; - GPU, driver and OS; - at least 300 s in the world after loading; - device lost / crashes (count), and rendered fps (median) if you have them; - the same run on `main` alone for comparison, if you can. Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough. AI-assisted (Claude Code).
NetZlash commented 2026-12-02 16:47:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by NetZlash on 2026-12-02T16:47:07Z.


@MoonEyes TAKEN | NetZlash | AI-assisted: OpenAI Codex (GPT-6.2 Sol)

I am preparing an isolated qualification of current head 26da88e8ea79b35c4618278ff52c8de1477ac102 merged with upstream main 5b1fff821cfa5a812de6a33b09f5938ba3406b52, alongside main alone. Planned: the same restored post-prologue save, Series X dynamic 1080–1440 rendering, 2560×1440 output, frame generation, DLSS and Smooth Motion disabled, and at least 300 seconds timed only after visually confirming the open world. Hardware: desktop RTX 4070 SUPER 12 GB, driver 621.40. Prediction: both arms complete the interval without a crash or device loss; this is a stability qualification, with one measured run per arm and no performance improvement claim. I will report numbers only, without game logs or screenshots.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7352451933 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2951#issuecomment-7352451933). Originally posted by [NetZlash](https://github.com/NetZlash) on 2026-12-02T16:47:07Z. --- @MoonEyes TAKEN | NetZlash | AI-assisted: OpenAI Codex (GPT-6.2 Sol) I am preparing an isolated qualification of current head `26da88e8ea79b35c4618278ff52c8de1477ac102` merged with upstream main `5b1fff821cfa5a812de6a33b09f5938ba3406b52`, alongside main alone. Planned: the same restored post-prologue save, Series X dynamic 1080–1440 rendering, 2560×1440 output, frame generation, DLSS and Smooth Motion disabled, and at least 300 seconds timed only after visually confirming the open world. Hardware: desktop RTX 4070 SUPER 12 GB, driver 621.40. Prediction: both arms complete the interval without a crash or device loss; this is a stability qualification, with one measured run per arm and no performance improvement claim. I will report numbers only, without game logs or screenshots.
NetZlash commented 2026-12-02 16:56:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by NetZlash on 2026-12-02T16:56:50Z.


CORRECTION to my TAKEN comment: the disclosure “GPT-6.2 Sol” should read GPT-6.1 Sol (gpt-6.1-sol), including the independent reviewer agents. I copied the model designation from the original contribution rather than checking this qualification session; the live session metadata confirms gpt-6.1-sol. This corrects the disclosure only; no build or test needs repeating.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7352682788 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2951#issuecomment-7352682788). Originally posted by [NetZlash](https://github.com/NetZlash) on 2026-12-02T16:56:50Z. --- CORRECTION to my [TAKEN comment](https://github.com/ProjectLeonida/mandy/pull/2951#issuecomment-7352451933): the disclosure “GPT-6.2 Sol” should read **GPT-6.1 Sol (`gpt-6.1-sol`)**, including the independent reviewer agents. I copied the model designation from the original contribution rather than checking this qualification session; the live session metadata confirms `gpt-6.1-sol`. This corrects the disclosure only; no build or test needs repeating.
NetZlash commented 2026-12-02 17:49:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by NetZlash on 2026-12-02T17:49:42Z.


@MoonEyes DONE — PROVISIONAL (n=1 controlled qualification run per arm).

Both sessions completed 300 seconds of measured open-world play after a separate 60-second settling period, with the world and native HUD visually confirmed before and after the measured window. The table counts these two controlled qualification sessions.

  • PR head: 26da88e8ea79b35c4618278ff52c8de1477ac102.
  • Upstream main snapshot, current when preparation began: 5b1fff821cfa5a812de6a33b09f5938ba3406b52.
  • Local qualification merge: e9f20f91c6eed8e15a3301baec05ea161c07b134 (PR head first parent, upstream snapshot second parent; clean merge, no additional source changes).

Hardware (profile M): desktop NVIDIA GeForce RTX 4070 SUPER, 12 GB VRAM, driver 621.40; AMD Ryzen 7 9700X (8 cores / 16 threads); 32 GB DDR5-4800; Windows 11 Pro x64, build 26200. Existing TdrDelay: 8 seconds; Windows-managed page file. OS/driver settings were retained.

Recipe: the snapshot's scripts/play-d3d12.ps1 -SeriesX -Lowest 1080 -NoDlss -NoFrameGen -NoSmoothMotion -Adapter '4070 SUPER' -Log. Series X dynamic 1080–1440 rendering, the title's own upscaler, 2560×1440 output, windowed. Both builds use diag with diagnostics,mimalloc. Additional settings: LEONIDA_LOG=info,leonida_gpu::frame=debug, isolated data and an empty explicit configuration, plus a per-run LEONIDA_KEYS_FILE. The measured scene was the same post-prologue idle boat, with no scripted movement inputs. Menus, loading and the introduction were excluded.

The saved-data seeds and application-cache seeds were hash-identical between arms. The snapshot's used-pipeline precompile was enabled (3,838 of 88,600 recorded pipelines); the shared driver cache was kept. All 67 effective launcher settings matched after normalizing four isolated paths. No builds or test suites were run alongside either measured interval.

Arm Measured open-world window Rendered FPS median p5 rendered FPS Frame p95 Crashes Device lost Final exit
A: main alone 300.000 s 39.80 30.97 32.289 ms 0 0 clean, 0
B: main + #2951 300.000 s 40.88 34.10 29.325 ms 0 0 clean, 0

FPS comes from native rendered-present timestamps: 1000 / median complete frame interval; p5 rate is 1000 / p95 frame interval. A separate read-only reviewer independently recomputed the raw timestamps using integer arithmetic. These are rendered frames with frame generation disabled.

RUN A | 2026-12-02 UTC | NetZlash | AI-assisted: OpenAI Codex
BASE: 5b1fff821 | shaders: player-launcher translation and used-pipeline precompile
MACHINE: RTX 4070 SUPER 12 GB desktop | 621.40 | Windows 11 Pro 26200 | 32 GB RAM
RECIPE: Series X recipe above | precompile: yes, 3,838 pipelines
OS/DRIVER: existing TdrDelay 8 s; automatic page file
TARGET: 300 s in open world | PREDICTED before the runs: complete without crash or device loss
MEASURED: 17:24:12.753–17:29:12.753 UTC, 300.000 s; 11,571 complete intervals spanning 299.980073 s; median rendered 39.80 FPS
END: intentional time limit after visual verification; normal suspension, cache saved, process exit 0
CACHES: identical primed application seed, launcher precompile; driver cache kept | measured run 1 of 2, order A then B
INSTRUMENTS: diagnostics, per-present logging, default DRED faults; visual captures outside measured interval
VERDICT: PASS; prediction held for this run
RUN B | 2026-12-02 UTC | NetZlash | AI-assisted: OpenAI Codex
BASE: 5b1fff821 + #2951 at 26da88e8e; local merge e9f20f91c | shaders: player-launcher translation and used-pipeline precompile
MACHINE: RTX 4070 SUPER 12 GB desktop | 621.40 | Windows 11 Pro 26200 | 32 GB RAM
RECIPE: Series X recipe above | precompile: yes, 3,838 pipelines
OS/DRIVER: existing TdrDelay 8 s; automatic page file
TARGET: 300 s in open world | PREDICTED before the runs: complete without crash or device loss
MEASURED: 17:41:48.884–17:46:48.884 UTC, 300.000 s; 12,010 complete intervals spanning 299.974804 s; median rendered 40.88 FPS
END: intentional time limit after visual verification; normal suspension, cache saved, process exit 0
CACHES: identical primed application seed, launcher precompile; driver cache kept | measured run 2 of 2, order A then B
INSTRUMENTS: diagnostics, per-present logging, default DRED faults; visual captures outside measured interval
VERDICT: PASS; prediction held for this run

This is one observation per arm, sufficient to report these stability results; it does not establish a performance improvement or long-session reliability.

During the campaign, upstream advanced to 45dc41f95c1cd0dcc29c2c50582e0e9af8a77259 (#3172). That merge changes launchers, precompile defaults, docs and tests, with no Rust runtime changes. Both measured arms remained pinned to the same snapshot above; the later full-precompile default is outside these results.

AI-assisted: OpenAI Codex, GPT-6.1 Sol and GPT-6.2 Sol; independent read-only source/evidence review and separate raw-timestamp recomputation by a GPT-6.1 Sol agent. Only aggregate values are posted; game logs, captures and proprietary assets remain local.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7353683465 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2951#issuecomment-7353683465). Originally posted by [NetZlash](https://github.com/NetZlash) on 2026-12-02T17:49:42Z. --- @MoonEyes DONE — **PROVISIONAL (n=1 controlled qualification run per arm)**. Both sessions completed 300 seconds of measured open-world play after a separate 60-second settling period, with the world and native HUD visually confirmed before and after the measured window. The table counts these two controlled qualification sessions. - PR head: `26da88e8ea79b35c4618278ff52c8de1477ac102`. - Upstream main snapshot, current when preparation began: `5b1fff821cfa5a812de6a33b09f5938ba3406b52`. - Local qualification merge: `e9f20f91c6eed8e15a3301baec05ea161c07b134` (PR head first parent, upstream snapshot second parent; clean merge, no additional source changes). Hardware (profile M): desktop NVIDIA GeForce RTX 4070 SUPER, 12 GB VRAM, driver 621.40; AMD Ryzen 7 9700X (8 cores / 16 threads); 32 GB DDR5-4800; Windows 11 Pro x64, build 26200. Existing TdrDelay: 8 seconds; Windows-managed page file. OS/driver settings were retained. Recipe: the snapshot's `scripts/play-d3d12.ps1 -SeriesX -Lowest 1080 -NoDlss -NoFrameGen -NoSmoothMotion -Adapter '4070 SUPER' -Log`. Series X dynamic 1080–1440 rendering, the title's own upscaler, 2560×1440 output, windowed. Both builds use `diag` with `diagnostics,mimalloc`. Additional settings: `LEONIDA_LOG=info,leonida_gpu::frame=debug`, isolated data and an empty explicit configuration, plus a per-run `LEONIDA_KEYS_FILE`. The measured scene was the same post-prologue idle boat, with no scripted movement inputs. Menus, loading and the introduction were excluded. The saved-data seeds and application-cache seeds were hash-identical between arms. The snapshot's used-pipeline precompile was enabled (3,838 of 88,600 recorded pipelines); the shared driver cache was kept. All 67 effective launcher settings matched after normalizing four isolated paths. No builds or test suites were run alongside either measured interval. | Arm | Measured open-world window | Rendered FPS median | p5 rendered FPS | Frame p95 | Crashes | Device lost | Final exit | | --- | ---: | ---: | ---: | ---: | ---: | ---: | --- | | A: main alone | 300.000 s | 39.80 | 30.97 | 32.289 ms | 0 | 0 | clean, 0 | | B: main + #2951 | 300.000 s | 40.88 | 34.10 | 29.325 ms | 0 | 0 | clean, 0 | FPS comes from native rendered-present timestamps: 1000 / median complete frame interval; p5 rate is 1000 / p95 frame interval. A separate read-only reviewer independently recomputed the raw timestamps using integer arithmetic. These are rendered frames with frame generation disabled. ```text RUN A | 2026-12-02 UTC | NetZlash | AI-assisted: OpenAI Codex BASE: 5b1fff821 | shaders: player-launcher translation and used-pipeline precompile MACHINE: RTX 4070 SUPER 12 GB desktop | 621.40 | Windows 11 Pro 26200 | 32 GB RAM RECIPE: Series X recipe above | precompile: yes, 3,838 pipelines OS/DRIVER: existing TdrDelay 8 s; automatic page file TARGET: 300 s in open world | PREDICTED before the runs: complete without crash or device loss MEASURED: 17:24:12.753–17:29:12.753 UTC, 300.000 s; 11,571 complete intervals spanning 299.980073 s; median rendered 39.80 FPS END: intentional time limit after visual verification; normal suspension, cache saved, process exit 0 CACHES: identical primed application seed, launcher precompile; driver cache kept | measured run 1 of 2, order A then B INSTRUMENTS: diagnostics, per-present logging, default DRED faults; visual captures outside measured interval VERDICT: PASS; prediction held for this run ``` ```text RUN B | 2026-12-02 UTC | NetZlash | AI-assisted: OpenAI Codex BASE: 5b1fff821 + #2951 at 26da88e8e; local merge e9f20f91c | shaders: player-launcher translation and used-pipeline precompile MACHINE: RTX 4070 SUPER 12 GB desktop | 621.40 | Windows 11 Pro 26200 | 32 GB RAM RECIPE: Series X recipe above | precompile: yes, 3,838 pipelines OS/DRIVER: existing TdrDelay 8 s; automatic page file TARGET: 300 s in open world | PREDICTED before the runs: complete without crash or device loss MEASURED: 17:41:48.884–17:46:48.884 UTC, 300.000 s; 12,010 complete intervals spanning 299.974804 s; median rendered 40.88 FPS END: intentional time limit after visual verification; normal suspension, cache saved, process exit 0 CACHES: identical primed application seed, launcher precompile; driver cache kept | measured run 2 of 2, order A then B INSTRUMENTS: diagnostics, per-present logging, default DRED faults; visual captures outside measured interval VERDICT: PASS; prediction held for this run ``` This is one observation per arm, sufficient to report these stability results; it does not establish a performance improvement or long-session reliability. During the campaign, upstream advanced to `45dc41f95c1cd0dcc29c2c50582e0e9af8a77259` (#3172). That merge changes launchers, precompile defaults, docs and tests, with no Rust runtime changes. Both measured arms remained pinned to the same snapshot above; the later full-precompile default is outside these results. AI-assisted: OpenAI Codex, GPT-6.1 Sol and GPT-6.2 Sol; independent read-only source/evidence review and separate raw-timestamp recomputation by a GPT-6.1 Sol agent. Only aggregate values are posted; game logs, captures and proprietary assets remain local.
MoonEyes commented 2026-12-02 18:02:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:02:49Z.


Code review only, not built (Windows-only leonida-gpu). The code is ready, but the gate is still open.

  • Head: 26da88e8e, merge base 1fff69129, 334 behind current main 45dc41f95. A trial merge is clean.
  • CI: the runs on this head are waiting for maintainer approval (action_required).
  • MoonEyes asked for the render-path in-game run (12:32). The author has said one is in progress (16:47) on an RTX 4070 SUPER. Not posted yet.

Review of d3d12/crates/leonida-gpu/src/residency.rs:

  • The fix is correct. next_pressure now returns which constraint is active (PhysicalOnly, CommitOnly, Both) using the same hysteresis thresholds that decide pressure: enter at 3 and 4 GiB, leave at 5 and 6 GiB. Before, the "physical" counter used a separate commit > 4 GiB test that disagreed with the active threshold while already under pressure: a 5 GiB commit counted as "physical alone".
  • The admission decision is unchanged. pressure = cause.is_some() is exactly the old a || b with the same thresholds. The table test checks all four cases on both sides of each threshold.
  • record_sample takes the counter array as a parameter, so successful_samples_update_the_reported_counters runs against a local array and does not touch the global SAID. That avoids test interference.
  • The log line wording changes ("physical only, commit only, both"). Anything that parses the memory line, such as tools or docs, should be checked. I found no parser of that string under tools/.

Verdict: ready on code. Behaviour is unchanged apart from the counters, so the in-game run should be a formality.

AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7353891028 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2951#issuecomment-7353891028). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:02:49Z. --- **Code review only, not built (Windows-only `leonida-gpu`). The code is ready, but the gate is still open.** - Head: `26da88e8e`, merge base `1fff69129`, 334 behind current `main` `45dc41f95`. A trial merge is clean. - CI: the runs on this head are waiting for maintainer approval (`action_required`). - MoonEyes asked for the render-path in-game run (12:32). The author has said one is in progress (16:47) on an RTX 4070 SUPER. Not posted yet. **Review of `d3d12/crates/leonida-gpu/src/residency.rs`:** - The fix is correct. `next_pressure` now returns which constraint is active (`PhysicalOnly`, `CommitOnly`, `Both`) using the same hysteresis thresholds that decide pressure: enter at 3 and 4 GiB, leave at 5 and 6 GiB. Before, the "physical" counter used a separate `commit > 4 GiB` test that disagreed with the active threshold while already under pressure: a 5 GiB commit counted as "physical alone". - The admission decision is unchanged. `pressure = cause.is_some()` is exactly the old `a || b` with the same thresholds. The table test checks all four cases on both sides of each threshold. - `record_sample` takes the counter array as a parameter, so `successful_samples_update_the_reported_counters` runs against a local array and does not touch the global `SAID`. That avoids test interference. - The log line wording changes ("physical only, commit only, both"). Anything that parses the memory line, such as tools or docs, should be checked. I found no parser of that string under `tools/`. Verdict: **ready** on code. Behaviour is unchanged apart from the counters, so the in-game run should be a formality. AI-assisted verification: Claude Opus (Claude Code), separate agent per batch. --- _Generated by [Claude Code](https://claude.ai/code)_
MoonEyes commented 2026-12-02 18:21:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:21:38Z.


RUN (in game, batch of seventeen render-path pull requests), each head merged with git merge --no-ff onto main 3c106eb2f, in one build: #3111 15b579756, #2948 5284c6eae, #2698 1f188c4f7, #2946 44bf554fe, #3001 d924cbb65, #2832 0c861595a, #2915 58e8535cf, #2822 d359a2f85, #2896 c9c6b103d, #2983 8278ef1b9, #3115 ba5121192, #2945 d2c08c14f, #2975 74512d658, #2951 26da88e8e, #2800 b6ebcedd4, #2893 7c7e99b48, #3113 fa1460b6b (and #3097 0d7a451ab, merged since). RTX 4060 8 GB, driver 610.88, Windows 11. Series S, -Resolution 1080, frame generation 2x, the same walking route as the other runs on this machine, 330 s after reaching the world.

What Result
Device lost / device removed 0
Exceptions, panics, hang watchdog, GPU stall, title suspended 0
Process alive at the end yes, stopped by the time limit
Rendered fps, last 240 s (43 samples) median 14.6, mean 12.7
Rendered fps, last 120 s median 13.7
Time under 5 fps in the world 13 % (short drops, lowest sample 0.3 fps)

The drops under 5 fps line up with shaders being translated while walking (about 500 translations in the last 330 s): this batch changes the shader translation, so the shader cache built by earlier runs did not apply and the pipeline precompile alone took about 45 minutes. The batch-5 run on the same machine and route had no sample under 5 fps (median 16.4). I read this as cold-cache stutter, not as a regression of a single pull request, but this run cannot tell them apart.

Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it.

Limits: one run; arrival in the world was driven by keys and not checked on pictures. A first attempt of this batch is not counted: the run script gave up waiting for the game window after 40 minutes of precompile.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7354442532 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2951#issuecomment-7354442532). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:21:38Z. --- RUN (in game, batch of seventeen render-path pull requests), each head merged with `git merge --no-ff` onto main `3c106eb2f`, in one build: #3111 `15b579756`, #2948 `5284c6eae`, #2698 `1f188c4f7`, #2946 `44bf554fe`, #3001 `d924cbb65`, #2832 `0c861595a`, #2915 `58e8535cf`, #2822 `d359a2f85`, #2896 `c9c6b103d`, #2983 `8278ef1b9`, #3115 `ba5121192`, #2945 `d2c08c14f`, #2975 `74512d658`, #2951 `26da88e8e`, #2800 `b6ebcedd4`, #2893 `7c7e99b48`, #3113 `fa1460b6b` (and #3097 `0d7a451ab`, merged since). RTX 4060 8 GB, driver 610.88, Windows 11. Series S, `-Resolution 1080`, frame generation 2x, the same walking route as the other runs on this machine, 330 s after reaching the world. | What | Result | |---|---| | Device lost / device removed | 0 | | Exceptions, panics, hang watchdog, GPU stall, title suspended | 0 | | Process alive at the end | yes, stopped by the time limit | | Rendered fps, last 240 s (43 samples) | median 14.6, mean 12.7 | | Rendered fps, last 120 s | median 13.7 | | Time under 5 fps in the world | 13 % (short drops, lowest sample 0.3 fps) | The drops under 5 fps line up with shaders being translated while walking (about 500 translations in the last 330 s): this batch changes the shader translation, so the shader cache built by earlier runs did not apply and the pipeline precompile alone took about 45 minutes. The batch-5 run on the same machine and route had no sample under 5 fps (median 16.4). I read this as cold-cache stutter, not as a regression of a single pull request, but this run cannot tell them apart. Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it. Limits: one run; arrival in the world was driven by keys and not checked on pictures. A first attempt of this batch is not counted: the run script gave up waiting for the game window after 40 minutes of precompile. AI-assisted (Claude Code).
fiestorra commented 2026-12-03 04:58:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T04:58:19Z.


VERIFY-2951 — 103 líneas en residency.rs, y el cambio es de los que necesitan una tabla de umbrales

d3d12/crates/leonida-gpu/src/residency.rs   1 file changed, 103 insertions(+), 28 deletions(-)

El título: «attribute residency pressure using active thresholds» — o sea, el doc-comment de refresh cambia de «mira una vez por segundo los que están bajo presión y con commit por encima de donde empieza la presión» a «los que están bajo presión, su desglose». Eso es lo que el diff muestra en las dos primeras líneas que leí.

Y ese cambio de frase es el cambio de comportamiento: antes la presión se atribuía a todo lo que pasaba del umbral; ahora se atribuye a lo que está activo y por encima del umbral. Es la diferencia entre «todo el que ocupa mucho» y «el que ocupa mucho y se está usando», y en un juego con memoria reservada pero quieta es la diferencia entre un aviso útil y uno constante.

Lo que verifiqué y lo que no, con el mismo límite de siempre: el crate compila y su suite pasa con el cambio (lo probé en el lote de #2841/#2892, no en esta PR suelta); lo que no puedo verificar es la atribución de verdad — necesita el título bajo presión de memoria, que es un estado que se provoca con una escena concreta y una tarjeta concreta, y esta máquina tiene VRAM de sobra.

La pregunta que le haría es la de siempre en este fichero: ¿los umbrales nuevos están en una tabla o repartidos por el código? Si están en una tabla, el cambio se puede medir en gpu-test-results/; si están repartidos, el siguiente que toque residency.rs los va a descubrir uno a uno.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7368236514 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2951#issuecomment-7368236514). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T04:58:19Z. --- ## VERIFY-2951 — 103 líneas en `residency.rs`, y el cambio es de los que necesitan una tabla de umbrales ``` d3d12/crates/leonida-gpu/src/residency.rs 1 file changed, 103 insertions(+), 28 deletions(-) ``` **El título**: **«attribute residency pressure using active thresholds»** — **o sea, el doc-comment de `refresh` cambia de «mira una vez por segundo los que están bajo presión *y* con commit por encima de donde empieza la presión» a «los que están bajo presión, su desglose».** **Eso es lo que el diff muestra en las dos primeras líneas que leí.** **Y ese cambio de frase es el cambio de comportamiento**: **antes la presión se atribuía a todo lo que pasaba del umbral; ahora se atribuye a lo que está *activo* y por encima del umbral.** **Es la diferencia entre «todo el que ocupa mucho» y «el que ocupa mucho y se está usando»,** **y en un juego con memoria reservada pero quieta es la diferencia entre un aviso útil y uno constante.** **Lo que verifiqué y lo que no, con el mismo límite de siempre**: **el crate compila y su suite pasa con el cambio** **(lo probé en el lote de `#2841`/`#2892`, no en esta PR suelta)**; **lo que no puedo verificar es la atribución de verdad — necesita el título bajo presión de memoria, que es un estado que se provoca con una escena concreta y una tarjeta concreta, y esta máquina tiene VRAM de sobra.** **La pregunta que le haría es la de siempre en este fichero**: **¿los umbrales nuevos están en una tabla o repartidos por el código?** **Si están en una tabla, el cambio se puede medir en `gpu-test-results/`; si están repartidos, el siguiente que toque `residency.rs` los va a descubrir uno a uno.**
merzleckeier commented 2026-12-03 05:12:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T05:12:25Z.


Independent replay on 26da88e8 paired with #3290 (898de93c). Both merge cleanly onto d9b618f10, and the tested Rust source tree matches that integration. I built the Windows MSVC diagnostics test binary and injected synthetic values at the OS memory-query boundary under Wine. The actual refresh() ran for 98 successful samples across the entry and retention thresholds, including the exact boundaries and adjacent bytes. It recorded 72 pressured samples: 16 physical only, 30 commit only, 26 both. The admission flag, headroom, low-water marks and counters matched the expected values, including 14 critical samples. Each of the 98 interleaved failed reads preserved the previous snapshot.

All four stock residency tests passed. A scratch control routing CommitOnly to the physical counter failed the replay immediately at the first commit-only sample. This exercises the real counter update with synthetic inputs. GitHub lists the three workflows for this head as action_required. AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7368489558 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2951#issuecomment-7368489558). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T05:12:25Z. --- Independent replay on `26da88e8` paired with #3290 (`898de93c`). Both merge cleanly onto `d9b618f10`, and the tested Rust source tree matches that integration. I built the Windows MSVC diagnostics test binary and injected synthetic values at the OS memory-query boundary under Wine. The actual `refresh()` ran for 98 successful samples across the entry and retention thresholds, including the exact boundaries and adjacent bytes. It recorded 72 pressured samples: 16 physical only, 30 commit only, 26 both. The admission flag, headroom, low-water marks and counters matched the expected values, including 14 critical samples. Each of the 98 interleaved failed reads preserved the previous snapshot. All four stock residency tests passed. A scratch control routing `CommitOnly` to the physical counter failed the replay immediately at the first commit-only sample. This exercises the real counter update with synthetic inputs. GitHub lists the three workflows for this head as `action_required`. AI-assisted with OpenAI Codex.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2951:upstream-pr/2951'
git switch 'upstream-pr/2951'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2951'
git switch 'upstream-pr/2951'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2951'
git switch 'upstream-pr/2951'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2951'
git switch 'main'
git merge --squash 'upstream-pr/2951'
git switch 'main'
git merge --ff-only 'upstream-pr/2951'
git switch 'main'
git merge 'upstream-pr/2951'
git push origin 'main'
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!2951
No description provided.