gpu: remap title view slots past capped host heaps #3518

Open
danielibabet wants to merge 2 commits from upstream-pr/3518 into main
danielibabet commented 2026-11-27 12:27:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by danielibabet on 2026-11-27T12:27:12Z.


Hosts whose shader-visible CBV/SRV/UAV heaps stop at 1,000,000 descriptors (resource binding tier 2, e.g. NVIDIA) lost every title descriptor past the cap (the old shortcut: descriptors past the host's limit are left out).

What changes

  • Host detects a capped device once (a HEAP_VIEWS shader-visible heap fails; VICTORY_CAPPED_HEAP=1 forces it).
  • HostHeap on such hosts keeps 672,320 title slots 1:1 and maps active higher title slots into 262,144 physical overflow slots (LIFO free list, recycled when the title clears a slot). Strides, view marks, view addresses, read marks and deferred placed textures (make_read) all follow the physical slot.
  • emit::Options::capped_heap: direct resource-heap indices (root type 5) go through a virtual→physical table, root SRV t254 in the root CBV space (next to VIEW_STRIDES; no HostShader field or cache-format change), and heap indices / null buffer views clamp below 1,000,000. Uncapped hosts translate exactly as before.
  • Tables reaching past the direct slots are made afresh in dynamic slots.
  • Shader cache key includes the capped mode.

Tests (RTX 4070 + WARP)

  • emit::remap_tests: compute shader reading/writing at virtual heap slots 1,150,000 / 1,500,000 through the remap table; unmapped slot reads the null view.
  • descriptor::host::remap_test: 1,245,184-slot title heap: overflow allocation, placed texture materialised through its physical slot, clear + reuse.
  • clippy (default and diagnostics) and cargo xtask policy clean. (The full victory-shader lib suite crashes locally in dxil.dll validation on origin/main too.)
<!-- greyfinch-sync:Marvisak/VIctory:issue:5526613552 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3518). Originally posted by [danielibabet](https://github.com/danielibabet) on 2026-11-27T12:27:12Z. --- Hosts whose shader-visible CBV/SRV/UAV heaps stop at 1,000,000 descriptors (resource binding tier 2, e.g. NVIDIA) lost every title descriptor past the cap (the old `shortcut: descriptors past the host's limit are left out`). **What changes** - `Host` detects a capped device once (a `HEAP_VIEWS` shader-visible heap fails; `VICTORY_CAPPED_HEAP=1` forces it). - `HostHeap` on such hosts keeps 672,320 title slots 1:1 and maps active higher title slots into 262,144 physical overflow slots (LIFO free list, recycled when the title clears a slot). Strides, view marks, view addresses, read marks and deferred placed textures (`make_read`) all follow the physical slot. - `emit::Options::capped_heap`: direct resource-heap indices (root type 5) go through a virtual→physical table, root SRV `t254` in the root CBV space (next to `VIEW_STRIDES`; no `HostShader` field or cache-format change), and heap indices / null buffer views clamp below 1,000,000. Uncapped hosts translate exactly as before. - Tables reaching past the direct slots are made afresh in dynamic slots. - Shader cache key includes the capped mode. **Tests** (RTX 4070 + WARP) - `emit::remap_tests`: compute shader reading/writing at virtual heap slots 1,150,000 / 1,500,000 through the remap table; unmapped slot reads the null view. - `descriptor::host::remap_test`: 1,245,184-slot title heap: overflow allocation, placed texture materialised through its physical slot, clear + reuse. - clippy (default and `diagnostics`) and `cargo xtask policy` clean. (The full `victory-shader` lib suite crashes locally in `dxil.dll` validation on `origin/main` too.)
oni-swr commented 2026-11-27 13:25:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-27T13:25:54Z.


Independent WARP/CPU verification of #3518 at head df88467b (base: main 63bcca43, merge-base of this PR). Head re-checked unchanged just before posting.

Setup: Windows 11 Pro 10.0.26200, AMD Ryzen 7 5700X3D, D3D12 WARP only (VICTORY_WARP=1 VICTORY_D3D12_WARP=1, dxil.dll from the Windows SDK on PATH). Base and head were built in separate worktrees with separate target dirs, so the head binary is a fresh build. Test commands: cargo test -p victory-gpu --features diagnostics and cargo test -p victory-shader --features diagnostics. Note that victory-gpu only honours VICTORY_D3D12_WARP with --features diagnostics; without it the tests use the real adapter.

lane base head
victory-gpu lib 246 passed, 0 failed, 1 ignored 247 passed, 0 failed, 1 ignored
victory-gpu lib, VICTORY_CAPPED_HEAP=1 246 / 0 / 1 247 / 0 / 1
victory-shader 298 passed, 4 failed, 3 ignored 299 passed, 4 failed, 3 ignored

The 4 victory-shader failures are the same set on both sides (a_mask_joined_with_data_at_a_uniform_loop_is_its_number, gathers_at_a_level_match_the_hardware, permutes_mask_high_address_bits_and_divergent_branches, permutes_read_the_lane_named_and_zero_from_lanes_left_out), so they are baseline WARP lane failures, not caused by this PR. The two new tests pass: remapped_high_heap_indices_execute_above_portable_views_limit in victory-shader, and capped_view_heap_remaps_high_slots_and_recycles_overflow_entries in victory-gpu.

Finding 1 (CI will fail): clippy -D warnings fails on dead code.
cargo clippy -p victory-shader --features diagnostics --all-targets -- -D warnings fails on the head and passes on base:

error: function `lower` is never used
   --> crates\victory-shader\src\emit\lower.rs:101:15

emit_with now calls lower_with, so the non-test build has no caller for lower (only tests use it). CI runs cargo clippy --workspace --all-targets --locked -- -D warnings, so it should fail there too. Fix: mark lower as #[cfg(test)], or move it into the test modules. cargo clippy -p victory-gpu passes on the head.

Finding 2 (test coverage): the victory-gpu cap test only runs the cap logic on a capped host.
descriptor/remap_test.rs:14 returns early when !host.capped_heap. On WARP that flag only becomes true when the 2^21-slot probe heap fails to create, or when VICTORY_CAPPED_HEAP=1 is set. The test passes in the capped lane, where its asserts on count, overflow and dynamic run. A plain WARP run may therefore skip the body. Running CI-style lanes with VICTORY_CAPPED_HEAP=1 would prevent a silent no-op. The victory-shader test does exercise the clamp and null-slot path on WARP, because the remap table is supplied directly.

Diff review for the question "can remapped slots alias or index out of range": I found no bug.

  • Physical overflow slots are direct..direct+OVERFLOW_VIEWS (direct = 1,000,000 - 65,536 - 262,144). Dynamic slots start above that, and NULL_RESERVE plus the null views stay at the top. The ranges are disjoint, and kept, strides, marks and addresses are all sized to count + overflow + dynamic.
  • The overflow slot allocator is a free list plus a to_phys/to_title pair kept under one slots mutex. write_remap is only called under that lock, so a slot cannot map to two titles. A freed slot resets its remap entry to CAPPED_HEAP_VIEWS - 1 (null).
  • In the shader, virtual indices clamp to REMAP_VIEWS - 1 before the table read, and the physical result clamps to heap_views - 1.
  • When the overflow pool is exhausted, the view is dropped (warn once, remap stays null), not aliased.

AI-assisted: Claude Code, Claude Sonnet 5.5 (build/test orchestration and diff review; results above are from the actual runs).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7219468570 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3518#issuecomment-7219468570). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-27T13:25:54Z. --- Independent WARP/CPU verification of #3518 at head `df88467b` (base: main `63bcca43`, merge-base of this PR). Head re-checked unchanged just before posting. **Setup:** Windows 11 Pro 10.0.26200, AMD Ryzen 7 5700X3D, D3D12 WARP only (`VICTORY_WARP=1 VICTORY_D3D12_WARP=1`, dxil.dll from the Windows SDK on PATH). Base and head were built in separate worktrees with separate target dirs, so the head binary is a fresh build. Test commands: `cargo test -p victory-gpu --features diagnostics` and `cargo test -p victory-shader --features diagnostics`. Note that `victory-gpu` only honours `VICTORY_D3D12_WARP` with `--features diagnostics`; without it the tests use the real adapter. | lane | base | head | |---|---|---| | victory-gpu lib | 246 passed, 0 failed, 1 ignored | 247 passed, 0 failed, 1 ignored | | victory-gpu lib, `VICTORY_CAPPED_HEAP=1` | 246 / 0 / 1 | 247 / 0 / 1 | | victory-shader | 298 passed, 4 failed, 3 ignored | 299 passed, 4 failed, 3 ignored | The 4 victory-shader failures are the same set on both sides (`a_mask_joined_with_data_at_a_uniform_loop_is_its_number`, `gathers_at_a_level_match_the_hardware`, `permutes_mask_high_address_bits_and_divergent_branches`, `permutes_read_the_lane_named_and_zero_from_lanes_left_out`), so they are baseline WARP lane failures, not caused by this PR. The two new tests pass: `remapped_high_heap_indices_execute_above_portable_views_limit` in victory-shader, and `capped_view_heap_remaps_high_slots_and_recycles_overflow_entries` in victory-gpu. **Finding 1 (CI will fail): clippy `-D warnings` fails on dead code.** `cargo clippy -p victory-shader --features diagnostics --all-targets -- -D warnings` fails on the head and passes on base: ``` error: function `lower` is never used --> crates\victory-shader\src\emit\lower.rs:101:15 ``` `emit_with` now calls `lower_with`, so the non-test build has no caller for `lower` (only tests use it). CI runs `cargo clippy --workspace --all-targets --locked -- -D warnings`, so it should fail there too. Fix: mark `lower` as `#[cfg(test)]`, or move it into the test modules. `cargo clippy -p victory-gpu` passes on the head. **Finding 2 (test coverage): the victory-gpu cap test only runs the cap logic on a capped host.** `descriptor/remap_test.rs:14` returns early when `!host.capped_heap`. On WARP that flag only becomes true when the 2^21-slot probe heap fails to create, or when `VICTORY_CAPPED_HEAP=1` is set. The test passes in the capped lane, where its asserts on `count`, `overflow` and `dynamic` run. A plain WARP run may therefore skip the body. Running CI-style lanes with `VICTORY_CAPPED_HEAP=1` would prevent a silent no-op. The victory-shader test does exercise the clamp and null-slot path on WARP, because the remap table is supplied directly. **Diff review for the question "can remapped slots alias or index out of range":** I found no bug. - Physical overflow slots are `direct..direct+OVERFLOW_VIEWS` (`direct = 1,000,000 - 65,536 - 262,144`). Dynamic slots start above that, and `NULL_RESERVE` plus the null views stay at the top. The ranges are disjoint, and `kept`, `strides`, `marks` and `addresses` are all sized to `count + overflow + dynamic`. - The overflow slot allocator is a free list plus a `to_phys`/`to_title` pair kept under one `slots` mutex. `write_remap` is only called under that lock, so a slot cannot map to two titles. A freed slot resets its `remap` entry to `CAPPED_HEAP_VIEWS - 1` (null). - In the shader, virtual indices clamp to `REMAP_VIEWS - 1` before the table read, and the physical result clamps to `heap_views - 1`. - When the overflow pool is exhausted, the view is dropped (warn once, remap stays null), not aliased. AI-assisted: Claude Code, Claude Sonnet 5.5 (build/test orchestration and diff review; results above are from the actual runs).
pickles976 commented 2026-11-27 13:48:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-27T13:48:20Z.


Linux/Wine verification of exact head df88467 (base 63bcca43), clean worktree. RTX 4060 Laptop 8 GiB (resource binding tier 2), NVIDIA 590.48.1, Wine 11.0, vkd3d-proton 3.2.0 diagnostic build 2576c0b4adfae4a+ (relaxed-vtable; not stock certification), DXVK vendor masking disabled. No title run.

Leg 1 — descriptor::host::remap_test::capped_view_heap_remaps_high_slots_and_recycles_overflow_entries 1/1 pass (fresh 9.36 s compile, 0.74 s test; verify-pr3518-descriptor-natural-df88467-20261127T134719Z). Two silent-skip paths were made fail-closed for this run only (absent host panics; host.capped_heap printed) and the source was restored afterwards: natural capped detection fires on this stack — the 1,000,000 HEAP_VIEWS shader-visible heap creation fails and host.capped_heap=true without VICTORY_CAPPED_HEAP. Full body executed on the real adapter: 1,245,184-slot title heap; high slots 737,856 / 950,000 / 1,200,000 each mapped into the 262,144-slot overflow pool with correct stride/address/read state; placed texture at 1,210,000 deferred on mirror(false) and materialized through its physical overflow slot by make_read; clear resets the virtual entry to CAPPED_HEAP_VIEWS - 1 and returns the physical slot; next high slot reuses it (LIFO). No device removal.

Leg 2 — emit::remap_tests::remapped_high_heap_indices_execute_above_portable_views_limit 1/1 pass (fresh 5.91 s compile, 1.31 s test; verify-pr3518-emit-remap-df88467-20261127T134738Z). Same fail-closed strengthening applied and restored. Both hardware legs created the remapped compute PSO and dispatched: virtual slot 1,150,000 read back [101, 202, 303, 404] through the remap table, unmapped virtual slot 1,800,000 read back zeros via the null view. Caveat: the warp=true leg is not real WARP here — Wine's EnumWarpAdapter returns the first hardware adapter, so it is a repeat NVIDIA leg, and the WARP must be available assertion was unchanged.

Scale context from this machine's title trials (context, not a matched measurement): a previous guarded run on a different stack measured room=737853 views=1000000 with 507,331 title slot past the host heap events, so a frame can plausibly want more than 262,144 simultaneously-live past-cap slots. The exhaustion path (descriptor/host.rs:983-993) warns once and returns None — the slot reads null, i.e. the pre-PR behavior — so degradation beyond the pool is bounded and observable via the host view heap overflow slots exhausted warning. If title logs on tier-2 hosts show that warning, it would indicate the 1 << 18 pool needs to grow or spill to a second heap.

Test-only probes restored; worktree left clean at the exact head. Evidence dirs and per-run resources.jsonl under .compat-runtime/logs/. Guarded scope: peak GPU 250 MiB, min available RAM 10,828 MiB, min disk 15.19 GiB. No gameplay, frame-time or black-frame claim — this PR removes the past-cap data loss, it does not establish that capped-heap nulls caused the black scene.

AI-assisted verification, review-only; no direct PR contributions.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7219965727 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3518#issuecomment-7219965727). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-27T13:48:20Z. --- Linux/Wine verification of exact head `df88467` (base `63bcca43`), clean worktree. RTX 4060 Laptop 8 GiB (resource binding tier 2), NVIDIA 590.48.1, Wine 11.0, vkd3d-proton 3.2.0 diagnostic build `2576c0b4adfae4a+` (relaxed-vtable; not stock certification), DXVK vendor masking disabled. No title run. **Leg 1 — `descriptor::host::remap_test::capped_view_heap_remaps_high_slots_and_recycles_overflow_entries` 1/1 pass** (fresh 9.36 s compile, 0.74 s test; `verify-pr3518-descriptor-natural-df88467-20261127T134719Z`). Two silent-skip paths were made fail-closed for this run only (absent host panics; `host.capped_heap` printed) and the source was restored afterwards: natural capped detection fires on this stack — the 1,000,000 `HEAP_VIEWS` shader-visible heap creation fails and `host.capped_heap=true` without `VICTORY_CAPPED_HEAP`. Full body executed on the real adapter: 1,245,184-slot title heap; high slots 737,856 / 950,000 / 1,200,000 each mapped into the 262,144-slot overflow pool with correct stride/address/read state; placed texture at 1,210,000 deferred on `mirror(false)` and materialized through its physical overflow slot by `make_read`; clear resets the virtual entry to `CAPPED_HEAP_VIEWS - 1` and returns the physical slot; next high slot reuses it (LIFO). No device removal. **Leg 2 — `emit::remap_tests::remapped_high_heap_indices_execute_above_portable_views_limit` 1/1 pass** (fresh 5.91 s compile, 1.31 s test; `verify-pr3518-emit-remap-df88467-20261127T134738Z`). Same fail-closed strengthening applied and restored. Both hardware legs created the remapped compute PSO and dispatched: virtual slot 1,150,000 read back `[101, 202, 303, 404]` through the remap table, unmapped virtual slot 1,800,000 read back zeros via the null view. Caveat: the `warp=true` leg is not real WARP here — Wine's `EnumWarpAdapter` returns the first hardware adapter, so it is a repeat NVIDIA leg, and the `WARP must be available` assertion was unchanged. **Scale context from this machine's title trials (context, not a matched measurement):** a previous guarded run on a different stack measured `room=737853 views=1000000` with 507,331 `title slot past the host heap` events, so a frame can plausibly want more than 262,144 simultaneously-live past-cap slots. The exhaustion path (`descriptor/host.rs:983-993`) warns once and returns `None` — the slot reads null, i.e. the pre-PR behavior — so degradation beyond the pool is bounded and observable via the `host view heap overflow slots exhausted` warning. If title logs on tier-2 hosts show that warning, it would indicate the 1 << 18 pool needs to grow or spill to a second heap. Test-only probes restored; worktree left clean at the exact head. Evidence dirs and per-run `resources.jsonl` under `.compat-runtime/logs/`. Guarded scope: peak GPU 250 MiB, min available RAM 10,828 MiB, min disk 15.19 GiB. No gameplay, frame-time or black-frame claim — this PR removes the past-cap data loss, it does not establish that capped-heap nulls caused the black scene. AI-assisted verification, review-only; no direct PR contributions.
AurumCarlos commented 2026-11-27 14:04:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AurumCarlos on 2026-11-27T14:04:41Z.

Review: COMMENTED


UsedResource::lower_bound is used as a descriptor count, but it is the shader register (native.rs:416: "Shader register of the first descriptor read"; the FSPX test there reads u11 at offset 0x58 with lower_bound: 11). Two places in draw.rs now depend on the register number:

  • draw.rs:1279: span = lower_bound - 1 moves end forward by register - 1 slots. An entry whose own slot is below host.count() is still marked fresh (made again in dynamic slots on every draw) when its register is high, which uses up dynamic slots a capped host has few of.
  • draw.rs:1318: n = offset / 8 + lower_bound. For that u11 entry, main copies 12 records and this copies 22. In general it copies register - 1 extra records past the last one the shader reads.

Nothing in UsedResource gives a range's length, so main's offset / 8 + 1 is what's known. Suggested fix: go back to main's two expressions in one helper used by both places, and add a test:

/// The slots of its table an entry reads, from the table's start.
fn entry_slots(u: &victory_shader::native::UsedResource) -> u32 {
    u.table_offset_dwords / 8 + 1
}

#[test]
fn a_table_entry_reads_up_to_its_own_slot() {
    use victory_shader::native::{ResourceType, RootType, UsedResource};
    // `u11` at its table's slot 11, as in `native.rs`'s FSPX test.
    let u = UsedResource {
        kind: ResourceType::Uav,
        root: RootType::Table,
        table_offset_dwords: 0x58,
        lower_bound: 11,
        stride: 0,
        dwords: 4,
        user_data: 0,
        slot: 1,
    };
    assert_eq!(entry_slots(&u), 12); // the head's formula gives 22
}

with let end = table + u64::from(u.table_offset_dwords) * 4; and .map(entry_slots). If the remap needs ranges longer than one record (arrays), that needs a count from the program's resource table, not the register.

<!-- greyfinch-sync:Marvisak/VIctory:review:6089318406 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3518#pullrequestreview-6089318406). Originally posted by [AurumCarlos](https://github.com/AurumCarlos) on 2026-11-27T14:04:41Z. **Review:** COMMENTED --- **`UsedResource::lower_bound` is used as a descriptor count, but it is the shader register** (`native.rs:416`: "Shader register of the first descriptor read"; the FSPX test there reads `u11` at offset `0x58` with `lower_bound: 11`). Two places in `draw.rs` now depend on the register number: - `draw.rs:1279`: `span = lower_bound - 1` moves `end` forward by `register - 1` slots. An entry whose own slot is below `host.count()` is still marked `fresh` (made again in dynamic slots on every draw) when its register is high, which uses up dynamic slots a capped host has few of. - `draw.rs:1318`: `n = offset / 8 + lower_bound`. For that `u11` entry, `main` copies 12 records and this copies 22. In general it copies `register - 1` extra records past the last one the shader reads. Nothing in `UsedResource` gives a range's length, so `main`'s `offset / 8 + 1` is what's known. Suggested fix: go back to `main`'s two expressions in one helper used by both places, and add a test: ```rust /// The slots of its table an entry reads, from the table's start. fn entry_slots(u: &victory_shader::native::UsedResource) -> u32 { u.table_offset_dwords / 8 + 1 } #[test] fn a_table_entry_reads_up_to_its_own_slot() { use victory_shader::native::{ResourceType, RootType, UsedResource}; // `u11` at its table's slot 11, as in `native.rs`'s FSPX test. let u = UsedResource { kind: ResourceType::Uav, root: RootType::Table, table_offset_dwords: 0x58, lower_bound: 11, stride: 0, dwords: 4, user_data: 0, slot: 1, }; assert_eq!(entry_slots(&u), 12); // the head's formula gives 22 } ``` with `let end = table + u64::from(u.table_offset_dwords) * 4;` and `.map(entry_slots)`. If the remap needs ranges longer than one record (arrays), that needs a count from the program's resource table, not the register.
pickles976 commented 2026-11-27 14:16:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-27T14:16:30Z.


Follow-up title-path evidence on the same Wine/RTX 4060 Laptop host. This is not an exact PR-head run: local dirty integration = #3147 2eb38bb1 + #2101 4d8c89a + this PR df88467b, manually conflict-resolved to retain Wave64 lowering, format filtering, and capped-heap remapping. Relaxed-vtable diagnostic vkd3d build; unchanged 6,000 MiB GPU / 2,048 MiB MemAvailable / 9 GiB scope guards.

Before launch, the combined stack passed:

  • emitted high-slot remap GPU oracle: 1/1
  • descriptor remap/materialize/clear/recycle fixture: 1/1
  • emit::wave64_tests: 11/11
  • packed-lighting GPU fixture: 1/1 (all four cases, 32/32 pixels and 128/128 components)

Fresh diagnostics release, reported 1920×1080, scripted A at 55 s. Run 20261127T141340Z stopped deliberately on the RAM guard at 88.31 s: 1,982.5 MiB available, 3,370 MiB GPU, 7,827.7 MiB scope (5,922.2 anon / 1,858.8 file including 1,837.9 shmem), 14.976 GiB disk, exit 137. The 45 s capture is the account picker; after A, DirectStorage opened shared_minigame000 and story000 packs, but the 90 s capture missed the already-killed client. No recognizable 3D scene/gameplay or performance claim.

Descriptor observation: the prior same-lineage run had 507,331 title slot past the host heap events. With this PR integrated, the log has one

host view heap capped at 1000000 with high-slot overflow remapping title_count=1245184 direct=672320 overflow=262144

and zero old past-cap warnings, zero host view heap overflow slots exhausted, and zero dynamic-slot-exhaustion warnings. So remapping is active on the title path and the pool did not visibly exhaust before the RAM stop. This does not establish that past-cap nulls caused the missing scene; 74 distinct compute translation refusals remain, and the log records two black-after-nonblack transitions.

I also saw AurumCarlos's new UsedResource::lower_bound review. Absence of exhaustion in this bounded run does not clear that register-vs-count defect. I would not promote or repeat the title stack until those two range expressions are corrected and covered by the proposed u11 test.

Local evidence: .compat-runtime/logs/20261127T141340Z-{console.log,resources.csv,guard-events.jsonl}, capture menu-20261127T141425337179Z.png, focused logs verify-scene3147-pr2101-pr3518-{shader-remap,gpu-remap,wave64,packed-lighting}.log.

AI-assisted verification; review-only, no code contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7220573992 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3518#issuecomment-7220573992). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-27T14:16:30Z. --- Follow-up title-path evidence on the same Wine/RTX 4060 Laptop host. This is **not an exact PR-head run**: local dirty integration = #3147 `2eb38bb1` + #2101 `4d8c89a` + this PR `df88467b`, manually conflict-resolved to retain Wave64 lowering, format filtering, and capped-heap remapping. Relaxed-vtable diagnostic vkd3d build; unchanged 6,000 MiB GPU / 2,048 MiB `MemAvailable` / 9 GiB scope guards. Before launch, the combined stack passed: - emitted high-slot remap GPU oracle: 1/1 - descriptor remap/materialize/clear/recycle fixture: 1/1 - `emit::wave64_tests`: 11/11 - packed-lighting GPU fixture: 1/1 (all four cases, 32/32 pixels and 128/128 components) Fresh diagnostics release, reported 1920×1080, scripted A at 55 s. Run `20261127T141340Z` stopped deliberately on the RAM guard at 88.31 s: 1,982.5 MiB available, 3,370 MiB GPU, 7,827.7 MiB scope (5,922.2 anon / 1,858.8 file including 1,837.9 shmem), 14.976 GiB disk, exit 137. The 45 s capture is the account picker; after A, DirectStorage opened `shared_minigame000` and `story000` packs, but the 90 s capture missed the already-killed client. No recognizable 3D scene/gameplay or performance claim. Descriptor observation: the prior same-lineage run had 507,331 `title slot past the host heap` events. With this PR integrated, the log has one ``` host view heap capped at 1000000 with high-slot overflow remapping title_count=1245184 direct=672320 overflow=262144 ``` and **zero** old past-cap warnings, zero `host view heap overflow slots exhausted`, and zero dynamic-slot-exhaustion warnings. So remapping is active on the title path and the pool did not visibly exhaust before the RAM stop. This does not establish that past-cap nulls caused the missing scene; 74 distinct compute translation refusals remain, and the log records two black-after-nonblack transitions. I also saw AurumCarlos's new `UsedResource::lower_bound` review. Absence of exhaustion in this bounded run does not clear that register-vs-count defect. I would not promote or repeat the title stack until those two range expressions are corrected and covered by the proposed `u11` test. Local evidence: `.compat-runtime/logs/20261127T141340Z-{console.log,resources.csv,guard-events.jsonl}`, capture `menu-20261127T141425337179Z.png`, focused logs `verify-scene3147-pr2101-pr3518-{shader-remap,gpu-remap,wave64,packed-lighting}.log`. AI-assisted verification; review-only, no code contribution.
oddmaniv commented 2026-11-27 14:22:52 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oddmaniv on 2026-11-27T14:22:52Z.


Independent verification of the PR author's concurrent WARP pipeline/draw test at df88467bb8a9f97b1cb4f0a9da83ea5be335b074.

cargo test --locked -p victory-shader --lib emit::host::tests::parallel_warp_pipelines_and_draws -- --exact --nocapture

Tree Result
Unmodified PR head 1 passed, 0 failed, 0 ignored; native exit 0
Unmodified main 1 passed, 0 failed, 0 ignored; native exit 0
PR patch applied to pinned main 1 passed, 0 failed, 0 ignored; native exit 0

Main baseline pin: 63bcca43c6a00a758510398fa43096ce7e4f7df0.

Windows x86_64 MSVC native runs. Local and remote source snapshots matched before and after each check. The adaptation applies the PR diff without additional source edits.
This is focused regression coverage, not the full workspace suite, a gameplay test, or an independent validation of every behavior in the PR. No new fix is claimed.

AI-assisted verification.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7220710064 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3518#issuecomment-7220710064). Originally posted by [oddmaniv](https://github.com/oddmaniv) on 2026-11-27T14:22:52Z. --- Independent verification of the PR author's concurrent WARP pipeline/draw test at `df88467bb8a9f97b1cb4f0a9da83ea5be335b074`. `cargo test --locked -p victory-shader --lib emit::host::tests::parallel_warp_pipelines_and_draws -- --exact --nocapture` | Tree | Result | | --- | --- | | Unmodified PR head | 1 passed, 0 failed, 0 ignored; native exit 0 | | Unmodified main | 1 passed, 0 failed, 0 ignored; native exit 0 | | PR patch applied to pinned main | 1 passed, 0 failed, 0 ignored; native exit 0 | Main baseline pin: `63bcca43c6a00a758510398fa43096ce7e4f7df0`. Windows x86_64 MSVC native runs. Local and remote source snapshots matched before and after each check. The adaptation applies the PR diff without additional source edits. This is focused regression coverage, not the full workspace suite, a gameplay test, or an independent validation of every behavior in the PR. No new fix is claimed. AI-assisted verification.
borosf commented 2026-11-27 16:19:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-27T16:19:02Z.


Numbers from a capped host that is not NVIDIA, in case they're useful for the body's "e.g. NVIDIA".

Intel Arc B580 12 GB, Windows 11 x64, --console series-x. This device caps too, with the same error, and the title asks for more than one heap holds:

WARN victory_gpu::descriptor::host: host view heap capped at 1000000
     error=The parameter is incorrect. (0x80070057) count=1245184
WARN victory_gpu::descriptor::host: title slot past the host heap index=934464 count=934464

In a single four-minute run through the prologue into the prison yard: 310,720 title slot past the host heap warnings, one per newly-seen index, contiguous from 934,464 to the title's 1,245,183. That is 24.9 % of the title's view slots never bound — on this machine it is the class of failure behind missing textures, not a performance question at all.

One interaction worth deciding before either merges, since you own both: on the same machine and the same tree, #3419's capped_heap_slots gives kept=737856 extra=262144, i.e. refusals go 310,720 → 507,328 (it reserves 262,144 dynamic slots out of the same 1,000,000). #3518's own split is 672,320 1:1 plus a 262,144 overflow for title slots, so the two PRs put different arithmetic in the same place. If #3419 lands first, a capped host loses a further 196,608 title slots until this lands; if this lands first, #3419's sizing needs rewriting on top of it.

If a run on this Arc at your head would help — bound/refused counts before and after, plus a screenshot of the yard — say the word and I'll do it. I'm not touching the code: the remap is yours.

AI use: Mistral Vibe (agent) — log counts on the machine above, no code.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7223115576 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3518#issuecomment-7223115576). Originally posted by [borosf](https://github.com/borosf) on 2026-11-27T16:19:02Z. --- Numbers from a capped host that is **not** NVIDIA, in case they're useful for the body's "e.g. NVIDIA". **Intel Arc B580 12 GB, Windows 11 x64, `--console series-x`.** This device caps too, with the same error, and the title asks for more than one heap holds: ``` WARN victory_gpu::descriptor::host: host view heap capped at 1000000 error=The parameter is incorrect. (0x80070057) count=1245184 WARN victory_gpu::descriptor::host: title slot past the host heap index=934464 count=934464 ``` In a single four-minute run through the prologue into the prison yard: **310,720** `title slot past the host heap` warnings, one per newly-seen index, contiguous from 934,464 to the title's 1,245,183. That is **24.9 % of the title's view slots** never bound — on this machine it is the class of failure behind missing textures, not a performance question at all. One interaction worth deciding before either merges, since you own both: on the same machine and the same tree, #3419's `capped_heap_slots` gives `kept=737856 extra=262144`, i.e. refusals go **310,720 → 507,328** (it reserves 262,144 dynamic slots out of the same 1,000,000). #3518's own split is 672,320 1:1 plus a 262,144 overflow for title slots, so the two PRs put different arithmetic in the same place. If #3419 lands first, a capped host loses a further 196,608 title slots until this lands; if this lands first, #3419's sizing needs rewriting on top of it. If a run on this Arc at your head would help — bound/refused counts before and after, plus a screenshot of the yard — say the word and I'll do it. I'm not touching the code: the remap is yours. _AI use: Mistral Vibe (agent) — log counts on the machine above, no code._
borosf commented 2026-11-27 16:36:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-27T16:36:05Z.


Two things from the Arc, both reproducible: the red check, and one bug in the remap.

The failing test is not your logic — it is a race on frame.rs's globals. frame::tests::waits_end_on_ticks_and_count_frames fails at frame.rs:231, left: 0, right: 1. Isolated, it passes 10/10 on your head (df88467) and 10/10 on its parent (63bcca4). In the full -p victory-gpu --lib suite it fails 2 of 8 runs on your head, and never in isolation. The counters it asserts on — FRAME, PRESENT_TICK, WAITS, LAST in frame.rs — are process-global, and your descriptor/remap_test.rs tests make lists and frames on other test threads, so whichever runs alongside it moves the numbers. A static TEST_LOCK around the frame tests, or reading only this thread's increments (the idiom #3224 just added for copystat), would settle it. Worth saying: on this machine your head is cleaner than its parent, which fails 8/8 on descriptor::host::tests::dynamic_slots_are_held_until_released (host.rs:2226) — your change fixes that one.

The overflow pool runs out well before your title's space does. From a four-minute run through the prologue into the prison yard on the Arc:

INFO  host: host view heaps capped; virtual view remapping enabled limit=1000000
WARN  descriptor::host: host view heap capped at 1000000 with high-slot overflow remapping
      title_count=1245184 direct=672320 overflow=262144
WARN  descriptor::host: host view heap overflow slots exhausted index=892146 overflow=262144

Zero title slot past the host heap warnings — the remap does what it says, the old failure is gone. But the title's space reaches 1,245,183 and the pool is exhausted at 892,146, so roughly 353,000 high slots never map, now silently: recycled overflow is sized for the active set, and the active set here is larger than 262,144. Either the pool needs to grow out of the 1,000,000 budget the direct slots don't use, or exhaustion should log a rate-limited count of the slots it left unmapped rather than one line.

AI use: Mistral Vibe (agent) — builds, suite runs and in-world log counts on Windows 11 x64, Intel Arc B580.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7223450709 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3518#issuecomment-7223450709). Originally posted by [borosf](https://github.com/borosf) on 2026-11-27T16:36:05Z. --- Two things from the Arc, both reproducible: the red `check`, and one bug in the remap. **The failing test is not your logic — it is a race on frame.rs's globals.** `frame::tests::waits_end_on_ticks_and_count_frames` fails at `frame.rs:231`, `left: 0, right: 1`. Isolated, it passes 10/10 on your head (`df88467`) and 10/10 on its parent (`63bcca4`). In the full `-p victory-gpu --lib` suite it fails **2 of 8 runs** on your head, and never in isolation. The counters it asserts on — `FRAME`, `PRESENT_TICK`, `WAITS`, `LAST` in `frame.rs` — are process-global, and your `descriptor/remap_test.rs` tests make lists and frames on other test threads, so whichever runs alongside it moves the numbers. A `static TEST_LOCK` around the frame tests, or reading only this thread's increments (the idiom #3224 just added for `copystat`), would settle it. Worth saying: on this machine your head is *cleaner* than its parent, which fails 8/8 on `descriptor::host::tests::dynamic_slots_are_held_until_released` (`host.rs:2226`) — your change fixes that one. **The overflow pool runs out well before your title's space does.** From a four-minute run through the prologue into the prison yard on the Arc: ``` INFO host: host view heaps capped; virtual view remapping enabled limit=1000000 WARN descriptor::host: host view heap capped at 1000000 with high-slot overflow remapping title_count=1245184 direct=672320 overflow=262144 WARN descriptor::host: host view heap overflow slots exhausted index=892146 overflow=262144 ``` Zero `title slot past the host heap` warnings — the remap does what it says, the old failure is gone. But the title's space reaches 1,245,183 and the pool is exhausted at 892,146, so roughly **353,000 high slots never map**, now silently: recycled overflow is sized for the active set, and the active set here is larger than 262,144. Either the pool needs to grow out of the 1,000,000 budget the direct slots don't use, or exhaustion should log a rate-limited count of the slots it left unmapped rather than one line. _AI use: Mistral Vibe (agent) — builds, suite runs and in-world log counts on Windows 11 x64, Intel Arc B580._
Jishnuraj07 commented 2026-11-27 18:18:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Jishnuraj07 on 2026-11-27T18:18:37Z.


Verification on NVIDIA GeForce RTX 5060 8 GB (Blackwell), driver 32.0.16.2112, native Windows 11 Pro 10.0.26200, rustc 1.98.1 (MSVC). Head df88467, base main 63bcca4. No game files; library tests only.

main 63bcca4 this PR df88467
cargo clippy -p victory-gpu -p victory-shader --all-targets --locked -- -D warnings clean clean
cargo test -p victory-gpu --lib --locked 229 passed, 2 failed 232 passed, 0 failed
cargo test -p victory-shader --lib --locked -- --test-threads=1 --skip heap_direct_texture_reads_mark_their_heap_index 298 passed, 3 failed 299 passed, 3 failed (the same 3)
  • The two capped-heap failures on main (dynamic_slots_are_held_until_released at host.rs:2226, lists_share_a_table_and_copies_keep_their_views at "past the dynamic slots") pass here, and so does the new remap_test.
  • No test that passes on main fails with this PR.
  • The three victory-shader failures are the same on both, with identical output: a_heap_buffer_read_by_element_takes_the_views_stride ([101, 104, 107, …]), a_heap_buffer_read_where_no_buffer_view_is_reads_zeros ("The parameter is incorrect") and gathers_at_a_level_match_the_hardware (lane 0). These are the ones in #3445. The second one uses the test host's own heap (emit/host.rs), not HostHeap, so this PR isn't expected to change it.
  • heap_direct_texture_reads_mark_their_heap_index is skipped because it crashes the test binary with 0xc0000005 on main too (the zero-length root-constants pointer reported in #3445). Without the skip, the binary stops after 78 tests.

No title run.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7225353973 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3518#issuecomment-7225353973). Originally posted by [Jishnuraj07](https://github.com/Jishnuraj07) on 2026-11-27T18:18:37Z. --- Verification on **NVIDIA GeForce RTX 5060 8 GB (Blackwell), driver 32.0.16.2112, native Windows 11 Pro 10.0.26200**, rustc 1.98.1 (MSVC). Head `df88467`, base `main` `63bcca4`. No game files; library tests only. | | `main` 63bcca4 | this PR df88467 | |---|---|---| | `cargo clippy -p victory-gpu -p victory-shader --all-targets --locked -- -D warnings` | clean | clean | | `cargo test -p victory-gpu --lib --locked` | 229 passed, **2 failed** | **232 passed, 0 failed** | | `cargo test -p victory-shader --lib --locked -- --test-threads=1 --skip heap_direct_texture_reads_mark_their_heap_index` | 298 passed, 3 failed | 299 passed, 3 failed (the same 3) | - The two capped-heap failures on `main` (`dynamic_slots_are_held_until_released` at `host.rs:2226`, `lists_share_a_table_and_copies_keep_their_views` at "past the dynamic slots") pass here, and so does the new `remap_test`. - No test that passes on `main` fails with this PR. - The three `victory-shader` failures are the same on both, with identical output: `a_heap_buffer_read_by_element_takes_the_views_stride` (`[101, 104, 107, …]`), `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros` ("The parameter is incorrect") and `gathers_at_a_level_match_the_hardware` (lane 0). These are the ones in #3445. The second one uses the test host's own heap (`emit/host.rs`), not `HostHeap`, so this PR isn't expected to change it. - `heap_direct_texture_reads_mark_their_heap_index` is skipped because it crashes the test binary with `0xc0000005` on `main` too (the zero-length root-constants pointer reported in #3445). Without the skip, the binary stops after 78 tests. No title run.
upipibi commented 2026-11-28 03:56:00 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-28T03:56:00Z.


A sizing point for the capped branch (read from this head df88467b and another tree's notes; not run here).

When the title's heap leaves no room for MIN_DYNAMIC on a 1,000,000 host, which is the case for the retail heap of a little over 1,000,000 views, this branch splits the heap into 672,320 direct slots, 262,144 overflow slots and 64,512 dynamic slots (descriptor/host.rs:229-240). main there gives 934,464 title slots and 65,536 dynamic ones.

trustno1-coder/VIctory-NVIDIA has measured both sides of that split on capped NVIDIA hosts (its descriptor/host.rs, the notes on DYNAMIC):

  • Dynamic slots. 2^16 ran out in the world. 2^17 ran out in the opening cutscene, where a frame asks for up to 16,000 tables while the frame before still holds its own. A draw then read table slots that were never made for it, and the card stopped within frames. They run 2^18. main's own note on DYNAMIC (host.rs:94) says the same about 2^16 on an RX 9070 XT.
  • Title slots. The highest title slot they have seen is about 720,000. So 2^18 dynamic slots still leave about 737,000 title slots 1:1, above everything they observed, with no remap.

On those numbers, this branch's 64,512 dynamic slots are the budget that ran out there. Only slots from 672,320 to about 720,000 (some 48,000) would go through the overflow table, so 262,144 overflow slots are far more than they need. Taking 2^18 dynamic slots out of the overflow pool, with the remap kept for title slots past that, would follow both measurements. One caveat: the 720,000 figure comes from one fork's sessions.

AI-assisted (Claude Code, Claude Opus 5.5 read this head and that tree's notes).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7233523831 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3518#issuecomment-7233523831). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-28T03:56:00Z. --- A sizing point for the capped branch (read from this head `df88467b` and another tree's notes; not run here). When the title's heap leaves no room for `MIN_DYNAMIC` on a 1,000,000 host, which is the case for the retail heap of a little over 1,000,000 views, this branch splits the heap into 672,320 direct slots, 262,144 overflow slots and 64,512 dynamic slots (`descriptor/host.rs:229-240`). `main` there gives 934,464 title slots and 65,536 dynamic ones. trustno1-coder/VIctory-NVIDIA has measured both sides of that split on capped NVIDIA hosts (its `descriptor/host.rs`, the notes on `DYNAMIC`): - **Dynamic slots.** 2^16 ran out in the world. 2^17 ran out in the opening cutscene, where a frame asks for up to 16,000 tables while the frame before still holds its own. A draw then read table slots that were never made for it, and the card stopped within frames. They run 2^18. `main`'s own note on `DYNAMIC` (`host.rs:94`) says the same about 2^16 on an RX 9070 XT. - **Title slots.** The highest title slot they have seen is about 720,000. So 2^18 dynamic slots still leave about 737,000 title slots 1:1, above everything they observed, with no remap. On those numbers, this branch's 64,512 dynamic slots are the budget that ran out there. Only slots from 672,320 to about 720,000 (some 48,000) would go through the overflow table, so 262,144 overflow slots are far more than they need. Taking 2^18 dynamic slots out of the overflow pool, with the remap kept for title slots past that, would follow both measurements. One caveat: the 720,000 figure comes from one fork's sessions. AI-assisted (Claude Code, Claude Opus 5.5 read this head and that tree's notes).
omarsaifuddin commented 2026-11-28 12:43:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by omarsaifuddin on 2026-11-28T12:43:22Z.


Ran this on an RTX 3070 Ti (Windows 11) from the first boot screen into the prologue world: main 63bcca4 + #3226 + #2323 + #2885 + this PR. (This PR conflicts with #2885 in descriptor/host.rs, emit/lower.rs and emit/mod.rs; I merged by hand, keeping both sides, and victory-gpu is 235/0.) The remap works: 0 "title slot past the host heap" warnings, no device removal, and the world load ran for 15 to 38 minutes in my runs without a crash. Two things in the diff cost it most of its draws, though.

1. State::tables sizes a fresh table with the shader register. main has table_offset_dwords / 8 + 1; this PR has table_offset_dwords / 8 + u.lower_bound.max(1), and the "reaches past the host heap" check uses lower_bound - 1 as a span too. UsedResource::lower_bound is the shader register of the descriptor (base_register in RootParam; nothing in the emitter reads it as an extent, and memory_tests.rs builds entries with lower_bound: k at table slot k). Added up with the entry offset, a table with 4 entries at offsets 0..3 gets n=108, 3 entries gets 71, and a single entry at offset 1 gets 278.

Counted over 80,000 fresh tables on this stack: 8,579,260 dynamic slots taken for 361,283 entries used, about 24 times too many. The dynamic pool was full whenever the world started drawing (used=261117 of=261120, longest free run 2, so it is exhaustion and not fragmentation), and roughly 70% of the dropped draws were no dynamic slots for its tables / for root views: mostly indirect mesh draws, so the G-buffer-like targets stayed almost empty (flat grey) and the world came out mostly white.

With the two lines back to + 1 and a span of 0, same binary otherwise: 43.9M slots for 32.7M entries (1.34x) over 7.3M fresh tables, 0 failed dynamic requests, 0 no dynamic slots drops, held slots 85k..175k of 261k instead of full, and the prologue prison yard (chain-link fence, guard tower, what looks like a figure behind the fence) is recognisable in the presented frame, still ghosted. Dropped draws: 1.4k after 15 minutes, against 12k after 20 minutes with the old sizing; most of what is left is root view offsets and refused shaders.

2. On the capped path the dynamic pool is MIN_DYNAMIC - NULL_RESERVE = 64,512 slots. The comment above DYNAMIC says 2^16 ran out seconds into the world on an RX 9070 XT. With the table sizes fixed it still peaked at 208,900 of 261,120 (2^18) here, so a capped host needs about the uncapped size. I used 2^18 dynamic, 410,176 direct and 327,680 overflow (in one run about 287k of the 606k direct slots were live at once; here the overflow pool reached its 327,680 limit and the exhausted warning fired once). I haven't checked that split on another card or title scene.

I have not run it without the + 1 change on a stack where the pools are the stock sizes, so I can't say how much of (1) alone the old sizes would have survived. Everything above is one card and one scene.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7239421943 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3518#issuecomment-7239421943). Originally posted by [omarsaifuddin](https://github.com/omarsaifuddin) on 2026-11-28T12:43:22Z. --- Ran this on an RTX 3070 Ti (Windows 11) from the first boot screen into the prologue world: main `63bcca4` + #3226 + #2323 + #2885 + this PR. (This PR conflicts with #2885 in `descriptor/host.rs`, `emit/lower.rs` and `emit/mod.rs`; I merged by hand, keeping both sides, and `victory-gpu` is 235/0.) The remap works: 0 "title slot past the host heap" warnings, no device removal, and the world load ran for 15 to 38 minutes in my runs without a crash. Two things in the diff cost it most of its draws, though. **1. `State::tables` sizes a fresh table with the shader register.** main has `table_offset_dwords / 8 + 1`; this PR has `table_offset_dwords / 8 + u.lower_bound.max(1)`, and the "reaches past the host heap" check uses `lower_bound - 1` as a span too. `UsedResource::lower_bound` is the shader register of the descriptor (`base_register` in `RootParam`; nothing in the emitter reads it as an extent, and `memory_tests.rs` builds entries with `lower_bound: k` at table slot `k`). Added up with the entry offset, a table with 4 entries at offsets 0..3 gets n=108, 3 entries gets 71, and a single entry at offset 1 gets 278. Counted over 80,000 fresh tables on this stack: 8,579,260 dynamic slots taken for 361,283 entries used, about 24 times too many. The dynamic pool was full whenever the world started drawing (`used=261117 of=261120`, longest free run 2, so it is exhaustion and not fragmentation), and roughly 70% of the dropped draws were `no dynamic slots for its tables` / `for root views`: mostly indirect mesh draws, so the G-buffer-like targets stayed almost empty (flat grey) and the world came out mostly white. With the two lines back to `+ 1` and a span of 0, same binary otherwise: 43.9M slots for 32.7M entries (1.34x) over 7.3M fresh tables, 0 failed dynamic requests, 0 `no dynamic slots` drops, held slots 85k..175k of 261k instead of full, and the prologue prison yard (chain-link fence, guard tower, what looks like a figure behind the fence) is recognisable in the presented frame, still ghosted. Dropped draws: 1.4k after 15 minutes, against 12k after 20 minutes with the old sizing; most of what is left is root view offsets and refused shaders. **2. On the capped path the dynamic pool is `MIN_DYNAMIC - NULL_RESERVE` = 64,512 slots.** The comment above `DYNAMIC` says 2^16 ran out seconds into the world on an RX 9070 XT. With the table sizes fixed it still peaked at 208,900 of 261,120 (2^18) here, so a capped host needs about the uncapped size. I used 2^18 dynamic, 410,176 direct and 327,680 overflow (in one run about 287k of the 606k direct slots were live at once; here the overflow pool reached its 327,680 limit and the exhausted warning fired once). I haven't checked that split on another card or title scene. I have not run it without the `+ 1` change on a stack where the pools are the stock sizes, so I can't say how much of (1) alone the old sizes would have survived. Everything above is one card and one scene.
danielibabet commented 2026-12-01 09:28:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by danielibabet on 2026-12-01T09:28:26Z.


Thanks @AurumCarlos, @upipibi, and @omarsaifuddin for the catch and measurements!

Updated on pr/capped-heap-remap:

  1. Fixed table sizing (draw.rs): reverted the UsedResource::lower_bound misuse to ntry_slots(u) = u.table_offset_dwords / 8 + 1 (plus nd = table + u64::from(u.table_offset_dwords) * 4) and added the _table_entry_reads_up_to_its_own_slot unit test.
  2. Expanded capped dynamic pool (descriptor/host.rs): capped heaps now allocate DYNAMIC - NULL_RESERVE (261,120) dynamic slots, 475,712 direct 1:1 slots, and 262,144 overflow slots (1,000,000 total).

Verified with cargo test -p victory-gpu descriptor::host::, draw::tests::a_table_entry, cargo test -p victory-shader remap_tests, cargo clippy --all-targets -- -D warnings, and cargo xtask policy.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7306751877 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3518#issuecomment-7306751877). Originally posted by [danielibabet](https://github.com/danielibabet) on 2026-12-01T09:28:26Z. --- Thanks @AurumCarlos, @upipibi, and @omarsaifuddin for the catch and measurements! Updated on pr/capped-heap-remap: 1. **Fixed table sizing (draw.rs)**: reverted the UsedResource::lower_bound misuse to ntry_slots(u) = u.table_offset_dwords / 8 + 1 (plus nd = table + u64::from(u.table_offset_dwords) * 4) and added the _table_entry_reads_up_to_its_own_slot unit test. 2. **Expanded capped dynamic pool (descriptor/host.rs)**: capped heaps now allocate DYNAMIC - NULL_RESERVE (261,120) dynamic slots, 475,712 direct 1:1 slots, and 262,144 overflow slots (1,000,000 total). Verified with cargo test -p victory-gpu descriptor::host::, draw::tests::a_table_entry, cargo test -p victory-shader remap_tests, cargo clippy --all-targets -- -D warnings, and cargo xtask policy.
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/3518:upstream-pr/3518'
git switch 'upstream-pr/3518'

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