Files
VIctory-NVIDIA/docs/bug-journal.md
Lyrnc 8b80173966 Sends: what the window used stays whatever RAM is free, and memory past 256 MiB is never kept
The bench on 1ecaa98a: with 0.1-0.8 GB of RAM free in play on the 32 GB
PC the free-RAM-scaled part of the line was ~0, so all that stayed was
what the last sweep needed at once (128-144 MiB) while the spares the
frames use were 168-232 MiB: 524 buffers made and 522 let go in 300 s
(19.5 GiB each way) against 7 and 6 on 697590ad, card copies 3.4 to
5.0 ms, fps 23.1 to 22.6, frames over 100 ms 36 to 41.

- Whatever RAM is free, of each class as many spares stay as were in
  use at once in the window (a class shrinks only when it went unused
  for all of it), and at least what the window's busiest moment needed
  at once less what is in use at the sweep, or the hot floor. Only
  spares beyond that are held to kept() scaled by the free RAM.
- Send memory past 256 MiB is made at its own size (64 KiB steps) and
  let go as soon as its submission has run, not kept nor counted in what
  was in use: at load one of 2112 MiB was made and dropped by a sweep.
  From 64 to 256 MiB, 64 MiB steps as before.

host::send: a walk whose sends move across sizes, three frames in the
air, with 0, 0.5 and 16 GiB free: 13 made in the first second, none
after (the rule of 1ecaa98a, modelled the same way, made one again every
second with 224 MiB of spares). Not run in game.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 12:35:57 +03:00

15 KiB
Raw Permalink Blame History

GPU residency bug journal

2026-11-30, local time

  • The submission send spares were made again every second on a 32 GB PC. 158d3177 trimmed them to the 16 MiB hot floor at every sweep under host memory pressure, and with the title at ~31 GB private a 32 GB PC is under pressure for good (free RAM under 5 GB), while a frame sends ~46 MB (VICTORY_SEND_OWN): the next frames made the upload buffers of 8-64 MiB again. Walking (RTX 5080, 9800X3D, Series X at 1440p) the trim took ~71 ms of the sweep each second, single sweeps 79-98 ms of the submitting thread; the card copies went from 3.4 to 6.6 ms a frame, with the fresh buffers counted there, and page-ins were 2-4 times as many. Under pressure the spares now keep, whatever RAM is free, of each size as many as were in use at once in the last 10 sweeps (VICTORY_SEND_KEEP_SECONDS; 0 is the floor alone, as before), so a size shrinks only when it went unused for the whole window, and at least what the window's busiest moment needed at once less what is in use at the sweep, or the hot floor; only spares beyond that are held to kept scaled by the share of 8 GiB of RAM that is free. Holding all of them to that scaled line brought the churn back, since play leaves 0.1-0.8 GB free on that PC: 524 buffers made and 522 let go in 300 s (19.5 GiB each way) against 7 and 6, card copies 3.4 to 5.0 ms. Send memory past 256 MiB (world load: one of 2112 MiB) is made at its own size and let go as soon as its submission has run, never kept: kept, a burst's buffers held 640 MiB for the window on a PC that paged heavily. From 64 to 256 MiB it is made in 64 MiB steps, not by doubles. All go at critical commit as before, and the small host's cap (kept) is unchanged. Those let go are released on a thread of their own (victory-send-free), not on the submitting thread, and a line at the sweep says what was made and let go when anything was.

2026-11-29, local time

  • #1496, a refused first upload does not spend the window. The first-upload window set itself to the cap whole when its first request came in past the cap: the request was refused, but the smaller faces of the same window were starved for the window's rest. A refused request spends nothing now, and those faces still go. The past-budget guard that shares this reproduction — first uploads fit a free range that exists now — is on main already (pool::texture_widest_free).

