Descriptor tests: take the capped heap's design into account #1769

Open
kais7654 wants to merge 1 commit from upstream-pr/1770 into main
kais7654 commented 2026-11-24 22:16:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kais7654 on 2026-11-24T22:16:13Z.


On a host that caps its shader-visible view heaps below HEAP_VIEWS (the software adapter; NVIDIA), HostHeap takes the smaller dynamic range by design, and pair() makes a host copy's views dynamic ones. The two tests asserted the roomy heap's numbers whatever the path, and failed there. They now accept the capped path: the full heap's slots where the host took them, and the pairs' region checked through the heap itself.

Generated by Mistral Vibe.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5481243465 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1770). Originally posted by [kais7654](https://github.com/kais7654) on 2026-11-24T22:16:13Z. --- On a host that caps its shader-visible view heaps below HEAP_VIEWS (the software adapter; NVIDIA), HostHeap takes the smaller dynamic range by design, and pair() makes a host copy's views dynamic ones. The two tests asserted the roomy heap's numbers whatever the path, and failed there. They now accept the capped path: the full heap's slots where the host took them, and the pairs' region checked through the heap itself. Generated by Mistral Vibe.
catminou4 commented 2026-11-24 22:18:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T22:18:33Z.

Review: COMMENTED


Static review only: Windows-only code (D3D12/windows_sys/Win32) — nothing compiles or runs on macOS; source review of the diff.

Descriptor tests take the capped heap's design into account: pairs_start() exposes the pairing offset so tests stop assuming a layout the capped heap no longer has. Test-only, 61 lines.

<!-- greyfinch-sync:Marvisak/VIctory:review:6048297287 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1770#pullrequestreview-6048297287). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T22:18:33Z. **Review:** COMMENTED --- Static review only: Windows-only code (D3D12/windows_sys/Win32) — nothing compiles or runs on macOS; source review of the diff. Descriptor tests take the capped heap's design into account: pairs_start() exposes the pairing offset so tests stop assuming a layout the capped heap no longer has. Test-only, 61 lines.
DesertGamer commented 2026-11-24 23:05:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DesertGamer on 2026-11-24T22:16:53Z.


VIctory V2: community PRs, merged and tested

Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.

Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).

⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.

Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2

Unofficial community fork of Marvisak/VIctory, GPL-3.0.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7146034167 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1770#issuecomment-7146034167). Originally posted by [DesertGamer](https://github.com/DesertGamer) on 2026-11-24T22:16:53Z. --- ### VIctory V2: community PRs, merged and tested Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch. **Where it stands today:** launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1). :warning: Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk. Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help: https://DesertGamer/VIctory-V2 *Unofficial community fork of Marvisak/VIctory, GPL-3.0.*
kais7654 commented 2026-11-24 23:05:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kais7654 on 2026-11-24T22:25:23Z.


Static review only: Windows-only code (D3D12/windows_sys/Win32) — nothing compiles or runs on macOS; source review of the diff.

Descriptor tests take the capped heap's design into account: pairs_start() exposes the pairing offset so tests stop assuming a layout the capped heap no longer has. Test-only, 61 lines.

@catminou4 Thanks for the static review! Right — #[cfg(test)] only, and the
runtime side was checked on Windows: cargo test -p victory-gpu runs
78 tests green there, on exactly the capped-heap host the old numbers
failed on. Hosts without D3D12 skip the tests early, same as the other
GPU tests in the repo.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7146209798 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1770#issuecomment-7146209798). Originally posted by [kais7654](https://github.com/kais7654) on 2026-11-24T22:25:23Z. --- > Static review only: Windows-only code (D3D12/windows_sys/Win32) — nothing compiles or runs on macOS; source review of the diff. > > Descriptor tests take the capped heap's design into account: pairs_start() exposes the pairing offset so tests stop assuming a layout the capped heap no longer has. Test-only, 61 lines. @catminou4 Thanks for the static review! Right — `#[cfg(test)]` only, and the runtime side was checked on Windows: `cargo test -p victory-gpu` runs 78 tests green there, on exactly the capped-heap host the old numbers failed on. Hosts without D3D12 skip the tests early, same as the other GPU tests in the repo.
upipibi commented 2026-11-24 23:05:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-24T22:30:25Z.


