GPU: fix dynamic descriptor wraparound scan, per-heap walk cap, and capped headroom #89

Closed
github-bot wants to merge 1 commit from gh-pr/89/head into gh-pr/89/base
Owner

@⁠dutch2005 on GitHub · 2026-11-25 13:44 UTC · original
fix/dynamic-descriptor-wraparound → main · +128 −32 · 1 files · 1 commits · closed without merging

Summary

Ports and consolidates dynamic descriptor allocator fixes from upstream forks (uiliannn/VItoriaBr a91ef70/b37344f/a65d054 and fxceless/victory-fork#932):

  1. Wraparound scan across cursor (find_dynamic_run): Previously (*next..spare).chain(0..*next) missed contiguous free runs that started before *next and ended after it. Extending the wrapped slice to 0..(cursor + n - 1).min(spare) recovers straddling runs while still never wrapping past the end of the array.
  2. Per-heap walk cap & lock-free free count: Replaced the process-global FAILED static with per-heap free: AtomicU32 (O(1) lock-free capacity check) and per-heap failed_walks, reset inside release() when slots are freed so fragmented misses on one heap never starve other heaps or post-release allocations mid-frame.
  3. Capped heap headroom (DYNAMIC_CAPPED): Doubled DYNAMIC_CAPPED from 1 << 16 to 1 << 17 on hosts capped at PORTABLE_VIEWS.

Verification

  • Ran cargo clippy -p victory-gpu --no-deps --all-targets --locked and --all-features (0 warnings on crates/victory-gpu/src/descriptor/host.rs).
  • Ran cargo test -p victory-gpu --lib -- --test-threads=1 descriptor::host::tests on host AMD Radeon RX 6700 XT: all 15 tests passed, including:
    • find_dynamic_run_scans_contiguous_runs_across_cursor_but_not_end
    • dynamic_allocation_finds_contiguous_range_crossing_search_cursor
    • failed_dynamic_walks_do_not_starve_other_heaps_and_reset_on_release
**@⁠dutch2005** on GitHub · 2026-11-25 13:44 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/89) `fix/dynamic-descriptor-wraparound` → `main` · +128 −32 · 1 files · 1 commits · closed without merging ## Summary Ports and consolidates dynamic descriptor allocator fixes from upstream forks (`uiliannn/VItoriaBr` `a91ef70`/`b37344f`/`a65d054` and `fxceless/victory-fork#932`): 1. **Wraparound scan across cursor (`find_dynamic_run`)**: Previously `(*next..spare).chain(0..*next)` missed contiguous free runs that started before `*next` and ended after it. Extending the wrapped slice to `0..(cursor + n - 1).min(spare)` recovers straddling runs while still never wrapping past the end of the array. 2. **Per-heap walk cap & lock-free free count**: Replaced the process-global `FAILED` static with per-heap `free: AtomicU32` (O(1) lock-free capacity check) and per-heap `failed_walks`, reset inside `release()` when slots are freed so fragmented misses on one heap never starve other heaps or post-release allocations mid-frame. 3. **Capped heap headroom (`DYNAMIC_CAPPED`)**: Doubled `DYNAMIC_CAPPED` from `1 << 16` to `1 << 17` on hosts capped at `PORTABLE_VIEWS`. ## Verification - Ran `cargo clippy -p victory-gpu --no-deps --all-targets --locked` and `--all-features` (0 warnings on `crates/victory-gpu/src/descriptor/host.rs`). - Ran `cargo test -p victory-gpu --lib -- --test-threads=1 descriptor::host::tests` on host AMD Radeon RX 6700 XT: all 15 tests passed, including: - `find_dynamic_run_scans_contiguous_runs_across_cursor_but_not_end` - `dynamic_allocation_finds_contiguous_range_crossing_search_cursor` - `failed_dynamic_walks_do_not_starve_other_heaps_and_reset_on_release`
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:35:27 +00:00
github-bot closed this pull request 2026-11-26 03:35:27 +00:00
Author
Owner

@⁠enriquebruno12 on GitHub · 2026-11-25 14:51 UTC · original

Independently tested on Windows with an RX 9070 XT. All 15 descriptor::host::tests passed single-threaded. I repeated the run with the two new hardware tests set to fail if D3D12 heap creation returned None; all 15 passed again. This confirms both the allocation across the search cursor and recovery after releasing slots. No game files were used.

**@⁠enriquebruno12** on GitHub · 2026-11-25 14:51 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/89#issuecomment-7165933227) Independently tested on Windows with an RX 9070 XT. All 15 descriptor::host::tests passed single-threaded. I repeated the run with the two new hardware tests set to fail if D3D12 heap creation returned None; all 15 passed again. This confirms both the allocation across the search cursor and recovery after releasing slots. No game files were used.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.