Release idle snapshots and optimize CPU write-range bookkeeping #357

Closed
github-bot wants to merge 0 commits from github-bot/gh-357 into main AGit
Owner

@⁠zzzz-26 on GitHub · 2026-12-01 17:55 UTC · original
zzzz-26:optimize-memory-bookkeeping-20261201-095455 → main · +483 −53 · 6 files · 72 commits · closed without merging

Summary

Recreates PR #108, which was accidentally closed, using the changes from commit 5a261b5 on a clean branch.

This PR addresses two independent inefficiencies in the GPU shadow memory subsystem:

  1. Excessive CPU overhead when tracking fragmented, overlapping and repeated GPU write declarations.
  2. Retention of unused CPU snapshot allocations following temporary workload spikes.

These changes improve algorithmic scaling and allocation lifetime management without intentionally changing rendering functionality.

Implementation

Write-range coverage

The previous implementation repeatedly subtracted existing write declarations from a vector of uncovered intervals.

Each subtraction could allocate another temporary vector and traverse previously generated fragments.

With heavily fragmented declarations, this could approach quadratic time complexity.

The updated implementation maintains exact write declarations in sorted order and calculates uncovered portions through a linear interval traversal.

This reduces repeated traversal and temporary allocations while preserving the original coverage semantics.

Duplicate write declarations

Repeated GPU write declarations previously required linear searches.

The updated implementation uses binary search over sorted declarations, reducing duplicate lookup from linear to logarithmic complexity.

Unique insertion remains linear because subsequent vector entries may need to be shifted. The mixed declaration benchmark accounts for this insertion cost.

Write-range retirement

Completed write declarations are retired through a merge-based traversal instead of repeated membership checks.

Both relay and non-relay completion paths benefit, with particularly significant improvements in the non-relay path.

Exact declaration identities, overlapping declarations, submission flight counts and resource lifetime semantics are preserved.

Snapshot memory management

  • Expire unused snapshots after 30 seconds under normal conditions.
  • Reduce expiry to two seconds under memory pressure.
  • Limit each sweep to 32 released buffers.
  • Retain a small warm cache under normal conditions.
  • Preserve existing pool count and capacity restrictions.
  • Move new snapshot allocation outside the pool mutex.
  • Avoid allocating snapshots for fully covered declarations.
  • Leave checked-out snapshots unaffected by cache expiry.

Idle snapshot expiration can be disabled using:

VICTORY_IDLE_TRIM=0

No intentional changes are made to rendering resolution, shaders, upscaling, frame generation or launcher functionality.

CPU performance benchmarks

Original measurements recorded on November 30, 2026.

Test environment

  • AMD Ryzen 7 7800X3D
  • Windows
  • rustc 1.98.1 (48a229cea)
  • Optimized standalone Rust executable
  • Baseline algorithms from commit 7281175

Results

All execution times are in microseconds per benchmark operation.

Benchmark Previous (us) Updated (us) Speedup
Coverage - 32 ranges 4.640 0.450 10.31x
Mixed declarations - 32 ranges 26.745 3.730 7.17x
Relay retirement - 32 ranges 0.325 0.155 2.10x
Non-relay retirement - 32 ranges 0.275 0.160 1.72x
Coverage - 256 ranges 82.560 1.060 77.89x
Mixed declarations - 256 ranges 1627.480 48.420 33.61x
Relay retirement - 256 ranges 4.250 0.750 5.67x
Non-relay retirement - 256 ranges 12.240 0.775 15.79x
Coverage - 1024 ranges 786.665 2.760 285.02x
Mixed declarations - 1024 ranges 24457.015 367.025 66.64x
Relay retirement - 1024 ranges 24.860 2.585 9.62x
Non-relay retirement - 1024 ranges 162.165 2.890 56.11x

At 1024 ranges, the fragmented coverage benchmark eliminates approximately 99.65% of its original execution time.

The mixed declaration benchmark decreases from approximately 24.46 ms to 0.367 ms, including sorted-vector insertion costs.

These results demonstrate improved algorithmic scaling rather than merely faster execution at a fixed input size.

Benchmark methodology

The standalone benchmark compares the new production helpers against reproductions of the previous algorithms within the same executable.

Both implementations are warmed before measurement.

