GPU: rate-limit capped heap slot warning to once per 64K band #2898

Open
github-bot wants to merge 2 commits from github-bot/gh-2898 into main AGit
Owner

@⁠alexandruiulian201-bot on GitHub · 2026-11-25 23:23 UTC · original
alexandruiulian201-bot:fix/rate-limit-capped-heap-warning → main · +118 −6 · 4 files · 2 commits · open

On hosts whose shader-visible CBV/SRV/UAV heap is capped below the title's heap size (e.g. NVIDIA's 1,000,000 descriptor limit), HostHeap::mirror tracks HIGHEST.fetch_max(index) < index and logs "title slot past the host heap" for every strictly increasing out-of-range slot.

When the title initializes descriptor slots sequentially past self.count, every slot satisfies HIGHEST < index, flooding stderr / logs with tens or hundreds of thousands of WARN lines (e.g. 113,664 warnings across 934_912..1_048_576) and adding avoidable log formatting overhead during load.

Changes

  • Replace per-slot HIGHEST tracking in HostHeap::mirror with 64 Ki-slot band tracking ((index >> 16) + 1, via note_capped_slot) so sequential heap initialization logs once per 64 Ki-slot band while still reporting the high-water mark as slots climb.
  • Add unit test descriptor::host::tests::capped_slot_warning_fires_once_per_64k_band covering a 113,664-slot sequential sweep, revisits to earlier bands, and u32::MAX (no overflow).

Verification

  • cargo test -p victory-gpu --locked descriptor::host::tests::capped_slot_warning_fires_once_per_64k_band — 1 passed, 0 failed
  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings (default and --all-features) — 0 warnings
  • cargo test -p xtask --bin xtask --locked — 6 passed, 0 failed (asset policy: 1 files ok)

AI-assisted. Synthetic unit test only.

**@⁠alexandruiulian201-bot** on GitHub · 2026-11-25 23:23 UTC · [original](https://github.com/Marvisak/VIctory/pull/2898) `alexandruiulian201-bot:fix/rate-limit-capped-heap-warning` → `main` · +118 −6 · 4 files · 2 commits · open On hosts whose shader-visible CBV/SRV/UAV heap is capped below the title's heap size (e.g. NVIDIA's 1,000,000 descriptor limit), `HostHeap::mirror` tracks `HIGHEST.fetch_max(index) < index` and logs `"title slot past the host heap"` for every strictly increasing out-of-range slot. When the title initializes descriptor slots sequentially past `self.count`, every slot satisfies `HIGHEST < index`, flooding stderr / logs with tens or hundreds of thousands of `WARN` lines (e.g. 113,664 warnings across `934_912..1_048_576`) and adding avoidable log formatting overhead during load. ### Changes - Replace per-slot `HIGHEST` tracking in `HostHeap::mirror` with 64 Ki-slot band tracking (`(index >> 16) + 1`, via `note_capped_slot`) so sequential heap initialization logs once per 64 Ki-slot band while still reporting the high-water mark as slots climb. - Add unit test `descriptor::host::tests::capped_slot_warning_fires_once_per_64k_band` covering a 113,664-slot sequential sweep, revisits to earlier bands, and `u32::MAX` (no overflow). ### Verification - `cargo test -p victory-gpu --locked descriptor::host::tests::capped_slot_warning_fires_once_per_64k_band` — 1 passed, 0 failed - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings` (default and `--all-features`) — 0 warnings - `cargo test -p xtask --bin xtask --locked` — 6 passed, 0 failed (`asset policy: 1 files ok`) AI-assisted. Synthetic unit test only.
On 1M-capped descriptor heaps (NVIDIA), sequential initialization of title slots past self.count triggered HIGHEST.fetch_max(index) < index on every slot, flooding logs with tens of thousands of warnings. Track 64 Ki-slot bands ((index >> 16) + 1) so each new band warns once.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:17:00 +00:00
Author
Owner

@⁠alexandruiulian201-bot on GitHub · 2026-11-25 23:42 UTC · original

@⁠fuzeofficlal Thanks for the thorough review and verification on RTX 5090 / WARP!

**@⁠alexandruiulian201-bot** on GitHub · 2026-11-25 23:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/2898#issuecomment-7177939709) @⁠fuzeofficlal Thanks for the thorough review and verification on RTX 5090 / WARP!
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 04:29 UTC · original

Automated triage for the maintainers.

Needs work. This logs the "title slot past the host heap" diagnostic in HostHeap::mirror once per 64 Ki-slot band. note_capped_slot is correct, but the flood described comes from a made-up range rather than a real run's log; please attach an excerpt that shows it. Per-band logging also no longer reports the final high-water mark the diagnostic exists for; please keep the true maximum (for example log it once at the end).

CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 04:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/2898#issuecomment-7182636265) <!-- victory-triage v1 head=bb45212a5d866f6cb4289373d29d163358b04098 verdict=needs-work at=2026-11-26T04:29:05Z --> Automated triage for the maintainers. **Needs work.** This logs the "title slot past the host heap" diagnostic in `HostHeap::mirror` once per 64 Ki-slot band. `note_capped_slot` is correct, but the flood described comes from a made-up range rather than a real run's log; please attach an excerpt that shows it. Per-band logging also no longer reports the final high-water mark the diagnostic exists for; please keep the true maximum (for example log it once at the end). CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Keep tracking the exact highest slot past a capped host view heap alongside the 64 Ki-slot band warning. Emit the exact high-water mark once whenever it advances past the last logged index (on the 5 s frame summary and before TerminateProcess in lifecycle::end).
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 23:35 UTC · original · reviewed

Right fix for the flood: the old per-new-maximum logic still warned on every sequential write past the cap (each is a new max); once-per-64K-band gives the diagnostic without the stderr storm. The test's two-band span assertion is exact. LGTM.

**@⁠kotekompotek** on GitHub · 2026-11-25 23:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/2898#pullrequestreview-6066478606) · **reviewed** Right fix for the flood: the old per-new-maximum logic still warned on every sequential write past the cap (each is a new max); once-per-64K-band gives the diagnostic without the stderr storm. The test's two-band span assertion is exact. LGTM.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 23:37 UTC · original · reviewed

Verified head bb45212a cleanly merged onto origin/main (63bcca43) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + D3D12 WARP + VICTORY_D3D12_DEBUG=1).

