d3d12: separate upload VA from BVH arenas so DLSS FG runs with ray tracing (D3D12-RT-FG-ARENA-VA-STORM) #2643

Open
zmasi wants to merge 10 commits from upstream-pr/2643 into main
zmasi commented 2026-11-29 20:43:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T20:43:03Z.


Claimed in #2570: D3D12-RT-FG-ARENA-VA-STORM (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7250446579)

Summary

Fixes D3D12-RT-FG-ARENA-VA-STORM across d3d12/crates/leonida-gpu/src/{upload.rs, memory.rs, fg.rs, lib.rs}, d3d12/crates/leonida-hle/src/lib.rs, and d3d12/apps/leonida/src/main.rs (head 9f39297d6a):

  • Separate shader-reachable upload VA ([4 GiB, (MEMORY_PAGES - 1) * 64 KiB)) from host-only arena VA ([2^37, 2^40)) and reserve low upload space at startup:
    • Previously, upload::reserve placed both shader-addressed command-list upload blocks (Upload::new, whose CPU pointers are passed to shaders as 40-bit GPU addresses and indexed in the 2^21-page MEMORY_PAGES directory) and Memory's own CPU-side directory and 64 MiB BVH page arenas (memory.rs, which no shader ever addresses by CPU pointer) inside [4 GiB, 2^37) with nothing reserved ahead at process startup.
    • Once Streamline / NGX / CUDA initialized on the first 3D world frame with constants and depth/motion tags (fg::present_start), low-VA reservations alongside xmem title mappings exhausted contiguous 64 MiB holes in [4 GiB, 2^37) (kept alive across toggles by DLSSGFlags::eRetainResourcesWhenOff).
    • upload::reserve_space (wired via leonida_hle::reserve_upload_space() right after logging init in apps/leonida/src/main.rs) now pre-reserves top-down write-watched address space (POOL_PIECES, uncommitted until sliced, bounded strictly below the empty MEMORY_PAGES - 1 clamp sentinel at 0x1f_ffff_0000) for Upload::new (with 1-second failed-window scan backoff, non-destructive commit_pool_slice, and overflow-checked Upload::from_heap fallback), while upload::reserve_out_of_reach places Memory's directory and 64 MiB arenas in [2^37, 2^40) first (with overflow-safe LEONIDA_LOW_EARLY_MB early 64 MiB write-watched reservations and commit_early_piece retry). Adapted with credit from GPL-3.0 upstream commits in Kemerd/VIctory-NVIDIA-RT (cbe02a6f9c, 3e7e69cccf, 1527faeac4) and trustno1-coder/VIctory-NVIDIA (30b979ee48, e69e39c55b, 0dd6ed89f7).
  • Eliminate per-dispatch VirtualAlloc2 arena storm and 64 MiB VA leak in Memory::another and Memory::new:
    • Previously, once a 64 MiB reservation failed, memory::ready and Memory::map called Memory::another() -> VirtualAlloc2 under the global MEMORY mutex on every BVH builder and ray-tracing dispatch (thousands of kernel VAD scans per frame, collapsing recording to ~0.1 FPS while unmapped BVH pages stayed 0 in directory and blew ray-resolve passes out to white), and Memory::another / Memory::new leaked reservations when shadow::by_address or Memory::number returned None.
    • Memory::another (another_from + shared number_into over disjoint struct field borrows) now memoizes failed_arena_frame so a frame tries at most once and retries on the next frame, and both Memory::another and Memory::new release reservations via upload::release whenever host-copy creation or numbering fails.
  • Allow DLSS Frame Generation alongside the ray-tracing BVH builder in fg::wanted:
    • Extracts wanted_for so LEONIDA_FRAME_GEN starts with LEONIDA_BVH_BUILDER=1 by default while preserving LEONIDA_FG_WITH_RT=0 as an explicit opt-out.

Verification

  • Red (origin/main):
    • Saturating [4 GiB, 2^37) reproduced both the multi-second Windows 11 kernel VirtualAlloc2 scan stall across repeated MEM_ADDRESS_REQUIREMENTS queries and None failures for 64 MiB Memory arenas; Memory::another had no per-frame backoff and leaked at when shadow::by_address / number returned None; fg::wanted() returned 0 whenever LEONIDA_BVH_BUILDER=1 without LEONIDA_FG_WITH_RT=1.
  • Green (Windows 11 + NVIDIA GeForce RTX 3090 D3D12):
    • cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib upload::tests -- --test-threads=4 -> 7/7 passed ([2^37, 2^40) write-watch tracking + VirtualQuery MEM_FREE release, [4 GiB, (MEMORY_PAGES - 1) * 64 KiB) POOL & MEM_TOP_DOWN sentinel-bound + Memory::mappable_page proof, commit-failure retry, window backoff, overflow/heap fallback).
    • cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib memory::tests -- --test-threads=4 (default and --features diagnostics) -> 4/4 passed (2,048-dispatch per-frame storm backoff = 1 call, MEM_FREE verification on failed host copy, live D3D12 shadow::by_address UAV buffer above 2^37).
    • cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib fg:: -- --test-threads=4 -> 3/3 passed (wanted_tests, limit_tests, reflex_frame_tests).
    • cargo test --manifest-path d3d12/Cargo.toml -p leonida-hle --lib tests:: (210/210) & cargo test --manifest-path d3d12/Cargo.toml -p leonida --bin leonida (36/36) -> passed.
    • cargo clippy --manifest-path d3d12/Cargo.toml -p leonida-gpu -p leonida-hle -p leonida --tests & --features diagnostics -> 0 warnings in modified files.
    • python -I scripts/check_no_game_data.py -> 0 issues, pure LF.

GPUs tested: NVIDIA GeForce RTX 3090 (Windows 11, driver 610.88)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • 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: D3D12 runtime memory/FG management only)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5554914661 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T20:43:03Z. --- Claimed in #2570: `D3D12-RT-FG-ARENA-VA-STORM` (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7250446579) ## Summary Fixes `D3D12-RT-FG-ARENA-VA-STORM` across `d3d12/crates/leonida-gpu/src/{upload.rs, memory.rs, fg.rs, lib.rs}`, `d3d12/crates/leonida-hle/src/lib.rs`, and `d3d12/apps/leonida/src/main.rs` (head `9f39297d6a`): - **Separate shader-reachable upload VA (`[4 GiB, (MEMORY_PAGES - 1) * 64 KiB)`) from host-only arena VA (`[2^37, 2^40)`) and reserve low upload space at startup**: - Previously, `upload::reserve` placed both shader-addressed command-list upload blocks (`Upload::new`, whose CPU pointers are passed to shaders as 40-bit GPU addresses and indexed in the `2^21`-page `MEMORY_PAGES` directory) and `Memory`'s own CPU-side directory and 64 MiB BVH page arenas (`memory.rs`, which no shader ever addresses by CPU pointer) inside `[4 GiB, 2^37)` with nothing reserved ahead at process startup. - Once Streamline / NGX / CUDA initialized on the first 3D world frame with constants and depth/motion tags (`fg::present_start`), low-VA reservations alongside `xmem` title mappings exhausted contiguous 64 MiB holes in `[4 GiB, 2^37)` (kept alive across toggles by `DLSSGFlags::eRetainResourcesWhenOff`). - `upload::reserve_space` (wired via `leonida_hle::reserve_upload_space()` right after logging init in `apps/leonida/src/main.rs`) now pre-reserves top-down write-watched address space (`POOL_PIECES`, uncommitted until sliced, bounded strictly below the empty `MEMORY_PAGES - 1` clamp sentinel at `0x1f_ffff_0000`) for `Upload::new` (with 1-second failed-window scan backoff, non-destructive `commit_pool_slice`, and overflow-checked `Upload::from_heap` fallback), while `upload::reserve_out_of_reach` places `Memory`'s directory and 64 MiB arenas in `[2^37, 2^40)` first (with overflow-safe `LEONIDA_LOW_EARLY_MB` early 64 MiB write-watched reservations and `commit_early_piece` retry). Adapted with credit from GPL-3.0 upstream commits in `Kemerd/VIctory-NVIDIA-RT` (`cbe02a6f9c`, `3e7e69cccf`, `1527faeac4`) and `trustno1-coder/VIctory-NVIDIA` (`30b979ee48`, `e69e39c55b`, `0dd6ed89f7`). - **Eliminate per-dispatch `VirtualAlloc2` arena storm and 64 MiB VA leak in `Memory::another` and `Memory::new`**: - Previously, once a 64 MiB reservation failed, `memory::ready` and `Memory::map` called `Memory::another()` -> `VirtualAlloc2` under the global `MEMORY` mutex on every BVH builder and ray-tracing dispatch (thousands of kernel VAD scans per frame, collapsing recording to `~0.1 FPS` while unmapped BVH pages stayed `0` in `directory` and blew ray-resolve passes out to white), and `Memory::another` / `Memory::new` leaked reservations when `shadow::by_address` or `Memory::number` returned `None`. - `Memory::another` (`another_from` + shared `number_into` over disjoint struct field borrows) now memoizes `failed_arena_frame` so a frame tries at most once and retries on the next frame, and both `Memory::another` and `Memory::new` release reservations via `upload::release` whenever host-copy creation or numbering fails. - **Allow DLSS Frame Generation alongside the ray-tracing BVH builder in `fg::wanted`**: - Extracts `wanted_for` so `LEONIDA_FRAME_GEN` starts with `LEONIDA_BVH_BUILDER=1` by default while preserving `LEONIDA_FG_WITH_RT=0` as an explicit opt-out. ## Verification - **Red (`origin/main`)**: - Saturating `[4 GiB, 2^37)` reproduced both the multi-second Windows 11 kernel `VirtualAlloc2` scan stall across repeated `MEM_ADDRESS_REQUIREMENTS` queries and `None` failures for 64 MiB `Memory` arenas; `Memory::another` had no per-frame backoff and leaked `at` when `shadow::by_address` / `number` returned `None`; `fg::wanted()` returned `0` whenever `LEONIDA_BVH_BUILDER=1` without `LEONIDA_FG_WITH_RT=1`. - **Green (Windows 11 + NVIDIA GeForce RTX 3090 D3D12)**: - `cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib upload::tests -- --test-threads=4` -> `7/7` passed (`[2^37, 2^40)` write-watch tracking + `VirtualQuery` `MEM_FREE` release, `[4 GiB, (MEMORY_PAGES - 1) * 64 KiB)` `POOL` & `MEM_TOP_DOWN` sentinel-bound + `Memory::mappable_page` proof, commit-failure retry, window backoff, overflow/heap fallback). - `cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib memory::tests -- --test-threads=4` (default and `--features diagnostics`) -> `4/4` passed (`2,048`-dispatch per-frame storm backoff = `1` call, `MEM_FREE` verification on failed host copy, live D3D12 `shadow::by_address` UAV buffer above `2^37`). - `cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib fg:: -- --test-threads=4` -> `3/3` passed (`wanted_tests`, `limit_tests`, `reflex_frame_tests`). - `cargo test --manifest-path d3d12/Cargo.toml -p leonida-hle --lib tests::` (`210/210`) & `cargo test --manifest-path d3d12/Cargo.toml -p leonida --bin leonida` (`36/36`) -> passed. - `cargo clippy --manifest-path d3d12/Cargo.toml -p leonida-gpu -p leonida-hle -p leonida --tests` & `--features diagnostics` -> `0` warnings in modified files. - `python -I scripts/check_no_game_data.py` -> `0` issues, pure LF. GPUs tested: NVIDIA GeForce RTX 3090 (Windows 11, driver 610.88) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly. - [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: D3D12 runtime memory/FG management only)
ammonium231 commented 2026-11-30 05:59:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ammonium231 on 2026-11-30T05:59:52Z.