Measurement order alternates across 11 samples of 20 operations, with published results representing medians across three independent process runs.

Coverage workloads deliberately contain fragmented, disjoint declarations to stress the previous algorithm.

Mixed workloads include permuted insertions and repeated declarations, accounting for sorted-vector insertion costs.

Both retirement implementations receive equivalent cloned inputs.

The previous relay implementation already used binary search, while the non-relay implementation performed linear membership checks.

Correctness assertions execute before measurement.

Algorithmic improvements

Operation Previous Updated
Coverage calculation Potentially O(n^2) O(n)
Duplicate lookup O(n) O(log n)
Unique insertion Amortized O(1) O(n)
Relay retirement O(n log m) O(n + m)
Non-relay retirement O(n * m) O(n + m)

Retirement complexities assume sorted completion ranges. Additional sorting is necessary when that invariant is absent.

Expected gameplay impact

Potential benefits include:

  • Reduced CPU submission overhead.
  • Reduced temporary memory allocations.
  • Improved scaling with fragmented and repeated declarations.
  • Reduced snapshot allocation lock contention.
  • Improved frametime consistency during CPU-heavy workloads.
  • Lower retained snapshot memory following workload spikes.

These benchmarks measure isolated CPU bookkeeping operations, not complete game frames.

Actual FPS improvements depend on real declaration distributions, submission frequency, CPU/GPU overlap and whether the affected operations occur on the frame's critical path.

Idle snapshot eviction may introduce reallocation costs when previously released buffers are needed again.

No measured gameplay FPS improvement or RAM reduction is claimed.

Validation

The original implementation passed:

  • Four write-range tests.
  • Five idle-pool tests.
  • Nine relay tests.
  • Compilation with the diagnostics feature enabled.

Reproduction commands:

New-Item -ItemType Directory -Force target
rustc --edition=2024 -O scripts/bench/memory_bookkeeping.rs -o target/memory-bookkeeping.exe

.\target\memory-bookkeeping.exe

cargo test -p victory-gpu --lib write_ranges
cargo test -p victory-gpu --lib idle_pool
cargo test -p victory-gpu --lib relay_tests
cargo check -p victory-gpu --features diagnostics

Follow-up optimization opportunities

Additional static source analysis identified the following independent optimization candidates.

These are not implemented or benchmarked by this PR.

Confidence refers to the source-code finding rather than a guaranteed gameplay performance improvement.

Candidate Confidence FPS potential Memory potential
Linear stale-page detection Very high Medium-high Low
Allocation-free stale-page checks Very high Medium Low
Sorted pending-range reuse Very high Medium-high Low
Linear sent-range merging Very high Medium Low
Incorrect VRAM budget accounting Very high High when affected High
Failed arena allocation cleanup Very high Low normally High on failure
Periodic exact-view eviction Very high Conditional High
Pressure-aware preallocation High Medium Medium
Bulk address-memory refresh scheduling High High Low
Sparse CPU snapshots High Medium Very high
Redundant snapshot copying High Very high High
GPU-address arena reclamation High Conditional Very high
Upload arena reclamation High Conditional High
Small-buffer suballocation Medium High during streaming High
Duplicate staging elimination Medium High Very high

1. Ordered stale-page detection

shadow.rs::stale_pages_in() performs a binary search into sorted write-watch results for each previously copied page.

An ordered traversal could replace O(P log W) searching with approximately O(P + W) work over the relevant ranges.

Shadow::stale_under_writes() also constructs a vector solely to determine whether any stale pages exist. An allocation-free early-exit iterator could eliminate this unnecessary work.

Never-copied pages and existing generation semantics must remain correctly handled.

2. Reuse sorted pending declarations

This PR introduces a sorted-declaration invariant.

Other paths, including Shadow::update(), still collect and sort overlapping ranges independently.

These paths could reuse the new range helpers and eliminate redundant sorting after verifying all mutation invariants.

Exact declaration identities must remain independent for retirement and flight accounting.

A separately maintained coalesced coverage representation could further accelerate repeated overlap queries.

3. Linear sent-range merging

SentRuns::note_joined() concatenates already sorted interval sequences and sorts the resulting vector.

A two-way interval merge could eliminate intermediate allocations and redundant sorting.

