[GPU][HLE] Hardware ray tracing: DXR 1.1 structures for XboxBvhBuilder and traversal loops lifted to RayQuery (VICTORY_HW_RT, off) #3706

Manually merged
github merged 12 commits from github-bot/gh-3706 into main 2026-11-30 14:14:26 +00:00 AGit
Owner

@⁠dyshay on GitHub · 2026-11-30 04:23 UTC · original
dyshay:pr/hardware-rt → main · +13991 −23 · 37 files · 12 commits · merged 2026-11-30 14:12 UTC

Closes #3704.

What it changes

Off by default: nothing changes unless VICTORY_HW_RT=1 is set. With it, on a card with DXR 1.1:

  • Shader side (victory-shader, emit/rayquery.rs, mounted in lower.rs): the console's traversal loops of the title's ray-tracing compute programs (image_bvh64_intersect_ray loops, and image_bvh_intersect_ray pairs) become DXR 1.1 RayQuery code where every value they leave behind is accounted for. A loop that is not keeps the software walk (intersect.rs), loop by loop; a program whose lifted form the lowering refuses is lowered again without lifting, whole. shader.rs gets the RayQuery DXIL calls and root RaytracingAccelerationStructure SRVs at t230..=t241 (230-249 are free in this tree; the original's t240.. collides with our 250-252 views), shader flag bit 25. HostShader.ray_queries records what was lifted; the shader cache keys on the switch only when it is on and stores the record after the rest only for a program that has one, so existing caches are served as before.
  • Host side (victory-gpu hwrt.rs, victory-hle modules/xboxbvh.rs): the title's XboxBvhBuilder.dll is replaced by an HLE module (its 12 exports by name; no title bytes, no loader hooks). Its calls become host bottom and top levels keyed by the console structure's GPU address: refits, a scratch pool, an empty top level until one is built, an instance-remap compute pass, the quantised-vertex and meshlet-index decoders, eviction when the title frees memory, and title memory materialised before VirtualQuery (so soft views do not hide the vertex and index buffers). Its operations go through list::external (in the list's order with VICTORY_THIN), and the title's compute binding is set again after the remap dispatch. draw.rs binds t230..t241 to the host structure named by the table's descriptor; the descriptor heap gets RTAS views and refreshes them.
  • Exclusive with VICTORY_BVH_BUILDER=1: the DLL is replaced, so the title's builder cannot run. With both set the hardware path is kept and the builder's switch is made 0 at load, with a warning. The pipeline left-outs treat the hardware path as the builder (CS_RaytracingResolve and the dead-RT policy keep running).
  • Light stand-ins: the ambient estimate and the reflection stand-in (ambient.rs, mirror.rs) stand aside when the hardware path is up, as they do when the builder runs (pipeline::rays_found). Unchanged without the switch.
  • F1 menu: a HARDWARE RAY TRACING item (off).
  • Counters: per program, ray queries lifted N of M (bvh64 a/b, bvh32 c/d), fell back: <reason>; every five seconds, programs lifted whole / partly / not at all with their dispatches a frame, and BLAS/TLAS live, builds, refits, evictions and structure memory. VICTORY_HW_RT_WHY=1 (=2: more) logs why a loop is not lifted; VICTORY_HW_RT_REFIT=0 rebuilds dynamic bottom levels instead of refitting them.

Not taken from the source branch: its replaced translator crate as a whole (only the lifting is mounted here), its loader hooks, its indirect.rs vendor change, its panel HUD, its adapter choice in emit/host.rs, and the diagnostics breadcrumbs (a stub there). Manley.B's texture re-register (c8f08560), which the source branch carried in the same commit, is already in main.

How it was tested

Unit tests (CPU and WARP):

  • a lone node test is found, not lifted, says why, and the program is byte-for-byte what it is with the switch off;
  • a RayQuery program as emit_ray_query builds it validates in dxil.dll and makes a compute pipeline on WARP with the structure as root SRV t230;
  • the lift classes counted per program (hwrt.rs);
  • an ignored test counts a local known-shaders.bin (VICTORY_KNOWN_SHADERS, never in the repository): on one PC's cache, 64 ray-tracing programs, 50 lifted whole, 6 partly, 7 not at all (bvh64 loops with two node tests each), 1 not translated; loops lifted bvh64 58 of 98, bvh32 299 of 315; every lifted program validates.

On the card: RTX 4090, Windows 11, diagnostics build, the house scene, 300 s each, VICTORY_HW_RT=1 VICTORY_BVH_BUILDER=0 against VICTORY_BVH_BUILDER=1:

Run Median ms p95 ms GPU ms
Series S, hardware, run 1 37.4 57 19
Series S, hardware, run 2 35.0 60 19
Series S, hardware, run 3 36.2 55 19
Series S, software walk 43 to 94
Series X 1440p (DLSS Quality), hardware 46.2 25
Series X 1440p (DLSS Quality), software walk 69.6

Every hardware run: 13 ray-tracing programs lifted whole, none fell back, 4,193 bottom levels live, no device loss. The software walk's spread comes from a slow state: after a camera cut six traversal programs take 2 to 9 times as long.

Checks on this branch: the three code commits apply onto main without conflicts; it builds with --profile diag --features diagnostics; the targeted tests pass (victory-shader rayquery/intersect/bvh: 31, victory-gpu hwrt, victory-hle). The full cargo test --workspace and the -D warnings clippy gate were not run here (main already fails -D warnings in victory-shader and victory-loader before this change).

Not tested: other NVIDIA generations, AMD RDNA 2+, cards with 8 to 12 GB (bottom-level memory), Linux/Proton. The issue lists what would help.

Checked for overlap

Searched open and closed PRs and issues for hardware DXR, RayQuery, xboxbvh, XboxBvhBuilder, dakisback2, HWRT, VICTORY_HW_RT, DXR 1.1, hardware ray tracing, RT cores, TraceRayInline, acceleration structure and BLAS:

  • #1370 (open issue, Yorivel): with ray tracing on, the translated XboxBvhBuilder programs take over half of the card's frame on an RTX 4090; it reports native DXR prototype results but no PR came from it. This PR replaces those programs with host DXR builds.
  • #3071 (VICTORY_BVH_LOG=1, notes what the title's builder is asked) and #3265 (the builder's geometry buffers made ready before it reads them): the software builder, which this leaves as it is when the switch is off. If #3071 lands first, its HLE notes and xboxbvh.rs both serve XboxBvhBuilder: only one of them can be registered at a time, and this one only with VICTORY_HW_RT=1.
  • #18 (closed, Kemerd): ray-tracing groundwork among other things, not DXR structures.
  • No PR ports hwrt.rs, xboxbvh.rs or rayquery.rs.

Provenance

  • Ported from Leslie-d-a/VIctory-NVIDIA-HWRT (branch hwrt at 7fdb87fa): 570a7f7c (the translator with the RayQuery lifting), 61e389e0 (hardware DXR 1.1 and its glue), 5f55bca8 (title memory materialised before VirtualQuery under soft views), and that repository's PROVENANCE.md.
  • Original work by dakisback2 in dakisback2/VIctory-Nvidia-Linux: 85b0b11b (the translator), ecc49d5b ("add opt-in hardware DXR 1.1 RT-core raytracing") and 72f8316a ("lift all remaining bvh64 queries, enable DXR 1.1 BLAS refits"). 61e389e0 also carried Manley.B's c8f08560 (texture re-register), which is already in main and not part of this PR.
  • Adapted to this tree here: Reg::V width, root slots t230..t241, list::external in place of a list op of its own, exclusivity with VICTORY_BVH_BUILDER, the stand-ins, the counters and the tests above.
  • GPL-3.0, as the whole lineage.

AI-assisted: the port, the adaptation and the tests were written with Claude Code (Anthropic) at my direction; I reviewed the changes and ran the measurements above on my card.

Co-authored-by: dakisback2 [email protected]
Co-authored-by: Leslie-d-a [email protected]

🤖 Generated with Claude Code

https://claude.ai/code/session_01PVi6XmTj4ohPL7QwUeFgV4

**@⁠dyshay** on GitHub · 2026-11-30 04:23 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706) `dyshay:pr/hardware-rt` → `main` · +13991 −23 · 37 files · 12 commits · merged 2026-11-30 14:12 UTC Closes #3704. ## What it changes Off by default: nothing changes unless `VICTORY_HW_RT=1` is set. With it, on a card with DXR 1.1: - **Shader side** (`victory-shader`, `emit/rayquery.rs`, mounted in `lower.rs`): the console's traversal loops of the title's ray-tracing compute programs (`image_bvh64_intersect_ray` loops, and `image_bvh_intersect_ray` pairs) become DXR 1.1 `RayQuery` code where every value they leave behind is accounted for. A loop that is not keeps the software walk (`intersect.rs`), loop by loop; a program whose lifted form the lowering refuses is lowered again without lifting, whole. `shader.rs` gets the `RayQuery` DXIL calls and root `RaytracingAccelerationStructure` SRVs at `t230..=t241` (230-249 are free in this tree; the original's `t240..` collides with our 250-252 views), shader flag bit 25. `HostShader.ray_queries` records what was lifted; the shader cache keys on the switch only when it is on and stores the record after the rest only for a program that has one, so existing caches are served as before. - **Host side** (`victory-gpu` `hwrt.rs`, `victory-hle` `modules/xboxbvh.rs`): the title's `XboxBvhBuilder.dll` is replaced by an HLE module (its 12 exports by name; no title bytes, no loader hooks). Its calls become host bottom and top levels keyed by the console structure's GPU address: refits, a scratch pool, an empty top level until one is built, an instance-remap compute pass, the quantised-vertex and meshlet-index decoders, eviction when the title frees memory, and title memory materialised before `VirtualQuery` (so soft views do not hide the vertex and index buffers). Its operations go through `list::external` (in the list's order with `VICTORY_THIN`), and the title's compute binding is set again after the remap dispatch. `draw.rs` binds `t230..t241` to the host structure named by the table's descriptor; the descriptor heap gets RTAS views and refreshes them. - **Exclusive with `VICTORY_BVH_BUILDER=1`**: the DLL is replaced, so the title's builder cannot run. With both set the hardware path is kept and the builder's switch is made `0` at load, with a warning. The pipeline left-outs treat the hardware path as the builder (`CS_RaytracingResolve` and the dead-RT policy keep running). - **Light stand-ins**: the ambient estimate and the reflection stand-in (`ambient.rs`, `mirror.rs`) stand aside when the hardware path is up, as they do when the builder runs (`pipeline::rays_found`). Unchanged without the switch. - **F1 menu**: a HARDWARE RAY TRACING item (off). - **Counters**: per program, `ray queries lifted N of M (bvh64 a/b, bvh32 c/d), fell back: <reason>`; every five seconds, programs lifted whole / partly / not at all with their dispatches a frame, and BLAS/TLAS live, builds, refits, evictions and structure memory. `VICTORY_HW_RT_WHY=1` (`=2`: more) logs why a loop is not lifted; `VICTORY_HW_RT_REFIT=0` rebuilds dynamic bottom levels instead of refitting them. Not taken from the source branch: its replaced translator crate as a whole (only the lifting is mounted here), its loader hooks, its `indirect.rs` vendor change, its panel HUD, its adapter choice in `emit/host.rs`, and the diagnostics breadcrumbs (a stub there). Manley.B's texture re-register (c8f08560), which the source branch carried in the same commit, is already in `main`. ## How it was tested Unit tests (CPU and WARP): - a lone node test is found, not lifted, says why, and the program is byte-for-byte what it is with the switch off; - a `RayQuery` program as `emit_ray_query` builds it validates in `dxil.dll` and makes a compute pipeline on WARP with the structure as root SRV `t230`; - the lift classes counted per program (`hwrt.rs`); - an ignored test counts a local `known-shaders.bin` (`VICTORY_KNOWN_SHADERS`, never in the repository): on one PC's cache, 64 ray-tracing programs, 50 lifted whole, 6 partly, 7 not at all (bvh64 loops with two node tests each), 1 not translated; loops lifted bvh64 58 of 98, bvh32 299 of 315; every lifted program validates. On the card: RTX 4090, Windows 11, diagnostics build, the house scene, 300 s each, `VICTORY_HW_RT=1 VICTORY_BVH_BUILDER=0` against `VICTORY_BVH_BUILDER=1`: | Run | Median ms | p95 ms | GPU ms | |---|---|---|---| | Series S, hardware, run 1 | 37.4 | 57 | 19 | | Series S, hardware, run 2 | 35.0 | 60 | 19 | | Series S, hardware, run 3 | 36.2 | 55 | 19 | | Series S, software walk | 43 to 94 | | | | Series X 1440p (DLSS Quality), hardware | 46.2 | | 25 | | Series X 1440p (DLSS Quality), software walk | 69.6 | | | Every hardware run: 13 ray-tracing programs lifted whole, none fell back, 4,193 bottom levels live, no device loss. The software walk's spread comes from a slow state: after a camera cut six traversal programs take 2 to 9 times as long. Checks on this branch: the three code commits apply onto `main` without conflicts; it builds with `--profile diag --features diagnostics`; the targeted tests pass (`victory-shader` rayquery/intersect/bvh: 31, `victory-gpu` hwrt, `victory-hle`). The full `cargo test --workspace` and the `-D warnings` clippy gate were not run here (`main` already fails `-D warnings` in `victory-shader` and `victory-loader` before this change). Not tested: other NVIDIA generations, AMD RDNA 2+, cards with 8 to 12 GB (bottom-level memory), Linux/Proton. The issue lists what would help. ## Checked for overlap Searched open and closed PRs and issues for hardware DXR, `RayQuery`, `xboxbvh`, `XboxBvhBuilder`, dakisback2, HWRT, `VICTORY_HW_RT`, DXR 1.1, hardware ray tracing, RT cores, `TraceRayInline`, acceleration structure and BLAS: - #1370 (open issue, Yorivel): with ray tracing on, the translated `XboxBvhBuilder` programs take over half of the card's frame on an RTX 4090; it reports native DXR prototype results but no PR came from it. This PR replaces those programs with host DXR builds. - #3071 (`VICTORY_BVH_LOG=1`, notes what the title's builder is asked) and #3265 (the builder's geometry buffers made ready before it reads them): the software builder, which this leaves as it is when the switch is off. If #3071 lands first, its HLE notes and `xboxbvh.rs` both serve `XboxBvhBuilder`: only one of them can be registered at a time, and this one only with `VICTORY_HW_RT=1`. - #18 (closed, Kemerd): ray-tracing groundwork among other things, not DXR structures. - No PR ports `hwrt.rs`, `xboxbvh.rs` or `rayquery.rs`. ## Provenance - Ported from **Leslie-d-a/VIctory-NVIDIA-HWRT** (branch `hwrt` at 7fdb87fa): 570a7f7c (the translator with the `RayQuery` lifting), 61e389e0 (hardware DXR 1.1 and its glue), 5f55bca8 (title memory materialised before `VirtualQuery` under soft views), and that repository's `PROVENANCE.md`. - Original work by **dakisback2** in dakisback2/VIctory-Nvidia-Linux: 85b0b11b (the translator), ecc49d5b ("add opt-in hardware DXR 1.1 RT-core raytracing") and 72f8316a ("lift all remaining bvh64 queries, enable DXR 1.1 BLAS refits"). 61e389e0 also carried **Manley.B**'s c8f08560 (texture re-register), which is already in `main` and not part of this PR. - Adapted to this tree here: `Reg::V` width, root slots `t230..t241`, `list::external` in place of a list op of its own, exclusivity with `VICTORY_BVH_BUILDER`, the stand-ins, the counters and the tests above. - GPL-3.0, as the whole lineage. AI-assisted: the port, the adaptation and the tests were written with Claude Code (Anthropic) at my direction; I reviewed the changes and ran the measurements above on my card. Co-authored-by: dakisback2 <90546900+[email protected]> Co-authored-by: Leslie-d-a <70692092+[email protected]> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01PVi6XmTj4ohPL7QwUeFgV4
VICTORY_HW_RT=1 (off by default, being measured; read in
victory_shader::emit::hw_rt, keyed in the shader cache only when on): the
console's traversal loops of the ray-tracing compute programs
(image_bvh64_intersect_ray, and image_bvh_intersect_ray pairs) become DXR 1.1
RayQuery code where every value they leave behind is accounted for. A loop
that is not keeps the software walk (intersect.rs), per loop; a program whose
lifted form our lowering refuses is lowered again without lifting, whole.

- emit/rayquery.rs: the analysis and emission, taken whole and mounted in
  lower.rs (Reg::V is u16 here; callback blocks keep this tree's exit/tail
  order and whole-wave section check). Their tests read the title's shader
  cache and are left out.
- lower.rs: Lower::new_with takes the plan; the wave64/LDS analyses see only
  what the program still runs (lifted loops' LDS stack as no-meeting sites,
  no LDS when only the stack had it, lane-constant masks ignored once lifted);
  run() skips lifted blocks and emits the query at the header; dead sites and
  attribute loads in inst(); merged-query selectors in fill_phis.
- shader.rs: rq_op opcodes, the RayQuery builder calls, root
  RaytracingAccelerationStructure SRVs at SLOT_TLAS_BASE..=SLOT_TLAS_MAX =
  t230..=t241 (theirs were t240..=t251, which hold our 250-252 views; 230-249
  are free here), ShaderFlags bit 25 / SFI0 0x100000, kept by usage().
- HostShader.ray_queries (RayQueries: tlas_srvs, loops found and lifted per
  kind, the first reason one was not), encoded in the shader cache after the
  rest only when there is one (old entries read as before).
- Tests (ours): a lone node test is found, not lifted, said why, and the
  program is the same as with the switch off (both forms); a RayQuery program
  as emit_ray_query builds one validates in dxil.dll and makes a compute
  pipeline on WARP with the structure as root SRV t230; an ignored test
  counts the local known-shaders.bin (VICTORY_KNOWN_SHADERS, never in the
  repository). On one PC's cache: 64 ray-tracing programs, 50 all lifted,
  6 partly, 7 none (bvh64 loops with 2 node tests each), 1 not translated;
  loops bvh64 58/98, bvh32 299/315; every lifted program validates.

Ported from Leslie-d-a/VIctory-NVIDIA-HWRT 570a7f7c (hwrt 7fdb87fa); original by dakisback2 85b0b11b (dakisback2/VIctory-Nvidia-Linux), GPL-3.0.

Co-authored-by: dakisback2 <[email protected]>
Co-authored-by: Leslie-d-a <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PVi6XmTj4ohPL7QwUeFgV4
With VICTORY_HW_RT=1 (off by default; victory_gpu::hwrt::requested reads
the same variable as the translator):

- victory-hle modules/xboxbvh.rs replaces the 12 exports of the title's
  XboxBvhBuilder.dll (export names only; no title bytes, no loader hooks).
- victory-gpu hwrt.rs: HwRtManager builds host BLAS/TLAS keyed by console GPU
  VA (refits, scratch pool, empty TLAS, the instance-remap compute, quant24 /
  meshlet decoders, eviction when the title frees memory), with 5f55bca8's
  materialize before VirtualQuery. Their GPU tests are left out (ours: the
  lift classes). The diagnostics breadcrumbs (a stub there) are dropped.
- Its operations go through list::external (our op for work of ours in a
  title list, VICTORY_THIN order included) instead of a thin-stream op of
  their own: the title's binding is set again after the remap dispatch
  (state.replay) in place of clobber_compute.
- Exclusive with VICTORY_BVH_BUILDER: with both set the builder's switch is
  made 0 at load (warned), hardware RT kept. Pipeline left-outs treat it as
  the builder (CS_RaytracingResolve and the dead-RT policy keep running).
- draw.rs binds root SRVs t230..t241 to tlas_gpu_va of the console structure
  named by the table's descriptor (empty TLAS until built; a dispatch with no
  manager is dropped); TLAS slots stay root descriptors (pipeline/host.rs, in
  the shader-side commit).