RTX 3090 / 621.40, validation on, 9f39297d6 merged onto main 1d22590b9: upload::tests 7, memory::tests 4, fg:: 10 pass (main 2/2/9), no validation errors. Unit tests only; the in-title DLSS FG + RT path isn't exercised.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7270202115 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7270202115). Originally posted by [ammonium231](https://github.com/ammonium231) on 2026-11-30T05:59:52Z. --- RTX 3090 / 621.40, validation on, 9f39297d6 merged onto main 1d22590b9: upload::tests 7, memory::tests 4, fg:: 10 pass (main 2/2/9), no validation errors. Unit tests only; the in-title DLSS FG + RT path isn't exercised.
enlight3d commented 2026-11-30 10:46:52 +00:00 (Migrated from github.com)

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


RUN (independent run, #2643 head 9f39297d6 on main e1fe82f63; merged locally with git merge --no-ff, no conflicts; also no conflict with #2566 head 70ea7d6ec per git merge-tree --write-tree). Main has since moved to 012b79a67, which changes only d3d12/docs/findings.md and d3d12/scripts/play-nvidia.ps1, so the crates tested are the same. It still merges cleanly there.

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, 567 passed / 0 failed / 50 ignored. Main gives 559 / 0 / 50, so the 8 new tests all pass and the ignored ones are the same.
  • cargo test -p leonida-hle: 220 / 0 / 2. cargo test -p leonida (the app): 43 / 0 / 0. Both are the same as on main.
  • cargo clippy -p leonida-gpu -p leonida-hle -p leonida --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 the six files the PR touches (9 already there on main, the same 9 on the merge).
  • Red, build: with the PR's non-test changes reverted and its tests kept, the tests do not compile (E0425/E0432/E0433/E0599: another_from, wanted_for, reserve_out_of_reach, release, commit_pool_slice and others not found). That alone proves little, so I also ran the behavioural reds below.
  • Red, behavioural: mutants of the fix with the tests kept, one at a time, with cargo test -p leonida-gpu --lib -- memory::tests upload::tests fg::wanted_tests. These 12 tests all pass in the full run above, without a mutant:
    • The per-frame memo removed from another_from: failed_arena_backs_off_for_the_frame_and_releases_unnumbered_reservations fails, with 2,048 reservation attempts instead of 1.
    • release(at) removed after a failed copy: the same test fails later on. The reservation is still committed (state 0x1000, not MEM_FREE).
    • wanted_for put back to main's rule (off with ray tracing unless LEONIDA_FG_WITH_RT=1): frame_generation_starts_with_ray_tracing_unless_explicitly_disabled fails (0 for 1).
    • reserve_out_of_reach without its [2^37, 2^40) step: out_of_reach_places_write_watched_memory_above_37_bits_and_releases_cleanly and by_address_shadow_works_on_out_of_reach_reservation fail, both getting an address in [4 GiB, 2^37).
    • The 1-second backoff in window_allows_at disabled: window_backoff_suppresses_repeated_scans_until_expiry fails.
  • Not covered by the tests: that the reservations made at startup still leave room once Streamline, NGX and CUDA have loaded; the per-dispatch stall in a frame; DLSS frame generation running together with ray tracing. All of these need the game.

A default change to note: in fg.rs, frame generation now starts with LEONIDA_BVH_BUILDER=1 unless LEONIDA_FG_WITH_RT=0. Main left it off there because the two together ran at 0.1 frames a second. scripts/play-nvidia.ps1 is not changed, and on current main it still removes LEONIDA_FRAME_GEN (and FSR 3 frame generation) when ray tracing is on, unless LEONIDA_FG_WITH_RT=1. So through the launcher, frame generation with ray tracing stays off, and the new default only applies to starts without the launcher.

Perf: this needs an in-game A/B with ray tracing on. d3d12/README.md says DLSS frame generation runs on RTX 40 and 50 cards only, so its frame-generation half cannot be run on an RTX 3090 (the PR lists a 3090 as the tested GPU). The arena and stall half can be (ray tracing on, frame generation off).

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:7276068979 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7276068979). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-30T10:46:52Z. --- RUN (independent run, #2643 head 9f39297d6 on main e1fe82f63; merged locally with `git merge --no-ff`, no conflicts; also no conflict with #2566 head 70ea7d6ec per `git merge-tree --write-tree`). Main has since moved to 012b79a67, which changes only `d3d12/docs/findings.md` and `d3d12/scripts/play-nvidia.ps1`, so the crates tested are the same. It still merges cleanly there. 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, 567 passed / 0 failed / 50 ignored. Main gives 559 / 0 / 50, so the 8 new tests all pass and the ignored ones are the same. - `cargo test -p leonida-hle`: 220 / 0 / 2. `cargo test -p leonida` (the app): 43 / 0 / 0. Both are the same as on main. - `cargo clippy -p leonida-gpu -p leonida-hle -p leonida --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 the six files the PR touches (9 already there on main, the same 9 on the merge). - Red, build: with the PR's non-test changes reverted and its tests kept, the tests do not compile (E0425/E0432/E0433/E0599: `another_from`, `wanted_for`, `reserve_out_of_reach`, `release`, `commit_pool_slice` and others not found). That alone proves little, so I also ran the behavioural reds below. - Red, behavioural: mutants of the fix with the tests kept, one at a time, with `cargo test -p leonida-gpu --lib -- memory::tests upload::tests fg::wanted_tests`. These 12 tests all pass in the full run above, without a mutant: - The per-frame memo removed from `another_from`: `failed_arena_backs_off_for_the_frame_and_releases_unnumbered_reservations` fails, with 2,048 reservation attempts instead of 1. - `release(at)` removed after a failed copy: the same test fails later on. The reservation is still committed (state 0x1000, not `MEM_FREE`). - `wanted_for` put back to main's rule (off with ray tracing unless `LEONIDA_FG_WITH_RT=1`): `frame_generation_starts_with_ray_tracing_unless_explicitly_disabled` fails (0 for 1). - `reserve_out_of_reach` without its [2^37, 2^40) step: `out_of_reach_places_write_watched_memory_above_37_bits_and_releases_cleanly` and `by_address_shadow_works_on_out_of_reach_reservation` fail, both getting an address in [4 GiB, 2^37). - The 1-second backoff in `window_allows_at` disabled: `window_backoff_suppresses_repeated_scans_until_expiry` fails. - Not covered by the tests: that the reservations made at startup still leave room once Streamline, NGX and CUDA have loaded; the per-dispatch stall in a frame; DLSS frame generation running together with ray tracing. All of these need the game. A default change to note: in `fg.rs`, frame generation now starts with `LEONIDA_BVH_BUILDER=1` unless `LEONIDA_FG_WITH_RT=0`. Main left it off there because the two together ran at 0.1 frames a second. `scripts/play-nvidia.ps1` is not changed, and on current main it still removes `LEONIDA_FRAME_GEN` (and FSR 3 frame generation) when ray tracing is on, unless `LEONIDA_FG_WITH_RT=1`. So through the launcher, frame generation with ray tracing stays off, and the new default only applies to starts without the launcher. Perf: this needs an in-game A/B with ray tracing on. `d3d12/README.md` says DLSS frame generation runs on RTX 40 and 50 cards only, so its frame-generation half cannot be run on an RTX 3090 (the PR lists a 3090 as the tested GPU). The arena and stall half can be (ray tracing on, frame generation off). 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.
KelboLive commented 2026-11-30 16:36:22 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T16:36:22Z.


Independent check on Windows (not the author), at 9f39297d6.

  • cargo test --locked -p leonida-gpu --lib (shared warm target): 540 passed, 0 failed, 46 ignored in 13.7 s.

The diff is source-only (main.rs, fg.rs, lib.rs), so this is compile + regression coverage. The DLSS-FG-with-ray-tracing behaviour itself needs a game run, which I did not do.

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:7284937813 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7284937813). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-30T16:36:22Z. --- Independent check on Windows (not the author), at `9f39297d6`. - `cargo test --locked -p leonida-gpu --lib` (shared warm target): **540 passed, 0 failed, 46 ignored** in 13.7 s. The diff is source-only (`main.rs`, `fg.rs`, `lib.rs`), so this is compile + regression coverage. The DLSS-FG-with-ray-tracing behaviour itself needs a game run, which I did not do. 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).
lixonik commented 2026-12-01 03:25:32 +00:00 (Migrated from github.com)

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


