GPU: report the view heap sizes when the host caps one #35

Closed
WallasSCRIPTS wants to merge 1 commit from upstream-pr/35 into main
WallasSCRIPTS commented 2026-11-23 23:28:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by WallasSCRIPTS on 2026-11-23T23:28:58Z.


Relates to #16 and #11.

What

When the host cannot make a view heap as large as the title asked for, it
caps it and keeps PORTABLE_VIEWS - DYNAMIC slots. The warning named only
the resulting size, so the number of title slots lost was invisible. This
reports three numbers at creation: what the title asked for, what the host
made, and the difference.

The earlier version of this PR also reported out-of-range reads from
mirror(). On main, mirror() already logs the highest past-heap slot,
and #21 remaps the root tables that reach past the cap. Two reports of the
same reads would overlap, so that part is gone. One report, one place.

Doc corrections

docs/view-heap-limit.md now reflects #21 landing: root tables are made
afresh in the dynamic area, State::tables does that when a table holds a
constant buffer or an entry past the host heap (there is no 16-descriptor
rule), and #16 is the RTX 5070 Ti report, not the RX 7600 this was built on.
The sampler heap's 2,048-entry limit is left for a separate issue.

Verification

Static review only; no NVIDIA host here.

  • Rebased onto main at 97c78d1, after #21 landed.
  • cargo check -p victory-gpu --all-targets: clean.
  • cargo test -p victory-gpu: 36 passed, 0 failed.
  • The changed hunk is rustfmt --edition 2024 clean; the file has
    pre-existing formatting drift elsewhere.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6571008609 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/35). Originally posted by [WallasSCRIPTS](https://github.com/WallasSCRIPTS) on 2026-11-23T23:28:58Z. --- Relates to #16 and #11. ## What When the host cannot make a view heap as large as the title asked for, it caps it and keeps `PORTABLE_VIEWS - DYNAMIC` slots. The warning named only the resulting size, so the number of title slots lost was invisible. This reports three numbers at creation: what the title asked for, what the host made, and the difference. The earlier version of this PR also reported out-of-range reads from `mirror()`. On `main`, `mirror()` already logs the highest past-heap slot, and #21 remaps the root tables that reach past the cap. Two reports of the same reads would overlap, so that part is gone. One report, one place. ## Doc corrections `docs/view-heap-limit.md` now reflects #21 landing: root tables are made afresh in the dynamic area, `State::tables` does that when a table holds a constant buffer or an entry past the host heap (there is no 16-descriptor rule), and #16 is the RTX 5070 Ti report, not the RX 7600 this was built on. The sampler heap's 2,048-entry limit is left for a separate issue. ## Verification Static review only; no NVIDIA host here. - Rebased onto `main` at `97c78d1`, after #21 landed. - `cargo check -p victory-gpu --all-targets`: clean. - `cargo test -p victory-gpu`: 36 passed, 0 failed. - The changed hunk is `rustfmt --edition 2024` clean; the file has pre-existing formatting drift elsewhere.
upstream-sync closed this pull request 2026-11-24 06:51:00 +00:00
Sunkiller-qc commented 2026-11-24 06:54:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Sunkiller-qc on 2026-11-23T23:46:47Z.


Thanks, the heap-creation report (asked for / made / lost) is useful. Since #21 landed, mirror() already logs the highest past-heap slot (main descriptor/host.rs:312), so this conflicts and the two reports would overlap. Picking one would help. A few things in docs/view-heap-limit.md look outdated or off: lines 14-15 say nothing remaps, but #21 now remaps tables; line 25 says draw::tables copies "tables holding more than 16 descriptors", but it makes tables afresh when they hold a CBV or reach past the cap (there's no 16-descriptor rule); and line 68 puts the "machine that filed #16" as an RX 7600, while the PR text says #16 is an RTX 5070 Ti. The note that a sampler heap over 2,048 makes HostHeap::new return None is a good catch and might deserve its own issue. Static review, not built or run.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7117354135 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/35#issuecomment-7117354135). Originally posted by [Sunkiller-qc](https://github.com/Sunkiller-qc) on 2026-11-23T23:46:47Z. --- Thanks, the heap-creation report (asked for / made / lost) is useful. Since #21 landed, `mirror()` already logs the highest past-heap slot (main `descriptor/host.rs:312`), so this conflicts and the two reports would overlap. Picking one would help. A few things in `docs/view-heap-limit.md` look outdated or off: lines 14-15 say nothing remaps, but #21 now remaps tables; line 25 says `draw::tables` copies "tables holding more than 16 descriptors", but it makes tables afresh when they hold a CBV or reach past the cap (there's no 16-descriptor rule); and line 68 puts the "machine that filed #16" as an RX 7600, while the PR text says #16 is an RTX 5070 Ti. The note that a sampler heap over 2,048 makes `HostHeap::new` return `None` is a good catch and might deserve its own issue. Static review, not built or run.
WallasSCRIPTS commented 2026-11-24 06:54:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by WallasSCRIPTS on 2026-11-24T00:02:49Z.


Picked one: dropped the per-read report and kept the creation-time sizes
(asked for / made / lost). mirror() on main stays the single report for
past-heap slots.

Rebased onto 97c78d1 after #21 landed. The doc now says root tables are
remapped, describes State::tables correctly (CBV or a past-cap entry, no
descriptor-count rule), and attributes #16 to the RTX 5070 Ti. The
sampler-heap > 2,048 failure will go in its own issue.

cargo check -p victory-gpu --all-targets clean, cargo test -p victory-gpu
36 passed. Static only, as you noted — no NVIDIA host here to see the line
fire. Thanks for the review.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7117643713 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/35#issuecomment-7117643713). Originally posted by [WallasSCRIPTS](https://github.com/WallasSCRIPTS) on 2026-11-24T00:02:49Z. --- Picked one: dropped the per-read report and kept the creation-time sizes (asked for / made / lost). `mirror()` on `main` stays the single report for past-heap slots. Rebased onto `97c78d1` after #21 landed. The doc now says root tables are remapped, describes `State::tables` correctly (CBV or a past-cap entry, no descriptor-count rule), and attributes #16 to the RTX 5070 Ti. The sampler-heap > 2,048 failure will go in its own issue. `cargo check -p victory-gpu --all-targets` clean, `cargo test -p victory-gpu` 36 passed. Static only, as you noted — no NVIDIA host here to see the line fire. Thanks for the review.
DaviTostes commented 2026-11-24 06:54:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T00:58:27Z.


Tested df40f86 under Wine 11.22 + vkd3d-proton 3.1 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build with cargo xwin ... --target x86_64-pc-windows-msvc: pass, no regression.\n\n- victory_gpu: 36 passed, 3 failed — the same three environment-only failures as main (argument_clamp_builds, a_rejected_blob_gives_an_empty_library, #128's VirtualQuery upload skip).\n\nNo game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7118625120 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/35#issuecomment-7118625120). Originally posted by [DaviTostes](https://github.com/DaviTostes) on 2026-11-24T00:58:27Z. --- Tested `df40f86` under **Wine 11.22 + vkd3d-proton 3.1** on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build with `cargo xwin ... --target x86_64-pc-windows-msvc`: **pass, no regression**.\n\n- `victory_gpu`: **36 passed, 3 failed** — the same three environment-only failures as `main` (`argument_clamp_builds`, `a_rejected_blob_gives_an_empty_library`, #128's `VirtualQuery` upload skip).\n\nNo game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).
Sunkiller-qc commented 2026-11-24 06:54:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Sunkiller-qc on 2026-11-24T01:05:51Z.


Thanks, the new version reads well, and the doc matches main now.

One small heads-up: if #135 lands, the capped heap keeps PORTABLE_VIEWS - DYNAMIC_CAPPED title slots, while made = PORTABLE_VIEWS - extra (descriptor/host.rs:97) still uses DYNAMIC, so the logged numbers would be off. Whichever merges second should adjust that line.

Static review, not built or run.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7118751128 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/35#issuecomment-7118751128). Originally posted by [Sunkiller-qc](https://github.com/Sunkiller-qc) on 2026-11-24T01:05:51Z. --- Thanks, the new version reads well, and the doc matches main now. One small heads-up: if #135 lands, the capped heap keeps `PORTABLE_VIEWS - DYNAMIC_CAPPED` title slots, while `made = PORTABLE_VIEWS - extra` (`descriptor/host.rs:97`) still uses `DYNAMIC`, so the logged numbers would be off. Whichever merges second should adjust that line. Static review, not built or run.
WallasSCRIPTS commented 2026-11-24 06:55:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by WallasSCRIPTS on 2026-11-24T01:36:27Z.


Superseded by #21 (merged), which makes tables past a capped host view heap afresh: the hang this diagnosed is now fixed rather than logged, so the reporting here has nothing left to say on a capped heap.

This branch is more than a hundred commits behind main. Its one piece nothing else carries is docs/view-heap-limit.md, the reasoning about SM 6.6 directly indexed heaps (ResourceDescriptorHeap): two heaps do not merge into one index space, so the remap that works for root descriptor tables cannot serve indices past the cap there. Nothing hits that path today; the note stands if something does. Closing rather than rebasing a log line.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7119268926 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/35#issuecomment-7119268926). Originally posted by [WallasSCRIPTS](https://github.com/WallasSCRIPTS) on 2026-11-24T01:36:27Z. --- Superseded by #21 (merged), which makes tables past a capped host view heap afresh: the hang this diagnosed is now fixed rather than logged, so the reporting here has nothing left to say on a capped heap. This branch is more than a hundred commits behind main. Its one piece nothing else carries is `docs/view-heap-limit.md`, the reasoning about SM 6.6 directly indexed heaps (`ResourceDescriptorHeap`): two heaps do not merge into one index space, so the remap that works for root descriptor tables cannot serve indices past the cap there. Nothing hits that path today; the note stands if something does. Closing rather than rebasing a log line.

Pull request closed

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!35
No description provided.