- descriptor/host.rs: a structure's view in a heap slot is a view of the host
  structure (never a raw twin, never in the list's own views), slots noted
  and refreshed when the TLAS is built or moved (refresh_tlas_views).
- watch.rs title_memory_unmapping -> hwrt::title_memory_freed.
- F1: HARDWARE RAY TRACING (VICTORY_HW_RT), live: false.
- Counters (log every 5 s, only with the switch): "ray queries: lifted
  shaders X, partly Y, fell back Z (software); per frame ... dispatches all
  lifted / partly / none"; "hardware RT: BLAS live N (built, refit,
  refit->rebuild, rehydrated), TLAS live, builds, asked found / misses,
  copies, evicted, quant24 VB / meshlet IB decoded (MB), BLAS / TLAS prep ms,
  AS memory MB"; one line per program with loops as its translation comes:
  "ray queries lifted N of M (bvh64 a/b, bvh32 c/d), fell back: <reason>".

Not taken: their replaced victory-shader, loader hooks.rs, indirect.rs vendor
change, panel.rs HUD, texback re-register (Manley.B c8f08560, already in main), emit/host.rs adapter
choice, 9863dfd6.

Ported from Leslie-d-a/VIctory-NVIDIA-HWRT 61e389e0 and 5f55bca8 (hwrt 7fdb87fa); original by dakisback2 ecc49d5b and 72f8316a (dakisback2/VIctory-Nvidia-Linux), GPL-3.0.

Co-authored-by: dakisback2 <[email protected]>
Co-authored-by: Leslie-d-a <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PVi6XmTj4ohPL7QwUeFgV4
With VICTORY_HW_RT=1 the title's structure builder is off, so
pipeline::builder_runs() says no ray finds anything, and the ambient light
estimate and the reflection stand-in (ambient.rs, mirror.rs) ran over the
traced light (Leslie-d-a/VIctory-NVIDIA-HWRT runs it with VICTORY_AMBIENT=0
for that). They now ask pipeline::rays_found(): the builder runs, or the
hardware ray tracing manager is up. Unchanged without the switch.

Ported from Leslie-d-a/VIctory-NVIDIA-HWRT 61e389e0 (its setting notes); original by dakisback2 ecc49d5b.

Co-authored-by: dakisback2 <[email protected]>
Co-authored-by: Leslie-d-a <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PVi6XmTj4ohPL7QwUeFgV4
Co-authored-by: dakisback2 <[email protected]>
Co-authored-by: Leslie-d-a <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PVi6XmTj4ohPL7QwUeFgV4
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PVi6XmTj4ohPL7QwUeFgV4
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PVi6XmTj4ohPL7QwUeFgV4
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 04:28:14 +00:00
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 05:20 UTC · original

Tested on an RTX 4070 Ti SUPER 16 GB (Windows 11, 9800X3D, 16 GB RAM), native 1440p, no upscaling, diagnostics build of this PR's head 5046243b, Series X profile. Shaders and pipelines warmed with VICTORY_HW_RT=1 first.

Run Result
VICTORY_HW_RT=1 VICTORY_BVH_MISS=0 VICTORY_ACTIVATE_RAYS=1 device removed (0x887A0005) about 100 s into play, before the first fps sample
Same build, VICTORY_BVH_BUILDER=1 (software walk) 10 min, no failure, 7-12 fps

The last hardware RT counter line before the removal:

hardware RT: BLAS live 3411 (built 4096, refit 1232, refit->rebuild 76, rehydrated 2034), TLAS live 5 (builds 240),
TLAS asked 4065 found / 162 misses (console TLAS with no host one), copies 366, evicted 488,
quant24 VB 8012 / meshlet IB 8610 decoded (131 MB), BLAS prep 8640 ms, TLAS prep 57 ms, AS memory 389 MB

The first failure the layer logged was a resource creation refused with the device already removed, so the removing command itself is not named. AS memory was 389 MB at the last counter line (no card-memory sample was taken before the removal). I can rerun with VICTORY_D3D12_DRED=1 or VICTORY_D3D12_DEBUG=1 if that helps narrow it down.

**@⁠eleboucher** on GitHub · 2026-11-30 05:20 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7269573594) Tested on an RTX 4070 Ti SUPER 16 GB (Windows 11, 9800X3D, 16 GB RAM), native 1440p, no upscaling, diagnostics build of this PR's head 5046243b, Series X profile. Shaders and pipelines warmed with `VICTORY_HW_RT=1` first. | Run | Result | |---|---| | `VICTORY_HW_RT=1 VICTORY_BVH_MISS=0 VICTORY_ACTIVATE_RAYS=1` | device removed (0x887A0005) about 100 s into play, before the first fps sample | | Same build, `VICTORY_BVH_BUILDER=1` (software walk) | 10 min, no failure, 7-12 fps | The last hardware RT counter line before the removal: ``` hardware RT: BLAS live 3411 (built 4096, refit 1232, refit->rebuild 76, rehydrated 2034), TLAS live 5 (builds 240), TLAS asked 4065 found / 162 misses (console TLAS with no host one), copies 366, evicted 488, quant24 VB 8012 / meshlet IB 8610 decoded (131 MB), BLAS prep 8640 ms, TLAS prep 57 ms, AS memory 389 MB ``` The first failure the layer logged was a resource creation refused with the device already removed, so the removing command itself is not named. AS memory was 389 MB at the last counter line (no card-memory sample was taken before the removal). I can rerun with `VICTORY_D3D12_DRED=1` or `VICTORY_D3D12_DEBUG=1` if that helps narrow it down.
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 05:32 UTC · original

Rerun with VICTORY_D3D12_DRED=1, same build and settings: it reproduced. Device removed (0x887A0005) about 3.5 min into play, after 8.2 fps / 2,089 draws a frame at t=120 s (card 13.8 GB in use, 3.9 GB shared at that sample). The layer printed no DRED breadcrumbs or page-fault data: the first thing that notices the removal is a buffer creation (no upload buffer ... 0x887A0005), and that path does not query DRED, so the removing command is still unnamed. Two removals in two hardware-path runs here; the software walk on the same build ran 10 min without one.

**@⁠eleboucher** on GitHub · 2026-11-30 05:32 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7269758425) Rerun with `VICTORY_D3D12_DRED=1`, same build and settings: it reproduced. Device removed (0x887A0005) about 3.5 min into play, after 8.2 fps / 2,089 draws a frame at t=120 s (card 13.8 GB in use, 3.9 GB shared at that sample). The layer printed no DRED breadcrumbs or page-fault data: the first thing that notices the removal is a buffer creation (`no upload buffer ... 0x887A0005`), and that path does not query DRED, so the removing command is still unnamed. Two removals in two hardware-path runs here; the software walk on the same build ran 10 min without one.
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 05:47 UTC · original

With the device-removed report fixed (#3740) on top of this PR, the third hardware-path run here (removed again ~100 s in) logged:

device removed: ... (0x887A0005)
device-removed data; breadcrumbs (done/count, list) []
when the host device went: the submitting thread was between submissions (nothing of ours was running on the card) ...; submissions started 123229 finished 123215

DRED auto-breadcrumbs and page-fault tracking were on, yet the driver recorded no breadcrumbs and no page fault for any of the layer's command lists, and the layer's own submitting thread was between submissions. So the removal does not look like a fault inside a translated draw or dispatch. Work recorded or executed outside those lists, such as the BLAS/TLAS builds, refits and the instance-remap pass, would be my first suspects, but that is not shown. A next step could be to put those list::external operations on their own list with markers, or to run with VICTORY_HW_RT_REFIT=0.

**@⁠eleboucher** on GitHub · 2026-11-30 05:47 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7270012433) With the device-removed report fixed (#3740) on top of this PR, the third hardware-path run here (removed again ~100 s in) logged: ``` device removed: ... (0x887A0005) device-removed data; breadcrumbs (done/count, list) [] when the host device went: the submitting thread was between submissions (nothing of ours was running on the card) ...; submissions started 123229 finished 123215 ``` DRED auto-breadcrumbs and page-fault tracking were on, yet the driver recorded no breadcrumbs and no page fault for any of the layer's command lists, and the layer's own submitting thread was between submissions. So the removal does not look like a fault inside a translated draw or dispatch. Work recorded or executed outside those lists, such as the BLAS/TLAS builds, refits and the instance-remap pass, would be my first suspects, but that is not shown. A next step could be to put those `list::external` operations on their own list with markers, or to run with `VICTORY_HW_RT_REFIT=0`.
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 06:03 UTC · original

Thank you, this is exactly the kind of test it needed, and the DRED run narrows it a lot.

One difference with our runs stands out: you set VICTORY_BVH_MISS=0. With the hardware path, the title's own builder is replaced, so the console-format structures are never written. Any traversal loop that doesn't lift to RayQuery falls back to the software walk, and with BVH_MISS=0 that walk reads structure memory that was never filled. An unbounded loop over garbage nodes on the card would fit what you saw: no breadcrumb in any of our lists, the submitting thread idle, then a removal. victory play sets VICTORY_BVH_MISS=1 in every run (apps/victory/src/play.rs:116), so in our four runs (4090, 300 s each) the fallback rays miss instead of walking. We had no removal.

Could you rerun once without VICTORY_BVH_MISS=0 (or with =1)? In the meantime I'll make the hardware path force the fallback to miss whatever BVH_MISS says, since walking unwritten structures is never right. That goes in this PR. I'm also queuing a 20-minute hardware-path soak on our side, plus one with BVH_MISS=0 to see if it reproduces here.

If it still happens with =1, the next suspects are the ones you named: the BLAS/TLAS builds, refits and the instance-remap pass outside our marked lists. I'll put those on their own list with markers so DRED can name them.

**@⁠dyshay** on GitHub · 2026-11-30 06:03 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7270253931) Thank you, this is exactly the kind of test it needed, and the DRED run narrows it a lot. One difference with our runs stands out: you set `VICTORY_BVH_MISS=0`. With the hardware path, the title's own builder is replaced, so the console-format structures are never written. Any traversal loop that doesn't lift to RayQuery falls back to the software walk, and with `BVH_MISS=0` that walk reads structure memory that was never filled. An unbounded loop over garbage nodes on the card would fit what you saw: no breadcrumb in any of our lists, the submitting thread idle, then a removal. `victory play` sets `VICTORY_BVH_MISS=1` in every run (`apps/victory/src/play.rs:116`), so in our four runs (4090, 300 s each) the fallback rays miss instead of walking. We had no removal. Could you rerun once without `VICTORY_BVH_MISS=0` (or with `=1`)? In the meantime I'll make the hardware path force the fallback to miss whatever `BVH_MISS` says, since walking unwritten structures is never right. That goes in this PR. I'm also queuing a 20-minute hardware-path soak on our side, plus one with `BVH_MISS=0` to see if it reproduces here. If it still happens with `=1`, the next suspects are the ones you named: the BLAS/TLAS builds, refits and the instance-remap pass outside our marked lists. I'll put those on their own list with markers so DRED can name them.
With VICTORY_HW_RT=1 the title's structure builder is ours and never
runs, so the console-format structures are never written. A traversal loop
that does not lift to RayQuery kept the software walk, and with
VICTORY_BVH_MISS=0 that walk read memory nobody filled (#3706: device
removed after ~100 s, 3 of 3 runs, no breadcrumb in our lists). The
fallback now misses every node whatever VICTORY_BVH_MISS says; a warning
says so once at startup when VICTORY_BVH_MISS=0 was asked. The shader
cache keys the fallback's miss form under VICTORY_HW_RT=1 too, so a
run with the switch at 0 or unset is not served the earlier walks.

Diagnostics: a marker (DRED with VICTORY_D3D12_DRED=1) before each TLAS
build, each BLAS build/refit batch and the instance-remap dispatch, so a
removal among them is named.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PVi6XmTj4ohPL7QwUeFgV4
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 06:42 UTC · original

Rerun as asked: same build (this PR + #3740), VICTORY_HW_RT=1 VICTORY_BVH_MISS=1 VICTORY_ACTIVATE_RAYS=1 VICTORY_D3D12_DRED=1, warmed with VICTORY_HW_RT=1. It still lost the device, inside the first 120 s of play (0x887A0005).

hardware RT: BLAS live 4175 (built 5308, refit 2637, refit->rebuild 73, rehydrated 2464), TLAS live 5 (builds 457),
TLAS asked 6575 found / 157 misses, copies 647, evicted 446, quant24 VB 10136 / meshlet IB 11045 decoded (173 MB),
BLAS prep 12340 ms, TLAS prep 78 ms, AS memory 472 MB          <- 3.6 s before the removal
device-removed data; breadcrumbs (done/count, list) []
when the host device went: the submitting thread was preparing a submission (nothing of ours was running on the card), of 27 lists ...

So BVH_MISS=0 is not needed for it: again no breadcrumbs, no page fault and nothing of the layer's lists running. That leaves the structure work outside the marked lists (builds, 2,637 refits, the remap pass), or the eviction of structures still in use (446 evicted by then). VICTORY_HW_RT_REFIT=0 would be my next single switch to try. I can run it, or your marked-list build when it is up.

**@⁠eleboucher** on GitHub · 2026-11-30 06:42 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7270932075) Rerun as asked: same build (this PR + #3740), `VICTORY_HW_RT=1 VICTORY_BVH_MISS=1 VICTORY_ACTIVATE_RAYS=1 VICTORY_D3D12_DRED=1`, warmed with `VICTORY_HW_RT=1`. It still lost the device, inside the first 120 s of play (0x887A0005). ``` hardware RT: BLAS live 4175 (built 5308, refit 2637, refit->rebuild 73, rehydrated 2464), TLAS live 5 (builds 457), TLAS asked 6575 found / 157 misses, copies 647, evicted 446, quant24 VB 10136 / meshlet IB 11045 decoded (173 MB), BLAS prep 12340 ms, TLAS prep 78 ms, AS memory 472 MB <- 3.6 s before the removal device-removed data; breadcrumbs (done/count, list) [] when the host device went: the submitting thread was preparing a submission (nothing of ours was running on the card), of 27 lists ... ``` So `BVH_MISS=0` is not needed for it: again no breadcrumbs, no page fault and nothing of the layer's lists running. That leaves the structure work outside the marked lists (builds, 2,637 refits, the remap pass), or the eviction of structures still in use (446 evicted by then). `VICTORY_HW_RT_REFIT=0` would be my next single switch to try. I can run it, or your marked-list build when it is up.
A device removal after 100 s to 3.5 min with hardware ray tracing (RTX 4070
Ti SUPER, DRED: none of our lists' commands). Plausible causes removed, no
switch (correctness and safety):

- Indices: every build and refit copies the title's indices on the card
  (clamp_ib), a triangle naming a vertex at or past VertexCount becomes
  0,0,0. Before, an IB the CPU could not read went unchecked and refits
  trusted a max-index cache by address. Refits key the topology on the
  title's IB, not the host copy. A geometry that cannot be given is now an
  inactive one in its place (NaN vertices / NaN box), so GeometryIndex stays
  the title's; before it was left out (idea from mrvdkpro/VIctory-NativeRT).
- Positions: float32 vertex buffers copied on the card (copy_vb) and the
  quant24 decode: not finite or |v| > 1e10 becomes NaN (inactive triangle);
  the copies are made readable by a transition before the builds (idea from
  mrvdkpro/VIctory-NativeRT).
- Scratch and instances: one shared scratch buffer and one instance buffer
  served every list. Now each BLAS wave, TLAS build and instance remap has a
  piece of its own (LeasePool), given back only when the list that used it
  is reset after its last execution (HostList::hold). A TLAS keeps the BLAS
  buffers its remap table named until its next build or its drop, then
  retires them, so a BLAS rebuilt elsewhere or evicted is never freed under
  a TLAS still in use (idea from akimfomin/VIctory-NVIDIA-Lab issue #8
  (TuxBox #455)).

New line every 5 s 'hardware RT inputs: ...'. CPU tests: position and
triangle rules, the HLSL compiles and follows them, lease pool.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PVi6XmTj4ohPL7QwUeFgV4
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 06:48 UTC · original

@⁠eleboucher thanks again. Since your runs, the PR head (53c6eab4) has five changes aimed at exactly that kind of removal, with no breadcrumb in our lists and the submitting thread idle:

  1. The software fallback always misses with the hardware path on, whatever VICTORY_BVH_MISS says. Unlifted loops no longer walk the console-format structures, which are never written in this mode. A warning is logged if =0 was asked.
  2. Index bounds on the card. Every build and refit copies the indices through a small compute. A triangle with an index at or past VertexCount becomes degenerate. Before, an IB the CPU couldn't read went to the build unchecked, and refits trusted a cache keyed by address. Skipped geometries now stay in place as inactive ones, so GeometryIndex doesn't shift.
  3. Vertex sanity. Non-finite or absurdly far positions (|v| > 1e10) become NaN, which DXR treats as inactive. Huge boxes could make traversal run long enough to hit the TDR.
  4. Lifetimes. Each BLAS wave, TLAS build and instance remap now has its own scratch and instance range, held until the list that used it is reset. Each TLAS also keeps the BLAS it references alive until its next build. Before, one shared scratch and instance buffer served lists in flight, and a BLAS rebuilt or evicted elsewhere could be freed under a TLAS still in use. That is a page fault that only shows after a few minutes.
  5. DRED markers on our own BLAS/TLAS builds, refits and the remap dispatch, so a removal names them.

If you have time, could you rerun the same settings on 53c6eab4, with VICTORY_D3D12_DRED=1 (and #3740 on top if you can)? On our side, a 20-minute soak and one with BVH_MISS=0 are running now on the 4090.

**@⁠dyshay** on GitHub · 2026-11-30 06:48 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7271036361) @⁠eleboucher thanks again. Since your runs, the PR head (`53c6eab4`) has five changes aimed at exactly that kind of removal, with no breadcrumb in our lists and the submitting thread idle: 1. **The software fallback always misses with the hardware path on**, whatever `VICTORY_BVH_MISS` says. Unlifted loops no longer walk the console-format structures, which are never written in this mode. A warning is logged if `=0` was asked. 2. **Index bounds on the card.** Every build and refit copies the indices through a small compute. A triangle with an index at or past `VertexCount` becomes degenerate. Before, an IB the CPU couldn't read went to the build unchecked, and refits trusted a cache keyed by address. Skipped geometries now stay in place as inactive ones, so `GeometryIndex` doesn't shift. 3. **Vertex sanity.** Non-finite or absurdly far positions (|v| > 1e10) become NaN, which DXR treats as inactive. Huge boxes could make traversal run long enough to hit the TDR. 4. **Lifetimes.** Each BLAS wave, TLAS build and instance remap now has its own scratch and instance range, held until the list that used it is reset. Each TLAS also keeps the BLAS it references alive until its next build. Before, one shared scratch and instance buffer served lists in flight, and a BLAS rebuilt or evicted elsewhere could be freed under a TLAS still in use. That is a page fault that only shows after a few minutes. 5. **DRED markers** on our own BLAS/TLAS builds, refits and the remap dispatch, so a removal names them. If you have time, could you rerun the same settings on `53c6eab4`, with `VICTORY_D3D12_DRED=1` (and #3740 on top if you can)? On our side, a 20-minute soak and one with `BVH_MISS=0` are running now on the 4090.
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 06:52 UTC · original

Same again with VICTORY_HW_RT_REFIT=0 (and BVH_MISS=1, DRED on): device removed inside the first 120 s, device-removed data; breadcrumbs (done/count, list) []. So refits are not it either. That leaves the builds themselves, the remap pass or eviction of structures still in use, which your marked-list build should separate. I'll run it here when it is pushed.

**@⁠eleboucher** on GitHub · 2026-11-30 06:52 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7271101646) Same again with `VICTORY_HW_RT_REFIT=0` (and `BVH_MISS=1`, DRED on): device removed inside the first 120 s, `device-removed data; breadcrumbs (done/count, list) []`. So refits are not it either. That leaves the builds themselves, the remap pass or eviction of structures still in use, which your marked-list build should separate. I'll run it here when it is pushed.
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 06:53 UTC · original

Thanks, that narrows it nicely. The marked build is already pushed: the PR head is 53c6eab4 (branch pr/hardware-rt on dyshay/VIctory-NVIDIA). Besides the DRED markers on the BLAS/TLAS builds, refits and the remap dispatch, it has the lifetime fixes: per-operation scratch and instance ranges held until their list is reset, and every TLAS keeping its referenced BLAS alive. So it tests the eviction hypothesis and names the operation if it still goes.

**@⁠dyshay** on GitHub · 2026-11-30 06:53 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7271124471) Thanks, that narrows it nicely. The marked build is already pushed: the PR head is `53c6eab4` (branch `pr/hardware-rt` on dyshay/VIctory-NVIDIA). Besides the DRED markers on the BLAS/TLAS builds, refits and the remap dispatch, it has the lifetime fixes: per-operation scratch and instance ranges held until their list is reset, and every TLAS keeping its referenced BLAS alive. So it tests the eviction hypothesis and names the operation if it still goes.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 07:04 UTC · original

@⁠dyshay @⁠eleboucher Thanks for pinning the repro and the lifetime fixes, and for crediting our Lab #8. We have another RTX 4070 Ti SUPER 16 GB on Windows 11.

Our experimental branch keeps the console builder active and independently tracks the native BLAS/TLAS generations. A generated DXR 1.1 fixture on this GPU gets 45 exact answers with queue-ordered late TLAS binding, including material culling and deformation. Selecting the stale generation changes two answers in the negative control. Fixture and results

For full graphics with native 1440p, we are checking reuse of the RayQuery lowering while retaining the entire original traversal whenever a required scene is incomplete or stale. Do you know of a dependency in the lifted shader ABI that requires replacing the console builder, beyond instance metadata and the TLAS SRVs? The translator-only patch applies cleanly to our base. We are checking the exact scene bindings and can share a small regression test for the missing-scene dispatch case.

**@⁠akimfomin** on GitHub · 2026-11-30 07:04 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7271329637) @⁠dyshay @⁠eleboucher Thanks for pinning the repro and the lifetime fixes, and for crediting our Lab #8. We have another RTX 4070 Ti SUPER 16 GB on Windows 11. Our experimental branch keeps the console builder active and independently tracks the native BLAS/TLAS generations. A generated DXR 1.1 fixture on this GPU gets 45 exact answers with queue-ordered late TLAS binding, including material culling and deformation. Selecting the stale generation changes two answers in the negative control. [Fixture and results](https://github.com/akimfomin/VIctory-NVIDIA-Lab/pull/15#issuecomment-7270857140) For full graphics with native 1440p, we are checking reuse of the RayQuery lowering while retaining the entire original traversal whenever a required scene is incomplete or stale. Do you know of a dependency in the lifted shader ABI that requires replacing the console builder, beyond instance metadata and the TLAS SRVs? The translator-only patch applies cleanly to our base. We are checking the exact scene bindings and can share a small regression test for the missing-scene dispatch case.
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 07:29 UTC · original

Data point from our side: a 20-minute soak on the RTX 4090 (Series S, house, hardware path, cc74ac5e = fallback-miss fix only, no lifetime fixes yet) ran without a device removal. It did show something to fix regardless: bottom levels are never budgeted. BLAS live grows steadily (3,763 → 9,277) and AS memory from 370 MB at ~3 min to 1,190 MB at ~17 min, ~190 MB every 3 minutes, with evictions not keeping up. That isn't what removes your device inside 120 s (you were at 472 MB), but on 16 GB cards it would add up over a session, so a BLAS budget with LRU eviction is next on our list.

**@⁠dyshay** on GitHub · 2026-11-30 07:29 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7271796454) Data point from our side: a 20-minute soak on the RTX 4090 (Series S, house, hardware path, `cc74ac5e` = fallback-miss fix only, no lifetime fixes yet) ran without a device removal. It did show something to fix regardless: bottom levels are never budgeted. BLAS live grows steadily (3,763 → 9,277) and AS memory from 370 MB at ~3 min to 1,190 MB at ~17 min, ~190 MB every 3 minutes, with evictions not keeping up. That isn't what removes your device inside 120 s (you were at 472 MB), but on 16 GB cards it would add up over a session, so a BLAS budget with LRU eviction is next on our list.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 07:30 UTC · original

Thanks for the long-run data. For the BLAS budget, it would help to log bytes of the lookup entries separately from bytes still pinned by a TLAS or an executing list. An LRU removal can get the next lookup under budget while the memory remains in flight. A pressure test that crosses a build, a later consumer, and a fence could check that distinction.

We published the generated dispatch-selection test requested above. Run.ps1 -Fallback got 45 exact answers on RTX 4070 Ti SUPER with native / fallback / native execution. Allowing an older scene on the middle dispatch changed exactly two hits. In our local full-graphics probe, the middle one of three required scene bindings was already pending when the hot dispatch was submitted. We keep the original dispatch until the scene’s validity can be checked in GPU order. Test and pinned source

**@⁠akimfomin** on GitHub · 2026-11-30 07:30 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7271805451) Thanks for the long-run data. For the BLAS budget, it would help to log bytes of the lookup entries separately from bytes still pinned by a TLAS or an executing list. An LRU removal can get the next lookup under budget while the memory remains in flight. A pressure test that crosses a build, a later consumer, and a fence could check that distinction. We published the generated dispatch-selection test requested above. `Run.ps1 -Fallback` got 45 exact answers on RTX 4070 Ti SUPER with native / fallback / native execution. Allowing an older scene on the middle dispatch changed exactly two hits. In our local full-graphics probe, the middle one of three required scene bindings was already pending when the hot dispatch was submitted. We keep the original dispatch until the scene’s validity can be checked in GPU order. [Test and pinned source](https://github.com/akimfomin/VIctory-NVIDIA-Lab/pull/15#issuecomment-7271709943)
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 07:39 UTC · original

@⁠akimfomin thanks, the fixture and the generation tracking are very useful.

On the lifted ABI: as far as our port goes, nothing in the lifted shaders needs the console builder replaced. What they depend on:

  1. A host TLAS SRV per console TLAS address the program binds, looked up by that address (our slots t230–241).
  2. Instance metadata reproduced from the title's instance descriptors: InstanceID, mask, contribution, and the remap from console instance to host BLAS.
  3. GeometryIndex matching the order of the title's geometry descriptors. That's why we now keep skipped geometries in place as inactive ones instead of dropping them.
  4. Hit attributes (primitive index, barycentrics) in the console's order, which follows from 3 with the same index buffers.

The HLE builder replacement is how we get 2–4 (the build calls carry the descriptors) and how we avoid paying the console builder's compute. Keeping the console builder running alongside, as you do, should work with the same lowering. It also keeps the software walk valid as a fallback, which our mode can't offer, hence our forced miss. Your "keep the original dispatch until the scene is valid in GPU order" is the safer design for incomplete scenes. A shared regression test for the missing-scene dispatch would be welcome.

On the budget: agreed, and thanks for the precise point. We'll count lookup-table bytes separately from bytes still pinned by a TLAS or a list in flight, and only count memory as freed once the last fence that can see it has passed, not when the LRU entry is dropped. The pressure test you describe (build → later consumer → fence, with eviction in between) is a good gate for it.

**@⁠dyshay** on GitHub · 2026-11-30 07:39 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7271975362) @⁠akimfomin thanks, the fixture and the generation tracking are very useful. On the lifted ABI: as far as our port goes, nothing in the lifted shaders needs the console builder replaced. What they depend on: 1. A host TLAS SRV per console TLAS address the program binds, looked up by that address (our slots t230–241). 2. Instance metadata reproduced from the title's instance descriptors: `InstanceID`, mask, contribution, and the remap from console instance to host BLAS. 3. `GeometryIndex` matching the order of the title's geometry descriptors. That's why we now keep skipped geometries in place as inactive ones instead of dropping them. 4. Hit attributes (primitive index, barycentrics) in the console's order, which follows from 3 with the same index buffers. The HLE builder replacement is how we *get* 2–4 (the build calls carry the descriptors) and how we avoid paying the console builder's compute. Keeping the console builder running alongside, as you do, should work with the same lowering. It also keeps the software walk valid as a fallback, which our mode can't offer, hence our forced miss. Your "keep the original dispatch until the scene is valid in GPU order" is the safer design for incomplete scenes. A shared regression test for the missing-scene dispatch would be welcome. On the budget: agreed, and thanks for the precise point. We'll count lookup-table bytes separately from bytes still pinned by a TLAS or a list in flight, and only count memory as freed once the last fence that can see it has passed, not when the LRU entry is dropped. The pressure test you describe (build → later consumer → fence, with eviction in between) is a good gate for it.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 07:42 UTC · original · edited 2026-11-30 08:00 UTC

Thanks for confirming the interface. We built both compute PSOs on the 4070 Ti SUPER with the console builder still active. The first hot shader lifted all five loops and consumes three TLAS slots. The second shader remains byte-for-byte stock because its lift would need substitute triangle attributes. We also confirmed the game builds all three TLAS inputs through the contiguous descriptor path. Our first sampling policy gave only one a chance to publish, so the next run gives each its own slot.

The generated fallback check is ready for independent use. I’ll extend the shared regression to cover a missing required TLAS among several bindings and preserve GeometryIndex, primitive and barycentric answers when the test switches paths. A source-level review of that case would be welcome. Current check and exact revision

Update: the three-scene generated regression is pinned here. The GPU falls back when just one required scene is missing. GeometryIndex 1 / PrimitiveIndex 1 and barycentrics agree across the two paths; 45/45 hits on RTX 4070 Ti SUPER.

**@⁠akimfomin** on GitHub · 2026-11-30 07:42 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7272031701) · edited 2026-11-30 08:00 UTC Thanks for confirming the interface. We built both compute PSOs on the 4070 Ti SUPER with the console builder still active. The first hot shader lifted all five loops and consumes three TLAS slots. The second shader remains byte-for-byte stock because its lift would need substitute triangle attributes. We also confirmed the game builds all three TLAS inputs through the contiguous descriptor path. Our first sampling policy gave only one a chance to publish, so the next run gives each its own slot. The generated fallback check is ready for independent use. I’ll extend the shared regression to cover a missing required TLAS among several bindings and preserve GeometryIndex, primitive and barycentric answers when the test switches paths. A source-level review of that case would be welcome. [Current check and exact revision](https://github.com/akimfomin/VIctory-NVIDIA-Lab/pull/15#issuecomment-7271709943) Update: [the three-scene generated regression is pinned here](https://github.com/akimfomin/VIctory-NVIDIA-Lab/pull/15#issuecomment-7272319220). The GPU falls back when just one required scene is missing. GeometryIndex 1 / PrimitiveIndex 1 and barycentrics agree across the two paths; 45/45 hits on RTX 4070 Ti SUPER.
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 08:11 UTC · original

Rerun on 53c6eab4 with #3740 on top, VICTORY_HW_RT=1 VICTORY_BVH_MISS=1 VICTORY_D3D12_DRED=1, same RTX 4070 Ti SUPER: still removed (0x887A0005), inside the first 120 s.

  • DRED: breadcrumbs (done/count, list) [] again. Your new markers on the BLAS/TLAS builds, refits and remap did not show up either. So either nothing marked was in flight, or the driver recorded no breadcrumbs at all for this removal (our own lists were empty too).
  • The layer's own report of what was in flight: 1 submission of 1 list, which held a single dispatch 160x90x1 [compute 2f03a2df10503cef] (u4=0xa04900, u5=0x153fdc0, first SRV s0+176 a 2044-element buffer at 0x46564100).

If 2f03a2df10503cef is one of the lifted programs, it could be a RayQuery against a TLAS (or one of its BLAS) that is not valid at that moment. The ray-tracing programs in our timing runs on this frame are f22a76fc/6d7fe774 plus several smaller ones; 2f03a2df appears there at ~0.14 ms per frame with the software walk. Does your lift report name it?

**@⁠eleboucher** on GitHub · 2026-11-30 08:11 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7272599193) Rerun on `53c6eab4` with #3740 on top, `VICTORY_HW_RT=1 VICTORY_BVH_MISS=1 VICTORY_D3D12_DRED=1`, same RTX 4070 Ti SUPER: still removed (0x887A0005), inside the first 120 s. - DRED: `breadcrumbs (done/count, list) []` again. Your new markers on the BLAS/TLAS builds, refits and remap did not show up either. So either nothing marked was in flight, or the driver recorded no breadcrumbs at all for this removal (our own lists were empty too). - The layer's own report of what was in flight: 1 submission of 1 list, which held a single `dispatch 160x90x1 [compute 2f03a2df10503cef]` (u4=0xa04900, u5=0x153fdc0, first SRV `s0+176` a 2044-element buffer at 0x46564100). If `2f03a2df10503cef` is one of the lifted programs, it could be a `RayQuery` against a TLAS (or one of its BLAS) that is not valid at that moment. The ray-tracing programs in our timing runs on this frame are f22a76fc/6d7fe774 plus several smaller ones; 2f03a2df appears there at ~0.14 ms per frame with the software walk. Does your lift report name it?
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 08:18 UTC · original

I checked 2f03a2df10503cef directly on the second 4070 Ti SUPER setup. The 7,096-byte local container contains one compute program. Its instruction stream decodes successfully and has zero image_bvh* operations. Stock translation and the translation with the #3706-derived RayQuery pass enabled produce byte-for-byte identical DXIL for this hash. The same shader binds normally on our local full-graphics run with the stock builder and private DXR scene preparation.

That rules out an inline ray query in that dispatch on this program. DRED and the last submitted name still leave earlier GPU work open. A useful one-variable isolation would be the HLE builder and its remap/bounds checks with lifted dispatches disabled, using a reproducible consumer test that needs no title hits. If that still removes the device, it narrows the search to scene preparation, lifetimes or queue state. The crash excerpt has enough for the current check; no private cache or dump needed.

**@⁠akimfomin** on GitHub · 2026-11-30 08:18 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7272739003) I checked `2f03a2df10503cef` directly on the second 4070 Ti SUPER setup. The 7,096-byte local container contains one compute program. Its instruction stream decodes successfully and has zero `image_bvh*` operations. Stock translation and the translation with the #3706-derived RayQuery pass enabled produce byte-for-byte identical DXIL for this hash. The same shader binds normally on our local full-graphics run with the stock builder and private DXR scene preparation. That rules out an inline ray query *in that dispatch* on this program. DRED and the last submitted name still leave earlier GPU work open. A useful one-variable isolation would be the HLE builder and its remap/bounds checks with lifted dispatches disabled, using a reproducible consumer test that needs no title hits. If that still removes the device, it narrows the search to scene preparation, lifetimes or queue state. The crash excerpt has enough for the current check; no private cache or dump needed.
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 08:39 UTC · original

@⁠eleboucher thank you for running the new head. @⁠akimfomin thanks for checking 2f03a2df: no image_bvh* in it, and identical DXIL with and without the pass, so that dispatch itself can't be a RayQuery.

That leaves the scene preparation (HLE builder, BLAS/TLAS builds, the remap compute, the new index/vertex copies) or something earlier in the queue. I'm adding the isolation akimfomin suggests, as a diagnostic switch: VICTORY_HW_RT_LIFT=0 keeps the HLE builder and all scene preparation running but lifts no loop, so every ray takes the (forced-miss) fallback. If the device still goes with it, the lifted shaders are out and the search is the preparation. If not, it's a lifted dispatch reading a structure that isn't valid yet, and akimfomin's GPU-order validity check is the fix. I'll post the head here when it's pushed.

@⁠eleboucher two quick facts would help: your driver version, and whether the removal still happens with ray tracing on but at a lower output size (e.g. Series S profile). The 4090 here has run 2 × 20 min plus 6 shorter runs on the same code without a removal, so something about the card, driver or memory size matters.

**@⁠dyshay** on GitHub · 2026-11-30 08:39 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7273178308) @⁠eleboucher thank you for running the new head. @⁠akimfomin thanks for checking `2f03a2df`: no `image_bvh*` in it, and identical DXIL with and without the pass, so that dispatch itself can't be a RayQuery. That leaves the scene preparation (HLE builder, BLAS/TLAS builds, the remap compute, the new index/vertex copies) or something earlier in the queue. I'm adding the isolation akimfomin suggests, as a diagnostic switch: `VICTORY_HW_RT_LIFT=0` keeps the HLE builder and all scene preparation running but lifts no loop, so every ray takes the (forced-miss) fallback. If the device still goes with it, the lifted shaders are out and the search is the preparation. If not, it's a lifted dispatch reading a structure that isn't valid yet, and akimfomin's GPU-order validity check is the fix. I'll post the head here when it's pushed. @⁠eleboucher two quick facts would help: your driver version, and whether the removal still happens with ray tracing on but at a lower output size (e.g. Series S profile). The 4090 here has run 2 × 20 min plus 6 shorter runs on the same code without a removal, so something about the card, driver or memory size matters.
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 08:43 UTC · original

  • Driver: 621.24 (RTX 4070 Ti SUPER 16 GB, PCIe gen 4; Windows 11, 9800X3D, 16 GB RAM). All our runs were native 1440p with no upscaling (--res 1440 --dlss off), Series X profile. Typical use during play: ~12.5-14 GB of the card plus ~3.5 GB shared, so memory is tighter here than on a 24 GB 4090.
  • Series S: queued now on 53c6eab4 + #3740, same switches (VICTORY_HW_RT=1 VICTORY_BVH_MISS=1 VICTORY_D3D12_DRED=1) with --series-s. It runs next on the PC; I'll post the result here, then VICTORY_HW_RT_LIFT=0 once that head is up.
**@⁠eleboucher** on GitHub · 2026-11-30 08:43 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7273255336) - **Driver:** 621.24 (RTX 4070 Ti SUPER 16 GB, PCIe gen 4; Windows 11, 9800X3D, 16 GB RAM). All our runs were native 1440p with no upscaling (`--res 1440 --dlss off`), Series X profile. Typical use during play: ~12.5-14 GB of the card plus ~3.5 GB shared, so memory is tighter here than on a 24 GB 4090. - **Series S:** queued now on `53c6eab4` + #3740, same switches (`VICTORY_HW_RT=1 VICTORY_BVH_MISS=1 VICTORY_D3D12_DRED=1`) with `--series-s`. It runs next on the PC; I'll post the result here, then `VICTORY_HW_RT_LIFT=0` once that head is up.
With hardware ray tracing on, VICTORY_HW_RT_LIFT=0 keeps the whole host
side (HLE builder, BLAS/TLAS builds and refits, instance remap, index and
vertex copies) but lifts no loop: every ray takes the software walk's
forced miss. It tells a device removal in the structure work from one in
the lifted traversal. Loops still found and counted (lifted 0, reason
VICTORY_HW_RT_LIFT=0); in the shader-cache key when set; warned at load.
Test: with LIFT=0 the translation equals the fallback-miss form.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PVi6XmTj4ohPL7QwUeFgV4
Author
Owner

@⁠ColorC on GitHub · 2026-11-30 08:58 UTC · original

AI Disclosure: This hardware benchmark, log analysis, and report were automated and posted by an AI assistant on behalf of the hardware owner (Ryzen 7 9800X3D, 32 GB DDR5, RTX 5070 Ti 16 GB, Windows 11 26200). No game screenshots or title assets are included.

Sharing a 4-minute (235s) open-world walking stability report on Blackwell (RTX 5070 Ti 16 GB) + Ryzen 7 9800X3D + 32 GB RAM (Series X 1440p, DLSS Quality + 3x MFG, VICTORY_HW_RT=1, 0 errors / NO 0x887A0005 Device Removed), plus a diagnostic clue on multi-second BLAS build bursts:

Metric (4-min automated Xbox gamepad walking tour) Raster (VICTORY_HW_RT=0) DXR 1.1 HW RT (VICTORY_HW_RT=1)
Duration / Crashes / 0x887A0005 240s (N=48) / 0 crashes / 0 errors 235s (N=47) / 0 crashes / 0 errors
Avg Draws / Frame 8,701 10,417
Overall Med / Best Native FPS 29.4 / 41.0 FPS (34.0 / 24.4 ms) 22.7 / 27.3 FPS (44.0 / 36.6 ms)
Steady Windows (<= 100 ms) 48/48: Avg 30.1 FPS (33.9 ms), Max 43.0 ms 41/47: Avg 23.8 FPS (42.6 ms), Med 40.8 ms, P90 50.0 ms, Max 58.8 ms
Peak VRAM (dedicated / shared) 11,361 MB / 6,649 MB 11,436 MB / 6,620 MB

RayQuery & Acceleration Structure Telemetry (t=235s)

ray queries: lifted shaders 16, partly 0, fell back 0 (software); per frame 5.0 dispatches all lifted, 0.0 partly, 0.0 none
hardware RT: BLAS live 3781 (built 14763, refit 276757, refit->rebuild 2945, rehydrated 2319), TLAS live 5 (builds 25811), TLAS asked 444973 found / 1256 misses (console TLAS with no host one), copies 2932, evicted 88, quant24 VB 9092 / meshlet IB 9459 decoded (136 MB), BLAS prep 11352 ms, TLAS prep 1043 ms, AS memory 512 MB