Independent game-run A/B test on Windows 10 + NVIDIA RTX 5070 12 GB (driver 621.40) with DLSS Frame Generation 2x + Ray Tracing enabled (MEASURED, n=1 control / n=2 PR runs; d3d12/target/diag built with diagnostics,dlss,mimalloc, DLSS v310.9.16, Streamline v2.14.16).

Verdict: better (reproduces the main 0.2 fps / 13-arena collapse and fixes it cleanly in both PR runs: 5,391.0 ms -> 101.8 / 104.0 ms, 0.2 -> 8.7 / 8.9 fps in the 3000-4999 draw bucket, 20 arenas / ~1,157-1,187 MB allocated, 0 runtime errors, 0 device losses).

One small launcher note (READ IN CODE, d3d12/scripts/play-nvidia.ps1:519): play-nvidia.ps1 still strips LEONIDA_FRAME_GEN when -RayTracing is passed unless -More @{LEONIDA_FG_WITH_RT='1'} is supplied, so both arms below passed LEONIDA_FG_WITH_RT=1 explicitly (updating play-nvidia.ps1 can be done here or in a follow-up). Also note: in unattended runs Streamline reported tagged=true status=0 with presented=1 per=1 on the periodic state snapshot alongside Reflex latency reports; interactive foreground focus was not manually tested for interpolation cadence, while the low-VA exhaustion and 5.4 s/frame collapse are completely resolved.

RUN 2643-A | 2026-12-01 UTC | lixonik | AI-assisted: Antigravity
BASE:        a596adfac (main) | shaders: warm cache (25,687 translated, 202 untranslated)
MACHINE:     NVIDIA GeForce RTX 5070, 12 GB, desktop | 621.40 | Windows 10 Pro 22H2 (build 19045) | 64 GiB RAM | Ryzen 9 5950X
RECIPE:      documented (scripts/play-d3d12.ps1 -SeriesS -RayTracing -FrameGen 2) + DEVIATIONS: LEONIDA_FG_WITH_RT=1, LEONIDA_KEYS_FILE (menu enter only) | precompile: yes (warm, 3 s)
OS/DRIVER:   TdrDelay=default (Windows 10 D3D12 Agility SDK)
TARGET:      world frame rate & arena allocation with RT + DLSS FG 2x | PREDICTED (written before the run): low-VA exhaustion stalls world frames near ~0.1-0.2 fps
MEASURED:    play (9 world samples, max 6,699 draws): median 0.2 fps (p10 0.1, p90 10.2), 5391.0 ms/frame (preparing 1806.5 ms, copies 305.9 ms / 141.6 MB, textures 26.4 ms, gpu_wait 0.0 ms, copy_back 7.1 ms, 4015 draws); buckets: 1000-2999 10.2 fps (1), 3000-4999 0.2 fps (6), 5000-6999 0.2 fps (2); stuck at 13 arenas (830 MB), 46 unmapped-page warnings, up to 4,359 build dispatches/frame | duration 212.8 s (75 s in world)
END:         time limit (75 s in world)
CACHES:      warm: shader cache + NVIDIA DXCache (same save restored before start) | RUN 1 of 1
INSTRUMENTS: standard diag log, d3d12_run_fps.py
VERDICT:     prediction held (reproduced low-VA arena exhaustion and 0.2 fps collapse on main)
RUN 2643-B1 | 2026-12-01 UTC | lixonik | AI-assisted: Antigravity
BASE:        a596adfac + #2643 (2cea6871c, merged locally 810050be6) | shaders: warm cache (same)
MACHINE:     NVIDIA GeForce RTX 5070, 12 GB, desktop | 621.40 | Windows 10 Pro 22H2 (build 19045) | 64 GiB RAM | Ryzen 9 5950X
RECIPE:      documented (scripts/play-d3d12.ps1 -SeriesS -RayTracing -FrameGen 2) + DEVIATIONS: LEONIDA_FG_WITH_RT=1, LEONIDA_KEYS_FILE (menu enter only) | precompile: yes (warm, 9 s)
OS/DRIVER:   TdrDelay=default (Windows 10 D3D12 Agility SDK)
TARGET:      world frame rate & arena allocation with RT + DLSS FG 2x | PREDICTED (written before the run): early 3,200 MB low-VA reservation prevents arena storm and sustains multi-fps play
MEASURED:    play (16 world samples, max 5,135 draws): median 9.8 fps (p10 1.6, p90 12.1), 101.8 ms/frame (preparing 63.8 ms, copies 20.6 ms / 44.3 MB, textures 2.8 ms, gpu_wait 10.2 ms, copy_back 14.0 ms, 4212 draws); buckets: 1000-2999 11.1 fps (4), 3000-4999 8.7 fps (10, +5700% vs A), 5000-6999 10.4 fps (2); early reservation 3,200 MB (50 pieces), 20 arenas (1,187 MB peak), Streamline FG tagged=true status=0, 0 runtime errors, 0 device lost | duration 242.2 s (75 s in world)
END:         time limit (75 s in world)
CACHES:      warm: shader cache + NVIDIA DXCache (same save restored before start) | RUN 1 of 2
INSTRUMENTS: standard diag log, d3d12_run_fps.py
VERDICT:     prediction held (arena storm eliminated; 53x shorter median frame time vs main)
RUN 2643-B2 | 2026-12-01 UTC | lixonik | AI-assisted: Antigravity
BASE:        a596adfac + #2643 (2cea6871c, merged locally 810050be6) | shaders: warm cache (same)
MACHINE:     NVIDIA GeForce RTX 5070, 12 GB, desktop | 621.40 | Windows 10 Pro 22H2 (build 19045) | 64 GiB RAM | Ryzen 9 5950X
RECIPE:      documented (scripts/play-d3d12.ps1 -SeriesS -RayTracing -FrameGen 2) + DEVIATIONS: LEONIDA_FG_WITH_RT=1, LEONIDA_KEYS_FILE (menu enter only) | precompile: yes (warm, 6 s)
OS/DRIVER:   TdrDelay=default (Windows 10 D3D12 Agility SDK)
TARGET:      repeatability check on warm RT cache | PREDICTED (written before the run): matches B1 (~9-10 fps, 20 arenas, 0 errors)
MEASURED:    play (17 world samples, max 5,507 draws): median 9.6 fps (p10 4.2, p90 12.0), 104.0 ms/frame (preparing 69.1 ms, copies 23.9 ms / 52.3 MB, textures 1.8 ms, gpu_wait 5.3 ms, copy_back 13.4 ms, 3323 draws); buckets: 1000-2999 9.9 fps (8), 3000-4999 8.9 fps (8), 5000-6999 4.2 fps (1); early reservation 3,200 MB (50 pieces), 20 arenas (1,157 MB peak), Streamline FG tagged=true status=0, 0 runtime errors, 0 device lost | duration 214.7 s (75 s in world)
END:         time limit (75 s in world)
CACHES:      warm: shader cache + NVIDIA DXCache (same save restored before start) | RUN 2 of 2
INSTRUMENTS: standard diag log, d3d12_run_fps.py
VERDICT:     prediction held (repeatable across 2/2 runs)

Summary via tools/d3d12_run_fps.py --compare (A vs B1):

  • 3000-4999 draws: A 0.2 fps (6) vs B1 8.7 fps (10) (+5700%), B2 8.9 fps (8)
  • 5000-6999 draws: A 0.2 fps (2) vs B1 10.4 fps (2)

