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

Open
github-bot wants to merge 1 commit from github-bot/gh-3518 into main AGit
Owner

@⁠danielibabet on GitHub · 2026-11-27 12:27 UTC · original
danielibabet:pr/capped-heap-remap → main · +961 −257 · 12 files · 1 commits · open

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.)
**@⁠danielibabet** on GitHub · 2026-11-27 12:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/3518) `danielibabet:pr/capped-heap-remap` → `main` · +961 −257 · 12 files · 1 commits · open 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.)
On hosts whose shader-visible view heaps stop at 1,000,000 descriptors
(D3D12 resource binding tier 2, e.g. NVIDIA), title heaps with more slots
lost every descriptor past the cap.

- HostHeap keeps the low slots 1:1 and maps active high title slots into a
  pool of physical overflow slots (recycled when the title clears them);
  strides, marks, view addresses, read marks and deferred placed textures
  follow the physical slot.
- Shaders translated for such hosts (emit::Options::capped_heap) read
  direct resource-heap indices through a virtual-to-physical table, root SRV
  t254 in the root CBV space, and clamp heap indices and null buffer views
  below 1,000,000.
- Tables reaching past the direct slots are made afresh in dynamic slots.
- The shader cache keys on the capped mode.

Tests: GPU dispatch of remapped high indices (host + WARP), overflow
allocation, clearing and reuse on a 1,245,184-slot heap.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 12:32:54 +00:00
Author
Owner

@⁠oni-swr on GitHub · 2026-11-27 13:25 UTC · original

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).

**@⁠oni-swr** on GitHub · 2026-11-27 13:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/3518#issuecomment-7219468570) 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).
Author
Owner

@⁠pickles976 on GitHub · 2026-11-27 13:48 UTC · original

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.

**@⁠pickles976** on GitHub · 2026-11-27 13:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/3518#issuecomment-7219965727) 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.
Author
Owner

@⁠AurumCarlos on GitHub · 2026-11-27 14:04 UTC · original · reviewed

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.

**@⁠AurumCarlos** on GitHub · 2026-11-27 14:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/3518#pullrequestreview-6089318406) · **reviewed** **`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.
Author
Owner

@⁠pickles976 on GitHub · 2026-11-27 14:16 UTC · original

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.

**@⁠pickles976** on GitHub · 2026-11-27 14:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/3518#issuecomment-7220573992) 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.
Author
Owner

@⁠oddmaniv on GitHub · 2026-11-27 14:22 UTC · original

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.

**@⁠oddmaniv** on GitHub · 2026-11-27 14:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/3518#issuecomment-7220710064) 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.
Author
Owner

@⁠borosf on GitHub · 2026-11-27 16:19 UTC · original

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** on GitHub · 2026-11-27 16:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/3518#issuecomment-7223115576) 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._
Author
Owner

@⁠borosf on GitHub · 2026-11-27 16:36 UTC · original

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.

**@⁠borosf** on GitHub · 2026-11-27 16:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/3518#issuecomment-7223450709) 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._
Author
Owner

@⁠Jishnuraj07 on GitHub · 2026-11-27 18:18 UTC · original

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.

**@⁠Jishnuraj07** on GitHub · 2026-11-27 18:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/3518#issuecomment-7225353973) 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.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3518/head:github-bot/gh-3518'
git switch 'github-bot/gh-3518'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3518'
git switch 'github-bot/gh-3518'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3518'
git switch 'github-bot/gh-3518'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3518'
git switch 'main'
git merge --squash 'github-bot/gh-3518'
git switch 'main'
git merge --ff-only 'github-bot/gh-3518'
git switch 'main'
git merge 'github-bot/gh-3518'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3518
No description provided.