D3D12-DYNAMIC-SLOTS-POOL-EXHAUSTION: default capped heaps to half the view heap #3016

Open
bobcatchris wants to merge 1 commit from upstream-pr/3016 into main
bobcatchris commented 2026-12-01 23:45:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-12-01T23:45:20Z.


Claimed in the coordination issue as: D3D12-DYNAMIC-SLOTS-POOL-EXHAUSTION### What and whyOn a host whose shader-visible view heap is capped at PORTABLE_VIEWS (NVIDIA, 1,000,000 views), descriptor/host.rs::dynamic_slots defaulted to 2^18 (262,144) dynamic descriptor slots. In a dense scene (9,100 draws, Series S, RTX 3060 Ti) that pool ran out: 18.87 tables a frame found no pool and waited 20.9 ms, 17.67 went without ΓÇö 17 fps. With 524,288 requested (clamped to 499,999, half the heap) no table was refused for five minutes in the same scene. play-nvidia.ps1 and play-linux.sh already set 524,288, so direct runs and other entry points still got the exhausted default.The capped path now defaults to half the heap, still bounded by an explicit LEONIDA_DYNAMIC_SLOTS override. The slot calculation is a pure helper, which also removes the old clamp(DYNAMIC, null / 2) panic when null / 2 < DYNAMIC and stops caching a heap-specific count in a OnceLock. The uncapped path is unchanged; no draws, shaders, effects or quality settings are removed.### Tested- cargo test -p leonida-gpu --locked dynamic_slots ΓÇö 6 related tests pass; plus a_small_capped_heap_does_not_panic.- python -I tools/d3d12_switches.py --check d3d12/docs/switches.md and python -I tests/test_d3d12_switches.py ΓÇö 20 tests pass.- Red/green: with the same assertions applied to the old source via a test-only shim, capped_default_takes_half_the_heap failed (left: 262144, right: 499999) and the small-heap case panicked with min > max; both pass with this change.- python -I scripts/check_no_game_data.py on both changed files ΓÇö clean.- Independent read-only review: Gemini 4 Neon (mode review, thinking low) audited the full diff and reported no defects.GPUs tested: n/a for the unit tests; the in-game measurement quoted above was supplied by Raisedpedro on an RTX 3060 Ti (Series S) and is the evidence for the default change, not a measurement made in this pull request.AI-assisted: yes ΓÇö Gemini 4 Neon (direction and independent review).### Checklist- [x] Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).- [x] One topic; follow-up work goes in a new pull request.- [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.- [x] A new translator rule is in the contract table of docs/design.md, with how it was confirmed. ΓÇö n/a: no translator rule changed.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5596765724 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3016). Originally posted by [bobcatchris](https://github.com/bobcatchris) on 2026-12-01T23:45:20Z. --- Claimed in the coordination issue as: D3D12-DYNAMIC-SLOTS-POOL-EXHAUSTION### What and whyOn a host whose shader-visible view heap is capped at `PORTABLE_VIEWS` (NVIDIA, 1,000,000 views), `descriptor/host.rs::dynamic_slots` defaulted to `2^18` (262,144) dynamic descriptor slots. In a dense scene (9,100 draws, Series S, RTX 3060 Ti) that pool ran out: **18.87 tables a frame found no pool and waited 20.9 ms, 17.67 went without ΓÇö 17 fps**. With 524,288 requested (clamped to 499,999, half the heap) **no table was refused for five minutes** in the same scene. `play-nvidia.ps1` and `play-linux.sh` already set 524,288, so direct runs and other entry points still got the exhausted default.The capped path now defaults to half the heap, still bounded by an explicit `LEONIDA_DYNAMIC_SLOTS` override. The slot calculation is a pure helper, which also removes the old `clamp(DYNAMIC, null / 2)` panic when `null / 2 < DYNAMIC` and stops caching a heap-specific count in a `OnceLock`. The uncapped path is unchanged; no draws, shaders, effects or quality settings are removed.### Tested- `cargo test -p leonida-gpu --locked dynamic_slots` ΓÇö 6 related tests pass; plus `a_small_capped_heap_does_not_panic`.- `python -I tools/d3d12_switches.py --check d3d12/docs/switches.md` and `python -I tests/test_d3d12_switches.py` ΓÇö 20 tests pass.- Red/green: with the same assertions applied to the old source via a test-only shim, `capped_default_takes_half_the_heap` failed (`left: 262144, right: 499999`) and the small-heap case panicked with `min > max`; both pass with this change.- `python -I scripts/check_no_game_data.py` on both changed files ΓÇö clean.- Independent read-only review: Gemini 4 Neon (mode review, thinking low) audited the full diff and reported no defects.GPUs tested: n/a for the unit tests; the in-game measurement quoted above was supplied by Raisedpedro on an RTX 3060 Ti (Series S) and is the evidence for the default change, not a measurement made in this pull request.AI-assisted: yes ΓÇö Gemini 4 Neon (direction and independent review).### Checklist- [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`).- [x] One topic; follow-up work goes in a new pull request.- [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.- [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. ΓÇö n/a: no translator rule changed.
andrew-ai commented 2026-12-01 23:46:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by andrew-ai on 2026-12-01T23:46:32Z.


