victory-gpu: fence-tracked LRU VRAM GC and upload buffer pooling #72

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

@⁠godsfathermixtape on GitHub · 2026-11-26 01:38 UTC · original
godsfathermixtape:feat/gpu-fence-lru-gc → main · +2028 −64 · 9 files · 1 commits · draft

Changes

  • HostHeap::kept: Added a Weak-backed reverse slot map to unpin stale bindless descriptor references prior to let_go_idle deallocation.
  • gc.rs: Added upload and staging buffer pooling for HostList::upload, gated per queue fence (Host::fence and copy-queue Worker::fence).
  • Host::present: Added a capped per-frame LRU eviction sweep targeting 75% of the DXGI LOCAL memory budget.

Configuration

  • VICTORY_GC=0|1
  • VICTORY_UPLOAD_POOL=0|1
  • VICTORY_MEM_BUDGET_MB=<MiB>

Verification

  • cargo test -p victory-gpu --lib: 329/329 passed (includes live D3D12 descriptor slot-nulling test).
  • cargo xtask policy: passed.
  • Runtime check (--console series-x, RTX 4060 8 GB, 32 GB RAM): reached opening street cutscene with zero DRED faults or texture corruption. Frame-time delta not isolated due to host RAM paging saturation.

Limitations

  • Budgets DXGI LOCAL memory only; NON_LOCAL (shared GPU memory) is not tracked or evicted.
  • Over-budget sweeps (needed_bytes.is_some()) bypass the 120-frame IDLE_FRAMES floor in resource::evict_lru and shadow::evict_lru, evicting fence-completed resources oldest-first. On GPUs where the active working set exceeds the LOCAL budget, this can cause re-upload thrashing.
  • resource::evict_lru holds TEXTURES and shadow::evict_lru holds LOOSE / BUFFERS locks while invoking slot_ref_count (RESOURCE_SLOTS + per-slot kept locks) per candidate, which may cause recording-thread contention under sustained budget pressure.
**@⁠godsfathermixtape** on GitHub · 2026-11-26 01:38 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/72) `godsfathermixtape:feat/gpu-fence-lru-gc` → `main` · +2028 −64 · 9 files · 1 commits · draft ### Changes - `HostHeap::kept`: Added a `Weak`-backed reverse slot map to unpin stale bindless descriptor references prior to `let_go_idle` deallocation. - `gc.rs`: Added upload and staging buffer pooling for `HostList::upload`, gated per queue fence (`Host::fence` and copy-queue `Worker::fence`). - `Host::present`: Added a capped per-frame LRU eviction sweep targeting 75% of the DXGI `LOCAL` memory budget. ### Configuration - `VICTORY_GC=0|1` - `VICTORY_UPLOAD_POOL=0|1` - `VICTORY_MEM_BUDGET_MB=<MiB>` ### Verification - `cargo test -p victory-gpu --lib`: 329/329 passed (includes live D3D12 descriptor slot-nulling test). - `cargo xtask policy`: passed. - Runtime check (`--console series-x`, RTX 4060 8 GB, 32 GB RAM): reached opening street cutscene with zero DRED faults or texture corruption. Frame-time delta not isolated due to host RAM paging saturation. ### Limitations - Budgets DXGI `LOCAL` memory only; `NON_LOCAL` (shared GPU memory) is not tracked or evicted. - Over-budget sweeps (`needed_bytes.is_some()`) bypass the 120-frame `IDLE_FRAMES` floor in `resource::evict_lru` and `shadow::evict_lru`, evicting fence-completed resources oldest-first. On GPUs where the active working set exceeds the `LOCAL` budget, this can cause re-upload thrashing. - `resource::evict_lru` holds `TEXTURES` and `shadow::evict_lru` holds `LOOSE` / `BUFFERS` locks while invoking `slot_ref_count` (`RESOURCE_SLOTS` + per-slot `kept` locks) per candidate, which may cause recording-thread contention under sustained budget pressure.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:31:46 +00:00
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 02:07 UTC · original

I read the full diff at 4f0d563. Two points matter for the reported 24–28 GB working-set and commit target:

  1. The budget is DXGI LOCAL only. gc::budget_bytes_from uses VICTORY_MEM_BUDGET_MB or 75% of the DXGI local budget, with a 90% hysteresis target; I found no read of K32GetProcessMemoryInfo, WorkingSetSize, PagefileUsage or GlobalMemoryStatusEx in the diff. On the 32 GB host here, a local run reached 10191 MB private, 4452 MB in memory, 16047 MB free physical and 154 MB left to commit — that commit pressure would not be visible to a VRAM-only watermark, and process working set is the metric the plan asks to reduce. A second band based on process working set, private commit and system commit headroom, with hysteresis, would address the stated target.

  2. Both new switches are on by default (VICTORY_GC and VICTORY_UPLOAD_POOL are disabled only when set to 0), and the over-watermark path bypasses the 120-frame floor and the 64-per-frame cap. The PR body already notes possible re-upload thrashing and recording-thread lock contention. I could not find a game-free unit test for shadow::evict_lru itself: the added tests cover UploadPoolCore, the budget/hysteresis helpers and one live D3D12 descriptor-slot case.

I am not claiming a frame-time or visual result; no game run was done for this review. Independently, at head 4f0d563 on RX 6950 XT / Ryzen 5 3600 / 32 GB / Windows 11, cargo test --locked -p victory-gpu --lib -- --test-threads=1 with an isolated target dir returned 328 passed; 1 failed; 34 ignored, exit 101. The single failure is the pre-existing descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in (assertion at descriptor/host.rs:4945); all three new gc::tests passed, including the live D3D12 descriptor case. At base 0a43566 with the same command I got 325 passed; 1 failed; 34 ignored, exit 101, with the same test failing. The PR adds three tests and all three pass; it introduces no new failure in this run.

Tool/model: OpenCode, Big Pickle.

**@⁠Adika713** on GitHub · 2026-11-26 02:07 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/72#issuecomment-7180482797) I read the full diff at `4f0d563`. Two points matter for the reported 24–28 GB working-set and commit target: 1. The budget is DXGI `LOCAL` only. `gc::budget_bytes_from` uses `VICTORY_MEM_BUDGET_MB` or 75% of the DXGI local budget, with a 90% hysteresis target; I found no read of `K32GetProcessMemoryInfo`, `WorkingSetSize`, `PagefileUsage` or `GlobalMemoryStatusEx` in the diff. On the 32 GB host here, a local run reached `10191 MB private`, `4452 MB in memory`, `16047 MB free physical` and `154 MB left to commit` — that commit pressure would not be visible to a VRAM-only watermark, and process working set is the metric the plan asks to reduce. A second band based on process working set, private commit and system commit headroom, with hysteresis, would address the stated target. 2. Both new switches are on by default (`VICTORY_GC` and `VICTORY_UPLOAD_POOL` are disabled only when set to `0`), and the over-watermark path bypasses the 120-frame floor and the 64-per-frame cap. The PR body already notes possible re-upload thrashing and recording-thread lock contention. I could not find a game-free unit test for `shadow::evict_lru` itself: the added tests cover `UploadPoolCore`, the budget/hysteresis helpers and one live D3D12 descriptor-slot case. I am not claiming a frame-time or visual result; no game run was done for this review. Independently, at head `4f0d563` on RX 6950 XT / Ryzen 5 3600 / 32 GB / Windows 11, `cargo test --locked -p victory-gpu --lib -- --test-threads=1` with an isolated target dir returned `328 passed; 1 failed; 34 ignored`, exit 101. The single failure is the pre-existing `descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in` (assertion at `descriptor/host.rs:4945`); all three new `gc::tests` passed, including the live D3D12 descriptor case. At base `0a43566` with the same command I got `325 passed; 1 failed; 34 ignored`, exit 101, with the same test failing. The PR adds three tests and all three pass; it introduces no new failure in this run. Tool/model: OpenCode, Big Pickle.
Author
Owner

@⁠MoonYueya on GitHub · 2026-11-26 09:42 UTC · original

RTX 3080 (10 GB) measurement of 4f0d563, with the PR's defaults left on
(VICTORY_GC and VICTORY_UPLOAD_POOL unset, so both enabled).

Setup: Ryzen 7 7700, 31.1 GB, Windows 11, driver 32.0.16.1742. Same save,
same switch set, same prewarmed cache policy (25,764 shaders translated,
206 that do not translate) for both arms; each arm on its own build so the
caches cannot mix. 480 s per run, unattended into the world. The control is f59a315 of MoonYueya/VIctory-Kira (this repo's e2a28ec plus the open NVIDIA PRs #47 #48 #24 #23 #78 #42 #66 #18 #10 #4 #58 #17 and #69), which does not contain this PR; n = 71 world
frame lines on the PR, 74 on the control.

control f59a315 PR #72 4f0d563
world frame time, median 450 ms 1951 ms (x4.33)
world frame time, p90 1091 ms 2528 ms
passed over unmapped (last) 2,516 18,436 (x7.3)
passes that made none for lack of room (last) 535 492
texture uploads, cumulative 3,338 MB 4,243 MB (+27%)
card use / DXGI budget (last) 9194 / 7790 MB 9172 / 7689 MB
picture mean / spatial sd (median, world) 74.1 / 53.7 50.0 / 63.2 (-32.5% mean)
device removed / panic / untranslated shaders 0 / 0 / 0 0 / 0 / 0

The only improvement is lack of room (-8%). Everything else that matters
moved the wrong way: 4.3x the frame time, 7.3x the textures skipped for want
of a mapping, 27% more uploaded bytes, and a visibly darker frame.

The log says why. Five watermark sweeps ran in 480 s, and the eviction counts
are not the routine path:

frame=1222 evicted=12798 freed_mb=813 budget_mb=5570
frame=1341 evicted=299   freed_mb=17  budget_mb=5756
frame=1401 evicted=2130  freed_mb=95  budget_mb=5716

budget_mb sits at 5.5-5.9 GB, which is 75% of a DXGI local budget that on
this card is itself only 7.0-7.9 GB. The layer's existing admission test
(resource.rs room()) admits work up to 90% of that same DXGI budget. So the
new watermark is below the line the renderer already considers full: the
sweep takes away host copies the renderer would still have used, and the next
frame uploads them again. That is the re-upload thrashing the PR body warns
about, and at 75% it is the normal case rather than an edge case on a 10 GB
card.

Two concrete suggestions, both small:

  1. Make the default watermark the same fraction the renderer already uses
    (90% to start evicting / 85% target, as Marvisak/VIctory 63bcca4 does in
    crates/victory-gpu/src/resource.rs evict_unused(), with its evict-then-rebuild guard) instead of 75% / 67.5%. Note that the
    over-budget path bypasses IDLE_FRAMES and ROUTINE_SWEEP_CAP entirely,
    so the fraction is the only thing standing between a sweep and a 12,798
    object eviction in one frame.
  2. Keep the fence gating and the pooled upload buffers, which are the parts
    that are safe on their own; at VICTORY_GC=0 this run's control numbers
    are reproduced, so the risk is contained to the sweep.

I am not claiming the upload-pool half of the PR is bad; I only measured the
PR as a whole with its defaults, and as a whole it is a regression here. Two
runs, one of which I discarded because a cargo test --workspace was running
beside it on the same 10 GB card.

AI-assisted: an AI agent ran the builds, runs and measurements.

**@⁠MoonYueya** on GitHub · 2026-11-26 09:42 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/72#issuecomment-7188363108) RTX 3080 (10 GB) measurement of `4f0d563`, with the PR's defaults left on (`VICTORY_GC` and `VICTORY_UPLOAD_POOL` unset, so both enabled). Setup: Ryzen 7 7700, 31.1 GB, Windows 11, driver 32.0.16.1742. Same save, same switch set, same prewarmed cache policy (25,764 shaders translated, 206 that do not translate) for both arms; each arm on its own build so the caches cannot mix. 480 s per run, unattended into the world. The control is `f59a315` of [MoonYueya/VIctory-Kira](https://github.com/MoonYueya/VIctory-Kira) (this repo's `e2a28ec` plus the open NVIDIA PRs #47 #48 #24 #23 #78 #42 #66 #18 #10 #4 #58 #17 and #69), which does not contain this PR; n = 71 world frame lines on the PR, 74 on the control. | | control `f59a315` | PR #72 `4f0d563` | |---|---|---| | world frame time, median | 450 ms | **1951 ms (x4.33)** | | world frame time, p90 | 1091 ms | 2528 ms | | passed over unmapped (last) | 2,516 | **18,436 (x7.3)** | | passes that made none for lack of room (last) | 535 | 492 | | texture uploads, cumulative | 3,338 MB | 4,243 MB (+27%) | | card use / DXGI budget (last) | 9194 / 7790 MB | 9172 / 7689 MB | | picture mean / spatial sd (median, world) | 74.1 / 53.7 | 50.0 / 63.2 (-32.5% mean) | | device removed / panic / untranslated shaders | 0 / 0 / 0 | 0 / 0 / 0 | The only improvement is `lack of room` (-8%). Everything else that matters moved the wrong way: 4.3x the frame time, 7.3x the textures skipped for want of a mapping, 27% more uploaded bytes, and a visibly darker frame. The log says why. Five watermark sweeps ran in 480 s, and the eviction counts are not the routine path: ``` frame=1222 evicted=12798 freed_mb=813 budget_mb=5570 frame=1341 evicted=299 freed_mb=17 budget_mb=5756 frame=1401 evicted=2130 freed_mb=95 budget_mb=5716 ``` `budget_mb` sits at 5.5-5.9 GB, which is 75% of a DXGI local budget that on this card is itself only 7.0-7.9 GB. The layer's existing admission test (`resource.rs room()`) admits work up to 90% of that same DXGI budget. So the new watermark is *below* the line the renderer already considers full: the sweep takes away host copies the renderer would still have used, and the next frame uploads them again. That is the re-upload thrashing the PR body warns about, and at 75% it is the normal case rather than an edge case on a 10 GB card. Two concrete suggestions, both small: 1. Make the default watermark the same fraction the renderer already uses (90% to start evicting / 85% target, as Marvisak/VIctory `63bcca4` does in `crates/victory-gpu/src/resource.rs` `evict_unused()`, with its evict-then-rebuild guard) instead of 75% / 67.5%. Note that the over-budget path bypasses `IDLE_FRAMES` and `ROUTINE_SWEEP_CAP` entirely, so the fraction is the only thing standing between a sweep and a 12,798 object eviction in one frame. 2. Keep the fence gating and the pooled upload buffers, which are the parts that are safe on their own; at `VICTORY_GC=0` this run's control numbers are reproduced, so the risk is contained to the sweep. I am not claiming the upload-pool half of the PR is bad; I only measured the PR as a whole with its defaults, and as a whole it is a regression here. Two runs, one of which I discarded because a `cargo test --workspace` was running beside it on the same 10 GB card. *AI-assisted: an AI agent ran the builds, runs and measurements.*
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 11:26 UTC · original

Target: #72

I checked MoonYueya's report against 4f0d563. It matches the code:

  • gc::budget_bytes_from defaults to 75% of DXGI LOCAL; hysteresis_target_bytes is 90% of that watermark, so the pressure sweep starts at 75% and stops at 67.5% of the local budget.
  • resource::room admits more host textures while used < budget * room_percent(), with room_percent defaulting to 90. On the reported 7.0-7.9 GB budget, the sweep therefore starts below the renderer's own admission line.
  • The over-watermark path passes usize::MAX to resource::evict_lru and shadow::evict_lru, bypassing both IDLE_FRAMES and ROUTINE_SWEEP_CAP. That is consistent with the logged 12,798-object eviction frame.
  • VICTORY_GC=0 leaves upload pooling on, but also leaves the new pool::room_with_budget path active; that caps empty blocks at 1 when local use is over the same 75% watermark. The control result with VICTORY_GC=0 points at the sweep, not the upload pool, as the main source of the regression.

I prepared a minimal patch against 4f0d563 (not pushed): default VRAM high watermark 90% of DXGI local, pressure target 85%, explicit VICTORY_MEM_BUDGET_MB still an exact watermark with its existing 90% target, and the upload-pool target unchanged. The gc::tests budget test is updated to assert 90%/85% while keeping the override and upload-pool assertions.

Verified on RX 6950 XT / Ryzen 5 3600 / 32 GB / Windows 11:

  • cargo test --locked -p victory-gpu --lib mem_budget_default_90_percent_85_target -- --test-threads=1: 1 passed, 0 failed.
  • cargo test --locked -p victory-gpu --lib -- --test-threads=1: 328 passed, 1 failed, 34 ignored, exit 101. The failure is the same pre-existing descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in seen at the PR head before this patch.
  • No game run was done, so I am not claiming a frame-time or visual improvement from the patch.

Given the measured 4.33x median regression, I would not merge the pressure sweep with its current 75% defaults. Either align it to 90%/85% and retest, or gate the pressure sweep off by default while keeping fence tracking and upload pooling. The branch also currently conflicts with main, so a rebase is needed before merge.

Tool/model: OpenCode, Big Pickle.

**@⁠Adika713** on GitHub · 2026-11-26 11:26 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/72#issuecomment-7190739468) Target: https://git.gtahub.st/github/avatarmanz--VIctory-7900XTX/pulls/72 I checked MoonYueya's report against `4f0d563`. It matches the code: - `gc::budget_bytes_from` defaults to 75% of DXGI `LOCAL`; `hysteresis_target_bytes` is 90% of that watermark, so the pressure sweep starts at 75% and stops at 67.5% of the local budget. - `resource::room` admits more host textures while `used < budget * room_percent()`, with `room_percent` defaulting to 90. On the reported 7.0-7.9 GB budget, the sweep therefore starts below the renderer's own admission line. - The over-watermark path passes `usize::MAX` to `resource::evict_lru` and `shadow::evict_lru`, bypassing both `IDLE_FRAMES` and `ROUTINE_SWEEP_CAP`. That is consistent with the logged 12,798-object eviction frame. - `VICTORY_GC=0` leaves upload pooling on, but also leaves the new `pool::room_with_budget` path active; that caps empty blocks at 1 when local use is over the same 75% watermark. The control result with `VICTORY_GC=0` points at the sweep, not the upload pool, as the main source of the regression. I prepared a minimal patch against `4f0d563` (not pushed): default VRAM high watermark 90% of DXGI local, pressure target 85%, explicit `VICTORY_MEM_BUDGET_MB` still an exact watermark with its existing 90% target, and the upload-pool target unchanged. The `gc::tests` budget test is updated to assert 90%/85% while keeping the override and upload-pool assertions. Verified on RX 6950 XT / Ryzen 5 3600 / 32 GB / Windows 11: - `cargo test --locked -p victory-gpu --lib mem_budget_default_90_percent_85_target -- --test-threads=1`: 1 passed, 0 failed. - `cargo test --locked -p victory-gpu --lib -- --test-threads=1`: 328 passed, 1 failed, 34 ignored, exit 101. The failure is the same pre-existing `descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in` seen at the PR head before this patch. - No game run was done, so I am not claiming a frame-time or visual improvement from the patch. Given the measured 4.33x median regression, I would not merge the pressure sweep with its current 75% defaults. Either align it to 90%/85% and retest, or gate the pressure sweep off by default while keeping fence tracking and upload pooling. The branch also currently conflicts with `main`, so a rebase is needed before merge. Tool/model: OpenCode, Big Pickle.
github-bot force-pushed github-bot/gh-72 from 4f0d563447 to 7d0bf9785a 2026-11-26 17:07:01 +00:00 Compare
Author
Owner

@⁠godsfathermixtape on GitHub · 2026-11-26 17:02 UTC · original

Rebased onto main (c9c932c, preserving PR #77's host::RamBand / shadow::window_victims and VICTORY_RESIDENCY paths) and updated at 7d0bf97 to address review feedback and add a minimal resource.rs retry-on-evict hook for #256.

Changes

  • gc::on: Changed VICTORY_GC default from 1 to 0 (opt-in); kept VICTORY_UPLOAD_POOL defaulting to 1.
  • gc::budget_and_target_bytes_from / pool::spares_with_budget: Raised the default DXGI LOCAL high watermark from 75% to 90% (matching resource::room()) with an 85% DXGI LOCAL hysteresis stop target. Retained explicit VICTORY_MEM_BUDGET_MB overrides as an exact watermark with a 90% hysteresis target. pool::room_with_budget no longer clamps spare blocks when VICTORY_GC=0.
  • gc::on_present / resource::evict_lru / shadow::evict_lru / texture::evict_lru: Removed usize::MAX eviction caps on the over-budget path. Over-budget sweeps now enforce OVER_BUDGET_SWEEP_CAP = 128 per frame and OVER_BUDGET_MIN_IDLE_FRAMES = 16 so recently used allocations are not evicted and re-uploaded on the next frame.
  • resource::Hosted::refused (#256): Replaced AtomicBool with RefusalState (None, Transient, Permanent). E_OUTOFMEMORY / ERROR_COMMITMENT_LIMIT and non-device-loss residency failures record Transient while keeping host_waits active; invalid/unsupported descriptions and device removal record Permanent. When resource::evict_lru frees VRAM (freed_bytes > 0), only Transient refusals are cleared.

Configuration

  • VICTORY_GC=0|1 (default 0)
  • VICTORY_UPLOAD_POOL=0|1 (default 1)
  • VICTORY_MEM_BUDGET_MB=<MiB> (exact watermark override; 90% hysteresis stop target)
  • VICTORY_UPLOAD_BUDGET_MB=<MiB>

Verification

  • cargo test -p victory-gpu --lib: 386 passed; 0 failed; 34 ignored (includes updated 90%/85% and VICTORY_GC=0 default tests, asset-free shadow::evict_lru fence/age-floor/cap test, #256 transient-vs-permanent refusal reset test, and live D3D12 descriptor slot-nulling test).
  • cargo xtask policy: asset policy: 266 files ok.
  • No new game run was performed for 7d0bf97

Limitations

  • gc budgets DXGI LOCAL memory only; NON_LOCAL memory is not tracked by gc (system-RAM pressure remains gated separately under VICTORY_WINDOW_BUDGET_MB and VICTORY_RESIDENCY).
  • #256 handling here is scoped to resource.rs (Refusal::Transient reset when resource::evict_lru frees VRAM, plus host_waits retention); draw.rs bindless queue completion and descriptor-cache fast paths described in #256 are not modified in this PR.
  • When VICTORY_GC=1, resource::evict_lru holds TEXTURES and shadow::evict_lru holds LOOSE / BUFFERS locks while calling slot_ref_count (RESOURCE_SLOTS + per-slot kept locks) per candidate, and working sets exceeding 90% of DXGI LOCAL with idle ages >= 16 frames can still incur bounded (<= 128/frame) re-upload churn.
**@⁠godsfathermixtape** on GitHub · 2026-11-26 17:02 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/72#issuecomment-7198407017) Rebased onto `main` (`c9c932c`, preserving PR #77's `host::RamBand` / `shadow::window_victims` and `VICTORY_RESIDENCY` paths) and updated at `7d0bf97` to address review feedback and add a minimal `resource.rs` retry-on-evict hook for #256. ### Changes - **`gc::on`**: Changed `VICTORY_GC` default from `1` to `0` (opt-in); kept `VICTORY_UPLOAD_POOL` defaulting to `1`. - **`gc::budget_and_target_bytes_from` / `pool::spares_with_budget`**: Raised the default DXGI `LOCAL` high watermark from 75% to 90% (matching `resource::room()`) with an 85% DXGI `LOCAL` hysteresis stop target. Retained explicit `VICTORY_MEM_BUDGET_MB` overrides as an exact watermark with a 90% hysteresis target. `pool::room_with_budget` no longer clamps spare blocks when `VICTORY_GC=0`. - **`gc::on_present` / `resource::evict_lru` / `shadow::evict_lru` / `texture::evict_lru`**: Removed `usize::MAX` eviction caps on the over-budget path. Over-budget sweeps now enforce `OVER_BUDGET_SWEEP_CAP = 128` per frame and `OVER_BUDGET_MIN_IDLE_FRAMES = 16` so recently used allocations are not evicted and re-uploaded on the next frame. - **`resource::Hosted::refused` (#256)**: Replaced `AtomicBool` with `RefusalState` (`None`, `Transient`, `Permanent`). `E_OUTOFMEMORY` / `ERROR_COMMITMENT_LIMIT` and non-device-loss residency failures record `Transient` while keeping `host_waits` active; invalid/unsupported descriptions and device removal record `Permanent`. When `resource::evict_lru` frees VRAM (`freed_bytes > 0`), only `Transient` refusals are cleared. ### Configuration - `VICTORY_GC=0|1` (default `0`) - `VICTORY_UPLOAD_POOL=0|1` (default `1`) - `VICTORY_MEM_BUDGET_MB=<MiB>` (exact watermark override; 90% hysteresis stop target) - `VICTORY_UPLOAD_BUDGET_MB=<MiB>` ### Verification - `cargo test -p victory-gpu --lib`: `386 passed; 0 failed; 34 ignored` (includes updated 90%/85% and `VICTORY_GC=0` default tests, asset-free `shadow::evict_lru` fence/age-floor/cap test, #256 transient-vs-permanent refusal reset test, and live D3D12 descriptor slot-nulling test). - `cargo xtask policy`: `asset policy: 266 files ok`. - No new game run was performed for `7d0bf97` ### Limitations - `gc` budgets DXGI `LOCAL` memory only; `NON_LOCAL` memory is not tracked by `gc` (system-RAM pressure remains gated separately under `VICTORY_WINDOW_BUDGET_MB` and `VICTORY_RESIDENCY`). - #256 handling here is scoped to `resource.rs` (`Refusal::Transient` reset when `resource::evict_lru` frees VRAM, plus `host_waits` retention); `draw.rs` bindless queue completion and descriptor-cache fast paths described in #256 are not modified in this PR. - When `VICTORY_GC=1`, `resource::evict_lru` holds `TEXTURES` and `shadow::evict_lru` holds `LOOSE` / `BUFFERS` locks while calling `slot_ref_count` (`RESOURCE_SLOTS` + per-slot `kept` locks) per candidate, and working sets exceeding 90% of DXGI `LOCAL` with idle ages `>= 16` frames can still incur bounded (`<= 128`/frame) re-upload churn.
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/72/head:github-bot/gh-72'
git switch 'github-bot/gh-72'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-72'
git switch 'github-bot/gh-72'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-72'
git switch 'github-bot/gh-72'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-72'
git switch 'main'
git merge --squash 'github-bot/gh-72'
git switch 'main'
git merge --ff-only 'github-bot/gh-72'
git switch 'main'
git merge 'github-bot/gh-72'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.