AI-assisted: Antigravity.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7299691356 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7299691356). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-01T03:25:32Z. --- Independent game-run A/B test on Windows 10 + NVIDIA RTX 5070 12 GB (driver 621.40) with DLSS Frame Generation 2x + Ray Tracing enabled (`MEASURED`, n=1 control / n=2 PR runs; `d3d12/target/diag` built with `diagnostics,dlss,mimalloc`, DLSS v310.9.16, Streamline v2.14.16). **Verdict: `better` (reproduces the `main` 0.2 fps / 13-arena collapse and fixes it cleanly in both PR runs: `5,391.0 ms` -> `101.8 / 104.0 ms`, `0.2 -> 8.7 / 8.9 fps` in the `3000-4999` draw bucket, 20 arenas / ~1,157-1,187 MB allocated, 0 runtime errors, 0 device losses).** One small launcher note (`READ IN CODE`, `d3d12/scripts/play-nvidia.ps1:519`): `play-nvidia.ps1` still strips `LEONIDA_FRAME_GEN` when `-RayTracing` is passed unless `-More @{LEONIDA_FG_WITH_RT='1'}` is supplied, so both arms below passed `LEONIDA_FG_WITH_RT=1` explicitly (updating `play-nvidia.ps1` can be done here or in a follow-up). Also note: in unattended runs Streamline reported `tagged=true status=0` with `presented=1 per=1` on the periodic state snapshot alongside Reflex latency reports; interactive foreground focus was not manually tested for interpolation cadence, while the low-VA exhaustion and 5.4 s/frame collapse are completely resolved. ```text RUN 2643-A | 2026-12-01 UTC | lixonik | AI-assisted: Antigravity BASE: a596adfac (main) | shaders: warm cache (25,687 translated, 202 untranslated) MACHINE: NVIDIA GeForce RTX 5070, 12 GB, desktop | 621.40 | Windows 10 Pro 22H2 (build 19045) | 64 GiB RAM | Ryzen 9 5950X RECIPE: documented (scripts/play-d3d12.ps1 -SeriesS -RayTracing -FrameGen 2) + DEVIATIONS: LEONIDA_FG_WITH_RT=1, LEONIDA_KEYS_FILE (menu enter only) | precompile: yes (warm, 3 s) OS/DRIVER: TdrDelay=default (Windows 10 D3D12 Agility SDK) TARGET: world frame rate & arena allocation with RT + DLSS FG 2x | PREDICTED (written before the run): low-VA exhaustion stalls world frames near ~0.1-0.2 fps MEASURED: play (9 world samples, max 6,699 draws): median 0.2 fps (p10 0.1, p90 10.2), 5391.0 ms/frame (preparing 1806.5 ms, copies 305.9 ms / 141.6 MB, textures 26.4 ms, gpu_wait 0.0 ms, copy_back 7.1 ms, 4015 draws); buckets: 1000-2999 10.2 fps (1), 3000-4999 0.2 fps (6), 5000-6999 0.2 fps (2); stuck at 13 arenas (830 MB), 46 unmapped-page warnings, up to 4,359 build dispatches/frame | duration 212.8 s (75 s in world) END: time limit (75 s in world) CACHES: warm: shader cache + NVIDIA DXCache (same save restored before start) | RUN 1 of 1 INSTRUMENTS: standard diag log, d3d12_run_fps.py VERDICT: prediction held (reproduced low-VA arena exhaustion and 0.2 fps collapse on main) ``` ```text RUN 2643-B1 | 2026-12-01 UTC | lixonik | AI-assisted: Antigravity BASE: a596adfac + #2643 (2cea6871c, merged locally 810050be6) | shaders: warm cache (same) MACHINE: NVIDIA GeForce RTX 5070, 12 GB, desktop | 621.40 | Windows 10 Pro 22H2 (build 19045) | 64 GiB RAM | Ryzen 9 5950X RECIPE: documented (scripts/play-d3d12.ps1 -SeriesS -RayTracing -FrameGen 2) + DEVIATIONS: LEONIDA_FG_WITH_RT=1, LEONIDA_KEYS_FILE (menu enter only) | precompile: yes (warm, 9 s) OS/DRIVER: TdrDelay=default (Windows 10 D3D12 Agility SDK) TARGET: world frame rate & arena allocation with RT + DLSS FG 2x | PREDICTED (written before the run): early 3,200 MB low-VA reservation prevents arena storm and sustains multi-fps play MEASURED: play (16 world samples, max 5,135 draws): median 9.8 fps (p10 1.6, p90 12.1), 101.8 ms/frame (preparing 63.8 ms, copies 20.6 ms / 44.3 MB, textures 2.8 ms, gpu_wait 10.2 ms, copy_back 14.0 ms, 4212 draws); buckets: 1000-2999 11.1 fps (4), 3000-4999 8.7 fps (10, +5700% vs A), 5000-6999 10.4 fps (2); early reservation 3,200 MB (50 pieces), 20 arenas (1,187 MB peak), Streamline FG tagged=true status=0, 0 runtime errors, 0 device lost | duration 242.2 s (75 s in world) END: time limit (75 s in world) CACHES: warm: shader cache + NVIDIA DXCache (same save restored before start) | RUN 1 of 2 INSTRUMENTS: standard diag log, d3d12_run_fps.py VERDICT: prediction held (arena storm eliminated; 53x shorter median frame time vs main) ``` ```text RUN 2643-B2 | 2026-12-01 UTC | lixonik | AI-assisted: Antigravity BASE: a596adfac + #2643 (2cea6871c, merged locally 810050be6) | shaders: warm cache (same) MACHINE: NVIDIA GeForce RTX 5070, 12 GB, desktop | 621.40 | Windows 10 Pro 22H2 (build 19045) | 64 GiB RAM | Ryzen 9 5950X RECIPE: documented (scripts/play-d3d12.ps1 -SeriesS -RayTracing -FrameGen 2) + DEVIATIONS: LEONIDA_FG_WITH_RT=1, LEONIDA_KEYS_FILE (menu enter only) | precompile: yes (warm, 6 s) OS/DRIVER: TdrDelay=default (Windows 10 D3D12 Agility SDK) TARGET: repeatability check on warm RT cache | PREDICTED (written before the run): matches B1 (~9-10 fps, 20 arenas, 0 errors) MEASURED: play (17 world samples, max 5,507 draws): median 9.6 fps (p10 4.2, p90 12.0), 104.0 ms/frame (preparing 69.1 ms, copies 23.9 ms / 52.3 MB, textures 1.8 ms, gpu_wait 5.3 ms, copy_back 13.4 ms, 3323 draws); buckets: 1000-2999 9.9 fps (8), 3000-4999 8.9 fps (8), 5000-6999 4.2 fps (1); early reservation 3,200 MB (50 pieces), 20 arenas (1,157 MB peak), Streamline FG tagged=true status=0, 0 runtime errors, 0 device lost | duration 214.7 s (75 s in world) END: time limit (75 s in world) CACHES: warm: shader cache + NVIDIA DXCache (same save restored before start) | RUN 2 of 2 INSTRUMENTS: standard diag log, d3d12_run_fps.py VERDICT: prediction held (repeatable across 2/2 runs) ``` Summary via `tools/d3d12_run_fps.py --compare` (A vs B1): - `3000-4999` draws: A `0.2 fps (6)` vs B1 `8.7 fps (10)` (`+5700%`), B2 `8.9 fps (8)` - `5000-6999` draws: A `0.2 fps (2)` vs B1 `10.4 fps (2)` AI-assisted: Antigravity.
merzleckeier commented 2026-12-01 13:07:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T13:07:10Z.


Required an actual GPU backing for the out-of-window reservation with 2cea6871c + ed867d7b2. I changed the optional by_address_shadow_works_on_out_of_reach_reservation assertion locally to require a hardware D3D12 device and a successful backing allocation. The 128 KiB fixture created the backing and passed span and GPU-offset checks on AMD RADV 26.3.1 and RTX 4070 SUPER (620.73.4), under Wine 11.22 and vkd3d-proton 3.1.0. The upload, memory and frame-generation helper filters passed 7, 4 and 10 tests respectively on each device. These tests cover the reservation and backing path. DLSS Frame Generation with ray tracing in-game was outside this run.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7312131871 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7312131871). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-01T13:07:10Z. --- Required an actual GPU backing for the out-of-window reservation with `2cea6871c` + `ed867d7b2`. I changed the optional `by_address_shadow_works_on_out_of_reach_reservation` assertion locally to require a hardware D3D12 device and a successful backing allocation. The 128 KiB fixture created the backing and passed span and GPU-offset checks on AMD RADV 26.3.1 and RTX 4070 SUPER (620.73.4), under Wine 11.22 and vkd3d-proton 3.1.0. The upload, memory and frame-generation helper filters passed 7, 4 and 10 tests respectively on each device. These tests cover the reservation and backing path. DLSS Frame Generation with ray tracing in-game was outside this run. AI-assisted with OpenAI Codex.
OreoFR commented 2026-12-01 23:48:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-01T23:48:40Z.


RUN (provisional, n=1 per arm) of head 2cea6871c merged onto main 913b88b90 (tree 940650739), against main 913b88b90 as control. RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11, launcher -SeriesS -RayTracing with DLSS and frame generation left at their defaults, BAR 0, texture budget 1024, 330 s walking run each, the pull request first and main second.

  • No device lost and no panic on either side.
  • With this pull request: frame median 148.6 ms (6.7 fps), p90 778 ms, private memory max 27.4 GB.
  • Main: frame median 214.5 ms (4.7 fps), p90 1 666 ms, one stretch at 1.85 s per frame at +180 s, private memory max 27.3 GB.
  • So the pull request side has fewer and shorter long frames, which fits the removed per-dispatch VirtualAlloc2 storm. But both arms are slow on this 8 GB laptop with ray tracing, the ray-tracing pipelines were compiling in both, and the two builds ran from different folders (the driver cache is per exe path), so this is a direction, not a measured gain.
  • Not checked: I did not find a log line that proves frame generation was active in either run, so I cannot say the FG + RT path itself was exercised.
    AI-assisted: Claude Code (oreofr-agent).
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7329799943 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7329799943). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-12-01T23:48:40Z. --- RUN (provisional, n=1 per arm) of head 2cea6871c merged onto main 913b88b90 (tree 940650739), against main 913b88b90 as control. RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11, launcher `-SeriesS -RayTracing` with DLSS and frame generation left at their defaults, BAR 0, texture budget 1024, 330 s walking run each, the pull request first and main second. - **No device lost and no panic on either side.** - With this pull request: frame median 148.6 ms (6.7 fps), p90 778 ms, private memory max 27.4 GB. - Main: frame median 214.5 ms (4.7 fps), p90 1 666 ms, one stretch at 1.85 s per frame at +180 s, private memory max 27.3 GB. - So the pull request side has fewer and shorter long frames, which fits the removed per-dispatch VirtualAlloc2 storm. But both arms are slow on this 8 GB laptop with ray tracing, the ray-tracing pipelines were compiling in both, and the two builds ran from different folders (the driver cache is per exe path), so this is a direction, not a measured gain. - Not checked: I did not find a log line that proves frame generation was active in either run, so I cannot say the FG + RT path itself was exercised. AI-assisted: Claude Code (oreofr-agent).
MoonEyes commented 2026-12-02 12:23:44 +00:00 (Migrated from github.com)

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


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:7345274167 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7345274167). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T12:23:44Z. --- 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).
Kal0s-design commented 2026-12-02 13:54:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T13:54:24Z.


Ran natively on Windows 11, head 2cea6871c merged into current main (128648cfe, no conflicts), leonida-gpu with --features diagnostics, --locked, toolchain 1.98.1. I ran the tests on the hardware card and again on WARP, with the same results.

Earlier runs covered the PR's own tests, mutants and in-game runs. This run checks whether the split between the upload pool, the early pieces and the out-of-reach arenas can give out the same address twice or send a lookup to the wrong buffer.

Suite

Check Result
cargo test -p leonida-gpu --lib (merge) 780 passed, 0 failed, 59 ignored
memory::tests upload::tests fg:: 21 passed
cargo clippy -p leonida-gpu --all-targets no warning in memory.rs, upload.rs, fg.rs or lib.rs

Allocator probes (throwaway tests in upload.rs, not committed)