A note for choosing between this and the code fixes. #1751 and #1779 fix the same two failing tests the other way round: they give capped (NVIDIA) heaps the full DYNAMIC range, because the MIN_DYNAMIC range runs out in the world (#59, #1496). On an RTX 3070, #1751 makes the original assertions pass as they are (victory-gpu 78 passed, against 76 + 2 failed on main 70564ae). If one of those merges, relaxing the tests to accept the smaller range would stop checking the very thing they fix.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7146311237 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1770#issuecomment-7146311237). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T22:30:25Z. --- A note for choosing between this and the code fixes. #1751 and #1779 fix the same two failing tests the other way round: they give capped (NVIDIA) heaps the full `DYNAMIC` range, because the `MIN_DYNAMIC` range runs out in the world (#59, #1496). On an RTX 3070, #1751 makes the original assertions pass as they are (`victory-gpu` 78 passed, against 76 + 2 failed on `main` `70564ae`). If one of those merges, relaxing the tests to accept the smaller range would stop checking the very thing they fix. AI-assisted (Claude Code).
kais7654 commented 2026-11-25 00:06:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kais7654 on 2026-11-24T23:23:51Z.


A note for choosing between this and the code fixes. #1751 and #1779 fix the same two failing tests the other way round: they give capped (NVIDIA) heaps the full DYNAMIC range, because the MIN_DYNAMIC range runs out in the world (#59, #1496). On an RTX 3070, #1751 makes the original assertions pass as they are (victory-gpu 78 passed, against 76 + 2 failed on main 70564ae). If one of those merges, relaxing the tests to accept the smaller range would stop checking the very thing they fix.

AI-assisted (Claude Code).

@upipibi Fair point — if #1751 or #1779 merges, the tests in this PR would stop checking exactly what those fix. This PR was written against 70564ae where the two tests fail, as a stopgap to document the capped heap's layout; it's test-only, so it can be dropped freely if the code fixes land first. Leaving the choice to the maintainer: code fix preferred, tests as a fallback.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7147352017 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1770#issuecomment-7147352017). Originally posted by [kais7654](https://github.com/kais7654) on 2026-11-24T23:23:51Z. --- > A note for choosing between this and the code fixes. #1751 and #1779 fix the same two failing tests the other way round: they give capped (NVIDIA) heaps the full `DYNAMIC` range, because the `MIN_DYNAMIC` range runs out in the world (#59, #1496). On an RTX 3070, #1751 makes the original assertions pass as they are (`victory-gpu` 78 passed, against 76 + 2 failed on `main` `70564ae`). If one of those merges, relaxing the tests to accept the smaller range would stop checking the very thing they fix. > > AI-assisted (Claude Code). @upipibi Fair point — if #1751 or #1779 merges, the tests in this PR would stop checking exactly what those fix. This PR was written against 70564ae where the two tests fail, as a stopgap to document the capped heap's layout; it's test-only, so it can be dropped freely if the code fixes land first. Leaving the choice to the maintainer: code fix preferred, tests as a fallback.
tigre437 commented 2026-11-25 01:08:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by tigre437 on 2026-11-25T00:40:20Z.


Tested on RTX 3060 Ti (driver 617.42, Windows 11, Rust 1.98.1), cargo test --workspace --locked --no-fail-fast. main (70564ae) gives 471 passed / 5 failed / 7 ignored. This branch (1beaca6) gives 473 / 3 / 7. The two descriptor tests pass.

Note: this only relaxes the tests. The shaders still clamp at HEAP_VIEWS (2^21) while the NVIDIA heap is capped at 1,000,000, so a_heap_buffer_read_where_no_buffer_view_is_reads_zeros still fails here ("dispatch failed: the parameter is incorrect"). #1777 sizes the clamp from the heap the host actually takes. It makes those same two tests pass with their original assertions, plus that third one (475 / 2 / 7 on the same machine). The two PRs also conflict in crates/victory-gpu/src/descriptor/host.rs, in the assertion of dynamic_slots_are_held_until_released. If #1777 lands, this one may no longer be needed.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148755348 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1770#issuecomment-7148755348). Originally posted by [tigre437](https://github.com/tigre437) on 2026-11-25T00:40:20Z. --- Tested on RTX 3060 Ti (driver 617.42, Windows 11, Rust 1.98.1), `cargo test --workspace --locked --no-fail-fast`. `main` (70564ae) gives 471 passed / 5 failed / 7 ignored. This branch (1beaca6) gives 473 / 3 / 7. The two descriptor tests pass. Note: this only relaxes the tests. The shaders still clamp at `HEAP_VIEWS` (2^21) while the NVIDIA heap is capped at 1,000,000, so `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros` still fails here ("dispatch failed: the parameter is incorrect"). #1777 sizes the clamp from the heap the host actually takes. It makes those same two tests pass with their original assertions, plus that third one (475 / 2 / 7 on the same machine). The two PRs also conflict in `crates/victory-gpu/src/descriptor/host.rs`, in the assertion of `dynamic_slots_are_held_until_released`. If #1777 lands, this one may no longer be needed.
Marvisak commented 2026-11-25 07:03:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T06:21:12Z.