Verified the default change and its scope at 4981d6d17 on Windows. Both default and Series X play-nvidia.ps1 -DryRun already emit LEONIDA_DYNAMIC_SLOTS=524288. Supplying 300000 through -More emitted 300000.

I also compiled the production sizing functions from the parent and PR with logging stubbed out, then ran a fresh process per value to avoid reusing the cached environment. With null slot 999999 on a million-view heap:

Input Parent PR
Unset 262144 499999
NVIDIA launcher setting (524288) 499999 499999
Explicit 300000 300000 300000

This confirms the increase for callers leaving the setting unset. On this heap the stock NVIDIA launcher already gets the larger pool. The checks cover configuration and sizing only, with no frame-rate or dropped-draw measurement.

Codex-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7329757730 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3016#issuecomment-7329757730). Originally posted by [andrew-ai](https://github.com/andrew-ai) on 2026-12-01T23:46:32Z. --- Verified the default change and its scope at 4981d6d17 on Windows. Both default and Series X play-nvidia.ps1 -DryRun already emit LEONIDA_DYNAMIC_SLOTS=524288. Supplying 300000 through -More emitted 300000. I also compiled the production sizing functions from the parent and PR with logging stubbed out, then ran a fresh process per value to avoid reusing the cached environment. With null slot 999999 on a million-view heap: | Input | Parent | PR | | --- | ---: | ---: | | Unset | 262144 | 499999 | | NVIDIA launcher setting (524288) | 499999 | 499999 | | Explicit 300000 | 300000 | 300000 | This confirms the increase for callers leaving the setting unset. On this heap the stock NVIDIA launcher already gets the larger pool. The checks cover configuration and sizing only, with no frame-rate or dropped-draw measurement. Codex-assisted.
MoonEyes commented 2026-12-02 12:36:38 +00:00 (Migrated from github.com)

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


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:7345596563 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3016#issuecomment-7345596563). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T12:36:38Z. --- 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:55:31 +00:00 (Migrated from github.com)

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


Ran natively on Windows 11, head 77b7bee55 merged into current main (128648cfe, clean merge). The earlier comment compiled the sizing functions on their own. This run builds real HostHeaps on a host whose view heap is capped (NVIDIA, null slot 999,999) and fills the dynamic pool until it refuses, using a throwaway test (not committed).

cargo test -p leonida-gpu --lib --locked: 695 passed, 0 failed, including the 4 new tests and the existing dynamic_slots_* tests. clippy reports one lint (host.rs:7633), and main reports the same one. tools/d3d12_switches.py --check d3d12/docs/switches.md exits 0.

Real heaps, filled until refused (title heap of 737,855 slots; one process per setting):