Probe Result
8 threads at once, 40 Upload::new each (100 B to 9 MiB, sizes chosen so some need a new arena), plus 32 reserve_out_of_reach of 4 or 64 MiB 352 ranges, all disjoint. Every upload lies in [4 GiB, LOW_END), every out-of-reach block in [2^37, 2^40)
LEONIDA_BVH_BUILDER=1: 8 threads × 10 reserve_out_of_reach(64 MiB) 50 early pieces then 30 fresh ones. No address given twice, all in [2^37, 2^40), and write-watch on a committed early piece reports the block written
commit_pool_slice on a 3-piece fake pool, 5,000 random sizes from 1 B to 64 MiB + 1 19 slices given and 4,981 refused (the sizes were uniform up to 64 MiB, so this probe is thin), all disjoint, 64 KiB aligned, none crossing its piece, the pool filled to the byte. 64 MiB fits only an empty piece and 64 MiB + 1 is refused
Real POOL marked full, then reserve(4 MiB) falls back to a fresh reservation at 0x1_0000_0000, below LOW_END and clear of all 32 pool pieces (0x1f7fff0000 up to LOW_END)
Two Upload::new(4 MiB) back to back the arenas are adjacent in one pool piece (...bff0000, ...c3f0000), and shadow::extent at each start and each last byte resolves to its own buffer

I found no overlap and no address given twice, and shadow::extent resolves both ends of two adjacent arenas to their own buffers.

Two behaviour changes, read in code, not tested in game:

  • When neither the pool nor the low window has room, Upload::new now returns process-heap memory (above 2^40) where main returned None. So allocate_upload (list 0x4a0, the title's BVH instance descriptions) now gets a pointer that shaders read as zeros, where main gave a null pointer. The PR logs this once.
  • reserve_upload_space() runs at startup whatever LEONIDA_UPLOAD_LOW says. So LEONIDA_UPLOAD_LOW=0 ("from the process heap, as before") still reserves the 32 × 64 MiB of address space, though it commits none of it.

Not checked: DLSS frame generation together with ray tracing in game. How much room the low window has after Streamline/NGX/CUDA have loaded. shadow::lookup, or an ask spanning two adjacent arenas. leonida-hle and the app on this merge. The same probes on main (no comparison made).

GPUs tested: one NVIDIA desktop card + WARP.
AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7347654885 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7347654885). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-12-02T13:54:24Z. --- Ran natively on Windows 11, head `2cea6871c` merged into current `main` (`128648cfe`, no conflicts), `leonida-gpu` with `--features diagnostics`, `--locked`, toolchain 1.98.1. I ran the tests on the hardware card and again on WARP, with the same results. Earlier runs covered the PR's own tests, mutants and in-game runs. This run checks whether the split between the upload pool, the early pieces and the out-of-reach arenas can give out the same address twice or send a lookup to the wrong buffer. **Suite** | Check | Result | |---|---| | `cargo test -p leonida-gpu --lib` (merge) | 780 passed, 0 failed, 59 ignored | | `memory::tests upload::tests fg::` | 21 passed | | `cargo clippy -p leonida-gpu --all-targets` | no warning in `memory.rs`, `upload.rs`, `fg.rs` or `lib.rs` | **Allocator probes** (throwaway tests in `upload.rs`, not committed) | Probe | Result | |---|---| | 8 threads at once, 40 `Upload::new` each (100 B to 9 MiB, sizes chosen so some need a new arena), plus 32 `reserve_out_of_reach` of 4 or 64 MiB | 352 ranges, all disjoint. Every upload lies in [4 GiB, `LOW_END`), every out-of-reach block in [2^37, 2^40) | | `LEONIDA_BVH_BUILDER=1`: 8 threads × 10 `reserve_out_of_reach(64 MiB)` | 50 early pieces then 30 fresh ones. No address given twice, all in [2^37, 2^40), and write-watch on a committed early piece reports the block written | | `commit_pool_slice` on a 3-piece fake pool, 5,000 random sizes from 1 B to 64 MiB + 1 | 19 slices given and 4,981 refused (the sizes were uniform up to 64 MiB, so this probe is thin), all disjoint, 64 KiB aligned, none crossing its piece, the pool filled to the byte. 64 MiB fits only an empty piece and 64 MiB + 1 is refused | | Real `POOL` marked full, then `reserve(4 MiB)` | falls back to a fresh reservation at `0x1_0000_0000`, below `LOW_END` and clear of all 32 pool pieces (`0x1f7fff0000` up to `LOW_END`) | | Two `Upload::new(4 MiB)` back to back | the arenas are adjacent in one pool piece (`...bff0000`, `...c3f0000`), and `shadow::extent` at each start and each last byte resolves to its own buffer | I found no overlap and no address given twice, and `shadow::extent` resolves both ends of two adjacent arenas to their own buffers. Two behaviour changes, read in code, not tested in game: - When neither the pool nor the low window has room, `Upload::new` now returns process-heap memory (above 2^40) where `main` returned `None`. So `allocate_upload` (list 0x4a0, the title's BVH instance descriptions) now gets a pointer that shaders read as zeros, where `main` gave a null pointer. The PR logs this once. - `reserve_upload_space()` runs at startup whatever `LEONIDA_UPLOAD_LOW` says. So `LEONIDA_UPLOAD_LOW=0` ("from the process heap, as before") still reserves the 32 × 64 MiB of address space, though it commits none of it. Not checked: DLSS frame generation together with ray tracing in game. How much room the low window has after Streamline/NGX/CUDA have loaded. `shadow::lookup`, or an ask spanning two adjacent arenas. `leonida-hle` and the app on this merge. The same probes on `main` (no comparison made). GPUs tested: one NVIDIA desktop card + WARP. AI-assisted: yes (Claude Code).
enlight3d commented 2026-12-02 17:07:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-12-02T17:07:36Z.


RUN (in game, gate-style, as asked by MoonEyes): head 2cea6871c tested in a batch with #2643 (2cea6871c), #3031 (a47b86855), #2789 (4bd128a8c) and #2661 (1b3f3dee0), all merged with git merge --no-ff onto main 23a51c494 (no conflict; the only file the four share is d3d12/docs/switches.md). Built with diagnostics,mimalloc, target x86_64-pc-windows-msvc. RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro (build 26300).

Launcher defaults, Series S settings, -NoDlss -NoFrameGen, standing at the save; a warm-up run first (the batch changes the translator, so everything was re-translated), then one run of 420 s with the memory safety stop:

Reached the world 71 s
Time in the world 349 s
Device losses 0
Crashes 0
Frame median 29.4 ms (33.6 fps rendered)
Card busy 95 %
Private memory, max 26.6 GB

Verdict: PASS for the batch (a pass covers each of the four; a failure would not have said which). Not covered here: -RayTracing (a run with it is queued), DLSS frame generation with ray tracing (needs an RTX 40/50 card), other GPUs.

AI-assisted: Claude Code (Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7352936227 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7352936227). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-12-02T17:07:36Z. --- RUN (in game, gate-style, as asked by MoonEyes): head 2cea6871c tested **in a batch** with #2643 (2cea6871c), #3031 (a47b86855), #2789 (4bd128a8c) and #2661 (1b3f3dee0), all merged with `git merge --no-ff` onto `main` 23a51c494 (no conflict; the only file the four share is `d3d12/docs/switches.md`). Built with `diagnostics,mimalloc`, target `x86_64-pc-windows-msvc`. RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro (build 26300). Launcher defaults, Series S settings, `-NoDlss -NoFrameGen`, standing at the save; a warm-up run first (the batch changes the translator, so everything was re-translated), then one run of 420 s with the memory safety stop: | | | |---|---| | Reached the world | 71 s | | Time in the world | 349 s | | Device losses | 0 | | Crashes | 0 | | Frame median | 29.4 ms (33.6 fps rendered) | | Card busy | 95 % | | Private memory, max | 26.6 GB | Verdict: **PASS** for the batch (a pass covers each of the four; a failure would not have said which). Not covered here: `-RayTracing` (a run with it is queued), DLSS frame generation with ray tracing (needs an RTX 40/50 card), other GPUs. AI-assisted: Claude Code (Claude Opus 5.5)
MoonEyes commented 2026-12-02 18:13:06 +00:00 (Migrated from github.com)

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


Checked #2643: Rust reviewed at the level of its structure, not built here (Windows-only). Merged onto current main the switches registry check fails: the new LEONIDA_LOW_EARLY_MB is not in d3d12/docs/switches.md.

Head 2cea6871cb
Merge with main 45dc41f95c clean (git merge-tree); merge base ad25611b53, 884 commits behind
In-game gate PASS by enlight3d on 2 December 17:07 (batch of four, this head)

Ran (Linux, Python 3.13.18, on an export of the merge tree in its own git repository)

python -I tools/d3d12_switches.py --check d3d12/docs/switches.md
  missing from the page: LEONIDA_LOW_EARLY_MB       exit 1
python -I tests/test_d3d12_switches.py              FAILED (failures=1)

Same commands on main 45dc41f95c alone: exit 0, 20/20 OK. The name comes from this branch: d3d12/crates/leonida-gpu/src/upload.rs reads std::env::var("LEONIDA_LOW_EARLY_MB"). The head's CI of 30 November was green; on today's merge the check fails, so merging as is would turn main red. Fix: merge main, run python -I tools/d3d12_switches.py --out d3d12/docs/switches.md, commit.

Review notes (not built)

  • Splitting shader-addressed upload VA ([4 GiB, (MEMORY_PAGES - 1) * 64 KiB)) from host-only arena VA ([2^37, 2^40)), and stopping Memory::another from calling VirtualAlloc2 on every dispatch after a failed reservation, addresses the cause described (VA exhaustion and a per-dispatch reservation storm under the global MEMORY mutex), not a symptom.
  • The description credits GPL-3.0 commits from two other repositories; d3d12/ is GPL-3.0-or-later (d3d12/Cargo.toml:11), so the licences are compatible. A maintainer may still want the credited commit IDs in the commit message, not only in the description.
  • 680 added lines across six files, 884 commits behind main. The Windows checks (ghost, KelboLive, lixonik A/B, merzleckeier, OreoFR, Kal0s-design) are on this head or the earlier 9f39297d6 and agree.

Verdict: defects. One regenerated switches.md on a current merge; otherwise covered by the Windows and in-game evidence already posted.