Code Review

  • note_capped_slot(&HIGHEST_BAND, index) computes band = (index >> 16) + 1, which cannot overflow u32 (max 0x10000) and starts at >= 1 against initial 0, guaranteeing the very first out-of-range slot always logs while capping subsequent logs to at most one per rising 64K band across threads.

Local Verification (VICTORY_D3D12_DEBUG=1)

  • RTX 5090 (skipping pre-existing 1M cap baseline dynamic_slots_are_held_until_released) and WARP: descriptor::host::tests 15/15 (including capped_slot_warning_fires_once_per_64k_band), descriptor::tests 7/7.
  • cargo clippy --locked -p victory-gpu --all-targets -- -D warnings (default and --features diagnostics) & cargo xtask policy (191 files ok): clean.

Looks clean and ready to merge.

**@⁠fuzeofficlal** on GitHub · 2026-11-25 23:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/2898#pullrequestreview-6066498572) · **reviewed** Verified head `bb45212a` cleanly merged onto `origin/main` (`63bcca43`) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + D3D12 WARP + `VICTORY_D3D12_DEBUG=1`). ### Code Review - `note_capped_slot(&HIGHEST_BAND, index)` computes `band = (index >> 16) + 1`, which cannot overflow `u32` (max `0x10000`) and starts at `>= 1` against initial `0`, guaranteeing the very first out-of-range slot always logs while capping subsequent logs to at most one per rising 64K band across threads. ### Local Verification (`VICTORY_D3D12_DEBUG=1`) - **RTX 5090** (skipping pre-existing 1M cap baseline `dynamic_slots_are_held_until_released`) and **WARP**: `descriptor::host::tests` **15/15** (including `capped_slot_warning_fires_once_per_64k_band`), `descriptor::tests` **7/7**. - `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` (default and `--features diagnostics`) & `cargo xtask policy` (`191 files ok`): clean. Looks clean and ready to merge.
Author
Owner

@⁠alexandruiulian201-bot on GitHub · 2026-11-26 09:58 UTC · original

Updated in cae9d1f to preserve and report the exact high-water mark, and here is the real log excerpt from a GTX 1070 (1M view heap cap) run:

2026-11-26T02:16:44.800227Z  WARN victory_gpu::descriptor::host: host view heap capped at 1000000 count=1245184 mirrored=934461 dynamic=65536
...
2026-11-26T02:16:44.895997Z  WARN victory_gpu::descriptor::host: title slot past the host heap index=934461 count=934461 for_draw=false
2026-11-26T02:16:44.898323Z  WARN victory_gpu::descriptor::host: title slot past the host heap index=983040 count=934461 for_draw=false
2026-11-26T02:16:44.901486Z  WARN victory_gpu::descriptor::host: title slot past the host heap index=1048576 count=934461 for_draw=false
2026-11-26T02:16:44.904503Z  WARN victory_gpu::descriptor::host: title slot past the host heap index=1114112 count=934461 for_draw=false
2026-11-26T02:16:44.907451Z  WARN victory_gpu::descriptor::host: title slot past the host heap index=1179648 count=934461 for_draw=false

The title requests a 1,245,184-slot view heap (934,461 mirrored slots after the 1M NVIDIA cap) and sequentially initializes slots past 934,461 through the 1,179,648 band (0x120000) in 11.45 ms (~3 ms per 64 Ki-slot band). Without band throttling, HIGHEST.fetch_max(index) < index fired on every slot across those ~310k slots.

Changes in cae9d1f:

  • Track both the 64 Ki-slot band (for immediate rate-limited warnings) and the exact maximum slot index (CappedSlots) in crates/victory-gpu/src/descriptor/host.rs.
  • Expose victory_gpu::descriptor::log_capped_high_water(), called on the 5 s Meter summary (crates/victory-gpu/src/host.rs) and before TerminateProcess in lifecycle::end() (crates/victory-hle/src/modules/lifecycle.rs), logging the exact highest title slot past the host heap once whenever the true maximum advances past the last logged index.
  • Updated the unit test to cover the real 934,461..1,245,184 range and exact high-water reporting.
**@⁠alexandruiulian201-bot** on GitHub · 2026-11-26 09:58 UTC · [original](https://github.com/Marvisak/VIctory/pull/2898#issuecomment-7188731600) Updated in `cae9d1f` to preserve and report the exact high-water mark, and here is the real log excerpt from a GTX 1070 (1M view heap cap) run: ```text 2026-11-26T02:16:44.800227Z WARN victory_gpu::descriptor::host: host view heap capped at 1000000 count=1245184 mirrored=934461 dynamic=65536 ... 2026-11-26T02:16:44.895997Z WARN victory_gpu::descriptor::host: title slot past the host heap index=934461 count=934461 for_draw=false 2026-11-26T02:16:44.898323Z WARN victory_gpu::descriptor::host: title slot past the host heap index=983040 count=934461 for_draw=false 2026-11-26T02:16:44.901486Z WARN victory_gpu::descriptor::host: title slot past the host heap index=1048576 count=934461 for_draw=false 2026-11-26T02:16:44.904503Z WARN victory_gpu::descriptor::host: title slot past the host heap index=1114112 count=934461 for_draw=false 2026-11-26T02:16:44.907451Z WARN victory_gpu::descriptor::host: title slot past the host heap index=1179648 count=934461 for_draw=false ``` The title requests a `1,245,184`-slot view heap (`934,461` mirrored slots after the 1M NVIDIA cap) and sequentially initializes slots past `934,461` through the `1,179,648` band (`0x120000`) in 11.45 ms (~3 ms per 64 Ki-slot band). Without band throttling, `HIGHEST.fetch_max(index) < index` fired on every slot across those ~310k slots. Changes in `cae9d1f`: - Track both the 64 Ki-slot band (for immediate rate-limited warnings) and the exact maximum slot index (`CappedSlots`) in `crates/victory-gpu/src/descriptor/host.rs`. - Expose `victory_gpu::descriptor::log_capped_high_water()`, called on the 5 s `Meter` summary (`crates/victory-gpu/src/host.rs`) and before `TerminateProcess` in `lifecycle::end()` (`crates/victory-hle/src/modules/lifecycle.rs`), logging the exact `highest title slot past the host heap` once whenever the true maximum advances past the last logged index. - Updated the unit test to cover the real `934,461..1,245,184` range and exact high-water reporting.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/2898/head:github-bot/gh-2898'
git switch 'github-bot/gh-2898'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2898'
git switch 'github-bot/gh-2898'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2898'
git switch 'github-bot/gh-2898'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2898'
git switch 'main'
git merge --squash 'github-bot/gh-2898'
git switch 'main'
git merge --ff-only 'github-bot/gh-2898'
git switch 'main'
git merge 'github-bot/gh-2898'
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!2898
No description provided.