2026-11-28, local time

  • #1520, small hosts of RAM: the L0 caches of ours scaled down, the windows cap back by itself. A 16 GB PC reached Windows' 8 GiB shared-memory cap in ~95 s of world load (0x8007000E on a host command list): the launcher's under-24-GB auto of 85a529b was lost when the script became a shim (22c6be2), and the L0 caches added since only know the 32 GiB line (limited_host_ram). New residency::small_host_ram() (< 24 GiB; unreadable RAM is not small), and every default it sizes keeps its switch: the buffer pool off (a 64 MiB L0 block sits there until it is empty whole), VICTORY_UPLOAD_POOL_MB 128 (was 1024), VICTORY_EXACT_POOL_MB 64 (was 256), VICTORY_BUFFERS_AHEAD 512 (was 4096) with its refill paused while the memory is pressured or commit critical, the submission send spares 128 MiB (was 768) and trimmed by the sweep with the copy sources' spares. The windows cap (VICTORY_WINDOWS_BAR_MB) is 3072 on a small host by itself again, at the window reader in shadow.rs, so every start path gets it; an explicit value decides as before. While the memory is short the spares keep a 16 MiB hot floor, all gone only when commit is critical: on a 16 GB PC the pressure never clears, and wiping whole at 1 Hz made each second's first copies wait for fresh allocations. victory-gpu lib suite 552 passed, 0 failed, 43 ignored (three new tests, one reshaped for the small host).

  • The two-plane present fallbacks locked themselves out. The three error paths of present_planes — the composer not made (before and after a resize) and a composite recording that failed — "dropped" the presenter by dropping the &mut Option<Presenter> they had of it, which does nothing, and then recursed into present_planes, which locks the presenter mutex again: the thread hung instead of showing the base plane (std::mem::drop on a reference; three of Clippy's warnings). The mutex guard goes back before the fallback now (drop(presentation)); the three warnings are gone, and with them the last easy self-deadlock on the present path. Found reading the warnings of a plain cargo check of the tree.

2026-11-25, Pacific time

  • 15:38, source verification. The default Play-VIctory.cmd and its fast selector use the same local release. Its SHA-256 matches the build from pareto-rtx-fast at fabb872. The live window showed 81.4 ms/frame for an interval with 4,463 draws/frame. This observation has no controlled scene match.
  • 15:39, descriptor lifetime and idle pools. Moved the bindless buffer sweep and its previous ranges onto their owning host heap. A list holds each stride buffer it uses. A deferred sweep verifies the stride buffer identity before reading a heap. The periodic budget check can now drain expired pieces and trim completely free blocks from the texture and upload pools. Busy allocators retry on their next opportunity.
  • 15:41-15:42, initial comparison. Both releases used fresh copies of the same opening save and warmed cache. The first comparison stopped each process when Windows commit headroom dipped below 2 GiB. Neither reached the 1,000 draws/frame threshold. The baseline reported 4,241 MiB of live texture staging, 277 MiB of commit headroom and 7,648 MiB of free physical memory in its pressure log. The first candidate reported 2,870 MiB of staging when it first signaled pressure, at a different frame. Those samples cannot quantify memory savings.
  • 15:45, staging admission. The pressure cap had applied before catch-up tripled the budget, and early prefetch could add its own allowance. On auto settings, the final shared budget now limits speculative staging to 16 MiB/frame under pressure or 32 MiB/frame on a limited-RAM host with at least 1 GiB of live staging. A single texture can cross the limit. Required material bakes keep their existing budget and explicit stage-budget overrides take precedence. The maintenance pass also releases all eligible spare staging blocks under host pressure. Release GPU suite: 329 passed, 34 ignored.
  • 15:46-15:48, release comparison on the RTX 5090. Repeated from the same copied save and the same initial cache with the normal Pareto rendering settings. Allowed transient Windows commit dips and stopped after 15 distinct title-bar intervals with at least 1,000 draws/frame. Baseline median 64.2 ms/frame, candidate 54.8. Both reached 50 ms or better in four intervals. Median draws/frame were 2,868 and 2,839. Peak process commit was 27.15 and 26.12 GiB. Sampled peak whole-adapter use was 18.67 and 17.45 GiB. The two runs progressed at different rates and window capture overlapped part of the baseline, so this pair is directional.
  • 15:49-15:50, visual verification. Window capture confirmed the candidate renders the opening street and characters with textures and colored lighting. In this longer capture run the median was 57.7 ms/frame over 23 heavy caption intervals, six at or below 50 ms. The slowest interval was 566 ms, peak process commit was 28.74 GiB, and sampled whole-adapter use peaked at 19.12 GiB. The original GDI captures returned white surfaces; Windows Graphics Capture returned the game image. PresentMon produced no events in this session, so there is no individual-present latency distribution. The two controlled releases used the same general shader and material paths. Wave64-to-Wave32 translation warnings remain in the logs. Sustained 50 ms/frame and full material coverage remain open.
  • Local build. The optional launcher selector is pareto-residency. SHA-256 4d5f1e9a0aa6d13c96dfdf69526c3128077588ed4f18df81f16bf3c8b3afc191. Comparison receipts and window captures are under ../XCL-frame-timing/pareto-residency-comparison relative to the checkout.
  • 15:53, manual run. Windows returned E_OUTOFMEMORY (0x8007000E) for a series of 64 MiB pool requests and individual uploads as small as 24,080 bytes. Rust subsequently aborted on a 786,432-byte allocation. The pasted log does not identify the Rust allocation site or a particular resource as the initial cause.
  • 15:56–15:59, reproducer and repair. Replayed eight reported upload sizes through the release pool with a failing block allocator. The unpatched test made eight block creation attempts in one burst. Each pool now backs off growth for 500 ms after a failed creation while still reusing space in its existing blocks. An out-of-memory return from host upload or texture allocation interrupts the descriptor texture sweep, leaving interrupted work eligible for retry. The sweep checks available Windows commit at most once per 32 ms, including during a long pass. It defers ordinary prefetch below 4 GiB and bake prefetch below 2 GiB; explicitly bound textures can still request upload memory. GPU unit and device suite: 331 passed, 34 ignored.
  • 16:00–16:03, first opening-save retest. Windows Graphics Capture showed a character, textured buildings and street lighting. The log contained no failed upload-buffer allocations or Rust allocation aborts. The harness timed out during shutdown and lost its timing receipt. The renderer logged a dropped draw due to exhausted dynamic descriptor slots.
  • 16:04–16:07, confirmation and install. From a fresh copy of the opening save, the release ran 135 seconds after the first interval above 1,000 draws/frame and remained live until the harness closed it. Peak process commit was 34.42 GiB; the lowest sampled Windows commit headroom was 1.30 GiB. Zero E_OUTOFMEMORY returns and zero Rust allocation aborts appeared in the log. Across 120 high-draw caption intervals the median was 54.3 ms/frame, with 39 at or below 50 ms. The descriptor-slot warning recurred. Installed and hash-verified the release behind the existing pareto-residency selector. SHA-256 d580328bf90fe54e643dad60c04481d7e4b0d7134b9b6ce70c5e0f5c77ff3cf1. Receipt and log: ../XCL-frame-timing/pareto-residency-comparison/oom-confirm/.
  • 16:50–18:20, facial deformation & wrapped meshes (d16 + table strides). Added zero-sweep table view-kind lookup (SLOT_TABLE_STRIDES = 252, heap_strides) and dynamic descriptor slot stride population in descriptor/host.rs, plus NVIDIA-valid typed integer lowering (bufferLoad.i32/bufferStore.i32 on VIEW_INTEGER/VIEW_SIGNED). Initially applying typed integer branching to non-d16 typed loads caused shader regressions; restricting integer branching to buffer_load_format_d16_* and buffer_store_format_d16_* restored clean shading while keeping VICTORY_TRANSLATOR cache-compatible with tools/cache-pareto (made=0).
  • 19:15–20:30, commit-gate starvation & synchronous bake uploads. Lowered commit reserves (has_upload_reserve: 256 MiB bake / 512 MiB non-bake; has_growth_reserve: 256 MiB bake / 1024 MiB speculative bindless; pressure entry 3 GiB RAM / 4 GiB commit, recovery 5 GiB / 6 GiB), scoped 64 MiB staging-block growth gating in pool.rs (REST = 2500 ms) to speculative bindless only, expanded bake detection (BAKE_GEOMETRY_SHADERS, ahead::drain, BAKE_PAGE_WRITTEN), and routed one-shot ped/decoration bake uploads through a dedicated synchronous host list (BAKE_UPLOAD / execute_sync_internal) with post-upload descriptor publication (prepare_bake_slot / publish_uploaded_slot). GPU suite: 335 passed, 34 ignored.
  • 20:50–21:10, alias-flood experiment reverted & clean release built. Propagating aliased view maps/unmaps into REMAPPED and widening bake lookahead caused 2–4 GiB bake-pass truncations on frames 1368–1369 (cap_alias_fix_rel, median 70.5 ms in diagnostics capture, face-mask/shorts regression) and was reverted. Rebuilt clean release binary target/release/victory.exe without the alias flood (SHA-256 38e99f1b1d6bafda2ff8de74d6566af06bc7e8cab70594d841af01752e501d73); installation into Downloads/game/victory-3d-rtx-pareto-residency.exe deferred while user-launched PID 13544 holds the file open.
  • 21:30–22:28, transmission prefilter Wave32 recovery, texture-starvation & scene-blinking fixes. Diagnosed four linked regressions on RTX 5090 (32 GiB RAM): (1) alphaResolve:CS_AlphTransmissionPrefilterMip_610a2fad (2da4beb386509b77) was dropped under Wave32 without_early_outs because resource::Tracer::descriptor() and live() omitted per-instruction lanes.guards[b][i] when pruning dead join edges, leaving transmission buffer 0x17dff443d70 zeroed and causing ptfx_PS_Transmission_aba1527f (dual-source blend) and transmissive eye/alpha shaders to output black squares / corrupted blending; fixed in crates/victory-shader/src/resource.rs (VICTORY_WAVE_WIDE intentionally kept off due to known loop-widening TDR risk). (2) Completed submissions kept Detached._state dynamic descriptor slots pinned across bury_lag() (16 submissions) in host.rs (relay_land, settle), exhausting NVIDIA's 262k dynamic slot pool and dropping draws; added Detached::release_tables() right on GPU completion plus a settle_for_fence() retry in draw.rs, and defaulted VICTORY_INDIRECT_REST=0 in indirect.rs so one oversized indirect record does not zero out subsequent draws. (3) Split residency throttling into mild pressure vs. critical_commit() (< 1536 MiB commit or upload refusal) across residency.rs, texture/ahead.rs, and pool.rs so VICTORY_UPLOAD_AHEAD, 64 MiB/frame prefetch, and one spare staging block stay active under mild 32 GiB pressure instead of stalling tens of thousands of textures on neutral(); fixed descriptor/host.rs (prepare_bake_slot, publish_uploaded_slot) and draw.rs (flush_for_bake) so pending bake slots are never prematurely overwritten with neutral() or silently dropped on defer/unmapped pages, and removed false address=0x0 unordered-SRV warning spam. (4) Scoped VICTORY_AMBIENT_AIR=1.5 to pareto-residency in Downloads/game/Play-VIctory.cmd to clear milky indoor ambient haze. Verification: victory-shader lib suite 281 passed, 0 failed, 4 ignored (including new a_guarded_access_excludes_dead_lane_edges_at_a_join); targeted victory-gpu suite 20 passed, 0 failed; RTX 5090 translate --jobs 1 --validate --pipelines on 154 VFX/particle/eye shaders emitted & validated 43/43 graphics + 96/111 compute pipelines (recovering CS_AlphTransmissionPrefilterMip, 0 regressions). Deployed release binary to Downloads/game/victory-3d-rtx-pareto-residency.exe, SHA-256 37a410b13fcd5ef4cecfe2c27761b7132af64b00019a07c9256529b96892d7da.