Diagnostic Clue Regarding 0x887A0005 on Other Systems

  • While our RTX 5070 Ti survived the full 4-minute walk past the 120s–210s window with 0 errors, 6 of the 47 windows saw large pauses when walking into newly streamed ~11.8k–12.2k-draw areas: t=35s (456 ms), t=40s (3,104 ms), t=50s (1,260 ms), t=55s (3,705 ms), t=70s (1,318 ms), t=215s (1,431 ms) — matching the BLAS prep 11352 ms cumulative total (14,763 builds / 2,319 rehydrates).
  • Visually, lighting/GI/reflections looked clean across the entire walk (including dense foliage dappled sunlight and boardwalk speculars). However, capping per-frame BLAS build/rehydrate work might both eliminate these 1–3.7 s streaming hitches and prevent slower GPUs/drivers from crossing Windows' 2 s WDDM TDR threshold (0x887A0005) during heavy streaming bursts.

Test Setup

  • Hardware: AMD Ryzen 7 9800X3D (Zen 5, 8C/16T), 32 GB DDR5, NVIDIA RTX 5070 Ti 16 GB (ReBAR ON), Windows 11 26200
  • Profile: Series X, 2560x1440, DLSS Quality, 3x MFG (--res 1440 --dlss quality --framegen 3 --fps 1000)
  • Build: Release ThinLTO (-C target-cpu=znver5) rebased on main (41adb551) with a curated local PR stack; all A/B numbers below are same-binary toggle ablations from the exact same restored save (~10.0k–10.4k draws/frame standing scene) after official 1-time warmup.
**@⁠ColorC** on GitHub · 2026-11-30 08:58 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7273582563) > **AI Disclosure:** This hardware benchmark, log analysis, and report were automated and posted by an AI assistant on behalf of the hardware owner (Ryzen 7 9800X3D, 32 GB DDR5, RTX 5070 Ti 16 GB, Windows 11 26200). No game screenshots or title assets are included. Sharing a **4-minute (235s) open-world walking stability report** on **Blackwell (RTX 5070 Ti 16 GB) + Ryzen 7 9800X3D + 32 GB RAM** (Series X 1440p, DLSS Quality + 3x MFG, `VICTORY_HW_RT=1`, `0` errors / **NO `0x887A0005` Device Removed**), plus a diagnostic clue on multi-second BLAS build bursts: | Metric (4-min automated Xbox gamepad walking tour) | Raster (`VICTORY_HW_RT=0`) | DXR 1.1 HW RT (`VICTORY_HW_RT=1`) | |---|---:|---:| | Duration / Crashes / `0x887A0005` | 240s (`N=48`) / **0 crashes** / **0 errors** | 235s (`N=47`) / **0 crashes** / **0 errors** | | Avg Draws / Frame | 8,701 | 10,417 | | Overall Med / Best Native FPS | 29.4 / 41.0 FPS (`34.0 / 24.4 ms`) | **22.7 / 27.3 FPS** (`44.0 / 36.6 ms`) | | Steady Windows (`<= 100 ms`) | 48/48: Avg `30.1 FPS` (`33.9 ms`), Max `43.0 ms` | **41/47: Avg `23.8 FPS` (`42.6 ms`), Med `40.8 ms`, P90 `50.0 ms`, Max `58.8 ms`** | | Peak VRAM (dedicated / shared) | 11,361 MB / 6,649 MB | 11,436 MB / 6,620 MB | ### RayQuery & Acceleration Structure Telemetry (`t=235s`) ``` ray queries: lifted shaders 16, partly 0, fell back 0 (software); per frame 5.0 dispatches all lifted, 0.0 partly, 0.0 none hardware RT: BLAS live 3781 (built 14763, refit 276757, refit->rebuild 2945, rehydrated 2319), TLAS live 5 (builds 25811), TLAS asked 444973 found / 1256 misses (console TLAS with no host one), copies 2932, evicted 88, quant24 VB 9092 / meshlet IB 9459 decoded (136 MB), BLAS prep 11352 ms, TLAS prep 1043 ms, AS memory 512 MB ``` ### Diagnostic Clue Regarding `0x887A0005` on Other Systems - While our RTX 5070 Ti survived the full 4-minute walk past the 120s–210s window with `0` errors, **6 of the 47 windows** saw large pauses when walking into newly streamed ~11.8k–12.2k-draw areas: `t=35s (456 ms)`, `t=40s (3,104 ms)`, `t=50s (1,260 ms)`, `t=55s (3,705 ms)`, `t=70s (1,318 ms)`, `t=215s (1,431 ms)` — matching the `BLAS prep 11352 ms` cumulative total (`14,763` builds / `2,319` rehydrates). - Visually, lighting/GI/reflections looked clean across the entire walk (including dense foliage dappled sunlight and boardwalk speculars). However, capping per-frame BLAS build/rehydrate work might both eliminate these 1–3.7 s streaming hitches and prevent slower GPUs/drivers from crossing Windows' 2 s WDDM TDR threshold (`0x887A0005`) during heavy streaming bursts. ### Test Setup - **Hardware:** AMD Ryzen 7 9800X3D (Zen 5, 8C/16T), 32 GB DDR5, NVIDIA RTX 5070 Ti 16 GB (ReBAR ON), Windows 11 26200 - **Profile:** Series X, 2560x1440, DLSS Quality, 3x MFG (`--res 1440 --dlss quality --framegen 3 --fps 1000`) - **Build:** Release ThinLTO (`-C target-cpu=znver5`) rebased on `main` (`41adb551`) with a curated local PR stack; all A/B numbers below are **same-binary toggle ablations** from the exact same restored save (~10.0k–10.4k draws/frame standing scene) after official 1-time warmup.
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 09:03 UTC · original

@⁠ColorC thank you, this is a very useful data point: a 16 GB Blackwell card with no removal over 4 minutes, so memory size alone isn't it. The streaming bursts you found are the best lead so far. 3.7 s pauses while BLAS prep runs fit exactly how a slower card or driver could cross the 2 s TDR: one submission carrying thousands of BLAS builds and rehydrates at once.

We'll cap the scene preparation per frame: a budget on BLAS builds and rehydrates (bytes and count) per submission. The rest is deferred to later frames, and instances whose BLAS isn't ready yet get mask 0 for those frames (a short-lived miss rather than a stall). Each build batch also goes on its own marked list, so a removal, if any is left, names it. It goes into this PR, and I'll post the head here. @⁠eleboucher this is the variant I'd most like you to try once it's up.

**@⁠dyshay** on GitHub · 2026-11-30 09:03 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7273685167) @⁠ColorC thank you, this is a very useful data point: a 16 GB Blackwell card with no removal over 4 minutes, so memory size alone isn't it. The streaming bursts you found are the best lead so far. 3.7 s pauses while BLAS prep runs fit exactly how a slower card or driver could cross the 2 s TDR: one submission carrying thousands of BLAS builds and rehydrates at once. We'll cap the scene preparation per frame: a budget on BLAS builds and rehydrates (bytes and count) per submission. The rest is deferred to later frames, and instances whose BLAS isn't ready yet get mask 0 for those frames (a short-lived miss rather than a stall). Each build batch also goes on its own marked list, so a removal, if any is left, names it. It goes into this PR, and I'll post the head here. @⁠eleboucher this is the variant I'd most like you to try once it's up.
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 09:03 UTC · original

The isolation switch is pushed: PR head 7bbd5e56. VICTORY_HW_RT_LIFT=0 keeps the HLE builder and all scene preparation (BLAS/TLAS builds, refits, remap, the index/vertex copies) but lifts no loop, so every ray takes the forced-miss fallback. @⁠eleboucher if the device still goes with LIFT=0, the cause is in scene preparation (most likely the build bursts ColorC measured), and the per-frame BLAS budget I'm adding next is the fix to try. If it doesn't go, it's on the lifted dispatches.

**@⁠dyshay** on GitHub · 2026-11-30 09:03 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7273694916) The isolation switch is pushed: PR head `7bbd5e56`. `VICTORY_HW_RT_LIFT=0` keeps the HLE builder and all scene preparation (BLAS/TLAS builds, refits, remap, the index/vertex copies) but lifts no loop, so every ray takes the forced-miss fallback. @⁠eleboucher if the device still goes with `LIFT=0`, the cause is in scene preparation (most likely the build bursts ColorC measured), and the per-frame BLAS budget I'm adding next is the fix to try. If it doesn't go, it's on the lifted dispatches.
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 09:05 UTC · original

Building 7bbd5e56 (+#3740) now; VICTORY_HW_RT_LIFT=0 runs right after the Series S run here, then the per-frame BLAS budget when it is up. Same card, driver 621.24, native 1440p, DRED on. Results to follow in this thread.

**@⁠eleboucher** on GitHub · 2026-11-30 09:05 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7273732287) Building `7bbd5e56` (+#3740) now; `VICTORY_HW_RT_LIFT=0` runs right after the Series S run here, then the per-frame BLAS budget when it is up. Same card, driver 621.24, native 1440p, DRED on. Results to follow in this thread.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 09:09 UTC · original

@⁠dyshay Thanks for adding the isolation switch. The stock-builder path now runs two lifted loops of one mixed compute pass in the game on our 4070 Ti SUPER. The other three loops retain the stock walk. The GPU selected both the hardware path and the original fallback in ordinary asynchronous submissions. The trial reached the house and exited normally. Its coverage is still one small scene, with the same-frame output comparison pending. Reproducible gate and separate hit checks

@⁠ColorC Thanks for the 5070 Ti walk. Correlating the six bad windows with per-window build/refit deltas and GPU queue intervals would separate BLAS demand from unrelated streaming waits. The cumulative CPU preparation total alone leaves that open. If those interval counters are already in your local trace, the aggregate deltas and whether a fence wait spans each pause would help.

**@⁠akimfomin** on GitHub · 2026-11-30 09:09 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7273810174) @⁠dyshay Thanks for adding the isolation switch. The stock-builder path now runs two lifted loops of one mixed compute pass in the game on our 4070 Ti SUPER. The other three loops retain the stock walk. The GPU selected both the hardware path and the original fallback in ordinary asynchronous submissions. The trial reached the house and exited normally. Its coverage is still one small scene, with the same-frame output comparison pending. [Reproducible gate and separate hit checks](https://github.com/akimfomin/VIctory-NVIDIA-Lab/pull/15#issuecomment-7272818813) @⁠ColorC Thanks for the 5070 Ti walk. Correlating the six bad windows with per-window build/refit deltas and GPU queue intervals would separate BLAS demand from unrelated streaming waits. The cumulative CPU preparation total alone leaves that open. If those interval counters are already in your local trace, the aggregate deltas and whether a fence wait spans each pause would help.
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 09:11 UTC · original

Series S (--series-s, 1280x720 inside) on 53c6eab4 + #3740, VICTORY_HW_RT=1 VICTORY_BVH_MISS=1 VICTORY_D3D12_DRED=1: removed too (0x887A0005), between 120 and 240 s of play. At t=120 s: 9.9 fps, 3,763 draws/frame, card 6.1 GB + 1.3 GB shared, so far from any memory limit. DRED breadcrumbs empty again. So it is not output size or memory on this card. 7bbd5e56 with VICTORY_HW_RT_LIFT=0 runs next.

**@⁠eleboucher** on GitHub · 2026-11-30 09:11 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7273860905) Series S (`--series-s`, 1280x720 inside) on `53c6eab4` + #3740, `VICTORY_HW_RT=1 VICTORY_BVH_MISS=1 VICTORY_D3D12_DRED=1`: removed too (0x887A0005), between 120 and 240 s of play. At t=120 s: 9.9 fps, 3,763 draws/frame, card 6.1 GB + 1.3 GB shared, so far from any memory limit. DRED breadcrumbs empty again. So it is not output size or memory on this card. `7bbd5e56` with `VICTORY_HW_RT_LIFT=0` runs next.
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 09:18 UTC · original

7bbd5e56 + #3740 with VICTORY_HW_RT_LIFT=0 (VICTORY_HW_RT=1 VICTORY_BVH_MISS=1 VICTORY_D3D12_DRED=1, Series X, native 1440p): still lost, inside 120 s. This time it was a hang, 0x887A0006 (DEVICE_HUNG), and DRED did record breadcrumbs:

  • 42 lists; all complete except two: "victory host list 17" at 15/46 and another at 0/6 (queued behind it).
  • Where list 17 stopped: between its barriers, commands 8..22, it was running small title dispatches:
    • dispatch 10x1x1 [compute 89d08e561897d4e5]
    • dispatch 20x1x1 [compute 55679a0547649d0b]
  • Both bind the same resources: SRV s0+688 = the 182,452,224-byte buffer at 0x28960000 (also bound as UAV s0+1480 on 0x1b1b05d5590), SRV s0+200 608,000 elements, SRV s0+712 960,000, UAVs s1+8/16/24, and UAV s1+32 = a 6,416-byte range at offset 58,927,424,544 of 0x1b1a38a7650.

So with no loop lifted it still hangs, and the hang is in a 10- or 20-group title dispatch: a few groups looping forever, not a big workload. Since the title builder is replaced on the hardware path, my first guess would be one of the title's programs that reads something the builder used to write (sizes, counts, node pointers) and now finds unwritten. Only a guess. Do 89d08e56 / 55679a05 appear in your lift report or in the builder's consumers? Aftermath dumps are now on here as well; the next run (LIFT=0, no DRED) should give a crash dump with the faulting shader if the driver records one.

**@⁠eleboucher** on GitHub · 2026-11-30 09:18 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7274024930) `7bbd5e56` + #3740 with **`VICTORY_HW_RT_LIFT=0`** (`VICTORY_HW_RT=1 VICTORY_BVH_MISS=1 VICTORY_D3D12_DRED=1`, Series X, native 1440p): still lost, inside 120 s. This time it was a **hang**, `0x887A0006` (DEVICE_HUNG), and DRED did record breadcrumbs: - 42 lists; all complete except two: `"victory host list 17"` at **15/46** and another at 0/6 (queued behind it). - Where list 17 stopped: between its barriers, commands 8..22, it was running small title dispatches: - `dispatch 10x1x1 [compute 89d08e561897d4e5]` - `dispatch 20x1x1 [compute 55679a0547649d0b]` - Both bind the same resources: SRV `s0+688` = the 182,452,224-byte buffer at 0x28960000 (also bound as UAV `s0+1480` on `0x1b1b05d5590`), SRV `s0+200` 608,000 elements, SRV `s0+712` 960,000, UAVs `s1+8/16/24`, and UAV `s1+32` = a 6,416-byte range at offset 58,927,424,544 of `0x1b1a38a7650`. So with no loop lifted it still hangs, and the hang is in a 10- or 20-group title dispatch: a few groups looping forever, not a big workload. Since the title builder is replaced on the hardware path, my first guess would be one of the title's programs that reads something the builder used to write (sizes, counts, node pointers) and now finds unwritten. Only a guess. Do 89d08e56 / 55679a05 appear in your lift report or in the builder's consumers? Aftermath dumps are now on here as well; the next run (`LIFT=0`, no DRED) should give a crash dump with the faulting shader if the driver records one.
matching 14,763 builds + 2,319 rehydrates (11.3 s CPU preparation); a 4070
Ti SUPER lost the device within 120 s. Thousands of builds in one
submission can pass Windows' 2 s TDR.

- Per frame at most 256 builds+rehydrates / 64 MB of inputs (one always
  goes, whatever its size) and 2,048 refits; the rest waits for the next
  frames in order of first request (a newer request for the same structure
  replaces it in place; builds and refits each never pass an older one).
  CPU decoding (quant24, meshlet) is deferred with it. Requests with
  postbuild info are never deferred; a copy from a waiting structure gives
  its build first; freed memory drops what waits there.
- Instances naming a BLAS that waits get InstanceMask 0 (remap table entry
  with host address 0), never the old structure; counted on the card.
- BLAS work given in chunks (64 builds / 16 MB), each behind a DRED marker
  with its counts; waiting work goes before every TLAS build.
- 5 s line 'hardware RT budget': deferred builds/rehydrates/refits, most
  given/deferred per frame, most waiting, frames with a backlog, chunks,
  instances masked for a BLAS not built yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PVi6XmTj4ohPL7QwUeFgV4
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 09:22 UTC · original

The per-frame budget is pushed: PR head a950fae3. At most 256 BLAS builds + rehydrates and 64 MB of build input per frame, plus 2,048 refits; the rest waits in FIFO order of first request. At least one build always goes, so nothing starves, and the CPU decode is deferred with its build. Instances whose BLAS isn't ready get mask 0 (a brief miss, never an old or freed structure). The per-frame BLAS work is chunked (64 builds / 16 MB) with one DRED marker per chunk, and a new 5 s line hardware RT budget counts deferrals, backlog and masked instances. A ~17k-build burst like ColorC's drains in about a second of backlog instead of one multi-second submission. @⁠eleboucher a950fae3 is the head to try (it keeps VICTORY_HW_RT_LIFT=0 available too).

**@⁠dyshay** on GitHub · 2026-11-30 09:22 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7274122504) The per-frame budget is pushed: PR head `a950fae3`. At most 256 BLAS builds + rehydrates and 64 MB of build input per frame, plus 2,048 refits; the rest waits in FIFO order of first request. At least one build always goes, so nothing starves, and the CPU decode is deferred with its build. Instances whose BLAS isn't ready get mask 0 (a brief miss, never an old or freed structure). The per-frame BLAS work is chunked (64 builds / 16 MB) with one DRED marker per chunk, and a new 5 s line `hardware RT budget` counts deferrals, backlog and masked instances. A ~17k-build burst like ColorC's drains in about a second of backlog instead of one multi-second submission. @⁠eleboucher `a950fae3` is the head to try (it keeps `VICTORY_HW_RT_LIFT=0` available too).
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 09:24 UTC · original

Building a950fae3 (+#3740) now; next on the PC are two runs, default lift and VICTORY_HW_RT_LIFT=0, DRED on (for the chunk markers), with the Aftermath monitor collecting crash dumps. Results here when done.

**@⁠eleboucher** on GitHub · 2026-11-30 09:24 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7274167112) Building `a950fae3` (+#3740) now; next on the PC are two runs, default lift and `VICTORY_HW_RT_LIFT=0`, DRED on (for the chunk markers), with the Aftermath monitor collecting crash dumps. Results here when done.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 09:24 UTC · original

@⁠eleboucher Both compute programs appear in our local cache. 89d08e561897d4e5 and 55679a0547649d0b each decode to one compute program with zero image_bvh instructions. Both produce byte-identical DXIL with our RayQuery translator enabled and disabled. Neither is a lift candidate here. That leaves what they read and write open.

@⁠dyshay With LIFT=0 still hanging, can we compare the producer order, allocation generation and initialized range of the shared buffer under the stock and replacement builders just before these two dispatches? A diagnostic that records only range sizes and readiness codes would be enough for a first comparison. The new cap helps isolate scheduling pressure separately. Our experiment keeps the original dispatch whenever the needed mask lacks confirmed coverage.

**@⁠akimfomin** on GitHub · 2026-11-30 09:24 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7274167415) @⁠eleboucher Both compute programs appear in our local cache. `89d08e561897d4e5` and `55679a0547649d0b` each decode to one compute program with zero `image_bvh` instructions. Both produce byte-identical DXIL with our RayQuery translator enabled and disabled. Neither is a lift candidate here. That leaves what they read and write open. @⁠dyshay With `LIFT=0` still hanging, can we compare the producer order, allocation generation and initialized range of the shared buffer under the stock and replacement builders just before these two dispatches? A diagnostic that records only range sizes and readiness codes would be enough for a first comparison. The new cap helps isolate scheduling pressure separately. Our experiment keeps the original dispatch whenever the needed mask lacks confirmed coverage.
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 09:32 UTC · original

Aftermath crash dumps (driver 621.24, Global mode via nv-aftermath-control, no SDK in the layer) name the fault, which DRED never did. On 7bbd5e56 LIFT=0 and a950fae3 with default lift and LIFT=0 (three runs, all lost inside 120 s, all 0x887A0006), the dumps agree:

Device state: Reset, Engine reset occurred: true
Faulted Warps: Misaligned Address Error: "A shader instruction accessed an address that is not aligned."
Shader: compute, NV shader hash 0x145B3497B18876A7 (1466823929762444967), 103,424 bytes
Shader GPU PC: compute_01 @ 0x000191d0, mapping dxil:8519

Same shader, same instruction, with and without lifting, so it is not the RayQuery code. It is a compute program that does an unaligned load or store, most likely a raw-buffer or structured access whose address now comes out misaligned on the hardware path (an offset, stride or base the replaced builder or the remap writes differently: e.g. a 4-byte Load at an address that is only 2-byte aligned, or a Load4 not on 16 bytes). The layer's in-flight report for these runs pointed at title compute fdd56d97a806bcca (a950fae3) and 89d08e561897d4e5 / 55679a0547649d0b (7bbd5e56), which all bind the 182 MB buffer at s0+688.

Next here: a run with VICTORY_SHADER_SAVE so nv-aftermath-format -B can map 0x145B3497B18876A7 to the title's shader hash and DXIL line. Happy to share the .nv-gpudmp files if useful.

**@⁠eleboucher** on GitHub · 2026-11-30 09:32 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7274356754) Aftermath crash dumps (driver 621.24, Global mode via `nv-aftermath-control`, no SDK in the layer) name the fault, which DRED never did. On `7bbd5e56` `LIFT=0` and `a950fae3` with default lift and `LIFT=0` (three runs, all lost inside 120 s, all `0x887A0006`), the dumps agree: ``` Device state: Reset, Engine reset occurred: true Faulted Warps: Misaligned Address Error: "A shader instruction accessed an address that is not aligned." Shader: compute, NV shader hash 0x145B3497B18876A7 (1466823929762444967), 103,424 bytes Shader GPU PC: compute_01 @ 0x000191d0, mapping dxil:8519 ``` Same shader, same instruction, with and without lifting, so it is not the RayQuery code. It is a compute program that does an unaligned load or store, most likely a raw-buffer or structured access whose address now comes out misaligned on the hardware path (an offset, stride or base the replaced builder or the remap writes differently: e.g. a 4-byte `Load` at an address that is only 2-byte aligned, or a `Load4` not on 16 bytes). The layer's in-flight report for these runs pointed at title compute `fdd56d97a806bcca` (`a950fae3`) and `89d08e561897d4e5` / `55679a0547649d0b` (`7bbd5e56`), which all bind the 182 MB buffer at `s0+688`. Next here: a run with `VICTORY_SHADER_SAVE` so `nv-aftermath-format -B` can map `0x145B3497B18876A7` to the title's shader hash and DXIL line. Happy to share the `.nv-gpudmp` files if useful.
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 09:39 UTC · original

@⁠eleboucher this is the breakthrough, thank you, and the Aftermath route was the right call. "Misaligned Address Error" in the same compute shader with and without lifting moves the fault from RayQuery to where the title's buffers sit.

One thing that stands out: 55679a0547649d0b is CS_Tree_BatchCull's second dispatch. It's the one SlaktarnVI found reading a structured view that isn't 16-byte aligned (a raw twin made null), and we found ~6,000 such views a frame on NVIDIA. That suggests a concrete mechanism for "only on the hardware path". Our HLE builder answers the title's prebuild-size queries itself, and the title then packs the BVH buffers into its graphics heap (the 182 MB buffer at s0+688) by those sizes. If our answers aren't rounded the way the console library's are (256-byte AS alignment, or the scratch/result size granularity), every buffer the title places after them shifts. Raw and structured views into that heap would then land on offsets the shaders assume are aligned, and on your driver a misaligned raw access faults. The 4090 here may tolerate it, or our heap layout may differ.

I'm checking our size answers against the alignment rules now, and will push a fix that rounds them as the console does if they don't. In the meantime, the VICTORY_SHADER_SAVE mapping of 0x145B3497B18876A7 to a title hash and DXIL line would confirm which load it is (likely a RawBufferLoad/Load4 through s0+688). If you can, also post the u4/u5 and the SRV offsets for the failing dispatch under both builders.

**@⁠dyshay** on GitHub · 2026-11-30 09:39 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7274507261) @⁠eleboucher this is the breakthrough, thank you, and the Aftermath route was the right call. "Misaligned Address Error" in the same compute shader with and without lifting moves the fault from RayQuery to *where the title's buffers sit*. One thing that stands out: `55679a0547649d0b` is `CS_Tree_BatchCull`'s second dispatch. It's the one SlaktarnVI found reading a structured view that isn't 16-byte aligned (a raw twin made null), and we found ~6,000 such views a frame on NVIDIA. That suggests a concrete mechanism for "only on the hardware path". Our HLE builder answers the title's prebuild-size queries itself, and the title then packs the BVH buffers into its graphics heap (the 182 MB buffer at `s0+688`) by those sizes. If our answers aren't rounded the way the console library's are (256-byte AS alignment, or the scratch/result size granularity), every buffer the title places after them shifts. Raw and structured views into that heap would then land on offsets the shaders assume are aligned, and on your driver a misaligned raw access faults. The 4090 here may tolerate it, or our heap layout may differ. I'm checking our size answers against the alignment rules now, and will push a fix that rounds them as the console does if they don't. In the meantime, the `VICTORY_SHADER_SAVE` mapping of `0x145B3497B18876A7` to a title hash and DXIL line would confirm which load it is (likely a `RawBufferLoad`/`Load4` through `s0+688`). If you can, also post the `u4`/`u5` and the SRV offsets for the failing dispatch under both builders.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 09:41 UTC · original

@⁠eleboucher I checked the additional fdd56d97a806bcca from the a950fae3 report too. It has one decoded compute program, no BVH instructions, and identical DXIL with and without our lift, like the other two. The Aftermath mapping would tell us whether any of these three is the shader that actually faulted. The mapped title hash, operation width, and offset modulo alignment are enough to share here. Please keep the raw dump local.

@⁠dyshay I’ll check the stock builder’s size and alignment distributions on our path, so a comparison can distinguish a layout change from a misaligned access already present in stock. Keeping the engine’s requested size, returned result and scratch sizes, and allocation alignment as separate fields should make that useful.

**@⁠akimfomin** on GitHub · 2026-11-30 09:41 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7274547401) @⁠eleboucher I checked the additional `fdd56d97a806bcca` from the `a950fae3` report too. It has one decoded compute program, no BVH instructions, and identical DXIL with and without our lift, like the other two. The Aftermath mapping would tell us whether any of these three is the shader that actually faulted. The mapped title hash, operation width, and offset modulo alignment are enough to share here. Please keep the raw dump local. @⁠dyshay I’ll check the stock builder’s size and alignment distributions on our path, so a comparison can distinguish a layout change from a misaligned access already present in stock. Keeping the engine’s requested size, returned result and scratch sizes, and allocation alignment as separate fields should make that useful.
The hardware path copied the host's own compacted and current sizes into
the title's slots. Those are another card's layout, with no promise of
being a multiple of 256, and the title places what follows a compacted
structure after it. They are now the size told at prebuild (host size,
at least 256, a multiple of 256), as the title's own builder path answers
them with VICTORY_BVH_SIZE_ANSWER (on by default). Written with
WriteBufferImmediate; serialization info is still emitted by the host.

Diagnostics builds: 'BVH size answer' once per distinct (builder, kind,
input shape, sizes) under both builders, with the size % 256; 'a buffer
view off 16 bytes' once per distinct (kind, residue, element, inside the
0x28960000 buffer) and counts by first byte % 16 at each power of two.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PVi6XmTj4ohPL7QwUeFgV4
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 09:55 UTC · original

Pushed as 22a6600b: one real difference, plus two diagnostics so we can see if it's the cause.

The difference. After a build, the hardware path wrote the driver's raw compacted and current sizes into the title's post-build slots. D3D12 doesn't promise those are multiples of 256, and the title sizes and places its compacted copies with them. The software path (the real library + VICTORY_BVH_SIZE_ANSWER) always writes 256-aligned sizes. Now the hardware path writes the size it announced at prebuild (≥ 256 and a multiple of 256). Prebuild answers were already multiples of 256, so nothing shifted from those.

Diagnostics (diagnostics builds):

  • BVH size answer: one line per distinct (builder, kind of answer, input shape, sizes), with size % 256, under both builders and with the same shape key, so a run on each can be compared line by line.
  • a buffer view off 16 bytes: one line per distinct case of a buffer SRV/UAV whose start isn't 16-aligned (view kind, start % 16, element size, inside the 0x28960000 heap or not), plus counters by remainder. All our raw loads declare 4-byte alignment, so a fault would need a view starting at an address that is 1–3 mod 4. This line will show whether that happens.

@⁠eleboucher if you run 22a6600b, the most useful output would be the device result plus those two log families (a diagnostics build), compared with the same save on the software builder.

**@⁠dyshay** on GitHub · 2026-11-30 09:55 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7274875658) Pushed as `22a6600b`: one real difference, plus two diagnostics so we can see if it's the cause. **The difference.** After a build, the hardware path wrote the driver's raw compacted and current sizes into the title's post-build slots. D3D12 doesn't promise those are multiples of 256, and the title sizes and places its compacted copies with them. The software path (the real library + `VICTORY_BVH_SIZE_ANSWER`) always writes 256-aligned sizes. Now the hardware path writes the size it announced at prebuild (≥ 256 and a multiple of 256). Prebuild answers were already multiples of 256, so nothing shifted from those. **Diagnostics (diagnostics builds):** - `BVH size answer`: one line per distinct (builder, kind of answer, input shape, sizes), with size % 256, under both builders and with the same shape key, so a run on each can be compared line by line. - `a buffer view off 16 bytes`: one line per distinct case of a buffer SRV/UAV whose start isn't 16-aligned (view kind, start % 16, element size, inside the 0x28960000 heap or not), plus counters by remainder. All our raw loads declare 4-byte alignment, so a fault would need a view starting at an address that is 1–3 mod 4. This line will show whether that happens. @⁠eleboucher if you run `22a6600b`, the most useful output would be the device result plus those two log families (a diagnostics build), compared with the same save on the software builder.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 09:56 UTC · original

@⁠dyshay The stock-builder audit reached the house and exited normally on 4070 Ti SUPER, Series X, internal 2560×1440, no DLSS or FG. Here are the independent counts from its prebuild returns and recorded allocations.

Stock sample Result size divisible by 256 Build scratch size divisible by 256 Update scratch size divisible by 256, nonzero only
2,048 BLAS prebuild returns 2,048 62 808 of 1,388
2,048 TLAS prebuild returns 2,048 0 0 nonzero returns

All observed destination and scratch addresses were divisible by 256 in the 24,576 batched BLAS and 2,048 batched TLAS descriptors. All nonzero update source addresses were too. This separates the title’s stock allocation alignment from the divisibility of the returned scratch byte counts. It is consistent with treating the post-build result size contract and the actual scratch pointer alignment separately. The device-loss outcome on 22a6600b is still the discriminating check.

**@⁠akimfomin** on GitHub · 2026-11-30 09:56 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7274894383) @⁠dyshay The stock-builder audit reached the house and exited normally on 4070 Ti SUPER, Series X, internal 2560×1440, no DLSS or FG. Here are the independent counts from its prebuild returns and recorded allocations. | Stock sample | Result size divisible by 256 | Build scratch size divisible by 256 | Update scratch size divisible by 256, nonzero only | | --- | ---: | ---: | ---: | | 2,048 BLAS prebuild returns | 2,048 | 62 | 808 of 1,388 | | 2,048 TLAS prebuild returns | 2,048 | 0 | 0 nonzero returns | All observed destination and scratch **addresses** were divisible by 256 in the 24,576 batched BLAS and 2,048 batched TLAS descriptors. All nonzero update source addresses were too. This separates the title’s stock allocation alignment from the divisibility of the returned scratch byte counts. It is consistent with treating the post-build result size contract and the actual scratch pointer alignment separately. The device-loss outcome on `22a6600b` is still the discriminating check.
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 09:57 UTC · original

Narrowed to one program. The layer's in-flight report at every hardware-path removal (7bbd5e56 LIFT=0, a950fae3 lift and LIFT=0) names title compute 89d08e561897d4e5 (dispatch 10x1x1, ~15-17 commands into a 46-command list). With VICTORY_SHADER_SAVE and dxc -dumpbin, its DXIL near the Aftermath PC (dxil:8519) is a chain of raw loads whose byte offsets come from buffer contents, never masked to 4:

%36 = shl (WaveReadLaneFirst idx), 2
%39 = rawBufferLoad.f32(heap[%17] /*ByteAddressBuffer*/, %36, mask 1, align 4)   ; %41 = this value
%45 = rawBufferLoad.f32(heap[%21], %41 + 60, align 4) ... %69 = rawBufferLoad(heap[%21], %41 + 4)   ; %71 = this value
%8508/8511/8514 = rawBufferLoad.f32(heap[%21], %71 + 376 / 380 / 384, align 4)   ; just before dxil:8519

So %41 is an offset the title stores in one buffer, and %71 an offset stored at %41 + 4 in another. If either holds a value that is not a multiple of 4, every one of these 4-byte loads is misaligned: NVIDIA silently ignores the low bits normally, and Aftermath's shader error reporting turns it into the fault we see. On current main with the software builder, the same program faults the same way under Aftermath's shader error reporting, and it runs clean without it. So the latent misalignment exists there too. On the hardware path, if the builder's outputs that this program reads (headers or offsets at %41, %71) are no longer written by the title's builder, the offsets are whatever the memory holds, which would fit the real removals. That is a hypothesis.

Question for you: does 89d08e561897d4e5 read the console structures or instance data that XboxBvhBuilder used to write (offset 60/64 headers, a table at +376)? If yes, the HLE builder needs to write those fields too (or the program must be fed the host-side equivalent). The full disassembly is available if useful.

**@⁠eleboucher** on GitHub · 2026-11-30 09:57 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7274921040) Narrowed to one program. The layer's in-flight report at every hardware-path removal (`7bbd5e56` LIFT=0, `a950fae3` lift and LIFT=0) names title compute **`89d08e561897d4e5`** (`dispatch 10x1x1`, ~15-17 commands into a 46-command list). With `VICTORY_SHADER_SAVE` and `dxc -dumpbin`, its DXIL near the Aftermath PC (`dxil:8519`) is a chain of raw loads whose byte offsets come from buffer contents, never masked to 4: ``` %36 = shl (WaveReadLaneFirst idx), 2 %39 = rawBufferLoad.f32(heap[%17] /*ByteAddressBuffer*/, %36, mask 1, align 4) ; %41 = this value %45 = rawBufferLoad.f32(heap[%21], %41 + 60, align 4) ... %69 = rawBufferLoad(heap[%21], %41 + 4) ; %71 = this value %8508/8511/8514 = rawBufferLoad.f32(heap[%21], %71 + 376 / 380 / 384, align 4) ; just before dxil:8519 ``` So `%41` is an offset the title stores in one buffer, and `%71` an offset stored at `%41 + 4` in another. If either holds a value that is not a multiple of 4, every one of these 4-byte loads is misaligned: NVIDIA silently ignores the low bits normally, and Aftermath's shader error reporting turns it into the fault we see. On current `main` with the software builder, the same program faults the same way under Aftermath's shader error reporting, and it runs clean without it. So the latent misalignment exists there too. On the hardware path, if the builder's outputs that this program reads (headers or offsets at `%41`, `%71`) are no longer written by the title's builder, the offsets are whatever the memory holds, which would fit the real removals. That is a hypothesis. Question for you: does `89d08e561897d4e5` read the console structures or instance data that `XboxBvhBuilder` used to write (offset 60/64 headers, a table at +376)? If yes, the HLE builder needs to write those fields too (or the program must be fed the host-side equivalent). The full disassembly is available if useful.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 10:08 UTC · original

@⁠eleboucher The stock run with shader error reporting is an important control. It shows that the reported instruction alone cannot explain the device losses seen with the reporting option off. I can inspect the same pass using our stock builder and compare its bound buffer ranges with the preceding builder output ranges. A shared backing heap alone does not identify the writer. I’ll look for a producer or copy that covers the specific view before the dispatch. No need to post the disassembly. The 22a6600b test with error reporting off is the separate check for the original device loss.

**@⁠akimfomin** on GitHub · 2026-11-30 10:08 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7275195063) @⁠eleboucher The stock run with shader error reporting is an important control. It shows that the reported instruction alone cannot explain the device losses seen with the reporting option off. I can inspect the same pass using our stock builder and compare its bound buffer ranges with the preceding builder output ranges. A shared backing heap alone does not identify the writer. I’ll look for a producer or copy that covers the specific view before the dispatch. No need to post the disassembly. The `22a6600b` test with error reporting off is the separate check for the original device loss.
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 10:24 UTC · original

Thanks both. 22a6600b (+#3740) is built and queued here with error reporting off (Aftermath disabled, DRED on), default lift, 10 min; result in this thread.

On the misaligned access itself, the AMD RDNA2 ISA reference settles what the console does. Section 7 (scalar memory): "The two LSBs of V#.base and of the final address are ignored to force Dword alignment." Section 8.1.7 says the same for non-formatted dword-or-wider buffer ops in the default DWORD alignment mode. 89d08e561897d4e5 loads byte offsets with s_buffer_load and reuses them as SGPR offsets of later s_buffer_loads. Our DXIL passed those offsets to rawBufferLoad without clearing bits 0-1. On the console that is well defined (rounded down). In D3D12 it is a misaligned access, tolerated silently by NVIDIA and fatal under Aftermath's shader error reporting. So the instruction Aftermath reports is a translator bug in main, independent of #3706. I have a translator fix under test here: the final SMEM address (and dword+ MUBUF addresses) is masked with & ~3, with a unit test. I'll open it as its own PR once the PC runs confirm it, and say whether it changes the hardware-path removals.

**@⁠eleboucher** on GitHub · 2026-11-30 10:24 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7275536545) Thanks both. `22a6600b` (+#3740) is built and queued here with error reporting off (Aftermath disabled, DRED on), default lift, 10 min; result in this thread. On the misaligned access itself, the AMD RDNA2 ISA reference settles what the console does. Section 7 (scalar memory): "The two LSBs of V#.base and of the final address are ignored to force Dword alignment." Section 8.1.7 says the same for non-formatted dword-or-wider buffer ops in the default DWORD alignment mode. `89d08e561897d4e5` loads byte offsets with `s_buffer_load` and reuses them as SGPR offsets of later `s_buffer_load`s. Our DXIL passed those offsets to `rawBufferLoad` without clearing bits 0-1. On the console that is well defined (rounded down). In D3D12 it is a misaligned access, tolerated silently by NVIDIA and fatal under Aftermath's shader error reporting. So the instruction Aftermath reports is a translator bug in main, independent of #3706. I have a translator fix under test here: the final SMEM address (and dword+ MUBUF addresses) is masked with `& ~3`, with a unit test. I'll open it as its own PR once the PC runs confirm it, and say whether it changes the hardware-path removals.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 10:27 UTC · original

@⁠eleboucher I ran the stock producer/consumer control on RTX 4070 Ti SUPER (617.14), native 1440p Series X with full RT. The specific compute pass had 115 resolved raw-view observations across 11 sampled dispatches. Zero view ranges intersected the tracked preceding stock builder destinations (batched/rehydrate reported ranges or a 64-byte typed-copy prefix, up to 8,192 preceding records). The stock scene loaded at the house and exited normally. This is a bounded negative result. It leaves untracked writers, copies to another range, and data-dependent byte offsets open. Thanks for finding the RDNA2 rule. Once you have the translator PR, I can cross-check a generated case with a dynamic offset plus immediate add crossing a dword boundary, and share only the generated fixture and summary.

**@⁠akimfomin** on GitHub · 2026-11-30 10:27 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7275628324) @⁠eleboucher I ran the stock producer/consumer control on RTX 4070 Ti SUPER (617.14), native 1440p Series X with full RT. The specific compute pass had 115 resolved raw-view observations across 11 sampled dispatches. Zero view ranges intersected the tracked preceding stock builder destinations (batched/rehydrate reported ranges or a 64-byte typed-copy prefix, up to 8,192 preceding records). The stock scene loaded at the house and exited normally. This is a bounded negative result. It leaves untracked writers, copies to another range, and data-dependent byte offsets open. Thanks for finding the RDNA2 rule. Once you have the translator PR, I can cross-check a generated case with a dynamic offset plus immediate add crossing a dword boundary, and share only the generated fixture and summary.
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 10:39 UTC · original