LEONIDA_DYNAMIC_SLOTS main: in place / dynamic PR: in place / dynamic
unset 737,855 / 262,144 500,000 / 499,999
abc (unparsable) 737,855 / 262,144 500,000 / 499,999
0 737,855 / 262,144 737,855 / 262,144
100000 737,855 / 262,144 737,855 / 262,144
300000 not run 699,999 / 300,000
524288 (NVIDIA launcher) 500,000 / 499,999 500,000 / 499,999
999999 not run 500,000 / 499,999

In every case the pool gave out exactly dynamic slots. For the 737,855-slot heap the last one was 999,998, one below the null slot, so nothing overlaps it. The next dynamic(1) was refused. With the default, title heaps of 300,000 and 1,100,000 slots behaved the same way: dynamic slots start at the in-place count and end at 999,998 or earlier. On WARP the heap is uncapped (null slot 2,097,151), and main and the PR gave the same results there: 1,048,576 dynamic slots for title heaps of 300,000 and 737,855, and 997,151 for 1,100,000.

Edge sizes. Reading the code, null comes only from probe_view_limit (999,999 or 2,097,151). null == 0 only happens when there is no host, and then HostHeap::new returns before sizing. So the small-heap results (0 for null 0, 50,000 for null 100,000) and the removed panic are defensive. A production host can't reach them. Values of 262,144 or less, including 0, still get raised to 262,144 (measured above), so setting LEONIDA_DYNAMIC_SLOTS=262144 gives back the old default.

One question (from reading the code, not measured). In the capped branch the extra dynamic slots come out of the title's in-place slots. As far as I can tell, heap_handle_at clamps a shader's view index only to the null slot. If that's right, then on a capped host a shader-computed title index between the in-place count and 999,998 reads whatever dynamic table is currently in that slot. With main's default, that range starts at 737,855. With this PR it starts at 500,000. The comment on DYNAMIC says the title's highest slot seen is about 720,000, which falls in the newly exposed range. Anyone using the stock NVIDIA launcher (524,288) already runs this way, so it isn't new for them. But it could be worth confirming that no shader-indexed title slot above 500,000 is in use, or noting the trade-off in the doc comment. The DYNAMIC comment ("2^18 leaves 737,000") also no longer describes the capped default.

Not checked: frame rate, refused tables or rendering in game, and whether title slots between 500,000 and 720,000 are actually read by computed index.