Automated triage for the maintainers.

Needs work. Re-reviewed at the new head 1beaca67e124. The diff is the same as at the previous head, so both earlier points still stand:

  • descriptor/host.rs test: #1751 rewrites the same heap-size assertion more precisely: it requires the full heap only when the host takes a HEAP_VIEWS heap. The A || B form here passes for any heap of 4 + MIN_DYNAMIC or more, so it would miss a host that takes the full heap but gets a capped one. Please drop this hunk in favour of #1751, or match its check.
  • memory.rs test (pairs_start): when pairs_start() is not below NumDescriptors (the capped heap), nothing is asserted about the pairs. HostHeap::pair hands out dynamic slots there by design, so add an else that asserts both pairs fall in the dynamic range.

With the second point done and the first left to #1751, this would be a useful test fix.

CI: no check runs on the head commit.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7154703058 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1770#issuecomment-7154703058). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T06:21:12Z. --- <!-- victory-triage v1 head=1beaca67e124da076d960df691c77eb87843785e verdict=needs-work at=2026-11-25T07:24:51Z --> Automated triage for the maintainers. **Needs work.** Re-reviewed at the new head `1beaca67e124`. The diff is the same as at the previous head, so both earlier points still stand: - **`descriptor/host.rs` test:** #1751 rewrites the same heap-size assertion more precisely: it requires the full heap only when the host takes a `HEAP_VIEWS` heap. The `A || B` form here passes for any heap of 4 + `MIN_DYNAMIC` or more, so it would miss a host that takes the full heap but gets a capped one. Please drop this hunk in favour of #1751, or match its check. - **`memory.rs` test (`pairs_start`):** when `pairs_start()` is not below `NumDescriptors` (the capped heap), nothing is asserted about the pairs. `HostHeap::pair` hands out dynamic slots there by design, so add an `else` that asserts both pairs fall in the dynamic range. With the second point done and the first left to #1751, this would be a useful test fix. CI: no check runs on the head commit. --- _Generated by [Claude Code](https://claude.ai/code)_
artor410 commented 2026-11-28 08:19:15 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by artor410 on 2026-11-28T08:19:15Z.


NVIDIA Ampere check of 1beaca6, merged cleanly onto main 63bcca4 (tree ff62d27). RTX 3070 Ti 8 GB (Ampere, view heap capped at 1,000,000), driver 610.88, Windows 11, rustc 1.98.1, hardware adapter. Synthetic tests only.

Command: cargo test -p victory-gpu --lib, then the two #3178 tests with --nocapture --test-threads=1.

  • main: 229 pass / 2 fail (dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views).
  • this PR: 231 pass / 0 fail. Both tests pass.

The test heap here has 65,540 descriptors. The first test now accepts >= 4 + MIN_DYNAMIC, and the pairs check is skipped whenever pairs_start lies past the heap, which is always the case on this card. So on a capped host the second test no longer checks where the pairs are.

Side by side with #1770, #2251, #2937, #3191 and #3244 in #3178.

(Claude Code, Claude Opus 5.5.)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7236506339 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1770#issuecomment-7236506339). Originally posted by [artor410](https://github.com/artor410) on 2026-11-28T08:19:15Z. --- NVIDIA Ampere check of `1beaca6`, merged cleanly onto `main` `63bcca4` (tree `ff62d27`). RTX 3070 Ti 8 GB (Ampere, view heap capped at 1,000,000), driver 610.88, Windows 11, rustc 1.98.1, hardware adapter. Synthetic tests only. Command: `cargo test -p victory-gpu --lib`, then the two #3178 tests with `--nocapture --test-threads=1`. - `main`: 229 pass / 2 fail (`dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views`). - this PR: 231 pass / 0 fail. Both tests pass. The test heap here has 65,540 descriptors. The first test now accepts `>= 4 + MIN_DYNAMIC`, and the pairs check is skipped whenever `pairs_start` lies past the heap, which is always the case on this card. So on a capped host the second test no longer checks where the pairs are. Side by side with #1770, #2251, #2937, #3191 and #3244 in #3178. (Claude Code, Claude Opus 5.5.)
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/1770:upstream-pr/1770'
git switch 'upstream-pr/1770'

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