The practical benefit should be measured against Rust's existing adaptive sorting implementation.

4. GPU-address VRAM accounting

shadow.rs::by_address() increments its allocation allowance before confirming whether the requested allocation fits or whether GPU allocation succeeds.

Failed reservations are not rolled back, and destruction does not return the corresponding allowance.

If this counter represents live allocations, inaccurate accounting can force otherwise eligible resources into system memory unnecessarily.

On discrete GPUs, this can introduce additional PCIe memory traffic and higher GPU memory access latency.

A lifetime-aware atomic reservation guard should be investigated, with budget release tied to actual resource retirement.

5. Failed arena allocation cleanup

Memory::another() and related initialization paths reserve raw virtual memory before subsequent fallible resource creation operations.

Failed initialization can leave those allocations committed.

An RAII allocation owner could ensure cleanup on every failure path.

This is principally a memory-exhaustion and stability fix.

6. Exact-view cache retention

The exact-view recycling pool has a byte limit, while live cached views are primarily pruned according to lookup activity and entry count.

Periodic byte-aware eviction could release idle live-map entries even when new cache misses stop occurring.

Existing GPU quarantine, ownership checks and fence requirements must be preserved.

Pressure-driven eviction should reduce total retained memory rather than simply transferring allocations into another cache.

7. Pressure-aware buffer preallocation

The speculative allocation worker creates thousands of small D3D12 buffers to reduce resource creation stalls.

However, CPU-side preallocation does not fully account for system memory pressure.

Pressure-aware targets, bounded allocation-failure backoff and reclamation of unused preallocated resources could reduce memory pressure without eliminating preallocation's streaming benefits.

Hysteresis should prevent repeated trimming and refilling.

8. Redundant address-memory refresh scheduling

memory.rs::Memory::bring_up() refreshes every known address-backed shadow for qualifying command lists.

Although deferred refresh requests are deduplicated, traversal, locking and hash lookups still occur.

A bulk scheduling interface could reduce lock acquisitions without changing synchronization behavior.

Dirty-generation tracking could provide further improvements, but must preserve initialization across independently recorded and submitted command lists.

9. Redundant snapshot copying

Historical profiling comments in the source describe approximately 1050 MB of copying per frame, consuming 72-86 ms, despite approximately 100 MB of changed data.

These are historical observations, not measurements of this PR.

Reliable GPU write tracking could potentially eliminate substantial unnecessary copying.

The existing experimental kept-snapshot mode should not be enabled globally without resolving its known coherence risks.

Selective shader write instrumentation or conservative dirty-region tracking may provide a path toward reducing snapshot traffic while retaining the existing implementation as a correctness fallback.

10. Sparse CPU snapshots

Snapshots currently allocate capacity for the entire shadow even when declared writes cover only a small portion.

Demand-committed virtual memory could preserve stable snapshot addresses while reducing committed capacity.

Deferred raw pointers, initialization state, worker-thread access and copy-back lifetimes must remain valid.

Reserved virtual address space, committed memory and resident working-set memory should be measured separately.

11. Arena reclamation

GPU-address arenas and upload arenas retain historical allocation peaks.

Per-arena occupancy tracking, allocation consolidation, fence-safe reclamation and descriptor lifetime management could substantially reduce retained memory.

Persistent GPU-generated data must not be discarded merely because CPU-side ownership appears inactive.

12. Resource suballocation and staging duplication

Numerous individually committed D3D12 resources may incur allocation overhead, alignment padding and driver metadata costs.

Shared-heap suballocation could reduce these costs where resource states and synchronization requirements permit.

The address-memory subsystem also retains multiple representations of memory. Eliminating unnecessary staging copies or permanently resident allocations could provide further memory reductions.

These are architectural changes requiring independent correctness and performance validation.

Future optimization work should measure:

  • Average FPS and 1% lows.
  • 95th, 99th and 99.9th percentile frametimes.
  • Submission-thread CPU execution time.
  • Snapshot capacity and actual copied bytes.
  • System RAM commit usage and working set.
  • Local and non-local GPU memory usage.
  • Cache hit rates, misses and eviction counts.
  • GPU resource allocation and retirement frequency.
  • Visual correctness across scene transitions.

Prioritize measured critical-path savings over isolated microbenchmark speedups.

References

The standalone benchmark source is retained for reproducibility.

Raw benchmark CSV files and separate benchmark documentation are intentionally excluded from the replacement commit.

AI disclosure

Claude Opus 5.5 assisted with codebase analysis, identification of algorithmic and memory-management inefficiencies, development of optimization strategies and preparation of this pull request.

AI-assisted findings and changes remain subject to independent review, compilation, regression testing and gameplay validation.

Replacement branch validation

The replacement branch has not yet been independently compiled or benchmarked. The reported results are from the original implementation.

**@⁠zzzz-26** on GitHub · 2026-12-01 17:55 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/357) `zzzz-26:optimize-memory-bookkeeping-20261201-095455` → `main` · +483 −53 · 6 files · 72 commits · closed without merging ## Summary Recreates PR #108, which was accidentally closed, using the changes from [commit 5a261b5](https://github.com/readmet3xt-lab/foxhound/commit/5a261b50b0d28c217e2836de2a345225c6ed9a38) on a clean branch. This PR addresses two independent inefficiencies in the GPU shadow memory subsystem: 1. Excessive CPU overhead when tracking fragmented, overlapping and repeated GPU write declarations. 2. Retention of unused CPU snapshot allocations following temporary workload spikes. These changes improve algorithmic scaling and allocation lifetime management without intentionally changing rendering functionality. ## Implementation ### Write-range coverage The previous implementation repeatedly subtracted existing write declarations from a vector of uncovered intervals. Each subtraction could allocate another temporary vector and traverse previously generated fragments. With heavily fragmented declarations, this could approach quadratic time complexity. The updated implementation maintains exact write declarations in sorted order and calculates uncovered portions through a linear interval traversal. This reduces repeated traversal and temporary allocations while preserving the original coverage semantics. ### Duplicate write declarations Repeated GPU write declarations previously required linear searches. The updated implementation uses binary search over sorted declarations, reducing duplicate lookup from linear to logarithmic complexity. Unique insertion remains linear because subsequent vector entries may need to be shifted. The mixed declaration benchmark accounts for this insertion cost. ### Write-range retirement Completed write declarations are retired through a merge-based traversal instead of repeated membership checks. Both relay and non-relay completion paths benefit, with particularly significant improvements in the non-relay path. Exact declaration identities, overlapping declarations, submission flight counts and resource lifetime semantics are preserved. ### Snapshot memory management - Expire unused snapshots after 30 seconds under normal conditions. - Reduce expiry to two seconds under memory pressure. - Limit each sweep to 32 released buffers. - Retain a small warm cache under normal conditions. - Preserve existing pool count and capacity restrictions. - Move new snapshot allocation outside the pool mutex. - Avoid allocating snapshots for fully covered declarations. - Leave checked-out snapshots unaffected by cache expiry. Idle snapshot expiration can be disabled using: `VICTORY_IDLE_TRIM=0` No intentional changes are made to rendering resolution, shaders, upscaling, frame generation or launcher functionality. ## CPU performance benchmarks Original measurements recorded on November 30, 2026. ### Test environment - AMD Ryzen 7 7800X3D - Windows - rustc 1.98.1 (48a229cea) - Optimized standalone Rust executable - Baseline algorithms from commit `7281175` ### Results All execution times are in microseconds per benchmark operation. | Benchmark | Previous (us) | Updated (us) | Speedup | |---|---:|---:|---:| | Coverage - 32 ranges | 4.640 | 0.450 | 10.31x | | Mixed declarations - 32 ranges | 26.745 | 3.730 | 7.17x | | Relay retirement - 32 ranges | 0.325 | 0.155 | 2.10x | | Non-relay retirement - 32 ranges | 0.275 | 0.160 | 1.72x | | Coverage - 256 ranges | 82.560 | 1.060 | 77.89x | | Mixed declarations - 256 ranges | 1627.480 | 48.420 | 33.61x | | Relay retirement - 256 ranges | 4.250 | 0.750 | 5.67x | | Non-relay retirement - 256 ranges | 12.240 | 0.775 | 15.79x | | Coverage - 1024 ranges | 786.665 | 2.760 | 285.02x | | Mixed declarations - 1024 ranges | 24457.015 | 367.025 | 66.64x | | Relay retirement - 1024 ranges | 24.860 | 2.585 | 9.62x | | Non-relay retirement - 1024 ranges | 162.165 | 2.890 | 56.11x | At 1024 ranges, the fragmented coverage benchmark eliminates approximately 99.65% of its original execution time. The mixed declaration benchmark decreases from approximately 24.46 ms to 0.367 ms, including sorted-vector insertion costs. These results demonstrate improved algorithmic scaling rather than merely faster execution at a fixed input size. ### Benchmark methodology The standalone benchmark compares the new production helpers against reproductions of the previous algorithms within the same executable. Both implementations are warmed before measurement. Measurement order alternates across 11 samples of 20 operations, with published results representing medians across three independent process runs. Coverage workloads deliberately contain fragmented, disjoint declarations to stress the previous algorithm. Mixed workloads include permuted insertions and repeated declarations, accounting for sorted-vector insertion costs. Both retirement implementations receive equivalent cloned inputs. The previous relay implementation already used binary search, while the non-relay implementation performed linear membership checks. Correctness assertions execute before measurement. ### Algorithmic improvements | Operation | Previous | Updated | |---|---|---| | Coverage calculation | Potentially O(n^2) | O(n) | | Duplicate lookup | O(n) | O(log n) | | Unique insertion | Amortized O(1) | O(n) | | Relay retirement | O(n log m) | O(n + m) | | Non-relay retirement | O(n * m) | O(n + m) | Retirement complexities assume sorted completion ranges. Additional sorting is necessary when that invariant is absent. ## Expected gameplay impact Potential benefits include: - Reduced CPU submission overhead. - Reduced temporary memory allocations. - Improved scaling with fragmented and repeated declarations. - Reduced snapshot allocation lock contention. - Improved frametime consistency during CPU-heavy workloads. - Lower retained snapshot memory following workload spikes. These benchmarks measure isolated CPU bookkeeping operations, not complete game frames. Actual FPS improvements depend on real declaration distributions, submission frequency, CPU/GPU overlap and whether the affected operations occur on the frame's critical path. Idle snapshot eviction may introduce reallocation costs when previously released buffers are needed again. No measured gameplay FPS improvement or RAM reduction is claimed. ## Validation The original implementation passed: - Four write-range tests. - Five idle-pool tests. - Nine relay tests. - Compilation with the diagnostics feature enabled. Reproduction commands: ```powershell New-Item -ItemType Directory -Force target rustc --edition=2024 -O scripts/bench/memory_bookkeeping.rs -o target/memory-bookkeeping.exe .\target\memory-bookkeeping.exe cargo test -p victory-gpu --lib write_ranges cargo test -p victory-gpu --lib idle_pool cargo test -p victory-gpu --lib relay_tests cargo check -p victory-gpu --features diagnostics ``` ## Follow-up optimization opportunities Additional static source analysis identified the following independent optimization candidates. These are not implemented or benchmarked by this PR. Confidence refers to the source-code finding rather than a guaranteed gameplay performance improvement. | Candidate | Confidence | FPS potential | Memory potential | |---|---|---|---| | Linear stale-page detection | Very high | Medium-high | Low | | Allocation-free stale-page checks | Very high | Medium | Low | | Sorted pending-range reuse | Very high | Medium-high | Low | | Linear sent-range merging | Very high | Medium | Low | | Incorrect VRAM budget accounting | Very high | High when affected | High | | Failed arena allocation cleanup | Very high | Low normally | High on failure | | Periodic exact-view eviction | Very high | Conditional | High | | Pressure-aware preallocation | High | Medium | Medium | | Bulk address-memory refresh scheduling | High | High | Low | | Sparse CPU snapshots | High | Medium | Very high | | Redundant snapshot copying | High | Very high | High | | GPU-address arena reclamation | High | Conditional | Very high | | Upload arena reclamation | High | Conditional | High | | Small-buffer suballocation | Medium | High during streaming | High | | Duplicate staging elimination | Medium | High | Very high | ### 1. Ordered stale-page detection `shadow.rs::stale_pages_in()` performs a binary search into sorted write-watch results for each previously copied page. An ordered traversal could replace O(P log W) searching with approximately O(P + W) work over the relevant ranges. `Shadow::stale_under_writes()` also constructs a vector solely to determine whether any stale pages exist. An allocation-free early-exit iterator could eliminate this unnecessary work. Never-copied pages and existing generation semantics must remain correctly handled. ### 2. Reuse sorted pending declarations This PR introduces a sorted-declaration invariant. Other paths, including `Shadow::update()`, still collect and sort overlapping ranges independently. These paths could reuse the new range helpers and eliminate redundant sorting after verifying all mutation invariants. Exact declaration identities must remain independent for retirement and flight accounting. A separately maintained coalesced coverage representation could further accelerate repeated overlap queries. ### 3. Linear sent-range merging `SentRuns::note_joined()` concatenates already sorted interval sequences and sorts the resulting vector. A two-way interval merge could eliminate intermediate allocations and redundant sorting. The practical benefit should be measured against Rust's existing adaptive sorting implementation. ### 4. GPU-address VRAM accounting `shadow.rs::by_address()` increments its allocation allowance before confirming whether the requested allocation fits or whether GPU allocation succeeds. Failed reservations are not rolled back, and destruction does not return the corresponding allowance. If this counter represents live allocations, inaccurate accounting can force otherwise eligible resources into system memory unnecessarily. On discrete GPUs, this can introduce additional PCIe memory traffic and higher GPU memory access latency. A lifetime-aware atomic reservation guard should be investigated, with budget release tied to actual resource retirement. ### 5. Failed arena allocation cleanup `Memory::another()` and related initialization paths reserve raw virtual memory before subsequent fallible resource creation operations. Failed initialization can leave those allocations committed. An RAII allocation owner could ensure cleanup on every failure path. This is principally a memory-exhaustion and stability fix. ### 6. Exact-view cache retention The exact-view recycling pool has a byte limit, while live cached views are primarily pruned according to lookup activity and entry count. Periodic byte-aware eviction could release idle live-map entries even when new cache misses stop occurring. Existing GPU quarantine, ownership checks and fence requirements must be preserved. Pressure-driven eviction should reduce total retained memory rather than simply transferring allocations into another cache. ### 7. Pressure-aware buffer preallocation The speculative allocation worker creates thousands of small D3D12 buffers to reduce resource creation stalls. However, CPU-side preallocation does not fully account for system memory pressure. Pressure-aware targets, bounded allocation-failure backoff and reclamation of unused preallocated resources could reduce memory pressure without eliminating preallocation's streaming benefits. Hysteresis should prevent repeated trimming and refilling. ### 8. Redundant address-memory refresh scheduling `memory.rs::Memory::bring_up()` refreshes every known address-backed shadow for qualifying command lists. Although deferred refresh requests are deduplicated, traversal, locking and hash lookups still occur. A bulk scheduling interface could reduce lock acquisitions without changing synchronization behavior. Dirty-generation tracking could provide further improvements, but must preserve initialization across independently recorded and submitted command lists. ### 9. Redundant snapshot copying Historical profiling comments in the source describe approximately 1050 MB of copying per frame, consuming 72-86 ms, despite approximately 100 MB of changed data. These are historical observations, not measurements of this PR. Reliable GPU write tracking could potentially eliminate substantial unnecessary copying. The existing experimental kept-snapshot mode should not be enabled globally without resolving its known coherence risks. Selective shader write instrumentation or conservative dirty-region tracking may provide a path toward reducing snapshot traffic while retaining the existing implementation as a correctness fallback. ### 10. Sparse CPU snapshots Snapshots currently allocate capacity for the entire shadow even when declared writes cover only a small portion. Demand-committed virtual memory could preserve stable snapshot addresses while reducing committed capacity. Deferred raw pointers, initialization state, worker-thread access and copy-back lifetimes must remain valid. Reserved virtual address space, committed memory and resident working-set memory should be measured separately. ### 11. Arena reclamation GPU-address arenas and upload arenas retain historical allocation peaks. Per-arena occupancy tracking, allocation consolidation, fence-safe reclamation and descriptor lifetime management could substantially reduce retained memory. Persistent GPU-generated data must not be discarded merely because CPU-side ownership appears inactive. ### 12. Resource suballocation and staging duplication Numerous individually committed D3D12 resources may incur allocation overhead, alignment padding and driver metadata costs. Shared-heap suballocation could reduce these costs where resource states and synchronization requirements permit. The address-memory subsystem also retains multiple representations of memory. Eliminating unnecessary staging copies or permanently resident allocations could provide further memory reductions. These are architectural changes requiring independent correctness and performance validation. ## Recommended follow-up validation Future optimization work should measure: - Average FPS and 1% lows. - 95th, 99th and 99.9th percentile frametimes. - Submission-thread CPU execution time. - Snapshot capacity and actual copied bytes. - System RAM commit usage and working set. - Local and non-local GPU memory usage. - Cache hit rates, misses and eviction counts. - GPU resource allocation and retirement frequency. - Visual correctness across scene transitions. Prioritize measured critical-path savings over isolated microbenchmark speedups. ## References - [Original PR #108](https://git.gtahub.st/github/readmet3xt-lab--foxhound/pulls/108) - [Original commit](https://github.com/readmet3xt-lab/foxhound/commit/5a261b50b0d28c217e2836de2a345225c6ed9a38) - [Original benchmark documentation](https://github.com/readmet3xt-lab/foxhound/blob/5a261b50b0d28c217e2836de2a345225c6ed9a38/docs/benchmarks/memory-bookkeeping.md) The standalone benchmark source is retained for reproducibility. Raw benchmark CSV files and separate benchmark documentation are intentionally excluded from the replacement commit. ## AI disclosure Claude Opus 5.5 assisted with codebase analysis, identification of algorithmic and memory-management inefficiencies, development of optimization strategies and preparation of this pull request. AI-assisted findings and changes remain subject to independent review, compilation, regression testing and gameplay validation. ## Replacement branch validation The replacement branch has not yet been independently compiled or benchmarked. The reported results are from the original implementation.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 17:57:40 +00:00
Author
Owner