@⁠eleboucher excellent find, and the ISA citation settles it: the console drops the two low bits, and our DXIL kept them. That's a translator correctness fix for main, independent of this PR, so I'll leave it to your PR rather than duplicate it, and test it on the 4090 as soon as it's up (we have a static save for exactly that). If the removals on the hardware path go away with it, the explanation would be that on this path different, not-dword-aligned offsets reach those loads more often, and NVIDIA's tolerance doesn't hold on your card/driver outside Aftermath.

@⁠akimfomin thanks for the stock-builder control and the alignment counts. Every observed address divisible by 256, while the scratch byte counts often aren't, matches the change in 22a6600b (announce 256-multiple sizes, separate from pointer alignment).

**@⁠dyshay** on GitHub · 2026-11-30 10:39 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7275901632) @⁠eleboucher excellent find, and the ISA citation settles it: the console drops the two low bits, and our DXIL kept them. That's a translator correctness fix for `main`, independent of this PR, so I'll leave it to your PR rather than duplicate it, and test it on the 4090 as soon as it's up (we have a static save for exactly that). If the removals on the hardware path go away with it, the explanation would be that on this path different, not-dword-aligned offsets reach those loads more often, and NVIDIA's tolerance doesn't hold on your card/driver outside Aftermath. @⁠akimfomin thanks for the stock-builder control and the alignment counts. Every observed address divisible by 256, while the scratch byte counts often aren't, matches the change in `22a6600b` (announce 256-multiple sizes, separate from pointer alignment).
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 11:02 UTC · original

22a6600b (+#3740), error reporting off (Aftermath disabled), VICTORY_HW_RT=1 VICTORY_BVH_MISS=1, DRED on, native 1440p Series X: 13.3 fps at t=120 s with the hardware path, then device removed (0x887A0005) before t=240 s. DRED breadcrumbs empty again. The layer's in-flight report: 1 submission of 8 lists, stopped in list 1 at a texture copy (copy to ... 64x150 f29). So the size answers alone do not stop it here. For comparison: plain main 41adb551 with the software builder also loses the device on this PC with ray tracing on (11 of 11 runs today, 120-240 s), so part of what we see may be a main issue rather than this PR. Translator fix for the misaligned SMEM access is up as #3894; it removes the Aftermath-reported fault but not these removals.

**@⁠eleboucher** on GitHub · 2026-11-30 11:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7276453120) `22a6600b` (+#3740), error reporting off (Aftermath disabled), `VICTORY_HW_RT=1 VICTORY_BVH_MISS=1`, DRED on, native 1440p Series X: **13.3 fps at t=120 s** with the hardware path, then device removed (0x887A0005) before t=240 s. DRED breadcrumbs empty again. The layer's in-flight report: 1 submission of 8 lists, stopped in list 1 at a texture copy (`copy to ... 64x150 f29`). So the size answers alone do not stop it here. For comparison: plain `main` 41adb551 with the software builder also loses the device on this PC with ray tracing on (11 of 11 runs today, 120-240 s), so part of what we see may be a `main` issue rather than this PR. Translator fix for the misaligned SMEM access is up as #3894; it removes the Aftermath-reported fault but not these removals.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 11:04 UTC · original

@⁠eleboucher Thanks for keeping the same native profile and checking both builders. The 13.3 fps point before removal is useful, and the 11/11 stock failures distinguish this from a hardware-builder-only result. On our 4070 Ti SUPER with 617.14, the pinned stock control reaches the same kind of open-world scene and exits normally after our short diagnostic windows. Those runs are shorter than your 120–240 s failure window. I’ll check a longer control separately and test #3894 against a generated SGPR+immediate carry case. If you have an aggregate for local VRAM use vs budget and queued flights just before the stock loss, that would help compare the texture-copy path. No dump or private log needed.

**@⁠akimfomin** on GitHub · 2026-11-30 11:04 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7276487280) @⁠eleboucher Thanks for keeping the same native profile and checking both builders. The 13.3 fps point before removal is useful, and the 11/11 stock failures distinguish this from a hardware-builder-only result. On our 4070 Ti SUPER with 617.14, the pinned stock control reaches the same kind of open-world scene and exits normally after our short diagnostic windows. Those runs are shorter than your 120–240 s failure window. I’ll check a longer control separately and test #3894 against a generated SGPR+immediate carry case. If you have an aggregate for local VRAM use vs budget and queued flights just before the stock loss, that would help compare the texture-copy path. No dump or private log needed.
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 11:09 UTC · original