GPUs tested: one NVIDIA desktop card + WARP.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7347688480 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3016#issuecomment-7347688480). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-12-02T13:55:31Z. --- Ran natively on Windows 11, head `77b7bee55` merged into current `main` (`128648cfe`, clean merge). The earlier comment compiled the sizing functions on their own. This run builds real `HostHeap`s on a host whose view heap is capped (NVIDIA, null slot 999,999) and fills the dynamic pool until it refuses, using a throwaway test (not committed). `cargo test -p leonida-gpu --lib --locked`: 695 passed, 0 failed, including the 4 new tests and the existing `dynamic_slots_*` tests. clippy reports one lint (`host.rs:7633`), and `main` reports the same one. `tools/d3d12_switches.py --check d3d12/docs/switches.md` exits 0. **Real heaps, filled until refused** (title heap of 737,855 slots; one process per setting): | `LEONIDA_DYNAMIC_SLOTS` | `main`: in place / dynamic | PR: in place / dynamic | |---|---|---| | unset | 737,855 / 262,144 | 500,000 / 499,999 | | `abc` (unparsable) | 737,855 / 262,144 | 500,000 / 499,999 | | `0` | 737,855 / 262,144 | 737,855 / 262,144 | | `100000` | 737,855 / 262,144 | 737,855 / 262,144 | | `300000` | not run | 699,999 / 300,000 | | `524288` (NVIDIA launcher) | 500,000 / 499,999 | 500,000 / 499,999 | | `999999` | not run | 500,000 / 499,999 | In every case the pool gave out exactly `dynamic` slots. For the 737,855-slot heap the last one was 999,998, one below the null slot, so nothing overlaps it. The next `dynamic(1)` was refused. With the default, title heaps of 300,000 and 1,100,000 slots behaved the same way: dynamic slots start at the in-place count and end at 999,998 or earlier. On WARP the heap is uncapped (null slot 2,097,151), and `main` and the PR gave the same results there: 1,048,576 dynamic slots for title heaps of 300,000 and 737,855, and 997,151 for 1,100,000. **Edge sizes.** Reading the code, `null` comes only from `probe_view_limit` (999,999 or 2,097,151). `null == 0` only happens when there is no host, and then `HostHeap::new` returns before sizing. So the small-heap results (`0` for null 0, `50,000` for null 100,000) and the removed panic are defensive. A production host can't reach them. Values of 262,144 or less, including `0`, still get raised to 262,144 (measured above), so setting `LEONIDA_DYNAMIC_SLOTS=262144` gives back the old default. **One question (from reading the code, not measured).** In the capped branch the extra dynamic slots come out of the title's in-place slots. As far as I can tell, `heap_handle_at` clamps a shader's view index only to the null slot. If that's right, then on a capped host a shader-computed title index between the in-place count and 999,998 reads whatever dynamic table is currently in that slot. With `main`'s default, that range starts at 737,855. With this PR it starts at 500,000. The comment on `DYNAMIC` says the title's highest slot seen is about 720,000, which falls in the newly exposed range. Anyone using the stock NVIDIA launcher (524,288) already runs this way, so it isn't new for them. But it could be worth confirming that no shader-indexed title slot above 500,000 is in use, or noting the trade-off in the doc comment. The `DYNAMIC` comment ("2^18 leaves 737,000") also no longer describes the capped default. Not checked: frame rate, refused tables or rendering in game, and whether title slots between 500,000 and 720,000 are actually read by computed index. GPUs tested: one NVIDIA desktop card + WARP. AI-assisted: yes (Claude Code).
MoonEyes commented 2026-12-02 18:02:30 +00:00 (Migrated from github.com)

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


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

  • Head: 77b7bee55, merge base 2705632c5, 309 behind current main 45dc41f95. A trial merge is clean. CI on the head: all 6 checks pass.
  • Already verified on this head: Kal0s-design (13:55) built real capped HostHeaps and filled them until refused. Unset now gives 500,000 in place and 499,999 dynamic, against 737,855 and 262,144 on main. The 4 new tests pass and d3d12_switches.py --check exits 0.
  • Not yet posted: the in-game run MoonEyes asked for (12:36).

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

  • dynamic_slots_for is a pure function and tested at the edges:
    • null = 0: clamp(0, 0), no panic, because the lower bound is DYNAMIC.min(max).
    • An override above half the heap is clamped.
    • The uncapped path is unchanged.
  • Removing the second OnceLock (CAPPED) fixes a real wart: the old code cached the first heap's null / 2 for every later heap.
  • The default for capped heaps becomes half the heap, the same value the NVIDIA launcher already sets (524288, clamped to 499,999). This changes default behaviour on every capped-heap host that is not launched with that switch: about 238k title slots that were kept in place now take the "made afresh" path. The PR body measures the refusal win (18.87 refused tables a frame to 0). What is not measured is the extra per-frame copy cost of the slots no longer in place. The in-game gate should include a fps comparison against main on a capped NVIDIA card.
  • Minor: the warning now fires on the default path too, since slots > DYNAMIC. That is fine, but it is no longer a sign that the user set an override.