@⁠Aniseto on GitHub · 2026-12-01 18:10 UTC · original

Ran the three named victory-gpu test groups at a49e5a28 on an NVIDIA Blackwell desktop part with 16 GB of VRAM.

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own CARGO_TARGET_DIR, no local patches.

cargo test -q --locked -p victory-gpu --lib write_ranges -- --test-threads=1
4 passed; 0 failed; 2 ignored; 517 filtered out      (exit 0)

cargo test -q --locked -p victory-gpu --lib idle_pool -- --test-threads=1
5 passed; 0 failed; 0 ignored; 518 filtered out      (exit 0)

cargo test -q --locked -p victory-gpu --lib relay_tests -- --test-threads=1
9 passed; 0 failed; 0 ignored; 514 filtered out      (exit 0)

All three groups pass here, matching the description's four write-range, five idle-pool and nine relay tests. These are synthetic tests; no title was run, so the CPU-overhead and snapshot-retention effects were not measured on a real workload.

Not tested: the full workspace suite, a retail title, CPU-time A/B for write-range tracking or snapshot release, Wine, AMD adapters, release profile, game data.

AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

**@⁠Aniseto** on GitHub · 2026-12-01 18:10 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/357#issuecomment-7320519499) Ran the three named `victory-gpu` test groups at `a49e5a28` on an NVIDIA Blackwell desktop part with 16 GB of VRAM. Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own `CARGO_TARGET_DIR`, no local patches. ``` cargo test -q --locked -p victory-gpu --lib write_ranges -- --test-threads=1 4 passed; 0 failed; 2 ignored; 517 filtered out (exit 0) cargo test -q --locked -p victory-gpu --lib idle_pool -- --test-threads=1 5 passed; 0 failed; 0 ignored; 518 filtered out (exit 0) cargo test -q --locked -p victory-gpu --lib relay_tests -- --test-threads=1 9 passed; 0 failed; 0 ignored; 514 filtered out (exit 0) ``` All three groups pass here, matching the description's four write-range, five idle-pool and nine relay tests. These are synthetic tests; no title was run, so the CPU-overhead and snapshot-retention effects were not measured on a real workload. Not tested: the full workspace suite, a retail title, CPU-time A/B for write-range tracking or snapshot release, Wine, AMD adapters, release profile, game data. AI-assisted (OpenCode), model: **MiMo-V2.6-Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
github-bot closed this pull request 2026-12-02 07:54:35 +00:00

Pull request closed

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