Aggregates from today's stock main losses here (41adb551 + #3740, software builder, ray tracing on, no Aftermath), taken from the last samples before each removal:

  • Card memory: 13.4-14.1 GB in use of a 15.07 GB budget (the card's own 14064 MB in use of a budget of 15066 MB at the last sample of one run), plus 3.6-4.3 GB of PC memory shared with the card.
  • PC memory: 16 GB RAM, 32-34 GB committed, 0.3-1.2 GB free. This box is tight on system RAM.
  • In flight at removal: mostly 1 submissions sent ahead (VICTORY_RELAY=1) of 1-8 lists, all 0x887A0005. One run was 0x887A0006 (hung) with 20 submissions / 245 lists ahead.
  • Timing: lost between 120 and 240 s after the start in 11 of 11 runs. Under Aftermath capture mode (no error reporting) and under DRED, the same build ran 8-10 min without loss. Both change timing, which points at a race rather than a faulting shader.

To find what changed, I'm bisecting main's first-parent merges since the goal1/main merge-base 7fcac7f1 (that older base ran 19/19 clean today), 2 x 5-min legs per step. I'll post the first bad merge here.

**@⁠eleboucher** on GitHub · 2026-11-30 11:09 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7276616237) Aggregates from today's stock `main` losses here (41adb551 + #3740, software builder, ray tracing on, no Aftermath), taken from the last samples before each removal: - Card memory: 13.4-14.1 GB in use of a 15.07 GB budget (`the card's own 14064 MB in use of a budget of 15066 MB` at the last sample of one run), plus 3.6-4.3 GB of PC memory shared with the card. - PC memory: 16 GB RAM, 32-34 GB committed, 0.3-1.2 GB free. This box is tight on system RAM. - In flight at removal: mostly `1 submissions sent ahead (VICTORY_RELAY=1)` of 1-8 lists, all 0x887A0005. One run was 0x887A0006 (hung) with 20 submissions / 245 lists ahead. - Timing: lost between 120 and 240 s after the start in 11 of 11 runs. Under Aftermath capture mode (no error reporting) and under DRED, the same build ran 8-10 min without loss. Both change timing, which points at a race rather than a faulting shader. To find what changed, I'm bisecting `main`'s first-parent merges since the goal1/main merge-base 7fcac7f1 (that older base ran 19/19 clean today), 2 x 5-min legs per step. I'll post the first bad merge here.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 11:28 UTC · original

@⁠eleboucher I completed the longer stock control. The Lab baseline e660311e on RTX 4070 Ti SUPER (617.14), 32 GB RAM, native 2560×1440 Series X, full stock RT, DLSS/FG off, stayed in the open-world house scene for 254 seconds after visual confirmation and exited normally. The camera alternated between idle and AFK views. No device removal or hang was logged. In 156 samples, dedicated GPU memory was 12,331–12,807 MB with a 14,655–14,906 MB budget, shared GPU memory 6,861–7,240 MB, and system commit 31,642–33,186 MB. This control has a different revision, driver and RAM capacity from your stock reproduction. Your bisect is the useful evidence for the first bad change. The source-only scalar fixture is tracked separately in #3894.

**@⁠akimfomin** on GitHub · 2026-11-30 11:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7277083841) @⁠eleboucher I completed the longer stock control. The Lab baseline e660311e on RTX 4070 Ti SUPER (617.14), 32 GB RAM, native 2560×1440 Series X, full stock RT, DLSS/FG off, stayed in the open-world house scene for 254 seconds after visual confirmation and exited normally. The camera alternated between idle and AFK views. No device removal or hang was logged. In 156 samples, dedicated GPU memory was 12,331–12,807 MB with a 14,655–14,906 MB budget, shared GPU memory 6,861–7,240 MB, and system commit 31,642–33,186 MB. This control has a different revision, driver and RAM capacity from your stock reproduction. Your bisect is the useful evidence for the first bad change. The source-only scalar fixture is tracked separately in #3894.
BLASes went only when the title freed their memory: on an RTX 4090 AS
memory went from 370 MB at 3 min to 1,583 MB at 20 min (10.2k live); on a
16 GB RTX 5070 Ti the card's memory passed its budget within 4 min, then a
device loss.

- The instance remap marks each table slot it finds with the TLAS build's
  stamp (g_used, a word per slot), copied to a readback buffer; read when
  the list is reset after its last execution (Feedback, HostList::hold).
- Past the budget (10% of the DXGI local budget, 256 MB..1.5 GB), the
  BLASes no instance named for 120 frames before the horizon (the oldest
  TLAS whose marks are still in flight) go from the lookup table, oldest
  first, down to 90% of it, at most 512 a frame; never one waiting, nor
  one without a request of the title's to build it from.
- Evicted BLASes stay in the remap table with host address 0 (instances
  masked); one named again is built again from the title's last request
  (no update, no postbuild) through the per-frame build budget.
- BLAS bytes are counted by a BlasMemory held by the lookup table and by
  every TLAS/table snapshot (BlasRefs); retired with the buffer, counted
  freed only when the last holder is dropped past its fence.
- Line every 5 s 'hardware RT BLAS memory': budget, live, pinned, evicted,
  named again, rebuilt after eviction, bytes freed past their fence.

No switch (a leak fix); the numbers are constants. CPU tests: never judged
on a TLAS in flight, LRU order, freed only past the last fence, rebuilt
after eviction (and copies).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PVi6XmTj4ohPL7QwUeFgV4
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 11:46 UTC · original

PR head 121d0dc8 adds the BLAS memory budget with LRU eviction, as discussed. Here is how it stays fence-safe. The remap shader stamps every BLAS entry a TLAS build actually resolves. Those stamps are read back after the list's last execution, so eviction only judges up to the oldest TLAS whose stamps are back, and a BLAS a TLAS in flight can name is never evicted. Each BLAS's bytes are shared between the lookup table and the TLAS snapshots holding it. Its memory counts as freed only when the last holder is released after its fence. An evicted BLAS stays in the table at address 0 (its instances are masked) and is rebuilt from the title's last request when an instance names it again, through the per-frame build budget. Defaults: budget 10 % of the DXGI local budget (256 MB to 1.5 GB), trim to 90 %, unused for 120 frames before eviction, at most 512 evictions a frame. A 5 s line hardware RT BLAS memory shows budget / live / pinned / evicted / renamed / rebuilt / freed after fence. @⁠voidharbor this is the head to check the memory growth against. Our 20-minute run is queued.

**@⁠dyshay** on GitHub · 2026-11-30 11:46 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7277501331) PR head `121d0dc8` adds the BLAS memory budget with LRU eviction, as discussed. Here is how it stays fence-safe. The remap shader stamps every BLAS entry a TLAS build actually resolves. Those stamps are read back after the list's last execution, so eviction only judges up to the oldest TLAS whose stamps are back, and a BLAS a TLAS in flight can name is never evicted. Each BLAS's bytes are shared between the lookup table and the TLAS snapshots holding it. Its memory counts as freed only when the last holder is released after its fence. An evicted BLAS stays in the table at address 0 (its instances are masked) and is rebuilt from the title's last request when an instance names it again, through the per-frame build budget. Defaults: budget 10 % of the DXGI local budget (256 MB to 1.5 GB), trim to 90 %, unused for 120 frames before eviction, at most 512 evictions a frame. A 5 s line `hardware RT BLAS memory` shows budget / live / pinned / evicted / renamed / rebuilt / freed after fence. @⁠voidharbor this is the head to check the memory growth against. Our 20-minute run is queued.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 11:55 UTC · original

@⁠dyshay Thanks for the exact LRU head. I checked the pass that writes a zero BLAS address for waiting or evicted entries. Our quality target keeps the original traversal whenever a pass’s needed instance masks are incomplete, so I’m interested in the interval after a required evicted BLAS is named again and before the rebuilt one is visible to the TLAS. Does your queued run expose remap resolutions for waiting/evicted instances and the number of frames until the same addresses recover? The existing pinned/live/freed counters cover memory ownership. The additional counts would tell us how many rendered frames actually have a temporary coverage gap. I can test the before-and-after cases in a generated scene independently from the game.

**@⁠akimfomin** on GitHub · 2026-11-30 11:55 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7277697684) @⁠dyshay Thanks for the exact LRU head. I checked the pass that writes a zero BLAS address for waiting or evicted entries. Our quality target keeps the original traversal whenever a pass’s needed instance masks are incomplete, so I’m interested in the interval after a required evicted BLAS is named again and before the rebuilt one is visible to the TLAS. Does your queued run expose remap resolutions for waiting/evicted instances and the number of frames until the same addresses recover? The existing pinned/live/freed counters cover memory ownership. The additional counts would tell us how many rendered frames actually have a temporary coverage gap. I can test the before-and-after cases in a generated scene independently from the game.
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 12:40 UTC · original

@⁠akimfomin good question. The 5 s line already counts BLAS named again after eviction (renamed) and those rebuilt (rebuilt after eviction), but not the gap itself. I'll add two numbers to it: TLAS instances resolved to a zero address because their BLAS was evicted (separate from those still waiting for their first build), and the frames from a BLAS being named again to its rebuilt address being visible. With 120 unused frames before eviction and rebuilds going through the per-frame budget, I expect the gap to be 1-3 frames and rare on a static scene; the walking run will tell. I'll post both from our run.

**@⁠dyshay** on GitHub · 2026-11-30 12:40 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7278757796) @⁠akimfomin good question. The 5 s line already counts BLAS named again after eviction (`renamed`) and those rebuilt (`rebuilt after eviction`), but not the gap itself. I'll add two numbers to it: TLAS instances resolved to a zero address because their BLAS was evicted (separate from those still waiting for their first build), and the frames from a BLAS being named again to its rebuilt address being visible. With 120 unused frames before eviction and rebuilds going through the per-frame budget, I expect the gap to be 1-3 frames and rare on a static scene; the walking run will tell. I'll post both from our run.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 12:59 UTC · original

@⁠dyshay Thanks. Splitting first-build waits from eviction-driven misses gives us exactly the comparison we need. If the walk catches those gaps, could you also report how many sampled frames had at least one missing instance of either type? The instance count can be dominated by many references to one BLAS. Our generated three-TLAS check now binds three actual TLAS resources and confirms that a missing proof selects fallback. We can use the walking aggregates to choose the next queue-lifetime case without relying on raw game logs.

**@⁠akimfomin** on GitHub · 2026-11-30 12:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7279193927) @⁠dyshay Thanks. Splitting first-build waits from eviction-driven misses gives us exactly the comparison we need. If the walk catches those gaps, could you also report how many sampled frames had at least one missing instance of either type? The instance count can be dominated by many references to one BLAS. Our [generated three-TLAS check](https://github.com/akimfomin/VIctory-NVIDIA-Lab/pull/15/commits/db9890b385e0a714daf4784da696b2dd502394e1) now binds three actual TLAS resources and confirms that a missing proof selects fallback. We can use the walking aggregates to choose the next queue-lifetime case without relying on raw game logs.
Author
Owner

@⁠voidharbor on GitHub · 2026-11-30 13:27 UTC · original

Numbers from a 16 GB card, and two memory changes that held the structures flat here. They are on 53c6eab4, so before your budget commits (a950fae3, 22a6600b, 121d0dc8), which I have not run yet.

Setup. Ryzen 7 9800X3D, RTX 5070 Ti 16 GB, 64 GB DDR5-4800, Windows 11. Series X profile at 2560x1440, DLSS Balanced, DLSS frame generation 2x, no frame cap. Tree: main 41adb551 with a number of open pull requests merged locally, this one among them. Caches fully preloaded for each switch set. Every run starts from the same save and is driven by a script through the keys file: 180 s of walking and camera turns in the open world. Frame rates are by draw count, from the seconds the route spends in each range.

Hardware against the software builder (an earlier head of this pull request, from the 29th; medians):

fps at 4-6k / 6-8k / 8k+ draws submitting thread at 6-8k card at 6-8k lost to card spikes, of 180 s device lost
software builder 15.8 / 15.0 / 14.0 68.1 ms 62.5 ms 5.3 to 12.0 s 2 of 9 runs
VICTORY_HW_RT=1 (7 runs) 19.0 / 17.0 / 17.0 57.7 ms 45.1 ms 0 0 of 7

So about 18 ms off the card and 10 ms off the submitting thread here, and the multi-second card spikes of the software builder are gone.

Memory, before any budget. From the memory now lines over the last 200 s of 240 s runs: the software builder grows 0.33 to 0.36 GB per 3 minutes, hardware 1.1 to 1.5 GB, and the card passes its budget inside four minutes (15.0 to 15.6 GB in use against about 14.9). The structure counters show 16,000 to 18,000 builds against 380 to 460 frees in 240 s. One of 22 hardware runs without the changes below lost the device, 164 s into the route (relay: the device was lost before fence value ... was reached).

Two changes that bound it without letting go of anything in use. Patches on 53c6eab4: https://gist.github.com/voidharbor/c00d271d10e75593ad0887050ab427cd

  • VICTORY_HW_RT_RELEASE=1: a host BLAS is let go when the title builds another structure over its memory (any overlap of the title's range), not only at the same address with another shape.
  • VICTORY_HW_RT_COMPACT=1: the title's compaction is done on the card too (the post-build size read back, a compacted copy made, the original freed a second later).
  • Plus a once-a-second line with structure counts and bytes, which is where the figures below come from.

Same route, 240 s, last 200 s:

card memory in use per 3 minutes fps at 6-8k
both off 13,855 to 15,596 MB (budget 14,904) +1,532 MB 17
both on 13,593 to 14,140 MB (budget 14,857) -94 MB 18

Longer runs with both on:

run BLAS alive at the end let go when overlapped compacted instance remaps matched / missed device
10 minutes, moving throughout 3,198 (314 MB) 9,771 (1,361 MB) 16,065 (1,221 MB saved) 72,477,950 / 0 kept
31 minutes (10 moving, 21 standing) 5,013 (460 MB) 23,283 (4,377 MB) not noted 221,599,515 / 0 kept

In the 10 minute run the card stayed at 13.9 to 14.3 GB throughout. In the 31 minute run it went over budget from about minute 16 (15.3 to 15.8 GB at the end), but that was texture copies growing from 3.3 to 5.65 GB while the structures stayed under 0.5 GB, so it is a separate matter from this pull request. Eight runs with both switches on so far, none lost the device.

What this does not show. The only picture check is the missed counter and a recording; I have not compared frames against the software builder. One card, one route. The patches will need a rebase past 22a6600b (I expect conflicts in emit_postbuild and execute_blas_batch), and I do not know yet how they sit with the budget and the eviction in 121d0dc8: they should lower what a budget has to evict, since what they let go is already replaced by the title. I can rebase and run both together on this card if that is useful.

**@⁠voidharbor** on GitHub · 2026-11-30 13:27 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7279879062) Numbers from a 16 GB card, and two memory changes that held the structures flat here. They are on 53c6eab4, so before your budget commits (a950fae3, 22a6600b, 121d0dc8), which I have not run yet. **Setup.** Ryzen 7 9800X3D, RTX 5070 Ti 16 GB, 64 GB DDR5-4800, Windows 11. Series X profile at 2560x1440, DLSS Balanced, DLSS frame generation 2x, no frame cap. Tree: main 41adb551 with a number of open pull requests merged locally, this one among them. Caches fully preloaded for each switch set. Every run starts from the same save and is driven by a script through the keys file: 180 s of walking and camera turns in the open world. Frame rates are by draw count, from the seconds the route spends in each range. **Hardware against the software builder** (an earlier head of this pull request, from the 29th; medians): | | fps at 4-6k / 6-8k / 8k+ draws | submitting thread at 6-8k | card at 6-8k | lost to card spikes, of 180 s | device lost | |---|---|---|---|---|---| | software builder | 15.8 / 15.0 / 14.0 | 68.1 ms | 62.5 ms | 5.3 to 12.0 s | 2 of 9 runs | | `VICTORY_HW_RT=1` (7 runs) | 19.0 / 17.0 / 17.0 | 57.7 ms | 45.1 ms | 0 | 0 of 7 | So about 18 ms off the card and 10 ms off the submitting thread here, and the multi-second card spikes of the software builder are gone. **Memory, before any budget.** From the `memory now` lines over the last 200 s of 240 s runs: the software builder grows 0.33 to 0.36 GB per 3 minutes, hardware 1.1 to 1.5 GB, and the card passes its budget inside four minutes (15.0 to 15.6 GB in use against about 14.9). The structure counters show 16,000 to 18,000 builds against 380 to 460 frees in 240 s. One of 22 hardware runs without the changes below lost the device, 164 s into the route (`relay: the device was lost before fence value ... was reached`). **Two changes that bound it without letting go of anything in use.** Patches on 53c6eab4: https://gist.github.com/voidharbor/c00d271d10e75593ad0887050ab427cd - `VICTORY_HW_RT_RELEASE=1`: a host BLAS is let go when the title builds another structure over its memory (any overlap of the title's range), not only at the same address with another shape. - `VICTORY_HW_RT_COMPACT=1`: the title's compaction is done on the card too (the post-build size read back, a compacted copy made, the original freed a second later). - Plus a once-a-second line with structure counts and bytes, which is where the figures below come from. Same route, 240 s, last 200 s: | | card memory in use | per 3 minutes | fps at 6-8k | |---|---|---|---| | both off | 13,855 to 15,596 MB (budget 14,904) | +1,532 MB | 17 | | both on | 13,593 to 14,140 MB (budget 14,857) | -94 MB | 18 | Longer runs with both on: | run | BLAS alive at the end | let go when overlapped | compacted | instance remaps matched / missed | device | |---|---|---|---|---|---| | 10 minutes, moving throughout | 3,198 (314 MB) | 9,771 (1,361 MB) | 16,065 (1,221 MB saved) | 72,477,950 / 0 | kept | | 31 minutes (10 moving, 21 standing) | 5,013 (460 MB) | 23,283 (4,377 MB) | not noted | 221,599,515 / 0 | kept | In the 10 minute run the card stayed at 13.9 to 14.3 GB throughout. In the 31 minute run it went over budget from about minute 16 (15.3 to 15.8 GB at the end), but that was texture copies growing from 3.3 to 5.65 GB while the structures stayed under 0.5 GB, so it is a separate matter from this pull request. Eight runs with both switches on so far, none lost the device. **What this does not show.** The only picture check is the missed counter and a recording; I have not compared frames against the software builder. One card, one route. The patches will need a rebase past 22a6600b (I expect conflicts in `emit_postbuild` and `execute_blas_batch`), and I do not know yet how they sit with the budget and the eviction in 121d0dc8: they should lower what a budget has to evict, since what they let go is already replaced by the title. I can rebase and run both together on this card if that is useful.
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 13:28 UTC · original

Retest of 121d0dc8 on a rebooted PC with Aftermath disabled (RTX 4070 Ti SUPER, driver 621.24, 1440p, VICTORY_HW_RT=1):

  • Lost the device at about 104 s into the first leg: host GPU failure: could not snapshot 12288 dirty bytes from a private CPU mirror; device removed (0x887A0005).
  • No WATCHDOG kernel report and no nvlddmkm event during the leg, so it was not a timeout reset. Clocks and power were normal until the loss (P0, 2835 / 10501 MHz).

Important for reading this: on the same boot, current main 41adb551 without this PR (software walk) also lost the device 3 out of 3 (at 574 s, before 240 s, before 120 s), while an older base ran 2 out of 2 ten-minute legs clean right after. So this loss probably comes from main, not from the hardware path. I am bisecting main now and will post the merge that introduces it. My earlier losses on 5046243b..22a6600b likely share that cause.

**@⁠eleboucher** on GitHub · 2026-11-30 13:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7279888791) Retest of 121d0dc8 on a rebooted PC with Aftermath disabled (RTX 4070 Ti SUPER, driver 621.24, 1440p, `VICTORY_HW_RT=1`): - Lost the device at about 104 s into the first leg: `host GPU failure: could not snapshot 12288 dirty bytes from a private CPU mirror; device removed (0x887A0005)`. - No WATCHDOG kernel report and no nvlddmkm event during the leg, so it was not a timeout reset. Clocks and power were normal until the loss (P0, 2835 / 10501 MHz). Important for reading this: on the same boot, current main 41adb551 without this PR (software walk) also lost the device 3 out of 3 (at 574 s, before 240 s, before 120 s), while an older base ran 2 out of 2 ten-minute legs clean right after. So this loss probably comes from main, not from the hardware path. I am bisecting main now and will post the merge that introduces it. My earlier losses on 5046243b..22a6600b likely share that cause.
Author
Owner

@⁠nick0451 on GitHub · 2026-11-30 13:28 UTC · original

An Ampere data point. RTX 3090 24 GB (driver 610.88), i9-14900K, 32 GB, Windows 11. Series S, DLSS performance, frame generation off.

Build: v2026.11.29.05 (41adb551) with this PR at a950fae3, plus #3740 so a removal would reach the log. Release build, VICTORY_D3D12_DRED=1.

Comparison: hardware = VICTORY_HW_RT=1 VICTORY_BVH_BUILDER=0; software = VICTORY_BVH_BUILDER=1, same exe. Fresh starts from frozen saves, alternating. A tap every 25 s keeps the idle camera off, so the shots are one view. Window off screen. Shots and fps 180 s into the world.

Stability

No hang or removal at all: 13 hardware starts of 3–4 min (balcony and city), plus one 20-minute city run. No 887A000x and no device-lost lines.

Speed (mean fps over the last minute of each start)

scene hardware software
balcony (4 + 4) 15.0, 20.5, 19.6, 17.3: 18.1 (the first was cold) 18.4, 16.4, 11.2, 13.4: 14.9
city street (4 + 3) 20.7, 17.4, 19.9, 20.4: 19.6 15.3, 15.2, 19.5: 16.7

All 14 RT programs were lifted whole, with no fallbacks (ray queries: lifted shaders 14, partly 0, fell back 0).

Picture

  • Hardware: 4 of 4 balcony starts are evenly darker than a clean software start. The character is greyish, the ladder dark, and the wall and door darker; in one start the door glass was black. It is the same in every start, which is good news against the software path's per-start black patches (#1412).
  • VICTORY_HW_RT_REFIT=0 (2 starts, 18.0 and 20.0 fps): the character comes out clearly lighter, in one start back to a normal white shirt and skin, and the ladder is lighter. The walls and door stay as dark. So the dark character looks tied to refitting the dynamic (skinned) BLAS. The walls look like a separate cause.
  • VICTORY_HW_RT_LIFT=0 doesn't help narrow it down here. All 14 programs fall back to the software walk, which with XboxBvhBuilder replaced has nothing to hit. The picture and fps (25.5) are those of RT off.

Memory: grows without levelling off (20-minute city run)

about minute 2 minute 20
process private 32.0 GB 39.5 GB
whole card (nvidia-smi) 14.9 GB 21.3 GB
BLAS live 3,319 9,441 (30,908 built, 894 evicted)
AS memory 447 MB 1,449 MB

That is about 0.45 GB a minute on each side, still rising at the end. The software path levels off around 26 GB private in the same scene. BLAS appear to be kept for traffic and pedestrians after they leave. AS memory explains only about 1 GB of the card's growth, so something else (inputs, decodes: quant24 VB / meshlet IB decoded 548 MB) is kept too.

🤖 Generated with Claude Code

**@⁠nick0451** on GitHub · 2026-11-30 13:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7279897716) An Ampere data point. RTX 3090 24 GB (driver 610.88), i9-14900K, 32 GB, Windows 11. Series S, DLSS performance, frame generation off. **Build:** v2026.11.29.05 (`41adb551`) with this PR at `a950fae3`, plus #3740 so a removal would reach the log. Release build, `VICTORY_D3D12_DRED=1`. **Comparison:** hardware = `VICTORY_HW_RT=1 VICTORY_BVH_BUILDER=0`; software = `VICTORY_BVH_BUILDER=1`, same exe. Fresh starts from frozen saves, alternating. A tap every 25 s keeps the idle camera off, so the shots are one view. Window off screen. Shots and fps 180 s into the world. ### Stability **No hang or removal at all:** 13 hardware starts of 3–4 min (balcony and city), plus one 20-minute city run. No `887A000x` and no device-lost lines. ### Speed (mean fps over the last minute of each start) | scene | hardware | software | |---|---|---| | balcony (4 + 4) | 15.0, 20.5, 19.6, 17.3: **18.1** (the first was cold) | 18.4, 16.4, 11.2, 13.4: **14.9** | | city street (4 + 3) | 20.7, 17.4, 19.9, 20.4: **19.6** | 15.3, 15.2, 19.5: **16.7** | All 14 RT programs were lifted whole, with no fallbacks (`ray queries: lifted shaders 14, partly 0, fell back 0`). ### Picture - **Hardware: 4 of 4 balcony starts are evenly darker** than a clean software start. The character is greyish, the ladder dark, and the wall and door darker; in one start the door glass was black. It is the same in every start, which is good news against the software path's per-start black patches (#1412). - **`VICTORY_HW_RT_REFIT=0`** (2 starts, 18.0 and 20.0 fps): **the character comes out clearly lighter**, in one start back to a normal white shirt and skin, and the ladder is lighter. The walls and door stay as dark. So the dark character looks tied to refitting the dynamic (skinned) BLAS. The walls look like a separate cause. - `VICTORY_HW_RT_LIFT=0` doesn't help narrow it down here. All 14 programs fall back to the software walk, which with `XboxBvhBuilder` replaced has nothing to hit. The picture and fps (25.5) are those of RT off. ### Memory: grows without levelling off (20-minute city run) | | about minute 2 | minute 20 | |---|---|---| | process private | 32.0 GB | 39.5 GB | | whole card (nvidia-smi) | 14.9 GB | 21.3 GB | | BLAS live | 3,319 | 9,441 (30,908 built, **894 evicted**) | | AS memory | 447 MB | 1,449 MB | That is about 0.45 GB a minute on each side, still rising at the end. The software path levels off around 26 GB private in the same scene. BLAS appear to be kept for traffic and pedestrians after they leave. AS memory explains only about 1 GB of the card's growth, so something else (inputs, decodes: `quant24 VB / meshlet IB decoded 548 MB`) is kept too. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 13:30 UTC · original

@⁠voidharbor Yes, a rebase onto 121d0dc8 would help. If feasible, run the same 10-minute walking replay with the budget alone, release alone added, and release plus compaction added. Live structure bytes, retired-but-fence-pinned bytes, and frames with any missing instances would separate the effects. I checked the patch: the one-second timer drops the source lookup, while remaining holders govern resource lifetime. A source lookup after that timer but before a delayed list submits is worth checking explicitly. Our generated three-scene test can cover the retired-source case independently of the title.

@⁠nick0451 The lighting difference despite all 14 programs lifting is an important result. If you repeat the identical balcony pose, can you compare stock, hardware refit, and hardware rebuild with just aggregate differences for the character and one fixed wall area? That gives us a direct way to separate the deformation issue from the wall shading issue without posting images or dumps.

**@⁠akimfomin** on GitHub · 2026-11-30 13:30 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7279951880) @⁠voidharbor Yes, a rebase onto `121d0dc8` would help. If feasible, run the same 10-minute walking replay with the budget alone, release alone added, and release plus compaction added. Live structure bytes, retired-but-fence-pinned bytes, and frames with any missing instances would separate the effects. I checked the patch: the one-second timer drops the source lookup, while remaining holders govern resource lifetime. A source lookup after that timer but before a delayed list submits is worth checking explicitly. Our [generated three-scene test](https://github.com/akimfomin/VIctory-NVIDIA-Lab/pull/15/commits/db9890b385e0a714daf4784da696b2dd502394e1) can cover the retired-source case independently of the title. @⁠nick0451 The lighting difference despite all 14 programs lifting is an important result. If you repeat the identical balcony pose, can you compare stock, hardware refit, and hardware rebuild with just aggregate differences for the character and one fixed wall area? That gives us a direct way to separate the deformation issue from the wall shading issue without posting images or dumps.
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 13:39 UTC · original

@⁠nick0451 thanks, the darker picture with HW_RT_REFIT=0 lightening the character is a strong lead: it points at our refit of skinned BLAS (stale vertex positions or a wrong update). We're on it, along with the walls, which look like a separate cause (instance flags or winding). Which head did you run: 121d0dc8 (with the BLAS budget) or earlier? 894 evictions in 20 minutes suggests the budget was on. @⁠voidharbor release on overlap and card-side compaction are the right ideas; we'll add both on top of the budget (credited to you) and post the 20-minute numbers.

**@⁠dyshay** on GitHub · 2026-11-30 13:39 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7280175022) @⁠nick0451 thanks, the darker picture with `HW_RT_REFIT=0` lightening the character is a strong lead: it points at our refit of skinned BLAS (stale vertex positions or a wrong update). We're on it, along with the walls, which look like a separate cause (instance flags or winding). Which head did you run: 121d0dc8 (with the BLAS budget) or earlier? 894 evictions in 20 minutes suggests the budget was on. @⁠voidharbor release on overlap and card-side compaction are the right ideas; we'll add both on top of the budget (credited to you) and post the 20-minute numbers.
Author
Owner

@⁠spk-c on GitHub · 2026-11-30 13:43 UTC · original

RTX 4090 / Windows 10 independent data point on 121d0dc8.

Ryzen 9 9950X3D, 64 GB RAM, driver 621.40, Series S, DLSS Quality, VICTORY_HW_RT=1, software builder off, early reservation 0. I tested a local combination with the depth-state fix from #3572, VICTORY_NARROW_BARRIERS=place, and sampled indirect-draw diagnostics. This is not a clean-head A/B: the HWRT revision and the local fixes changed together.

Configuration World duration Mean rendered FPS Result
Combined, D3D12 debug on, FG off ~30 s 12.3 0x887A0005
Combined, debug off, FG off 1800 s 15.2 completed, no removal
Combined, debug off, DLSS FG 2x one world frame interval 12.4 0x887A0005

The 30-minute run had median 15.2 FPS, p99 frame time 119.8 ms (26,845 samples), mean GPU busy 52.3%, VRAM peak 17,900 MiB, private memory peak 36.5 GiB. Route input covered the first ~590 s, then remained stationary. Native DXR initialization and BLAS/TLAS activity were confirmed. In the debug run, zero depth-read and copy-source ID 538 messages, but 137 root-SRV messages remain, including a title buffer promoted to COPY_DEST when read by SetComputeRootShaderResourceView. No useful DRED breadcrumbs. Earlier runs on 22a6600b with FG off and FG on both named the same indirect graphics pipeline in the in-flight report; that is not proof of the faulting shader.

The long run is promising, not proof of an RT fix. FG remains unstable; independent PresentMon capture failed, so no display-FPS claim. Next I am isolating the Streamline present/HUD-less path and submission timing, and checking CPU preparation/copy-back costs. No raw game logs/assets attached.

AI disclosure: benchmark orchestration and this report were assisted by AI on the hardware owner's behalf.

**@⁠spk-c** on GitHub · 2026-11-30 13:43 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7280263137) RTX 4090 / Windows 10 independent data point on `121d0dc8`. Ryzen 9 9950X3D, 64 GB RAM, driver 621.40, Series S, DLSS Quality, `VICTORY_HW_RT=1`, software builder off, early reservation 0. I tested a local combination with the depth-state fix from #3572, `VICTORY_NARROW_BARRIERS=place`, and sampled indirect-draw diagnostics. This is not a clean-head A/B: the HWRT revision and the local fixes changed together. | Configuration | World duration | Mean rendered FPS | Result | |---|---:|---:|---| | Combined, D3D12 debug on, FG off | ~30 s | 12.3 | 0x887A0005 | | Combined, debug off, FG off | 1800 s | 15.2 | completed, no removal | | Combined, debug off, DLSS FG 2x | one world frame interval | 12.4 | 0x887A0005 | The 30-minute run had median 15.2 FPS, p99 frame time 119.8 ms (26,845 samples), mean GPU busy 52.3%, VRAM peak 17,900 MiB, private memory peak 36.5 GiB. Route input covered the first ~590 s, then remained stationary. Native DXR initialization and BLAS/TLAS activity were confirmed. In the debug run, zero depth-read and copy-source ID 538 messages, but 137 root-SRV messages remain, including a title buffer promoted to COPY_DEST when read by SetComputeRootShaderResourceView. No useful DRED breadcrumbs. Earlier runs on `22a6600b` with FG off and FG on both named the same indirect graphics pipeline in the in-flight report; that is not proof of the faulting shader. The long run is promising, not proof of an RT fix. FG remains unstable; independent PresentMon capture failed, so no display-FPS claim. Next I am isolating the Streamline present/HUD-less path and submission timing, and checking CPU preparation/copy-back costs. No raw game logs/assets attached. AI disclosure: benchmark orchestration and this report were assisted by AI on the hardware owner's behalf.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 13:45 UTC · original

@⁠spk-c Thanks for separating the 30-minute FG-off result and the debug and FG failures. For the remaining COPY_DEST-to-root-SRV warning, one short matched check would help: keep FG off, #3572 and the barrier flags fixed, and compare the stock builder with 121d0dc8 at the same route point. If the warning appears in both, we can track it separately from the hardware builder. If it only appears with HWRT, the preceding writer category (original copy, geometry decode, or instance remap) and command-list type would be enough to narrow it down. Counts and operation names are sufficient.

**@⁠akimfomin** on GitHub · 2026-11-30 13:45 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7280310289) @⁠spk-c Thanks for separating the 30-minute FG-off result and the debug and FG failures. For the remaining `COPY_DEST`-to-root-SRV warning, one short matched check would help: keep FG off, #3572 and the barrier flags fixed, and compare the stock builder with `121d0dc8` at the same route point. If the warning appears in both, we can track it separately from the hardware builder. If it only appears with HWRT, the preceding writer category (original copy, geometry decode, or instance remap) and command-list type would be enough to narrow it down. Counts and operation names are sufficient.
github manually merged commit ffdc55faf3 into main 2026-11-30 14:14:26 +00:00
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 14:41 UTC · original

For follow-up after the merge, the VIctory-NVIDIA Lab handoff includes the replayable diagnostic sources for our independent prototype. In its late large-scene samples, 56–63 of 107–112 distinct missing bindings already had a skipped direct build at submission. Exact-address prioritization still left 126 misses and was set aside. The generated three-TLAS test matched 135 expected results and caught both stale generations and swapped scene inputs. Same-frame hit, material and output parity in the game remains open. These counts are from the Lab prototype, not from the merged implementation.

**@⁠akimfomin** on GitHub · 2026-11-30 14:41 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7281784697) For follow-up after the merge, the [VIctory-NVIDIA Lab handoff](https://github.com/akimfomin/VIctory-NVIDIA-Lab/issues/23) includes the [replayable diagnostic sources](https://github.com/akimfomin/VIctory-NVIDIA-Lab/tree/codex/development-handoff/handoff) for our independent prototype. In its late large-scene samples, 56–63 of 107–112 distinct missing bindings already had a skipped direct build at submission. Exact-address prioritization still left 126 misses and was set aside. The generated three-TLAS test matched 135 expected results and caught both stale generations and swapped scene inputs. Same-frame hit, material and output parity in the game remains open. These counts are from the Lab prototype, not from the merged implementation.
Author
Owner

@⁠nick0451 on GitHub · 2026-11-30 15:25 UTC · original

@⁠dyshay Those runs were on a950fae3, so before the BLAS budget, plus #3740 on v2026.11.29.05. The 894 evictions came from that build's own eviction, with no budget.

The same 20-minute city run on the merged release (v2026.11.30.01, c71899d9, so with 121d0dc8's budget) is queued right now, along with 3 + 3 balcony starts for the darkening. I'll post the numbers here when they're in, in about an hour.

🤖 Generated with Claude Code

**@⁠nick0451** on GitHub · 2026-11-30 15:25 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7282963303) @⁠dyshay Those runs were on `a950fae3`, so before the BLAS budget, plus #3740 on v2026.11.29.05. The 894 evictions came from that build's own eviction, with no budget. The same 20-minute city run on the merged release (v2026.11.30.01, `c71899d9`, so with `121d0dc8`'s budget) is queued right now, along with 3 + 3 balcony starts for the darkening. I'll post the numbers here when they're in, in about an hour. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

@⁠eleboucher on GitHub · 2026-11-30 17:19 UTC · original

Correction to my 13:28Z retest: that 121d0dc8 run was on a Windows boot that had already lost the device three times. On this PC (RTX 4070 Ti SUPER, 16 GB RAM, driver 621.24) a device loss makes later runs on the same boot lose sooner, whatever the build: the older base that runs clean on a fresh boot lost 2 of 3 legs after several losses, then 3 of 3 clean after a reboot. So that retest says little about this PR.

Clean data since then (first run of a fresh boot each, 1440p, Aftermath off):

  • main c71899d9 (this PR merged), VICTORY_HW_RT=1: device removed before 240 s.
  • main c71899d9, software builder: device removed before 240 s and at about 5 min.
  • an older base (7fcac7f1 + 48 commits): 5 of 5 ten-minute legs clean.

So on this PC the loss is not specific to the hardware path; main loses in both. I am bisecting main against the older base now (a GPU device restart between steps clears the post-loss state as a reboot does) and will post the merge it names.

**@⁠eleboucher** on GitHub · 2026-11-30 17:19 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7286097220) Correction to my 13:28Z retest: that 121d0dc8 run was on a Windows boot that had already lost the device three times. On this PC (RTX 4070 Ti SUPER, 16 GB RAM, driver 621.24) a device loss makes later runs on the same boot lose sooner, whatever the build: the older base that runs clean on a fresh boot lost 2 of 3 legs after several losses, then 3 of 3 clean after a reboot. So that retest says little about this PR. Clean data since then (first run of a fresh boot each, 1440p, Aftermath off): - main c71899d9 (this PR merged), `VICTORY_HW_RT=1`: device removed before 240 s. - main c71899d9, software builder: device removed before 240 s and at about 5 min. - an older base (7fcac7f1 + 48 commits): 5 of 5 ten-minute legs clean. So on this PC the loss is not specific to the hardware path; main loses in both. I am bisecting main against the older base now (a GPU device restart between steps clears the post-loss state as a reboot does) and will post the merge it names.
Author
Owner

@⁠DoubleD17 on GitHub · 2026-11-30 19:40 UTC · original

RTX 5070 12 GB (driver 621.40), Ryzen 7 5800X, 64 GB, Windows 11: one of the 8–12 GB cards the PR lists as untested

Setup (from the runs' logs): 2560×1440 DLAA, frame generation off, 30 fps cap.

  • hardware = VICTORY_HW_RT=1 VICTORY_BVH_BUILDER=0
  • software = VICTORY_BVH_BUILDER=1
  • Each set was preloaded first, then the runs alternated.
  • The PC was in light use during the runs, the same for every arm.

Speed and stability

software hardware
idle camera, c71899d9 (3 + 3) 3.6–5.2 fps 6.2–8.4 fps (+62 %)
"on the GPU" in the host line 98–186 ms 39–81 ms
one fixed pose, 84bd61e2 (3 + 3) 3.6–4.4 fps 7.4–10.2 fps
shared memory, steady (fixed pose) 7.9–8.6 GB 6.3–6.8 GB
  • All 14 ray-query programs were lifted, with no fallbacks.
  • BLAS memory: about 300 MB live (2,900 BLAS) of a 1.08 GB budget, with no evictions.
  • No device removal or hang in 11 hardware starts of about 4 minutes each.

The darker picture: software vs hardware refit vs hardware rebuild

This is the matched check @⁠akimfomin asked for:

  • One start pose on the balcony.
  • The idle camera was kept off with a short forward tap every 20 s (the character pushes into the railing).
  • 80 frames at 150 s, 3 starts per arm, order S H R R H S S H R.
  • Hardware rebuild = hardware + VICTORY_HW_RT_REFIT=0.

Mean luma (0–255) of fixed areas, median over the 80 frames. The camera sits a little differently between starts, so the areas are approximate.

start shirt arm wall water sky frames flagged as flicker
software 1 76 64 71 191 209 0
software 2 71 57 76 192 209 0
software 3 83 69 75 191 206 0
hardware refit 1 37 32 47 107 195 21 / 80
hardware refit 2 35 25 35 47 196 35 / 80
hardware refit 3 66 50 62 173 192 0
hardware rebuild 1 91 46 20 117 195 0
hardware rebuild 2 28 27 71 191 200 0
hardware rebuild 3 19 15 15 81 191 0

What we see:

  • Software: the 3 starts are the same picture, within a few points.
  • Hardware: the darkening changes from start to start, with refit and without it. Some areas come out normal and others go dark, and which ones differs each start:
    • refit 3 was close to the software picture;
    • rebuild 1 had a bright shirt, but a near-black wall and brownish water with no sky in it;
    • rebuild 2 had a dark character over a normal wall and water;
    • rebuild 3 was dark everywhere.
  • Refit off: on this card it doesn't make the character consistently lighter, so the dark character doesn't look tied to refitting alone. It does look like it removes the flicker: in the two dark refit starts, dark blotches on the wall changed from frame to frame, and none of the three rebuild starts had that.
  • Water: when it goes dark, it stops reflecting the sky. That is the biggest single difference from the software picture.
  • Sky: 6–18 points lower in every hardware start.

AI Assisted

**@⁠DoubleD17** on GitHub · 2026-11-30 19:40 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7289762521) **RTX 5070 12 GB (driver 621.40), Ryzen 7 5800X, 64 GB, Windows 11: one of the 8–12 GB cards the PR lists as untested** Setup (from the runs' logs): 2560×1440 DLAA, frame generation off, 30 fps cap. - hardware = `VICTORY_HW_RT=1 VICTORY_BVH_BUILDER=0` - software = `VICTORY_BVH_BUILDER=1` - Each set was preloaded first, then the runs alternated. - The PC was in light use during the runs, the same for every arm. ### Speed and stability | | software | hardware | |---|---|---| | idle camera, c71899d9 (3 + 3) | 3.6–5.2 fps | 6.2–8.4 fps (+62 %) | | "on the GPU" in the host line | 98–186 ms | 39–81 ms | | one fixed pose, 84bd61e2 (3 + 3) | 3.6–4.4 fps | 7.4–10.2 fps | | shared memory, steady (fixed pose) | 7.9–8.6 GB | 6.3–6.8 GB | - All 14 ray-query programs were lifted, with no fallbacks. - BLAS memory: about 300 MB live (2,900 BLAS) of a 1.08 GB budget, with no evictions. - No device removal or hang in 11 hardware starts of about 4 minutes each. ### The darker picture: software vs hardware refit vs hardware rebuild This is the matched check @⁠akimfomin asked for: - One start pose on the balcony. - The idle camera was kept off with a short forward tap every 20 s (the character pushes into the railing). - 80 frames at 150 s, 3 starts per arm, order S H R R H S S H R. - Hardware rebuild = hardware + `VICTORY_HW_RT_REFIT=0`. Mean luma (0–255) of fixed areas, median over the 80 frames. The camera sits a little differently between starts, so the areas are approximate. | start | shirt | arm | wall | water | sky | frames flagged as flicker | |---|---|---|---|---|---|---| | software 1 | 76 | 64 | 71 | 191 | 209 | 0 | | software 2 | 71 | 57 | 76 | 192 | 209 | 0 | | software 3 | 83 | 69 | 75 | 191 | 206 | 0 | | hardware refit 1 | 37 | 32 | 47 | 107 | 195 | 21 / 80 | | hardware refit 2 | 35 | 25 | 35 | 47 | 196 | 35 / 80 | | hardware refit 3 | 66 | 50 | 62 | 173 | 192 | 0 | | hardware rebuild 1 | 91 | 46 | 20 | 117 | 195 | 0 | | hardware rebuild 2 | 28 | 27 | 71 | 191 | 200 | 0 | | hardware rebuild 3 | 19 | 15 | 15 | 81 | 191 | 0 | What we see: - **Software:** the 3 starts are the same picture, within a few points. - **Hardware:** the darkening changes from start to start, with refit and without it. Some areas come out normal and others go dark, and which ones differs each start: - refit 3 was close to the software picture; - rebuild 1 had a bright shirt, but a near-black wall and brownish water with no sky in it; - rebuild 2 had a dark character over a normal wall and water; - rebuild 3 was dark everywhere. - **Refit off:** on this card it doesn't make the character consistently lighter, so the dark character doesn't look tied to refitting alone. It does look like it removes the flicker: in the two dark refit starts, dark blotches on the wall changed from frame to frame, and none of the three rebuild starts had that. - **Water:** when it goes dark, it stops reflecting the sky. That is the biggest single difference from the software picture. - **Sky:** 6–18 points lower in every hardware start. AI Assisted
Author
Owner

@⁠KruIN689 on GitHub · 2026-11-30 20:37 UTC · original

Notes from our fork, which carried an earlier head of this PR (before the LRU eviction, build budget and leases now in main). Shared so nobody repeats the dead ends. RTX 5080 16 GB, 9950X3D, 1440p native, DLSS off.

1. The first measure. Standing still at a save, HW RT gave 34.5 fps with 1.8 frames over 50 ms per 1,000. Software RT (VICTORY_BVH_BUILDER=1) gave 9–18 fps. The card was 75 % busy, and the picture in captured frames looked right.

2. 20-minute session, standing still.

  • fps fell from 32–33 to 25–28, with about one frame over 100 ms each second from minute 15.
  • The cause was not HW RT itself. It was the once-a-second sweep growing with play: "the heaps' records and what is swept" went from 0.5 to 5.9 ms a frame. Spreading the sweep into parts (as #3858 does) took that back to 0.3 ms.

3. BLASes never let go (the earlier head).

  • Live BLASes rose linearly even standing still: ~12,000 after 20 min, AS memory 1.4–2.1 GB, the card at 13.8 of 14.9 GB.
  • The log then showed "textures picked by index: the card has no room for more; they wait", and a host pipeline failed with 0x8007000E.
  • A probe stamped each BLAS when a TLAS's instances named it (byte 56 of each 64-byte instance, sampled every 16th TLAS build). On a 10-minute roam, 5,536 of 6,591 live BLASes (806 of 942 MB) had not been named for 2 minutes. Letting those go after 2 min took AS memory from 1,489 to 133 MB and the card's peak from 13.0 to 12.0 GB, at +1.7 fps.
  • Main's LRU eviction with rebuild-on-demand now covers this.

4. Dead end: letting BLASes go when a later build overlaps their console range. It found 133,000 overlaps in 10 min, but took out BLASes still in use. Rehydrated ones have the title's own size, not the one our prebuild answer gave. fps fell to 8–17.

5. Dead end that may matter for leases. We placed AS buffers in pooled card-memory blocks, reused 2 s after a BLAS went (placed resources instead of one committed resource per BLAS). Making AS buffers had cost the list threads 15.8 s in a 10-minute roam, the biggest part of BLAS preparation. Pooling removed the device twice, each time after a ~4 s GPU hang, while committed resources never did. Our reading: a BLAS address can still be referenced after its map entry goes, possibly from a TLAS table filled on another list thread before its list was queued. With committed resources that dangling address is freed memory; with pooled blocks it gets reused by another BLAS. If main's leases reuse pieces, a hold of a few seconds past retirement, or keeping the BLASes a TLAS table names on that list, may be worth checking.

6. Smaller items.

  • Meshlet IB upload buffers were each a committed resource: 7.9 s per 10 minutes. Cut from the upload pool: 0.4 s.
  • Single BLAS batches took up to 650 ms on a list thread while roaming. Main's per-frame build budget should cover that.

(Measured and written with Claude Code, for KruIN689.)

**@⁠KruIN689** on GitHub · 2026-11-30 20:37 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7291227361) Notes from our fork, which carried an earlier head of this PR (before the LRU eviction, build budget and leases now in main). Shared so nobody repeats the dead ends. RTX 5080 16 GB, 9950X3D, 1440p native, DLSS off. **1. The first measure.** Standing still at a save, HW RT gave 34.5 fps with 1.8 frames over 50 ms per 1,000. Software RT (`VICTORY_BVH_BUILDER=1`) gave 9–18 fps. The card was 75 % busy, and the picture in captured frames looked right. **2. 20-minute session, standing still.** - fps fell from 32–33 to 25–28, with about one frame over 100 ms each second from minute 15. - The cause was not HW RT itself. It was the once-a-second sweep growing with play: "the heaps' records and what is swept" went from 0.5 to 5.9 ms a frame. Spreading the sweep into parts (as #3858 does) took that back to 0.3 ms. **3. BLASes never let go (the earlier head).** - Live BLASes rose linearly even standing still: ~12,000 after 20 min, AS memory 1.4–2.1 GB, the card at 13.8 of 14.9 GB. - The log then showed "textures picked by index: the card has no room for more; they wait", and a host pipeline failed with `0x8007000E`. - A probe stamped each BLAS when a TLAS's instances named it (byte 56 of each 64-byte instance, sampled every 16th TLAS build). On a 10-minute roam, 5,536 of 6,591 live BLASes (806 of 942 MB) had not been named for 2 minutes. Letting those go after 2 min took AS memory from 1,489 to 133 MB and the card's peak from 13.0 to 12.0 GB, at +1.7 fps. - Main's LRU eviction with rebuild-on-demand now covers this. **4. Dead end: letting BLASes go when a later build overlaps their console range.** It found 133,000 overlaps in 10 min, but took out BLASes still in use. Rehydrated ones have the title's own size, not the one our prebuild answer gave. fps fell to 8–17. **5. Dead end that may matter for leases.** We placed AS buffers in pooled card-memory blocks, reused 2 s after a BLAS went (placed resources instead of one committed resource per BLAS). Making AS buffers had cost the list threads 15.8 s in a 10-minute roam, the biggest part of BLAS preparation. Pooling removed the device twice, each time after a ~4 s GPU hang, while committed resources never did. Our reading: a BLAS address can still be referenced after its map entry goes, possibly from a TLAS table filled on another list thread before its list was queued. With committed resources that dangling address is freed memory; with pooled blocks it gets reused by another BLAS. If main's leases reuse pieces, a hold of a few seconds past retirement, or keeping the BLASes a TLAS table names on that list, may be worth checking. **6. Smaller items.** - Meshlet IB upload buffers were each a committed resource: 7.9 s per 10 minutes. Cut from the upload pool: 0.4 s. - Single BLAS batches took up to 650 ms on a list thread while roaming. Main's per-frame build budget should cover that. (Measured and written with Claude Code, for KruIN689.)
Author
Owner

@⁠KruIN689 on GitHub · 2026-11-30 22:47 UTC · original

Final head, 20-minute session. Main 84bd61e2 plus our fork's set (spread sweep, #3272, #3063/#3067, #4234), VICTORY_HW_RT=1. RTX 5080 16 GB, 9950X3D, 47 GB, Series X native 1440p, DLSS and FG off. Auto-driven roaming (walk and drive), 20 minutes in the world.

  • fps, minute by minute: 25.5–29.4 throughout, with no drift (minute 1: 27.7, minute 10: 28.7, minute 20: 27.2). Frames over 50 ms: 15–50 per 1,000 each minute; over 100 ms: 0–2 a minute; longest 171 ms.
  • BLAS live / AS memory: 3,021 / 346 MB at 3 min, 4,534 / 649 MB at 11 min, 5,710 / 907 MB at 18 min. It is still growing, but at about half the rate of the earlier head (~12,000 / 2 GB at 20 min there).
  • The card: 12.2–12.7 GB of a 14.7 GB budget from minute 5 on. No "card has no room" warnings, no errors, no device removal.

Compared with the earlier head (notes above): the fps fall and the card filling up are gone. If the LRU eviction waits for a budget, sessions longer than 20 min may still be worth one look. On this card, HW RT now looks steady enough for long sessions.

(Measured and written with Claude Code, for KruIN689.)

**@⁠KruIN689** on GitHub · 2026-11-30 22:47 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7294308129) **Final head, 20-minute session.** Main 84bd61e2 plus our fork's set (spread sweep, #3272, #3063/#3067, #4234), `VICTORY_HW_RT=1`. RTX 5080 16 GB, 9950X3D, 47 GB, Series X native 1440p, DLSS and FG off. Auto-driven roaming (walk and drive), 20 minutes in the world. - **fps, minute by minute:** 25.5–29.4 throughout, with no drift (minute 1: 27.7, minute 10: 28.7, minute 20: 27.2). Frames over 50 ms: 15–50 per 1,000 each minute; over 100 ms: 0–2 a minute; longest 171 ms. - **BLAS live / AS memory:** 3,021 / 346 MB at 3 min, 4,534 / 649 MB at 11 min, 5,710 / 907 MB at 18 min. It is still growing, but at about half the rate of the earlier head (~12,000 / 2 GB at 20 min there). - **The card:** 12.2–12.7 GB of a 14.7 GB budget from minute 5 on. No "card has no room" warnings, no errors, no device removal. Compared with the earlier head (notes above): the fps fall and the card filling up are gone. If the LRU eviction waits for a budget, sessions longer than 20 min may still be worth one look. On this card, HW RT now looks steady enough for long sessions. (Measured and written with Claude Code, for KruIN689.)
Author
Owner

@⁠AsrieIDreemurr on GitHub · 2026-12-01 01:46 UTC · original

@⁠eleboucher another data point for your bisect, from a different machine: same symptom, also clean on an older base is consistent with what you see.

RTX 4070 Ti 12 GB, Ryzen 9 7950X3D, 64 GB RAM, Windows 11, driver 621.40 (also seen on 621.24). Series X profile, 2560x1440, DLSS Quality, DLSS FG 2x, no frame cap, release build, VICTORY_D3D12_DRED=faults. Each run is a scripted walk in the open world from the same save.

Plain v2026.11.30.03 (e1251c31), first two runs after a fresh reboot:

  • software builder (VICTORY_BVH_BUILDER=1): device removed (0x887A0005) about 5.5 min into the world (~14 fps; this first run also compiled pipelines on the fly).
  • VICTORY_HW_RT=1: device removed (0x887A0005) about 1 min 50 s into the world (~17 fps).

Earlier, on v2026.11.29.05 (41adb551) with a few open PRs merged locally, 12 uncapped runs all lost the device 2-4 min in, always 0x887A0005, DRED breadcrumbs empty, the log saying nothing of ours was running on the card. It made no difference whether FG was on or off, the driver was 621.24 or 621.40, VICTORY_SWEEP=0 was set, or #3686 or #3706 (22a6600b) were merged.

What does avoid it here: a frame cap. With -Fps 13, the same build ran 84 minutes without a loss. That also fits your race reading, since DRED/Aftermath changing the timing hides it for you.

Happy to test a candidate merge or revert once your bisect names one.

(Claude written this.)

**@⁠AsrieIDreemurr** on GitHub · 2026-12-01 01:46 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3706#issuecomment-7297883219) @⁠eleboucher another data point for your bisect, from a different machine: same symptom, also clean on an older base is consistent with what you see. RTX 4070 Ti 12 GB, Ryzen 9 7950X3D, 64 GB RAM, Windows 11, driver 621.40 (also seen on 621.24). Series X profile, 2560x1440, DLSS Quality, DLSS FG 2x, no frame cap, release build, `VICTORY_D3D12_DRED=faults`. Each run is a scripted walk in the open world from the same save. Plain v2026.11.30.03 (e1251c31), first two runs after a fresh reboot: - software builder (`VICTORY_BVH_BUILDER=1`): device removed (0x887A0005) about 5.5 min into the world (~14 fps; this first run also compiled pipelines on the fly). - `VICTORY_HW_RT=1`: device removed (0x887A0005) about 1 min 50 s into the world (~17 fps). Earlier, on v2026.11.29.05 (41adb551) with a few open PRs merged locally, 12 uncapped runs all lost the device 2-4 min in, always 0x887A0005, DRED breadcrumbs empty, the log saying nothing of ours was running on the card. It made no difference whether FG was on or off, the driver was 621.24 or 621.40, `VICTORY_SWEEP=0` was set, or #3686 or #3706 (22a6600b) were merged. What does avoid it here: a frame cap. With `-Fps 13`, the same build ran 84 minutes without a loss. That also fits your race reading, since DRED/Aftermath changing the timing hides it for you. Happy to test a candidate merge or revert once your bisect names one. (Claude written this.)
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3706
No description provided.