Verdict: ready on code. Do not merge until the requested in-game run (300 s, device losses, median fps against main) is posted.

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


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7353885933 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3016#issuecomment-7353885933). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:02:30Z. --- **Code review only, not built (Windows-only `leonida-gpu`). The code is ready, but the in-game gate is still open.** - Head: `77b7bee55`, merge base `2705632c5`, 309 behind current `main` `45dc41f95`. A trial merge is clean. CI on the head: all 6 checks pass. - Already verified on this head: Kal0s-design (13:55) built real capped `HostHeap`s and filled them until refused. Unset now gives 500,000 in place and 499,999 dynamic, against 737,855 and 262,144 on `main`. The 4 new tests pass and `d3d12_switches.py --check` exits 0. - Not yet posted: the in-game run MoonEyes asked for (12:36). **Review of `d3d12/crates/leonida-gpu/src/descriptor/host.rs`:** - `dynamic_slots_for` is a pure function and tested at the edges: - `null = 0`: `clamp(0, 0)`, no panic, because the lower bound is `DYNAMIC.min(max)`. - An override above half the heap is clamped. - The uncapped path is unchanged. - Removing the second `OnceLock` (`CAPPED`) fixes a real wart: the old code cached the first heap's `null / 2` for every later heap. - The default for capped heaps becomes half the heap, the same value the NVIDIA launcher already sets (`524288`, clamped to 499,999). This changes default behaviour on every capped-heap host that is not launched with that switch: about 238k title slots that were kept in place now take the "made afresh" path. The PR body measures the refusal win (18.87 refused tables a frame to 0). What is not measured is the extra per-frame copy cost of the slots no longer in place. The in-game gate should include a fps comparison against `main` on a capped NVIDIA card. - Minor: the warning now fires on the default path too, since slots > `DYNAMIC`. That is fine, but it is no longer a sign that the user set an override. Verdict: **ready** on code. Do not merge until the requested in-game run (300 s, device losses, median fps against `main`) is posted. AI-assisted verification: Claude Opus (Claude Code), separate agent per batch. --- _Generated by [Claude Code](https://claude.ai/code)_
bobcatchris commented 2026-12-02 21:02:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-12-02T21:02:36Z.


@MoonEyes @Kal0s-design @andrew-ai Thank you for the reviews and capped-heap / allocation verification on 77b7bee55.

  • Head 77b7bee55 is left untouched (CI 6/6 green, d3d12_switches.py --check exit 0).
  • Note: our local machine runs an uncapped AMD Radeon RX 7900 XTX without an NVIDIA capped heap or local game archive, so 77b7bee55 awaits a third-party NVIDIA capped-heap in-game gate run (default LEONIDA_DYNAMIC_SLOTS, >= 300 s).

AI-assisted: Gemini 4 Neon

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7358705371 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3016#issuecomment-7358705371). Originally posted by [bobcatchris](https://github.com/bobcatchris) on 2026-12-02T21:02:36Z. --- @MoonEyes @Kal0s-design @andrew-ai Thank you for the reviews and capped-heap / allocation verification on `77b7bee55`. - Head `77b7bee55` is left untouched (CI 6/6 green, `d3d12_switches.py --check` exit 0). - Note: our local machine runs an uncapped AMD Radeon RX 7900 XTX without an NVIDIA capped heap or local game archive, so `77b7bee55` awaits a third-party NVIDIA capped-heap in-game gate run (default `LEONIDA_DYNAMIC_SLOTS`, >= 300 s). AI-assisted: Gemini 4 Neon
EdenBendheim commented 2026-12-02 21:02:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by EdenBendheim on 2026-12-02T21:02:50Z.


