Skip to content

Ray tracing: no arena storm when the low range is full (the 30 s watchdog crash); reserve the arenas' room at the start - #88

Merged
trustno1-coder merged 1 commit into
trustno1-coder:mainfrom
Yorivel:fix/rt-arena-room
Nov 27, 2026
Merged

trustno1-coder merged 1 commit into
trustno1-coder:mainfrom
Yorivel:fix/rt-arena-room

Conversation

@Yorivel

@Yorivel Yorivel commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

With the structure builder on (VICTORY_BVH_BUILDER=1), ray tracing ended 1-3 minutes in at +0x23cf683 (write to 0x0). That address is the title's own hang watchdog: it fires when no frame has been presented for 30 s. Not a bad pointer.

Cause: an arena storm.

  • memory::ready asks for another arena (Memory::another, 64 MiB through upload::reserve) at every build dispatch while the spares are low.
  • Once the low range [4 GiB, 2^37) had no 64 MiB gap left (19 arenas on this PC), nothing remembered the failure.
  • Every one of the thousands of build dispatches a frame searched the address range again, under the MEMORY lock.
  • A profile showed the recording threads ~70 % in the kernel under VirtualAlloc2, frames of 7-32 s, then the watchdog.

Changes

  • Memory::another: after a failure, no other arena is tried before the next frame. The reason is logged (no room, or its copy could not be made), and a reservation whose copy could not be made is released.
  • upload::reserve_early, called at host creation: when the builder is on, 50 reservations of 64 MiB (VICTORY_LOW_EARLY_MB, 3200; 0 off) are made in the low range with write watch, before the title fills it. An arena commits one of them before it looks for room. They are separate pieces because, as one 3.2 GB reservation, the submissions' write-watch askings walked all arenas in single runs, about 2 ms a frame more.

Measured (RTX 4090, prison area, ray tracing on, frame generation off, 30 fps cap)

before after
arenas stuck at 19 28
pages a frame read as zeros (no copy), settled ~280-650 ~18
watchdog end 1-3 minutes in none in several sessions
steady fps after the first minute n/a 22-28

The first minute or two of a new area still stutters (waits for flights while the builder works). See the comments on #57 for what we found there.