AI-assisted: Claude Opus 5.5 (Claude Code), verification only.

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


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7354145301 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7354145301). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:13:06Z. --- **Checked #2643: Rust reviewed at the level of its structure, not built here (Windows-only). Merged onto current `main` the switches registry check fails: the new `LEONIDA_LOW_EARLY_MB` is not in `d3d12/docs/switches.md`.** | | | |---|---| | Head | `2cea6871cb` | | Merge with `main` `45dc41f95c` | clean (`git merge-tree`); merge base `ad25611b53`, 884 commits behind | | In-game gate | PASS by enlight3d on 2 December 17:07 (batch of four, this head) | **Ran (Linux, Python 3.13.18, on an export of the merge tree in its own git repository)** ``` python -I tools/d3d12_switches.py --check d3d12/docs/switches.md missing from the page: LEONIDA_LOW_EARLY_MB exit 1 python -I tests/test_d3d12_switches.py FAILED (failures=1) ``` Same commands on `main` `45dc41f95c` alone: exit 0, 20/20 OK. The name comes from this branch: `d3d12/crates/leonida-gpu/src/upload.rs` reads `std::env::var("LEONIDA_LOW_EARLY_MB")`. The head's CI of 30 November was green; on today's merge the check fails, so merging as is would turn `main` red. Fix: merge `main`, run `python -I tools/d3d12_switches.py --out d3d12/docs/switches.md`, commit. **Review notes (not built)** - Splitting shader-addressed upload VA (`[4 GiB, (MEMORY_PAGES - 1) * 64 KiB)`) from host-only arena VA (`[2^37, 2^40)`), and stopping `Memory::another` from calling `VirtualAlloc2` on every dispatch after a failed reservation, addresses the cause described (VA exhaustion and a per-dispatch reservation storm under the global `MEMORY` mutex), not a symptom. - The description credits GPL-3.0 commits from two other repositories; `d3d12/` is GPL-3.0-or-later (`d3d12/Cargo.toml:11`), so the licences are compatible. A maintainer may still want the credited commit IDs in the commit message, not only in the description. - 680 added lines across six files, 884 commits behind `main`. The Windows checks (ghost, KelboLive, lixonik A/B, merzleckeier, OreoFR, Kal0s-design) are on this head or the earlier `9f39297d6` and agree. **Verdict: defects.** One regenerated `switches.md` on a current merge; otherwise covered by the Windows and in-game evidence already posted. AI-assisted: Claude Opus 5.5 (Claude Code), verification only. AI-assisted verification: Claude Opus (Claude Code), separate agent per batch. --- _Generated by [Claude Code](https://claude.ai/code)_
zmasi commented 2026-12-02 18:23:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-02T18:23:35Z.


Thanks @MoonEyes — merged origin/main (45dc41f95c), regenerated d3d12/docs/switches.md (LEONIDA_LOW_EARLY_MB, LEONIDA_BVH_BUILDER, LEONIDA_FG_WITH_RT), and recorded the credited GPL-3.0 upstream commit IDs in commit ad354791d5 as well. The PR's Rust diff from 2cea6871cb (covered by @enlight3d's RTX 3090 in-game batch gate and @Kal0s-design's hardware + WARP runs) is completely unchanged.

Verified on ad354791d5:

  • python -I tools/d3d12_switches.py --check d3d12/docs/switches.md -> exit 0
  • python -I tests/test_d3d12_switches.py -> 20/20 OK
  • cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib upload::tests (7/7), memory::tests (4/4), fg:: (17/17), plus cargo check with and without --features diagnostics -> green.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7354503065 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7354503065). Originally posted by [zmasi](https://github.com/zmasi) on 2026-12-02T18:23:35Z. --- Thanks @MoonEyes — merged `origin/main` (`45dc41f95c`), regenerated `d3d12/docs/switches.md` (`LEONIDA_LOW_EARLY_MB`, `LEONIDA_BVH_BUILDER`, `LEONIDA_FG_WITH_RT`), and recorded the credited GPL-3.0 upstream commit IDs in commit `ad354791d5` as well. The PR's Rust diff from `2cea6871cb` (covered by @enlight3d's RTX 3090 in-game batch gate and @Kal0s-design's hardware + WARP runs) is completely unchanged. Verified on `ad354791d5`: - `python -I tools/d3d12_switches.py --check d3d12/docs/switches.md` -> exit 0 - `python -I tests/test_d3d12_switches.py` -> `20/20` OK - `cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib upload::tests` (`7/7`), `memory::tests` (`4/4`), `fg::` (`17/17`), plus `cargo check` with and without `--features diagnostics` -> green.
zmasi commented 2026-12-02 23:08:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-02T23:08:30Z.


Merged current origin/main (16243cd6eb, integrating #3154's title_range.rs in a17a658ea9): leonida_hle::reserve_upload_space() now runs immediately after leonida_gpu::title_range::keep() (skipping POOL when title_range holds [4 GiB, 2^37 - 64 KiB), while still reserving LEONIDA_LOW_EARLY_MB in [2^37, 2^40) for Memory), and upload::release re-holds freed low-window spans in title_range while leaving [2^37, 2^40) out-of-reach reservations MEM_FREE (11/11 upload::, 10/10 title_range::, 4/4 memory::, 17/17 fg::, 27/27 xmem::, and 20/20 test_d3d12_switches.py passing).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7361615189 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7361615189). Originally posted by [zmasi](https://github.com/zmasi) on 2026-12-02T23:08:30Z. --- Merged current `origin/main` (`16243cd6eb`, integrating #3154's `title_range.rs` in `a17a658ea9`): `leonida_hle::reserve_upload_space()` now runs immediately after `leonida_gpu::title_range::keep()` (skipping `POOL` when `title_range` holds `[4 GiB, 2^37 - 64 KiB)`, while still reserving `LEONIDA_LOW_EARLY_MB` in `[2^37, 2^40)` for `Memory`), and `upload::release` re-holds freed low-window spans in `title_range` while leaving `[2^37, 2^40)` out-of-reach reservations `MEM_FREE` (`11/11` `upload::`, `10/10` `title_range::`, `4/4` `memory::`, `17/17` `fg::`, `27/27` `xmem::`, and `20/20` `test_d3d12_switches.py` passing).
OreoFR commented 2026-12-03 00:54:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-03T00:54:49Z.


In-game run (head a17a658ea9 merged --no-ff onto main 81efe45669): PASS (stability), with one frame-generation observation.

Setup:

  • RTX 4070 Laptop 8 GB, driver 621.40.
  • Build: diag profile (diagnostics, dlss, mimalloc).
  • A fresh data copy per run, 330 s walk in the world (W + J/L turns), clean close.
  • Frame rates are medians over the last 240 s of the walk.

Run A, this PR's case: -SeriesS -HardwareRT -FrameGen 2 -PrecompileUsed, LEONIDA_FG_WITH_RT=1, BAR 0, texture budget 1024.

Generated frames Rendered / shown fps Frame time Over 100 ms (last 240 s)
A1 none: per=1 in 20 of 21 state lines, shown = rendered (Streamline started with frames=2) 20.2 / 20.2 (22.3 over the last 120 s) 44.7 ms 1
A2 (repeat) yes: per=2 in all 11 world state lines 22.9 / 45.9 (24.2 / 48.5 over the last 120 s) 44.3 ms 2
Control: main 81efe4566 alone, same settings yes: per=2 in 7 of 9 state lines 17.4 / 31.6 63 ms 29
  • 12 resets in each of A1 and A2, and 0 eWarnOutOfVRAM in all three runs.
  • No device removed or lost, and no crash, in any run.
  • When frame generation is generating, this PR matches main's best figures on this card (22-24 rendered / 45-48 shown) and beats tonight's control. That is PROVISIONAL, n=1 per build.
  • Open point: A1 generated no frames at all, which no main run on this card has shown (0 of 3). With 1 of 2 runs on this PR, it may be chance.
  • Not tested: frame generation with ray tracing started without LEONIDA_FG_WITH_RT set.

Run B, standard gate: -SeriesS -NoDlss -NoFrameGen -PrecompileUsed, BAR 0, texture budget 1024.

  • 27.0 fps, 35.5 ms, within the usual range for this card.
  • 2 frames over 100 ms (one of 1.48 s) in the last 240 s.
  • No device removed or lost, no crash.

AI-assisted (oreofr-agent)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7363736606 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7363736606). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-12-03T00:54:49Z. --- In-game run (head a17a658ea9c04dfe47cdc45034838b994305a67d merged --no-ff onto main 81efe45669c83a4666b3801e8bd69d34adf57442): **PASS (stability)**, with one frame-generation observation. **Setup:** - RTX 4070 Laptop 8 GB, driver 621.40. - Build: diag profile (diagnostics, dlss, mimalloc). - A fresh data copy per run, 330 s walk in the world (W + J/L turns), clean close. - Frame rates are medians over the last 240 s of the walk. **Run A, this PR's case:** `-SeriesS -HardwareRT -FrameGen 2 -PrecompileUsed`, `LEONIDA_FG_WITH_RT=1`, BAR 0, texture budget 1024. | | Generated frames | Rendered / shown fps | Frame time | Over 100 ms (last 240 s) | |---|---|---|---|---| | A1 | none: per=1 in 20 of 21 state lines, shown = rendered (Streamline started with frames=2) | 20.2 / 20.2 (22.3 over the last 120 s) | 44.7 ms | 1 | | A2 (repeat) | yes: per=2 in all 11 world state lines | 22.9 / 45.9 (24.2 / 48.5 over the last 120 s) | 44.3 ms | 2 | | Control: main 81efe4566 alone, same settings | yes: per=2 in 7 of 9 state lines | 17.4 / 31.6 | 63 ms | 29 | - 12 resets in each of A1 and A2, and 0 eWarnOutOfVRAM in all three runs. - No device removed or lost, and no crash, in any run. - When frame generation is generating, this PR matches main's best figures on this card (22-24 rendered / 45-48 shown) and beats tonight's control. That is PROVISIONAL, n=1 per build. - **Open point:** A1 generated no frames at all, which no main run on this card has shown (0 of 3). With 1 of 2 runs on this PR, it may be chance. - **Not tested:** frame generation with ray tracing started without `LEONIDA_FG_WITH_RT` set. **Run B, standard gate:** `-SeriesS -NoDlss -NoFrameGen -PrecompileUsed`, BAR 0, texture budget 1024. - 27.0 fps, 35.5 ms, within the usual range for this card. - 2 frames over 100 ms (one of 1.48 s) in the last 240 s. - No device removed or lost, no crash. AI-assisted (oreofr-agent)
zmasi commented 2026-12-03 03:28:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-03T03:28:05Z.


Merged origin/main (516c9eaabf, including #3230 and #3244) into 26e7b6057e strictly to regenerate d3d12/docs/switches.md (needs rebase); all six Rust files (main.rs, fg.rs, lib.rs, memory.rs, upload.rs, and leonida-hle/src/lib.rs) have byte-identical diffs against origin/main compared to a17a658ea9.

@OreoFR Thank you for the RTX 4070 Laptop 8 GB run report! On the A1 observation (per=1 in 20 of 21 state lines despite Streamline started with frames=2, while 1 of 21 lines in A1 and 11 of 11 in A2 had per=2):

  • This PR only changes startup wanted_for (fg.rs:67-89, cached in OnceLock), which returned the same 1 (2x) as main under LEONIDA_FG_WITH_RT=1; present_start, present_end, tag, and STALE_RESETS (12 resets in both A1 and A2) are untouched.
  • Because 1 of 21 lines in A1 did reach per=2, Streamline initialized and generated at least one interval before dropping back to per=1 (fg.rs:1509). The most common cause of status=0, tagged=true, presented=1 after an active interval is the game window losing Win32 foreground focus (fg.rs:1503-1504: DLSS-G suspends generation whenever the window is unfocused); checking status and tagged on A1's frame generation: state lines (fg.rs:1512-1520) will show whether it was unfocused pass-through (status=0, tagged=true, presented=1) vs a non-zero Streamline status or tagged=false.
  • Also noting that with #3230 now on main, play-nvidia.ps1 sets LEONIDA_FG_WITH_RT=1 automatically on Series S (and Series X >= 20 GB), while wanted_for in fg.rs aligns direct runtime launches (play-d3d12.ps1 / Linux) and still honors LEONIDA_FG_WITH_RT=0.

AI-assisted: Gemini 4 Carbon (High) and Gemini 4 Neon (XHigh).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7366598704 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7366598704). Originally posted by [zmasi](https://github.com/zmasi) on 2026-12-03T03:28:05Z. --- Merged `origin/main` (`516c9eaabf`, including `#3230` and `#3244`) into `26e7b6057e` strictly to regenerate `d3d12/docs/switches.md` (`needs rebase`); all six Rust files (`main.rs`, `fg.rs`, `lib.rs`, `memory.rs`, `upload.rs`, and `leonida-hle/src/lib.rs`) have byte-identical diffs against `origin/main` compared to `a17a658ea9`. @OreoFR Thank you for the RTX 4070 Laptop 8 GB run report! On the `A1` observation (`per=1` in 20 of 21 state lines despite `Streamline started with frames=2`, while 1 of 21 lines in `A1` and 11 of 11 in `A2` had `per=2`): - This PR only changes startup `wanted_for` (`fg.rs:67-89`, cached in `OnceLock`), which returned the same `1` (2x) as `main` under `LEONIDA_FG_WITH_RT=1`; `present_start`, `present_end`, `tag`, and `STALE_RESETS` (`12 resets` in both `A1` and `A2`) are untouched. - Because 1 of 21 lines in `A1` did reach `per=2`, Streamline initialized and generated at least one interval before dropping back to `per=1` (`fg.rs:1509`). The most common cause of `status=0, tagged=true, presented=1` after an active interval is the game window losing Win32 foreground focus (`fg.rs:1503-1504`: DLSS-G suspends generation whenever the window is unfocused); checking `status` and `tagged` on `A1`'s `frame generation: state` lines (`fg.rs:1512-1520`) will show whether it was unfocused pass-through (`status=0, tagged=true, presented=1`) vs a non-zero Streamline `status` or `tagged=false`. - Also noting that with `#3230` now on `main`, `play-nvidia.ps1` sets `LEONIDA_FG_WITH_RT=1` automatically on Series S (and Series X `>= 20 GB`), while `wanted_for` in `fg.rs` aligns direct runtime launches (`play-d3d12.ps1` / Linux) and still honors `LEONIDA_FG_WITH_RT=0`. AI-assisted: Gemini 4 Carbon (High) and Gemini 4 Neon (XHigh).
fiestorra commented 2026-12-03 05:47:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T05:47:31Z.


VERIFY-2642 y #2643 — las dos grandes, las dos sin tests nuevos, y una de ellas mejora al fusionar

Las dos de zmasi, las dos de 5-6 días, y las dos con switches.md en el diff (la marca de esta noche para «cambia lo que el jugador puede encender»):

#2642   13 files, +1003/−272    709 passed; 1 failed   0 tests nuevos
#2643    7 files, +771/−90      724 passed; 1 failed   0 tests nuevos

La única falla en las dos es la de la iGPU.

#2643 — y este número sí dice algo

724 es más que los 715 de main, con cero tests nuevos — o sea que su base trae nueve tests que main ya no tiene o tiene distintos, y aun así la suite pasa. Lo digo porque es lo contrario de un problema: un árbol que añade pruebas respecto a main y pasa entero es un árbol que se fusionó con cuidado.

El cambio: separar la VA de subida de las arenas del BVH para que DLSS FG funcione con ray tracing — 570 líneas en upload.rs, 229 en memory.rs. Es un cambio de reparto de memoria, y el título nombra el síntoma exacto («DLSS FG runs with ray tra…»): el jugador enciende las dos cosas y una se rompe.

#2642 — compilar shaders SM 5.1 con DXC en Wine

Y esta es la más ambiciosa de las dos: 13 ficheros, y inplace.rs/replay/play/merge.rs en el diff — no es sólo el compilador, es el camino de la grabación.

Lo que verifiqué en las dos: la suite completa del crate, con la única falla conocida, y que ninguna trae test nuevo.
Lo que no: que DLSS FG y el ray tracing convivan (#2643) ni que un shader SM 5.1 compile en Wine (#2642) — son los dos estados que el título promete y ninguno está en la suite.

Y una observación sobre la cola, con las dos delante: son las dos PRs más grandes que quedan sin revisar (1 003 y 771 líneas) y las dos vienen del mismo autor con la misma etiqueta de switches.md. Si alguien va a fusionar dos de las antiguas esta semana, estas dos cambian el comportamiento del juego más que las otras cinco juntas — y por eso son las que más necesitan una fila en gpu-test-results/, que es lo único que puede decir si funcionan.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7369117546 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7369117546). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T05:47:31Z. --- ## VERIFY-2642 y `#2643` — las dos grandes, las dos sin tests nuevos, y una de ellas mejora al fusionar **Las dos de zmasi, las dos de 5-6 días, y las dos con `switches.md` en el diff** (**la marca de esta noche para «cambia lo que el jugador puede encender»**): ``` #2642 13 files, +1003/−272 709 passed; 1 failed 0 tests nuevos #2643 7 files, +771/−90 724 passed; 1 failed 0 tests nuevos ``` **La única falla en las dos es la de la iGPU.** ## `#2643` — y este número sí dice algo **`724` es más que los `715` de `main`**, **con cero tests nuevos** — **o sea que su base trae nueve tests que `main` ya no tiene o tiene distintos**, **y aun así la suite pasa.** **Lo digo porque es lo contrario de un problema: un árbol que *añade* pruebas respecto a `main` y pasa entero es un árbol que se fusionó con cuidado.** **El cambio**: **separar la VA de subida de las arenas del BVH para que DLSS FG funcione con ray tracing** — **570 líneas en `upload.rs`, 229 en `memory.rs`.** **Es un cambio de reparto de memoria, y el título nombra el síntoma exacto** (*«DLSS FG runs with ray tra…»*): **el jugador enciende las dos cosas y una se rompe.** ## `#2642` — compilar shaders SM 5.1 con DXC en Wine **Y esta es la más ambiciosa de las dos**: **13 ficheros, y `inplace.rs`/`replay/play/merge.rs` en el diff** — **no es sólo el compilador, es el camino de la grabación.** **Lo que verifiqué en las dos**: **la suite completa del crate, con la única falla conocida, y que ninguna trae test nuevo.** **Lo que no**: **que DLSS FG y el ray tracing convivan** (`#2643`) **ni que un shader SM 5.1 compile en Wine** (`#2642`) — **son los dos estados que el título promete y ninguno está en la suite.** **Y una observación sobre la cola, con las dos delante**: **son las dos PRs más grandes que quedan sin revisar (1 003 y 771 líneas) y las dos vienen del mismo autor con la misma etiqueta de `switches.md`.** **Si alguien va a fusionar dos de las antiguas esta semana, estas dos cambian el comportamiento del juego más que las otras cinco juntas** — **y por eso son las que más necesitan una fila en `gpu-test-results/`, que es lo único que puede decir si funcionan.**
lixonik commented 2026-12-03 08:57:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-03T08:57:56Z.


RUN (in game, RTX 5070 12 GB, Hardware RT + Streamline FG 2x init, 315 s in-world gate) -- PASS (stability), plus one parallel unit-test race finding

  • Head tested: 26e7b6057 merged cleanly (git merge --no-ff) onto main (d9b618f10)
  • Preflight & unit tests (Windows 10 x64):
    • python -I scripts/check_no_game_data.py -- PASS
    • python -I tools/d3d12_switches.py --check d3d12/docs/switches.md -- PASS
    • cargo test -p leonida-gpu --lib --locked upload:: -- --test-threads=1 -- 11/11 PASS
    • cargo test -p leonida-gpu --lib --locked memory:: -- PASS
    • cargo test -p leonida-gpu --lib --locked fg:: -- 17/17 PASS (including frame_generation_starts_with_ray_tracing_unless_explicitly_disabled)
    • cargo test -p leonida-hle --lib --locked -- 258 passed, 0 failed, 2 ignored
    • cargo build --profile diag --features "diagnostics,dlss,mimalloc" --locked -- PASS
  • Unit-test race finding (intermittent under default parallel cargo test):
    • Running cargo test -p leonida-gpu --lib --locked upload:: without --test-threads=1 failed 2 of 4 times at crates/leonida-gpu/src/upload.rs:610 (release_reholds_title_range_spans_and_leaves_out_of_reach_free: assert_eq!(mbi.State, MEM_FREE) got 4096 (MEM_COMMIT) instead of 65536 (MEM_FREE)).
    • Cause: out_of_reach_places_write_watched_memory_above_37_bits_and_releases_cleanly runs in parallel in the same [OUT_START, OUT_END) window and can immediately claim the just-freed lowest VA between release_in(&range, out) and VirtualQuery(out, ...). Serializing the OUT_START..OUT_END VirtualQuery tests (or holding a test mutex across reserve/release/query) should eliminate the flake.
  • In-game run (Windows 10, RTX 5070 12 GB, Series S preset, DLSS + Hardware RT (LEONIDA_HW_RT=1, LEONIDA_AMBIENT=0, LEONIDA_RT_RESOLVE=1, LEONIDA_ACTIVATE_RAYS=1) + -FrameGen 2, 315 s in world, 498.3 s total, 63 world samples, max 5,137 draws):
    • Runtime errors: 0; device lost: 0; eWarnOutOfVRAM: 0 (only Streamline getRefreshRate lines after the harness closed the window at teardown)
    • Startup VA reservation: title_range held 126,975 MiB across 124 pieces before Streamline/NGX loaded (sl.dlss_g PRODUCTION)
    • Hardware RT active: DXR 1.1 tier 11, 5,185 live BLAS (569 MB / 1,074 MB budget, 0 evicted)
    • Frame rate (rendered): median 23.7 fps (42.1 ms; slowest tenth 10.3, fastest tenth 25.4); 3000-4999 draws bucket: 23.8 fps (57 samples)
    • Honest scope note on FG output (per=1): Streamline initialized cleanly (Streamline started frames=2, amount set (1 = off) result=sl::Result::eOk (0) frames=2, status=0 across all 29 state lines, tagged=true in world), but presented=1 per=1 on all state lines on this Windows 10 automated test setup (the same per=1 behavior occurred on an unrelated FG-only run on this host, so this appears host/window-state related rather than PR-specific). Also not tested in-game here: software BVH (LEONIDA_BVH_BUILDER=1) with LEONIDA_FG_WITH_RT unset.

AI-assisted: yes (Antigravity -- Gemini 4 Neon).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7372985346 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7372985346). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-03T08:57:56Z. --- RUN (in game, RTX 5070 12 GB, Hardware RT + Streamline FG 2x init, 315 s in-world gate) -- PASS (stability), plus one parallel unit-test race finding - Head tested: `26e7b6057` merged cleanly (`git merge --no-ff`) onto `main` (`d9b618f10`) - Preflight & unit tests (Windows 10 x64): - `python -I scripts/check_no_game_data.py` -- PASS - `python -I tools/d3d12_switches.py --check d3d12/docs/switches.md` -- PASS - `cargo test -p leonida-gpu --lib --locked upload:: -- --test-threads=1` -- 11/11 PASS - `cargo test -p leonida-gpu --lib --locked memory::` -- PASS - `cargo test -p leonida-gpu --lib --locked fg::` -- 17/17 PASS (including `frame_generation_starts_with_ray_tracing_unless_explicitly_disabled`) - `cargo test -p leonida-hle --lib --locked` -- 258 passed, 0 failed, 2 ignored - `cargo build --profile diag --features "diagnostics,dlss,mimalloc" --locked` -- PASS - **Unit-test race finding (intermittent under default parallel `cargo test`):** - Running `cargo test -p leonida-gpu --lib --locked upload::` without `--test-threads=1` failed 2 of 4 times at `crates/leonida-gpu/src/upload.rs:610` (`release_reholds_title_range_spans_and_leaves_out_of_reach_free`: `assert_eq!(mbi.State, MEM_FREE)` got `4096` (`MEM_COMMIT`) instead of `65536` (`MEM_FREE`)). - Cause: `out_of_reach_places_write_watched_memory_above_37_bits_and_releases_cleanly` runs in parallel in the same `[OUT_START, OUT_END)` window and can immediately claim the just-freed lowest VA between `release_in(&range, out)` and `VirtualQuery(out, ...)`. Serializing the `OUT_START..OUT_END` `VirtualQuery` tests (or holding a test mutex across reserve/release/query) should eliminate the flake. - In-game run (Windows 10, RTX 5070 12 GB, Series S preset, DLSS + Hardware RT (`LEONIDA_HW_RT=1`, `LEONIDA_AMBIENT=0`, `LEONIDA_RT_RESOLVE=1`, `LEONIDA_ACTIVATE_RAYS=1`) + `-FrameGen 2`, 315 s in world, 498.3 s total, 63 world samples, max 5,137 draws): - Runtime errors: 0; device lost: 0; `eWarnOutOfVRAM`: 0 (only Streamline `getRefreshRate` lines after the harness closed the window at teardown) - Startup VA reservation: `title_range` held `126,975 MiB` across `124` pieces before Streamline/NGX loaded (`sl.dlss_g` PRODUCTION) - Hardware RT active: DXR 1.1 tier 11, 5,185 live BLAS (`569 MB` / `1,074 MB` budget, `0` evicted) - Frame rate (rendered): median **23.7 fps** (42.1 ms; slowest tenth 10.3, fastest tenth 25.4); `3000-4999` draws bucket: **23.8 fps** (57 samples) - **Honest scope note on FG output (`per=1`):** Streamline initialized cleanly (`Streamline started frames=2`, `amount set (1 = off) result=sl::Result::eOk (0) frames=2`, `status=0` across all 29 state lines, `tagged=true` in world), but `presented=1 per=1` on all state lines on this Windows 10 automated test setup (the same `per=1` behavior occurred on an unrelated FG-only run on this host, so this appears host/window-state related rather than PR-specific). Also not tested in-game here: software BVH (`LEONIDA_BVH_BUILDER=1`) with `LEONIDA_FG_WITH_RT` unset. AI-assisted: yes (Antigravity -- Gemini 4 Neon).
zmasi commented 2026-12-03 11:25:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-03T11:25:35Z.


Merged origin/main (6e97990505, #3318) into 2e0b23a002 to regenerate d3d12/docs/switches.md (needs rebase), and serialized the four [OUT_START, OUT_END) VirtualQuery tests across upload::tests and memory::tests under #[cfg(test)] out_of_reach_test_lock() — thank you @lixonik for both the 315 s RTX 5070 Hardware RT + Streamline FG 2x gate report and catching that parallel test race! Zero non-test Rust bytes changed compared to 26e7b6057e (15/15 consecutive parallel upload:: + memory:: runs pass).

AI-assisted: Gemini 4 Neon (XHigh) and Gemini 4 Carbon (High).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7376683333 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7376683333). Originally posted by [zmasi](https://github.com/zmasi) on 2026-12-03T11:25:35Z. --- Merged `origin/main` (`6e97990505`, `#3318`) into `2e0b23a002` to regenerate `d3d12/docs/switches.md` (`needs rebase`), and serialized the four `[OUT_START, OUT_END)` `VirtualQuery` tests across `upload::tests` and `memory::tests` under `#[cfg(test)]` `out_of_reach_test_lock()` — thank you @lixonik for both the 315 s RTX 5070 Hardware RT + Streamline FG 2x gate report and catching that parallel test race! Zero non-test Rust bytes changed compared to `26e7b6057e` (`15/15` consecutive parallel `upload::` + `memory::` runs pass). AI-assisted: Gemini 4 Neon (XHigh) and Gemini 4 Carbon (High).
MoonEyes commented 2026-12-03 14:31:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T14:31:56Z.


RUN (in game, third party, batch of five pull requests), each head merged with git merge --no-ff onto main b053a1813, in one build: #2686 c5269801b, #2643 2e0b23a00, #2789 4cd9d71f8, #3072 0f1e26355, #2999 91537d2af. RTX 4060 8 GB, driver 610.88, Windows 11. Series S, -Resolution 1080, frame generation 2x, -PrecompileUsed, 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 (46 samples) median 16.3, mean 16.4
Rendered fps, last 120 s median 16.2
Frames over 100 ms 21.3 per 1000; 2 pauses over 1 s
Time under 5 fps in the world 0 %

For reference, the same machine and route rendered 13.3 to 17.6 fps on other runs today: a check that nothing fell over, not a measurement of a gain.

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. #2834 was left out of the batch (it conflicts with the others).

Limits: one run; arrival in the world was driven by keys and not checked on pictures. The precompile took 589 s (the batch changes shader code, so the pipeline cache was cold). Switches that are off by default were not turned on: this run covers their default path only.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7381601447 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2643#issuecomment-7381601447). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-03T14:31:56Z. --- RUN (in game, third party, batch of five pull requests), each head merged with `git merge --no-ff` onto main `b053a1813`, in one build: #2686 `c5269801b`, #2643 `2e0b23a00`, #2789 `4cd9d71f8`, #3072 `0f1e26355`, #2999 `91537d2af`. RTX 4060 8 GB, driver 610.88, Windows 11. Series S, `-Resolution 1080`, frame generation 2x, `-PrecompileUsed`, 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 (46 samples) | median 16.3, mean 16.4 | | Rendered fps, last 120 s | median 16.2 | | Frames over 100 ms | 21.3 per 1000; 2 pauses over 1 s | | Time under 5 fps in the world | 0 % | For reference, the same machine and route rendered 13.3 to 17.6 fps on other runs today: a check that nothing fell over, not a measurement of a gain. 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. #2834 was left out of the batch (it conflicts with the others). Limits: one run; arrival in the world was driven by keys and not checked on pictures. The precompile took 589 s (the batch changes shader code, so the pipeline cache was cold). Switches that are off by default were not turned on: this run covers their default path only. AI-assisted (Claude Code, Claude Opus 5.5).
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/2643:upstream-pr/2643'
git switch 'upstream-pr/2643'

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