RUN (standalone RTX 3090 300 s stress gate + Windows red/green unit tests) — PASS covering exact head 77b7bee55f2de53ebecb609044234329bd8a4108.

  • Build & unit verification: Clean merge onto 80910637f (diagnostics,dlss,mimalloc, exe_sha16 = 710b646bcfb6f327; changed-file clean-room scan exit 0).
    • Red on base (80910637f): compile-time exit 101 (base lacks dynamic_slots_for).
    • Green on merged tree: 8 passed default / 8 passed with --features diagnostics.
  • Hardware & setup: Windows 11, Ryzen 9 5900X (32 GB RAM), NVIDIA GeForce RTX 3090 24 GB, driver 610.88, Series X profile, 2560x1440, -NoFrameGen, LEONIDA_DYNAMIC_SLOTS= (explicitly unset so the launcher's 524288 override does not mask the capped default under test!), scripts/game-gate.ps1 (301.5 s in world) with downtown street-level teleport + 8-leg dynamic sprint/turn/strafe stress mod (GATE CONTROL moved=2.43 m, max_from_ctrl=5,060.2 m).
Metric #3016 (LEONIDA_DYNAMIC_SLOTS=, 710b646bcfb6f327) main b41763227 baseline (cf499737bf684f6a)
Gate verdict / exit PASS (clean, 0 reasons, 0 warnings) PASS (clean, 0 reasons, 0 warnings)
World time 301.5 s 305.6 s
Device lost / crashes / missed pipeline waits 0 / 0 / 0 0 / 0 / 0
Rendered FPS (median) / p95 frame time 18.97 FPS / 73.46 ms 19.13 FPS / 74.01 ms
Median draws/frame / longest present gap 7,409 / 2.456 s 7,983 / 2.358 s
Peak private commit / peak VRAM 36,638 MB / 15,542 MB 37,803 MB / 16,220 MB

Verdict: PASS for the 300 s standalone in-game gate on 77b7bee55 with LEONIDA_DYNAMIC_SLOTS= exercising the new capped default.

(AI-assisted verification: gemini-4-neon + gpt-6.2-astra.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7358711372 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3016#issuecomment-7358711372). Originally posted by [EdenBendheim](https://github.com/EdenBendheim) on 2026-12-02T21:02:50Z. --- **RUN (standalone RTX 3090 300 s stress gate + Windows red/green unit tests)** — **PASS** covering exact head `77b7bee55f2de53ebecb609044234329bd8a4108`. - **Build & unit verification:** Clean merge onto `80910637f` (`diagnostics,dlss,mimalloc`, `exe_sha16 = 710b646bcfb6f327`; changed-file clean-room scan exit `0`). - **Red on base (`80910637f`):** compile-time exit `101` (base lacks `dynamic_slots_for`). - **Green on merged tree:** `8` passed default / `8` passed with `--features diagnostics`. - **Hardware & setup:** Windows 11, Ryzen 9 5900X (32 GB RAM), NVIDIA GeForce RTX 3090 24 GB, driver `610.88`, Series X profile, `2560x1440`, `-NoFrameGen`, **`LEONIDA_DYNAMIC_SLOTS=`** (explicitly unset so the launcher's `524288` override does not mask the capped default under test!), `scripts/game-gate.ps1` (`301.5 s` in world) with downtown street-level teleport + 8-leg dynamic sprint/turn/strafe stress mod (`GATE CONTROL moved=2.43 m`, `max_from_ctrl=5,060.2 m`). | Metric | `#3016` (`LEONIDA_DYNAMIC_SLOTS=`, `710b646bcfb6f327`) | `main` `b41763227` baseline (`cf499737bf684f6a`) | |---|---:|---:| | Gate verdict / exit | **PASS** (`clean`, `0` reasons, `0` warnings) | **PASS** (`clean`, `0` reasons, `0` warnings) | | World time | `301.5 s` | `305.6 s` | | Device lost / crashes / missed pipeline waits | `0` / `0` / `0` | `0` / `0` / `0` | | Rendered FPS (median) / p95 frame time | `18.97 FPS` / `73.46 ms` | `19.13 FPS` / `74.01 ms` | | Median draws/frame / longest present gap | `7,409` / `2.456 s` | `7,983` / `2.358 s` | | Peak private commit / peak VRAM | `36,638 MB` / `15,542 MB` | `37,803 MB` / `16,220 MB` | **Verdict:** **PASS** for the 300 s standalone in-game gate on `77b7bee55` with `LEONIDA_DYNAMIC_SLOTS=` exercising the new capped default. *(AI-assisted verification: `gemini-4-neon` + `gpt-6.2-astra`.)*
fiestorra commented 2026-12-02 22:16:01 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T22:16:01Z.


VERIFY-3016 — Windows nativo: red then green en la regla nueva, y el caso que la motiva está medido en el propio comentario

Head (this PR)
Merge base 2705632c5 (behind main b41763227)
Merged onto main — merge-tree clean, git merge --no-ff clean (auto-merged host.rs and docs/switches.md)

Ran

cargo test -p leonida-gpu --lib descriptor::host     61 passed; 1 failed; 5 ignored
  descriptor::host::tests::capped_dynamic_slots_default_to_half_the_heap ... ok
  descriptor::host::tests::explicit_dynamic_slots_override_is_honoured_and_bounded ... ok
  descriptor::host::tests::a_small_capped_heap_does_not_panic ... ok
  descriptor::host::tests::uncapped_dynamic_slots_are_unchanged ... ok

The one failure is this machine's, unchanged all day (views_are_made_beside_the_heap_and_copied_in, the integrated GPU artefact of D3D12CreateDevice(None, ..) that #2995 addresses).

Negative control (synthetic): I changed let max = null / 2; to let max = null; — the cap this PR is about — and rebuilt:

FAILED: capped_dynamic_slots_default_to_half_the_heap
FAILED: explicit_dynamic_slots_override_is_honoured_and_bounded      assertion `left == right` failed

Two of the four new tests bite on exactly that line.

The change, and why it is plausible: on a host whose view heap is capped (null < PORTABLE_VIEWS, the 1,000,000-view heaps of an RTX 3060 Ti or a Series S) the dynamic pool now defaults to half the heap, clamped to it, instead of DYNAMIC << 2. The doc comment keeps the measurement that motivates it: at 2^18, "refused 18.87 tables of 9,100 draws a frame and let 17.67 go without (17 fps); twice as many (clamped to half the heap) refused none for five minutes in the same scene" — a refusal count with an fps figure and a five-minute control, which is the kind of number I would ask for.

What I could not test

  • A capped heap: this card's heap is above PORTABLE_VIEWS, so the capped branch is exercised only by the synthetic dynamic_slots_for(count, null, asked) calls, not by a device.
  • The pool under the title's real table count: no game run, so the 27,000–35,000 tables a frame the comment mentions are quoted, not reproduced here.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7360455829 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3016#issuecomment-7360455829). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T22:16:01Z. --- ## VERIFY-3016 — Windows nativo: `red then green` en la regla nueva, y el caso que la motiva está medido en el propio comentario | | | |---|---| | Head | `(this PR)` | | Merge base | `2705632c5` (behind `main` `b41763227`) | | Merged onto | `main` — `merge-tree` clean, `git merge --no-ff` clean (auto-merged `host.rs` and `docs/switches.md`) | **Ran** ``` cargo test -p leonida-gpu --lib descriptor::host 61 passed; 1 failed; 5 ignored descriptor::host::tests::capped_dynamic_slots_default_to_half_the_heap ... ok descriptor::host::tests::explicit_dynamic_slots_override_is_honoured_and_bounded ... ok descriptor::host::tests::a_small_capped_heap_does_not_panic ... ok descriptor::host::tests::uncapped_dynamic_slots_are_unchanged ... ok ``` The one failure is this machine's, unchanged all day (`views_are_made_beside_the_heap_and_copied_in`, the integrated GPU artefact of `D3D12CreateDevice(None, ..)` that #2995 addresses). **Negative control (synthetic)**: I changed `let max = null / 2;` to `let max = null;` — the cap this PR is about — and rebuilt: ``` FAILED: capped_dynamic_slots_default_to_half_the_heap FAILED: explicit_dynamic_slots_override_is_honoured_and_bounded assertion `left == right` failed ``` **Two of the four new tests bite on exactly that line.** **The change, and why it is plausible**: on a host whose view heap is capped (`null < PORTABLE_VIEWS`, the 1,000,000-view heaps of an RTX 3060 Ti or a Series S) the dynamic pool now defaults to **half the heap**, clamped to it, instead of `DYNAMIC << 2`. The doc comment keeps the measurement that motivates it: at 2^18, *"refused 18.87 tables of 9,100 draws a frame and let 17.67 go without (17 fps); twice as many (clamped to half the heap) refused none for five minutes in the same scene"* — a refusal count with an fps figure and a five-minute control, which is the kind of number I would ask for. ## What I could not test - **A capped heap**: this card's heap is above `PORTABLE_VIEWS`, so the capped branch is exercised only by the synthetic `dynamic_slots_for(count, null, asked)` calls, not by a device. - **The pool under the title's real table count**: no game run, so the 27,000–35,000 tables a frame the comment mentions are quoted, not reproduced here. Written with an AI assistant.
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/3016:upstream-pr/3016'
git switch 'upstream-pr/3016'

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