Related, not in this PR: victory warm without VICTORY_BVH_BUILDER=1 skips the CS_RaytracingResolve pipelines (make.rs's leave-out), yet writes them into warm-done.txt, so later warms never make them. With VICTORY_BVH_BUILDER=1 victory warm --again --used the start-up RT pipeline builds (~670 "being made") went away. A separate small PR follows for that.

Testing

  • cargo check on this branch (rebased on 29d8dbf).
  • Played on the 959dcaf base with these two files, in several sessions of 3-10 minutes.
  • One unrelated-looking crash (+0xc18d1a, read 0x159c) was seen once in those sessions and did not repeat.

🤖 Generated with Claude Code

… its room at the start

With the structure builder on (VICTORY_BVH_BUILDER=1), memory::ready asks
for another arena at every build dispatch while the spares are low. Once
upload::reserve could find no 64 MiB gap in [4 GiB, 2^37), nothing
remembered it: every one of thousands of dispatches a frame searched the
address range again under the MEMORY lock (the recording threads ~70 % in
the kernel under VirtualAlloc2), frames took 7 to 32 s, and the title's
own hang watchdog (the store to 0 at +0x23cf683) ended the run.

- Memory::another: after a failure, none is tried again before the next
  frame; the reason is logged (no room, or its copy could not be made),
  and a reservation whose copy could not be made is given back.
- upload::reserve_early, at host creation: 50 reservations of 64 MiB in
  the low range, with write watch, when the builder is on
  (VICTORY_LOW_EARLY_MB, 3200; 0 off). An arena commits one of them before
  looking for room. Separate pieces, not one 3.2 GB reservation: as one,
  the submissions' write-watch askings walked across all arenas in single
  runs, about 2 ms a frame more.

RTX 4090, prison area, ray tracing on, frame generation off:
- before: stuck at 19 arenas, ~280-650 pages a frame read as zeros,
  watchdog crash 1-3 minutes in;
- after: 28 arenas, ~18 pages a frame once settled, no watchdog crash,
  22-28 fps (30 cap) after the first minute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ProjectsbyDrew pushed a commit to ProjectsbyDrew/VIctory-NVIDIA that referenced this pull request Nov 27, 2026
…overflows

Audio, watch: no overflow on huge title sizes (XMA read advance, fread)
@trustno1-coder
trustno1-coder merged commit c5f7528 into trustno1-coder:main Nov 27, 2026
trustno1-coder added a commit that referenced this pull request Nov 27, 2026
…ersion, VICTORY_HOME

- upload.rs: 32 pieces of 64 MiB at the top of [4 GiB, 2^37) are reserved first
  thing in main, before the process's allocations can fill that window. On
  players' PCs it was full by the first ray-traced frame, the first upload
  failed and the title threw "D3D12 XDXR Error: Failed to allocate upload
  buffer". Past the pool: the window as before, a failed search not repeated
  for a second (with PR #88's per-frame limit in memory.rs), then the heap
  instead of null.
- main.rs: D3D12SDKVersion follows the version of D3D12\D3D12Core.dll beside
  the exe (a repack's 1.618 or 1.620 gave 0x887E0003 against our 614).
- VICTORY_HOME: one folder for settings, saves, caches, logs and downloads
  (a full C: drive, issue 135).
- README: both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mikeyoubeach pushed a commit to mikeyoubeach/VIctory-NVIDIA-Turing that referenced this pull request Nov 27, 2026
Brings in the upload room reserved at the start (PR trustno1-coder#88), the view table
leak fix (PR trustno1-coder#58), the DSP mono convolver (PR trustno1-coder#77), AMD FSR 3 frame
generation, the Windows 10 runtime download, VICTORY_HOME and the D3D12
folder of any version.

Conflicts kept both sides: our Series S default and the Turing switches in
play.rs and play-foxhound.ps1, the key capture and our menu test beside the
new preload/MFG lines, Reflex and DLSS Ray Reconstruction beside FSR 3 frame
generation in streamline.rs, the HDR swap chain call in host.rs, and the
Turing notes at the top of the README over upstream's new sections.

upload.rs takes the new early reservation as its frame and keeps our
VICTORY_UPLOAD_LOW=0 (straight to the process heap) as the default, plus
VICTORY_DISPLAY_WIDE and reserve_out_of_reach for the wide output.
MfDev0 pushed a commit to MfDev0/VIctory-NVIDIA that referenced this pull request Nov 27, 2026
Port the recycled ray-tracing fault-page budget from fxceless/victory-fork commit 3e573d2556adc5a5b22ccd2d6d92231a72ee55bb (including the fault-miss breakdown from 52dfd12 carried in 3e573d2) into crates/victory-gpu/src/memory.rs while preserving PR trustno1-coder#88 (30b979e) in Memory::another.
iGlideForever pushed a commit to iGlideForever/VIctory-iGL-NVIDIA that referenced this pull request Nov 27, 2026
…top, without the MFG Unlocker download

From trustno1 main df2daaf:
- PR trustno1-coder#58: placed views ignore the resource description's padding words and
  the view words their kind does not use (views leak, confetti on faces); at
  most a million table entries of views no resource releases.
- PR trustno1-coder#88: memory by address, no arena storm when the low range is full; its
  room is reserved at the start. Upload room reserved at the start too.
- PR trustno1-coder#77: audio DSP mono convolutions (TVs, phone calls, reverb).
- AMD FSR 3 frame generation for cards without DLSS frame generation, the
  start notice, F1 preload fix, warm-up restart, Windows 10 runtime
  (D3D12SDKVersion export, d3d12.dll loaded on first use), crash fixes,
  launch fixes, README and the needs-logs workflow.

Left out: 0cef07e ("MFG Unlocker as an F1 option: downloaded and loaded at
start when on") is reversed in this merge. It fetched a third-party mod
from a personal GitHub release and loaded it into victory.exe; this branch
builds from source only. 10862a6's notice stays: it only names DLLs that
sit beside victory.exe in place of Windows' own, in the log and on screen.

Kept, read before merging: scripts/get-amd-fsr.ps1 (AMD's FidelityFX DLLs
from AMD's GitHub) and scripts/get-d3d12.ps1 (Microsoft's D3D12 runtime from
nuget.org), each pinned to a SHA-256 and run only by hand or after a yes/no
question; apps/victory/build.rs (linker arguments only).

The merge had no conflicts. Our launcher settings stay (texture room 88/90 %
with DLSS frame generation; FSR's 80/86 % applies only when nothing set it).

Tests: victory 24, victory-gpu 431, victory-hle 175, victory-shader 290
passed; the two indirect.rs GPU tests that fail on bee30bc fail the same.
diag build made.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kemerd pushed a commit to Kemerd/VIctory-NVIDIA-RT that referenced this pull request Nov 28, 2026
Kemerd pushed a commit to Kemerd/VIctory-NVIDIA-RT that referenced this pull request Nov 28, 2026
…ersion, VICTORY_HOME

- upload.rs: 32 pieces of 64 MiB at the top of [4 GiB, 2^37) are reserved first
  thing in main, before the process's allocations can fill that window. On
  players' PCs it was full by the first ray-traced frame, the first upload
  failed and the title threw "D3D12 XDXR Error: Failed to allocate upload
  buffer". Past the pool: the window as before, a failed search not repeated
  for a second (with PR trustno1-coder#88's per-frame limit in memory.rs), then the heap
  instead of null.
- main.rs: D3D12SDKVersion follows the version of D3D12\D3D12Core.dll beside
  the exe (a repack's 1.618 or 1.620 gave 0x887E0003 against our 614).
- VICTORY_HOME: one folder for settings, saves, caches, logs and downloads
  (a full C: drive, issue 135).
- README: both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eleboucher pushed a commit to eleboucher/VIctory-NVIDIA that referenced this pull request Nov 28, 2026
…overflows

Audio, watch: no overflow on huge title sizes (XMA read advance, fread)
eleboucher pushed a commit to eleboucher/VIctory-NVIDIA that referenced this pull request Nov 28, 2026
…overflows

Audio, watch: no overflow on huge title sizes (XMA read advance, fread)
Kikoarl added a commit to Kikoarl/VIctory-NVIDIA that referenced this pull request Nov 28, 2026
…ine Port VICTORY_POOL_GATE from fxceless/victory-fork commit 2eade68cade9b2f8cd2511cc97328e83f58508c3 onto trustno1-victory main (63b902f).  - pool, resource: make a new 64 MiB texture block only while card real use + block + buffer-copy reserve + render targets still to come stays at or under the texture line (VICTORY_POOL_GATE=0 disables); otherwise reuse free pieces or defer waitable heap textures, keeping 2-5% + one block free during idle sweeps so the gate does not deadlock. Support fullest-block-first placement (VICTORY_POOL_FULLEST; launcher keeps first-fit).  - draw, host: defer heap texture slots with no free piece when the gate closes, track HEAP_TEXTURES_NO_PLACE and pool::BLOCKS, and log 'texture blocks: ...' alongside room_terms.  - shadow: enforce targets_to_come reserve in by_address_room for title memory by address (memory.rs routes arenas through shadow::by_address on main, so no memory.rs change is needed and PR trustno1-coder#88 is preserved).
whoalin1 added a commit to whoalin1/victory-altracing-prs that referenced this pull request Nov 28, 2026
whoalin1 added a commit to whoalin1/victory-altracing-prs that referenced this pull request Nov 28, 2026
…s, PRs trustno1-coder#697/trustno1-coder#614/trustno1-coder#700/trustno1-coder#666

- upload.rs: set default VICTORY_LOW_EARLY_MB=0 (restores bright bedroom & cuts stray faults while retaining explicit override + trustno1-coder#88 arena backoff)

- host/panel.rs & shadow::register: port Spaghetih/victory-sley-fork 6d813b4 (panel COPY_SOURCE->COPY_DEST barrier via uploaded flag; retire replaced shadow entry)

- descriptor.rs: port PR trustno1-coder#666 (FxHasher FastMap, split VIEW_SHAPES RwLock, forget early-out)

- watch.rs/host.rs/shadow.rs: port PR trustno1-coder#697 (per-range ask holds), PR trustno1-coder#614 (lock-free atomic shadow copied + ReadJournal + wide_chunks + word_runs + deferred coalescing), PR trustno1-coder#700 (keep 4 MiB chunk in scratch_any_size)

- shadow::land_tests: drop JournalRead before calling watch::nothing_new to prevent Windows SRWLock recursive read deadlock
SplenectomY pushed a commit to SplenectomY/VIctory-NVIDIA that referenced this pull request Nov 28, 2026
…GPURT node answer

Port the portable pieces of fxceless/victory-fork commits 17533c5, 1170216, 1320dfd, and 9a9091d onto trustno1 main (f3534e6):

- victory-shader: enable USER_DISPATCH_THREADS_X guarding for spilled 1D compute programs on 32-lane waves and programs with barriers by adding partial_active/effect_guard instead of early return when threads must stay for s_barrier or two-wave exchanges (after 1320dfd).

- victory-shader: check exact operand dwords in lane_uniform (full dwords on scalars, exact VGPR dwords except v_movrel/v_swap), widen ordered/stable uniform ds_read checks beyond ds_read_b32, and mask v_readfirstlane_b32 with partial_active when halves are alike or guarded (after 1170216, 1320dfd).

- victory-shader: return [u32::MAX; 4] (-1 per AMD GPURT) for instance and procedural BVH nodes (kinds 6 and 7) in bvh::intersect and emit::intersect, and use effect_guard for BVH intersection loads (after 9a9091d).

- victory-gpu: extract Location (words 4-5) for placed as well as shader acceleration-structure views in view_address, returning None when zero (after 9a9091d).

Adaptations for main: 17533c5 (VICTORY_WAVE_PAIRS_SPILLED) is inapplicable because main uses halves/exchange/pairs without paired.rs; 9a9091d memory sync/written-page tracking is omitted because main already uses arena Shadow::by_address sync (preserving PR trustno1-coder#88 and PR trustno1-coder#58) and VICTORY_BVH_BUILDER remains opt-in (=1).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants