D3D12.X: opt-in XCL_HW_RT shadow builder #3700

Open
Kalmarv wants to merge 3 commits from upstream-pr/3700 into main
Kalmarv commented 2026-12-02 15:37:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-02T15:37:09Z.


Add the opt-in XCL_HW_RT=1 native DXR 1.1 shadow builder that mirrors XboxBvhBuilder bottom-level builds, top-level builds, rehydrates, and copies into host DXR acceleration structures recorded on the title's own command list after the console build. Off by default: no extra hooks are installed for it when XCL_HW_RT is unset (on the 16-window layout #3662's hooks still run and check hw_rt::enabled() per call; XCL_RAYTRACING=0 also disables it).

Part of #1751. Stacked on #3697 (and #3662 on main 5eaadb54c; commit 93ac81233 is the new diff here). Note: title_list::active_backing (and its unit test) was moved here from #3653 because this PR is its only caller, so #3653 can drop it.

Related: #2184, #2185. Unlike those earlier PRs, this stacks on #3662's GPU-view hooks and #3697's pure registry/geometry translator, mirrors XboxBvhBuilder BuildRaytracingAccelerationStructureBatched2X, RehydrateRaytracingAccelerationStructureBatched2X, and CopyRaytracingAccelerationStructureX with explicit UAV barriers between BLAS/TLAS/copy phases, resolves console R16_TYPELESS/R32_TYPELESS index formats, retires native AS buffers via late_release GPU fences, and includes WARP DXR 1.1 tests covering builds, rehydration, and copies.

Why this PR is over 800 changed lines: The diff is +1795 / -16 lines across 5 files, consisting of ~1235 production lines (hw_rt.rs host DXR state, scratch/staging pools, Batched2X BLAS/TLAS/rehydrate/copy recording, bvh_builder.rs hook wiring, late_release.rs fence-backed retirement, title_list.rs active backing helper, host.rs periodic summary logging) and ~560 lines of WARP DXR 1.1, cross-tile GPU-view read, and command-list tests. The pure registry and geometry translation were already split out into #3697; splitting the remaining host state from its hook callers or its WARP tests would either introduce unused code or land unverified host DXR command recording.

What is in it

  • crates/xcl/src/hle/d3d12x/hw_rt.rs: HostDxr (DXR 1.1 device/tier probe), ShadowState (registry, pooled scratch/staging buffers reused after 4 presents under a configurable VRAM budget, retired list draining through late_release), on_build_batched2x (two-phase BLAS then TLAS recording with UAV barrier; TLAS instance arrays/pointer arrays read tile-by-tile across 64 KiB GPU-view boundaries via bvh_builder::read_gpu_bytes + view_want::cpu_run + dstorage::read_own and capped at MAX_TLAS_INSTANCES), on_rehydrate_batched2x (native rebuild when geometry count matches, fallback tracking otherwise), on_copy_as (native CopyRaytracingAccelerationStructure for clone/compact with surrounding UAV barriers), periodic HW RT shadow (XCL_HW_RT): summary formatting, cross-tile/cap unit test (read_console_instances_crosses_view_tiles_and_caps_count), and 3 WARP DXR 1.1 integration tests.
  • crates/xcl/src/hle/bvh_builder.rs: hook Build*Batched2X, Rehydrate*Batched2X, and Copy*X to forward to hw_rt when XCL_HW_RT=1; expose pub(crate) read_gpu_bytes and MAX_TLAS_INSTANCES and read packed archive headers (read_archive_prims) through read_gpu_bytes (tile-safe and TOCTOU-free, with unit test read_archive_prims_crosses_view_tile_and_handles_failed_read).
  • crates/xcl/src/hle/d3d12x/late_release.rs: hold_owned_resource helper so replaced native AS buffers wait until every active queue is past a fence before release.
  • crates/xcl/src/hle/d3d12x/title_list.rs: active_backing helper (moved from #3653, its only caller) returning the active PC command list backing a wrapped console list across split segments, plus unit test active_backing_tracks_primary_and_split_segment.
  • crates/xcl/src/host.rs: log hw_rt::summary_line() every 10 s when active.

Tested
Hardware: Windows 11 x64, NVIDIA GeForce RTX 5070 Ti (15995 MiB VRAM, DXR Tier 1.1), AMD Ryzen 9 9950X, rustc 1.99.0, DXC 1.9.2609.5 (XCL_DXC_DIR).

  • cargo build --release -p xcl (commit 93ac812337a7171f3c16bb28f007682e2d9c8f59): succeeded, 39 warnings (0 new vs main; 0 in bvh_builder.rs or hw_rt.rs).
  • .\scripts\test.ps1 (commit 93ac812337a7171f3c16bb28f007682e2d9c8f59): 2998 passed, 0 failed, 52 ignored across 43 test targets + doc-tests; 24 GPU tests skipped on this adapter (22 no wave64, 2 no heap windows). All 10 hle::d3d12x::hw_rt tests (including read_console_instances_crosses_view_tiles_and_caps_count and all 3 WARP DXR 1.1 tests), all 13 hle::bvh_builder tests (including read_archive_prims_crosses_view_tile_and_handles_failed_read), and active_backing_tracks_primary_and_split_segment passed.
  • On the default 4-window layout almost every bottom level is skipped (vertex buffer VA outside UMA: the geometry lives at GPU-view addresses that only the 16-window layout maps), so native bottom levels are built primarily with XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16.
  • Prior live 180 s XCL_HW_RT=1 run on 3620d76522ae28985d4f0d982b3afd16732adbda (before restacking on updated #3662) (default memory layout, XCL_PREPARE=0, XCL_NETWORK=0, XCL_PSO_EVICT_FRAMES=600, automated title-screen advance): exit: 0x0, 2149 frames shown, 0 device removals, 0 crashes:
    • HW RT shadow (XCL_HW_RT): live 2 BLAS / 5 TLAS / 90 rehydrated (1 MiB AS, 6 MiB pools); built 2 BLAS (0 updates, 2324 skipped), 75 TLAS (35 complete, 40 hybrid, 0 skipped); insts 34307 resolved / 0 null / 1487 rehydrated-skip / 29212 missing-skip; 1137 rehydrated recorded (0 built natively, 95 count mismatch), 0 stale invalidated, 0 copy-invalidated, 0 copied natively, 0 alloc-err, 0 budget-skip
  • Prior live 180 s XCL_HW_RT=1 XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 run on 3620d76522ae28985d4f0d982b3afd16732adbda (before restacking on updated #3662) (same settings, with GPU view windows active): exit: 0x0, 2016 frames shown, 0 device removals, 0 crashes:
    • HW RT shadow (XCL_HW_RT): live 2654 BLAS / 5 TLAS / 140 rehydrated (238 MiB AS, 118 MiB pools); built 1199 BLAS (0 updates, 1371 skipped), 154 TLAS (82 complete, 72 hybrid, 0 skipped); insts 104399 resolved / 0 null / 2188 rehydrated-skip / 31495 missing-skip; 1960 rehydrated recorded (1809 built natively, 151 count mismatch), 158 stale invalidated, 0 copy-invalidated, 0 copied natively, 0 alloc-err, 0 budget-skip
    • (See Known limitations #6 below for the 1 of 2 16-window XCL_HW_RT=1 runs that hit 0x887a0006.)

Regression run

Base (main):

xcl-smoke v1
commit: 5eaadb54c14e0fc29597b2a1689d7dbd83491303
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1658 (PresentX 1658)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 16763 MB

PR (pr/hw-rt-shadow):

xcl-smoke v1
commit: 93ac812337a7171f3c16bb28f007682e2d9c8f59
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1701 (PresentX 1701)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16200 MB

Not tested

  • AMD/Intel GPUs and native wave64 GPU tests (22 skipped on RTX 5070 Ti).
  • Sample-gated tests (XCL_SAMPLE_* unset).
  • Native traversal in shaders (XCL_HW_RT_TRAVERSE=1; handled in the follow-up stacked PRs).
  • Live 180 s XCL_HW_RT=1 run was not re-run on 93ac81233 (the cross-tile read changes are covered by unit tests and the 60 s default-layout smoke run above).
  • Known limitations:
    1. Scratch and staging pools are reused after 4 presents without an explicit GPU fence (assumes at most 3 frames in flight; replaced AS buffers wait via late_release until every active queue is past a fence).
    2. TLAS instance descriptions are read on the CPU at command-record time (same-frame GPU writes to the instance buffer are read stale; unknown BLAS VAs are masked to AccelerationStructure = 0, InstanceMask = 0 so there is no GPU fault, though those instances are skipped until the BLAS is known).
    3. Natively built rehydrated BLASes use geometry primitive indices rather than the archive's original primitive indices.
    4. In-place BLAS rebuilds keep referencing TLASes marked complete (the title is expected to rebuild or update the TLAS, matching console behaviour).
    5. The copy hook does not request the copy destination range in GPU view windows (same gap as #3662).
    6. On the 16-window layout, 1 of 3 XCL_HW_RT=1 runs (including #3705's 180 s XCL_HW_RT_TRAVERSE=1 run) ended in 0x887a0006 (DEVICE_HUNG) at 154.2 s / frame 1969 with +3.9 GiB VRAM overcommit (last recorded: DispatchMesh in two passes); one 180 s XCL_HW_RT=0 control finished (1920 frames, 0 removals). Cause not determined; the native structures add about 360 MiB of VRAM (238 MiB AS + 118 MiB pools at 180 s).

AI use

  • Claude Code (Claude Opus 5.5): architecture, hang/TDR audit, barrier and lifetime review, and final diff/description review.
  • Antigravity (Gemini 4 Neon): split, rebase onto main, cross-tile read_gpu_bytes + MAX_TLAS_INSTANCES fixes and tests, builds, test suite, smoke runs, live XCL_HW_RT=1 verification, and PR description.
<!-- greyfinch-sync:ivall/xcl:issue:5609707217 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3700). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-02T15:37:09Z. --- Add the opt-in `XCL_HW_RT=1` native DXR 1.1 shadow builder that mirrors `XboxBvhBuilder` bottom-level builds, top-level builds, rehydrates, and copies into host DXR acceleration structures recorded on the title's own command list after the console build. Off by default: no extra hooks are installed for it when `XCL_HW_RT` is unset (on the 16-window layout #3662's hooks still run and check `hw_rt::enabled()` per call; `XCL_RAYTRACING=0` also disables it). Part of #1751. Stacked on #3697 (and #3662 on `main` `5eaadb54c`; commit `93ac81233` is the new diff here). Note: `title_list::active_backing` (and its unit test) was moved here from #3653 because this PR is its only caller, so #3653 can drop it. Related: #2184, #2185. Unlike those earlier PRs, this stacks on #3662's GPU-view hooks and #3697's pure registry/geometry translator, mirrors `XboxBvhBuilder` `BuildRaytracingAccelerationStructureBatched2X`, `RehydrateRaytracingAccelerationStructureBatched2X`, and `CopyRaytracingAccelerationStructureX` with explicit UAV barriers between BLAS/TLAS/copy phases, resolves console `R16_TYPELESS`/`R32_TYPELESS` index formats, retires native AS buffers via `late_release` GPU fences, and includes WARP DXR 1.1 tests covering builds, rehydration, and copies. **Why this PR is over 800 changed lines:** The diff is +1795 / -16 lines across 5 files, consisting of ~1235 production lines (`hw_rt.rs` host DXR state, scratch/staging pools, `Batched2X` BLAS/TLAS/rehydrate/copy recording, `bvh_builder.rs` hook wiring, `late_release.rs` fence-backed retirement, `title_list.rs` active backing helper, `host.rs` periodic summary logging) and ~560 lines of WARP DXR 1.1, cross-tile GPU-view read, and command-list tests. The pure registry and geometry translation were already split out into #3697; splitting the remaining host state from its hook callers or its WARP tests would either introduce unused code or land unverified host DXR command recording. **What is in it** - `crates/xcl/src/hle/d3d12x/hw_rt.rs`: `HostDxr` (DXR 1.1 device/tier probe), `ShadowState` (registry, pooled scratch/staging buffers reused after 4 presents under a configurable VRAM budget, retired list draining through `late_release`), `on_build_batched2x` (two-phase BLAS then TLAS recording with UAV barrier; TLAS instance arrays/pointer arrays read tile-by-tile across 64 KiB GPU-view boundaries via `bvh_builder::read_gpu_bytes` + `view_want::cpu_run` + `dstorage::read_own` and capped at `MAX_TLAS_INSTANCES`), `on_rehydrate_batched2x` (native rebuild when geometry count matches, fallback tracking otherwise), `on_copy_as` (native `CopyRaytracingAccelerationStructure` for clone/compact with surrounding UAV barriers), periodic `HW RT shadow (XCL_HW_RT):` summary formatting, cross-tile/cap unit test (`read_console_instances_crosses_view_tiles_and_caps_count`), and 3 WARP DXR 1.1 integration tests. - `crates/xcl/src/hle/bvh_builder.rs`: hook `Build*Batched2X`, `Rehydrate*Batched2X`, and `Copy*X` to forward to `hw_rt` when `XCL_HW_RT=1`; expose `pub(crate) read_gpu_bytes` and `MAX_TLAS_INSTANCES` and read packed archive headers (`read_archive_prims`) through `read_gpu_bytes` (tile-safe and TOCTOU-free, with unit test `read_archive_prims_crosses_view_tile_and_handles_failed_read`). - `crates/xcl/src/hle/d3d12x/late_release.rs`: `hold_owned_resource` helper so replaced native AS buffers wait until every active queue is past a fence before release. - `crates/xcl/src/hle/d3d12x/title_list.rs`: `active_backing` helper (moved from #3653, its only caller) returning the active PC command list backing a wrapped console list across split segments, plus unit test `active_backing_tracks_primary_and_split_segment`. - `crates/xcl/src/host.rs`: log `hw_rt::summary_line()` every 10 s when active. **Tested** Hardware: Windows 11 x64, NVIDIA GeForce RTX 5070 Ti (15995 MiB VRAM, DXR Tier 1.1), AMD Ryzen 9 9950X, `rustc 1.99.0`, DXC `1.9.2609.5` (`XCL_DXC_DIR`). - `cargo build --release -p xcl` (commit `93ac812337a7171f3c16bb28f007682e2d9c8f59`): succeeded, 39 warnings (0 new vs `main`; 0 in `bvh_builder.rs` or `hw_rt.rs`). - `.\scripts\test.ps1` (commit `93ac812337a7171f3c16bb28f007682e2d9c8f59`): **2998 passed, 0 failed, 52 ignored** across 43 test targets + doc-tests; **24 GPU tests skipped** on this adapter (22 `no wave64`, 2 `no heap windows`). All 10 `hle::d3d12x::hw_rt` tests (including `read_console_instances_crosses_view_tiles_and_caps_count` and all 3 WARP DXR 1.1 tests), all 13 `hle::bvh_builder` tests (including `read_archive_prims_crosses_view_tile_and_handles_failed_read`), and `active_backing_tracks_primary_and_split_segment` passed. - On the default 4-window layout almost every bottom level is skipped (`vertex buffer VA outside UMA`: the geometry lives at GPU-view addresses that only the 16-window layout maps), so native bottom levels are built primarily with `XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16`. - Prior live 180 s `XCL_HW_RT=1` run on `3620d76522ae28985d4f0d982b3afd16732adbda` (before restacking on updated #3662) (default memory layout, `XCL_PREPARE=0`, `XCL_NETWORK=0`, `XCL_PSO_EVICT_FRAMES=600`, automated title-screen advance): `exit: 0x0`, `2149` frames shown, `0` device removals, `0` crashes: - `HW RT shadow (XCL_HW_RT): live 2 BLAS / 5 TLAS / 90 rehydrated (1 MiB AS, 6 MiB pools); built 2 BLAS (0 updates, 2324 skipped), 75 TLAS (35 complete, 40 hybrid, 0 skipped); insts 34307 resolved / 0 null / 1487 rehydrated-skip / 29212 missing-skip; 1137 rehydrated recorded (0 built natively, 95 count mismatch), 0 stale invalidated, 0 copy-invalidated, 0 copied natively, 0 alloc-err, 0 budget-skip` - Prior live 180 s `XCL_HW_RT=1 XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16` run on `3620d76522ae28985d4f0d982b3afd16732adbda` (before restacking on updated #3662) (same settings, with GPU view windows active): `exit: 0x0`, `2016` frames shown, `0` device removals, `0` crashes: - `HW RT shadow (XCL_HW_RT): live 2654 BLAS / 5 TLAS / 140 rehydrated (238 MiB AS, 118 MiB pools); built 1199 BLAS (0 updates, 1371 skipped), 154 TLAS (82 complete, 72 hybrid, 0 skipped); insts 104399 resolved / 0 null / 2188 rehydrated-skip / 31495 missing-skip; 1960 rehydrated recorded (1809 built natively, 151 count mismatch), 158 stale invalidated, 0 copy-invalidated, 0 copied natively, 0 alloc-err, 0 budget-skip` - (See Known limitations #6 below for the 1 of 2 16-window `XCL_HW_RT=1` runs that hit `0x887a0006`.) **Regression run** Base (`main`): ``` xcl-smoke v1 commit: 5eaadb54c14e0fc29597b2a1689d7dbd83491303 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1658 (PresentX 1658) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 16763 MB ``` PR (`pr/hw-rt-shadow`): ``` xcl-smoke v1 commit: 93ac812337a7171f3c16bb28f007682e2d9c8f59 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1701 (PresentX 1701) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16200 MB ``` **Not tested** - AMD/Intel GPUs and native wave64 GPU tests (22 skipped on RTX 5070 Ti). - Sample-gated tests (`XCL_SAMPLE_*` unset). - Native traversal in shaders (`XCL_HW_RT_TRAVERSE=1`; handled in the follow-up stacked PRs). - Live 180 s `XCL_HW_RT=1` run was not re-run on `93ac81233` (the cross-tile read changes are covered by unit tests and the 60 s default-layout smoke run above). - Known limitations: 1. Scratch and staging pools are reused after 4 presents without an explicit GPU fence (assumes at most 3 frames in flight; replaced AS buffers wait via `late_release` until every active queue is past a fence). 2. TLAS instance descriptions are read on the CPU at command-record time (same-frame GPU writes to the instance buffer are read stale; unknown BLAS VAs are masked to `AccelerationStructure = 0, InstanceMask = 0` so there is no GPU fault, though those instances are skipped until the BLAS is known). 3. Natively built rehydrated BLASes use geometry primitive indices rather than the archive's original primitive indices. 4. In-place BLAS rebuilds keep referencing TLASes marked complete (the title is expected to rebuild or update the TLAS, matching console behaviour). 5. The copy hook does not request the copy destination range in GPU view windows (same gap as #3662). 6. On the 16-window layout, 1 of 3 `XCL_HW_RT=1` runs (including #3705's 180 s `XCL_HW_RT_TRAVERSE=1` run) ended in `0x887a0006` (`DEVICE_HUNG`) at `154.2 s` / frame `1969` with `+3.9 GiB` VRAM overcommit (last recorded: `DispatchMesh in two passes`); one 180 s `XCL_HW_RT=0` control finished (`1920` frames, `0` removals). Cause not determined; the native structures add about 360 MiB of VRAM (`238 MiB AS + 118 MiB pools` at `180 s`). **AI use** - Claude Code (`Claude Opus 5.5`): architecture, hang/TDR audit, barrier and lifetime review, and final diff/description review. - Antigravity (`Gemini 4 Neon`): split, rebase onto `main`, cross-tile `read_gpu_bytes` + `MAX_TLAS_INSTANCES` fixes and tests, builds, test suite, smoke runs, live `XCL_HW_RT=1` verification, and PR description.
Jockerino commented 2026-12-02 15:48:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Jockerino on 2026-12-02T15:48:29Z.


merge-check claim
head: 3620d76522ae28985d4f0d982b3afd16732adbda

<!-- greyfinch-sync:ivall/xcl:comment:7350953318 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3700#issuecomment-7350953318). Originally posted by [Jockerino](https://github.com/Jockerino) on 2026-12-02T15:48:29Z. --- merge-check claim head: [3620d76522ae28985d4f0d982b3afd16732adbda](https://github.com/xcl-dev/xcl/pull/3700/changes/3620d76522ae28985d4f0d982b3afd16732adbda)
Jockerino commented 2026-12-02 16:42:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Jockerino on 2026-12-02T16:42:51Z.


merge-check
base: 5eaadb54c1
head: 3620d76522
merge: clean
build: cargo build --workspace -> ok (cargo build --release -p xcl: 39 lib warnings on the base and on the merge, none new)
tests: cargo test at 1 thread instead of --test-threads=4, as one cargo process a group (the library's 2879 tests in 11 groups by module, then --bins, each of the 38 integration tests, the two test packages and the doc tests; this PC has gone down under the parallel run before) -> 2995 passed, 0 failed, 52 ignored, each test counted once; SKIPPED: 26 (22 no wave64, 2 no heap windows, 2 cannot disable the driver cache: Windows Developer Mode is off here); failing: none. All 9 hle::d3d12x::hw_rt tests ran, the 3 WARP DXR 1.1 ones without a SKIPPED notice, and the 11 hle::bvh_builder tests. cargo bench -p xcl --bench '*' -- --test: ok.
review: whole diff read, all three commits (+3707/-1, 9 files; a65c38b16 is #3662's and b1bd0a442 is #3697's, both still open; 3620d7652 is this PR's own). (1) Not verified here: XCL_HW_RT=1 inside the world. On this machine main itself loses the device when a save in the first interior is continued (scripts/smoke.ps1 settings plus XCL_PRESS_AT): 0x887a0006 at the first world submits - base 5eaadb54c at 138 s; the merge with XCL_HW_RT unset at 142 s; the merge with XCL_HW_RT=1 at 329 s (that run was still compiling shaders before); video memory was 2.0 to 2.4 GB over budget in these three. With XCL_DEVICE_TYPE=lockhart the merge (XCL_HW_RT unset) lost the device at 137 s as well, 0.9 GB under budget, so the budget alone does not explain it. So the removal is not this PR's, and no native structure was exercised through world frames. Up to the removal the XCL_HW_RT=1 run logged "XboxBvhBuilder: builds, rehydrates and copies wrapped (GPU views: no view windows, XCL_HW_RT on)", "native DXR 1.1 shadow builder active (host RaytracingTier=12, budget=1024 MiB)" and one summary line: live 2 BLAS / 5 TLAS / 11 rehydrated (1 MiB AS, 1 MiB pools); built 2 BLAS (0 updates, 683 skipped), 5 TLAS (3 complete, 2 hybrid, 0 skipped); 160 rehydrated recorded (0 built natively, 11 count mismatch); 0 alloc-err, 0 budget-skip - in line with the description's default-layout numbers. The 16-window layout was not run here. (2) hw_rt.rs: the scratch and staging pools only grow. acquire_scratch (~918) and acquire_staging (~964) push a new buffer and add to pool_bytes (~954, ~1005); nothing removes one. pool_bytes counts against XCL_HW_RT_BUDGET_MB together with the live structures (total_bytes ~884), so after a peak - one batch sizes a single scratch buffer for all its bottom levels - that video memory stays for the life of the process, and once pools plus structures reach the budget every later allocation fails with "budget exceeded" (~941, ~987: the build is skipped and its entry invalidated) although idle pool buffers could be freed first. Opt-in path only. (3) Minor: bvh_builder.rs resolve_scratch_bytes (~440) treats a PERFORM_UPDATE with Source = 0 as an update in place (it falls back to the destination), but execute_shadow_batch passes d.build.source to Registry::can_update (~1177, ~1321), which returns None for 0 (~352): such an update is rebuilt natively, not refitted. Correct output, more GPU work, and only if a title passes 0. (4) Minor: Copy_hook (bvh_builder.rs ~683) has no forwarding test; the build and rehydrate hooks have one each, the copy only the wrap_with mapping (~776). (5) Fine: the gate (hw_rt::enabled() = XCL_HW_RT and not XCL_RAYTRACING=0) is checked in wrap, in every hook and in summary_line; with it unset and no view windows nothing is wrapped (no "XboxBvhBuilder:" line in the merge's default-layout smoke log); UAV barriers follow the bottom-level phase, the top-level phase and surround native copies; unresolved instances are masked (AccelerationStructure 0, mask 0); replaced buffers wait 4 presents and then go through late_release's fences; read_archive_prims goes through list_x::cpu_at, which leaves a CPU address as it is.
performance: off by default. With XCL_HW_RT unset the added work is one enabled() check per hook call (16-window layout only) and one summary_line() call every 10 s that returns None. Measured, 60 s smoke pair on the default layout (blocks below): 1582 -> 1574 frames shown (99.5 %), presents per 2 s 60 60 60 in both, peak commit 17482 -> 18457 MB (105.6 %), 0 device removals, 0 crashes. A repeat of the base right after the pair gave 1329 frames and 26189 MB, so on this machine two runs of main differ more than main and the merge do. With XCL_HW_RT=1: not measured in the world (review 1); by reading, up to XCL_HW_RT_BUDGET_MB (1024 MiB by default) of video memory for native structures and pools; in the default profile this card is already about 2 GB over budget at world load here.
verdict: safe to merge (after #3662 and #3697, which it carries): the default path is unchanged and measured clean, build and suite pass, and the review found nothing blocking; the opt-in XCL_HW_RT=1 path starts and builds structures here but could not be followed into the world because main itself does not survive that world load on this machine.
hardware / tool and model: NVIDIA GeForce RTX 5070 Ti (driver 621.40), AMD Ryzen 7 7800X3D, Windows 11 Pro 26300, rustc 1.101.0-nightly (clang-cl with an xwin sysroot, not the stable MSVC toolchain), DXC 1.9.2609 / Claude Code with Claude Fable 5.2 (ran the build, the tests and the runs and drafted this report)

Regression run, scripts/smoke.ps1 unchanged, one isolated data root for both, after a warm-up run of the base:

xcl-smoke v1
commit: 5eaadb54c14e0fc29597b2a1689d7dbd83491303
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1582 (PresentX 1582)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17482 MB
xcl-smoke v1
commit: 3620d76522ae28985d4f0d982b3afd16732adbda
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1574 (PresentX 1574)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 18457 MB
<!-- greyfinch-sync:ivall/xcl:comment:7352350553 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3700#issuecomment-7352350553). Originally posted by [Jockerino](https://github.com/Jockerino) on 2026-12-02T16:42:51Z. --- merge-check base: 5eaadb54c14e0fc29597b2a1689d7dbd83491303 head: 3620d76522ae28985d4f0d982b3afd16732adbda merge: clean build: cargo build --workspace -> ok (cargo build --release -p xcl: 39 lib warnings on the base and on the merge, none new) tests: cargo test at 1 thread instead of --test-threads=4, as one cargo process a group (the library's 2879 tests in 11 groups by module, then --bins, each of the 38 integration tests, the two test packages and the doc tests; this PC has gone down under the parallel run before) -> 2995 passed, 0 failed, 52 ignored, each test counted once; SKIPPED: 26 (22 no wave64, 2 no heap windows, 2 cannot disable the driver cache: Windows Developer Mode is off here); failing: none. All 9 hle::d3d12x::hw_rt tests ran, the 3 WARP DXR 1.1 ones without a SKIPPED notice, and the 11 hle::bvh_builder tests. cargo bench -p xcl --bench '*' -- --test: ok. review: whole diff read, all three commits (+3707/-1, 9 files; a65c38b16 is #3662's and b1bd0a442 is #3697's, both still open; 3620d7652 is this PR's own). (1) Not verified here: XCL_HW_RT=1 inside the world. On this machine main itself loses the device when a save in the first interior is continued (scripts/smoke.ps1 settings plus XCL_PRESS_AT): 0x887a0006 at the first world submits - base 5eaadb54c at 138 s; the merge with XCL_HW_RT unset at 142 s; the merge with XCL_HW_RT=1 at 329 s (that run was still compiling shaders before); video memory was 2.0 to 2.4 GB over budget in these three. With XCL_DEVICE_TYPE=lockhart the merge (XCL_HW_RT unset) lost the device at 137 s as well, 0.9 GB under budget, so the budget alone does not explain it. So the removal is not this PR's, and no native structure was exercised through world frames. Up to the removal the XCL_HW_RT=1 run logged "XboxBvhBuilder: builds, rehydrates and copies wrapped (GPU views: no view windows, XCL_HW_RT on)", "native DXR 1.1 shadow builder active (host RaytracingTier=12, budget=1024 MiB)" and one summary line: live 2 BLAS / 5 TLAS / 11 rehydrated (1 MiB AS, 1 MiB pools); built 2 BLAS (0 updates, 683 skipped), 5 TLAS (3 complete, 2 hybrid, 0 skipped); 160 rehydrated recorded (0 built natively, 11 count mismatch); 0 alloc-err, 0 budget-skip - in line with the description's default-layout numbers. The 16-window layout was not run here. (2) hw_rt.rs: the scratch and staging pools only grow. acquire_scratch (~918) and acquire_staging (~964) push a new buffer and add to pool_bytes (~954, ~1005); nothing removes one. pool_bytes counts against XCL_HW_RT_BUDGET_MB together with the live structures (total_bytes ~884), so after a peak - one batch sizes a single scratch buffer for all its bottom levels - that video memory stays for the life of the process, and once pools plus structures reach the budget every later allocation fails with "budget exceeded" (~941, ~987: the build is skipped and its entry invalidated) although idle pool buffers could be freed first. Opt-in path only. (3) Minor: bvh_builder.rs resolve_scratch_bytes (~440) treats a PERFORM_UPDATE with Source = 0 as an update in place (it falls back to the destination), but execute_shadow_batch passes d.build.source to Registry::can_update (~1177, ~1321), which returns None for 0 (~352): such an update is rebuilt natively, not refitted. Correct output, more GPU work, and only if a title passes 0. (4) Minor: Copy_hook (bvh_builder.rs ~683) has no forwarding test; the build and rehydrate hooks have one each, the copy only the wrap_with mapping (~776). (5) Fine: the gate (hw_rt::enabled() = XCL_HW_RT and not XCL_RAYTRACING=0) is checked in wrap, in every hook and in summary_line; with it unset and no view windows nothing is wrapped (no "XboxBvhBuilder:" line in the merge's default-layout smoke log); UAV barriers follow the bottom-level phase, the top-level phase and surround native copies; unresolved instances are masked (AccelerationStructure 0, mask 0); replaced buffers wait 4 presents and then go through late_release's fences; read_archive_prims goes through list_x::cpu_at, which leaves a CPU address as it is. performance: off by default. With XCL_HW_RT unset the added work is one enabled() check per hook call (16-window layout only) and one summary_line() call every 10 s that returns None. Measured, 60 s smoke pair on the default layout (blocks below): 1582 -> 1574 frames shown (99.5 %), presents per 2 s 60 60 60 in both, peak commit 17482 -> 18457 MB (105.6 %), 0 device removals, 0 crashes. A repeat of the base right after the pair gave 1329 frames and 26189 MB, so on this machine two runs of main differ more than main and the merge do. With XCL_HW_RT=1: not measured in the world (review 1); by reading, up to XCL_HW_RT_BUDGET_MB (1024 MiB by default) of video memory for native structures and pools; in the default profile this card is already about 2 GB over budget at world load here. verdict: safe to merge (after #3662 and #3697, which it carries): the default path is unchanged and measured clean, build and suite pass, and the review found nothing blocking; the opt-in XCL_HW_RT=1 path starts and builds structures here but could not be followed into the world because main itself does not survive that world load on this machine. hardware / tool and model: NVIDIA GeForce RTX 5070 Ti (driver 621.40), AMD Ryzen 7 7800X3D, Windows 11 Pro 26300, rustc 1.101.0-nightly (clang-cl with an xwin sysroot, not the stable MSVC toolchain), DXC 1.9.2609 / Claude Code with Claude Fable 5.2 (ran the build, the tests and the runs and drafted this report) Regression run, `scripts/smoke.ps1` unchanged, one isolated data root for both, after a warm-up run of the base: ``` xcl-smoke v1 commit: 5eaadb54c14e0fc29597b2a1689d7dbd83491303 gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1582 (PresentX 1582) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17482 MB ``` ``` xcl-smoke v1 commit: 3620d76522ae28985d4f0d982b3afd16732adbda gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1574 (PresentX 1574) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 18457 MB ```
Foniass commented 2026-12-03 02:07:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T02:07:50Z.


merge-check
base: 078358a058
head: 150a158411
merge: clean
build: ok
tests: 3028 passed, 0 failed, 52 ignored; 28 skipped, the same as on main
review: 1 high, 3 medium, 1 nit (below)
performance: 60 s smoke run: 1669 → 1679 frames (100 % of main), peak commit 17577 → 17862 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 223 s there, 0 device removals, 0 crashes, 3.1 presents/s; run with XCL_SKIP_CS=95cc13288a27a96e (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)
verdict: not yet: 1 blocking finding (critical or high, below); also PR description is red
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5


In short: Adds the opt-in XCL_HW_RT=1 shadow builder. After each XboxBvhBuilder build, rehydrate or copy it records a native DXR 1.1 BLAS, TLAS or clone on the title's own list; nothing reads these yet (traversal is #3705). It is stacked on #3662 and #3697, whose heads match, and only 150a1584 is its own. The default path is unchanged, but the TLAS instance read ignores 64 KiB view-tile boundaries, which gives wrong instances on the 16-window layout this feature mainly runs on.

High

  1. TLAS instances are read across view tiles as one block. read_console_instances (hw_rt.rs ~1057-1110) translates only the first address with list_x::cpu_at, then read_owns n64 bytes (or n8 pointer bytes) from there in one go. In a GPU view, the CPU pages behind the next 64 KiB tile need not follow; that is why view_want::cpu_run exists and why #3662 reads tile by tile with read_gpu_bytes. Any instance array that crosses a tile boundary on the 16-window layout therefore gets bytes from unrelated memory: wrong transforms and BLAS addresses in the native TLAS. Reuse bvh_builder::read_gpu_bytes with cpu_run, and add a cross-tile case to the tests.

Medium

  1. Unexplained device hang on the 16-window layout. 1 of 3 XCL_HW_RT=1 16-window runs ended in DEVICE_HUNG (Known limitation 6), cause not found. The 180 s HW_RT runs were on 3620d765, before the restack, not this head. It is opt-in, so this does not block, but find the cause before anything turns it on, or rule the shadow builds in or out with XCL_HW_RT=0 runs of the same length.
  2. Pools are reused by present count, not by fence. acquire_scratch and acquire_staging (~900-1010) hand a buffer out again 4 presents after its last use, without checking a fence. A list that is executed late, executed more than once, or a title running more than 3 frames ahead lets a new build overwrite scratch or instance data the GPU is still reading. late_release already tracks fences for the retired AS buffers; use the same for pool reuse.
  3. 1612 lines in its own commit. This is over ~800 lines. The reason given (no unused code, no unverified recording) is plausible, but ~1200 production lines in one commit is hard to review. late_release::hold_owned_resource and title_list::active_backing, with their tests, could go first.

Nit

  1. No cap on the instance count. read_console_instances allocates num_descs*64 bytes straight from the title's inputs, while #3662 caps its walk at MAX_TLAS_INSTANCES. A corrupt count aborts on allocation.
Checked and fine
  • The stack matches: f783a5f5 is #3697's head and 4082300b is #3662's
  • Default path: with XCL_HW_RT unset on the 4-window layout nothing is wrapped; on the 16-window layout the new Copy hook only passes through when XCL_HW_RT is off
  • The Copy hook's signature matches the mangled export (this, list, u64, u64, enum), and native rehydrate builds are recorded only when the DLL returns hr >= 0
  • There is a UAV barrier after the BLAS phase and after the TLAS phase, clones sit between two barriers, and BLAS scratch offsets are 256-byte aligned within one pooled buffer
  • hold_owned_resource drops XCL-owned AS buffers only after every queue passes a fence and skips resource_ending, which is right for objects never adopted into the title's table
  • active_backing reads F_BACKING, its test covers the split-segment case, and the WARP tests call skip_test when there is no WARP DXR device
How this was tested
  • Merged onto main 078358a0, then cargo build --workspace and cargo test --workspace --no-fail-fast -- --test-threads=4.
  • The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar).
  • scripts/smoke.ps1: 60 s of a retail title on main 078358a0 and on this merge; presents per 2 s at the end: 60 60 61.
  • Title run: the release build of this merge launched the retail title with XCL_RUN_SECONDS=300 and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7365118412 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3700#issuecomment-7365118412). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T02:07:50Z. --- merge-check base: 078358a058f7ba5d16690dba8dc4e55d2c88ae0a head: 150a158411304f354d32df80718821f4f11060b2 merge: clean build: ok tests: 3028 passed, 0 failed, 52 ignored; 28 skipped, the same as on main review: 1 high, 3 medium, 1 nit (below) performance: 60 s smoke run: 1669 → 1679 frames (100 % of main), peak commit 17577 → 17862 MB, no device removal, no crash title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 223 s there, 0 device removals, 0 crashes, 3.1 presents/s; run with `XCL_SKIP_CS=95cc13288a27a96e` (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590) verdict: not yet: 1 blocking finding (critical or high, below); also `PR description` is red hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 --- **In short:** Adds the opt-in XCL_HW_RT=1 shadow builder. After each XboxBvhBuilder build, rehydrate or copy it records a native DXR 1.1 BLAS, TLAS or clone on the title's own list; nothing reads these yet (traversal is #3705). It is stacked on #3662 and #3697, whose heads match, and only 150a1584 is its own. The default path is unchanged, but the TLAS instance read ignores 64 KiB view-tile boundaries, which gives wrong instances on the 16-window layout this feature mainly runs on. #### High 1. **TLAS instances are read across view tiles as one block.** read_console_instances (hw_rt.rs ~1057-1110) translates only the first address with list_x::cpu_at, then read_owns n*64 bytes (or n*8 pointer bytes) from there in one go. In a GPU view, the CPU pages behind the next 64 KiB tile need not follow; that is why view_want::cpu_run exists and why #3662 reads tile by tile with read_gpu_bytes. Any instance array that crosses a tile boundary on the 16-window layout therefore gets bytes from unrelated memory: wrong transforms and BLAS addresses in the native TLAS. Reuse bvh_builder::read_gpu_bytes with cpu_run, and add a cross-tile case to the tests. #### Medium 2. **Unexplained device hang on the 16-window layout.** 1 of 3 XCL_HW_RT=1 16-window runs ended in DEVICE_HUNG (Known limitation 6), cause not found. The 180 s HW_RT runs were on 3620d765, before the restack, not this head. It is opt-in, so this does not block, but find the cause before anything turns it on, or rule the shadow builds in or out with XCL_HW_RT=0 runs of the same length. 3. **Pools are reused by present count, not by fence.** acquire_scratch and acquire_staging (~900-1010) hand a buffer out again 4 presents after its last use, without checking a fence. A list that is executed late, executed more than once, or a title running more than 3 frames ahead lets a new build overwrite scratch or instance data the GPU is still reading. late_release already tracks fences for the retired AS buffers; use the same for pool reuse. 4. **1612 lines in its own commit.** This is over ~800 lines. The reason given (no unused code, no unverified recording) is plausible, but ~1200 production lines in one commit is hard to review. late_release::hold_owned_resource and title_list::active_backing, with their tests, could go first. #### Nit 5. **No cap on the instance count.** read_console_instances allocates num_descs*64 bytes straight from the title's inputs, while #3662 caps its walk at MAX_TLAS_INSTANCES. A corrupt count aborts on allocation. <details><summary>Checked and fine</summary> - The stack matches: f783a5f5 is #3697's head and 4082300b is #3662's - Default path: with XCL_HW_RT unset on the 4-window layout nothing is wrapped; on the 16-window layout the new Copy hook only passes through when XCL_HW_RT is off - The Copy hook's signature matches the mangled export (this, list, u64, u64, enum), and native rehydrate builds are recorded only when the DLL returns hr >= 0 - There is a UAV barrier after the BLAS phase and after the TLAS phase, clones sit between two barriers, and BLAS scratch offsets are 256-byte aligned within one pooled buffer - hold_owned_resource drops XCL-owned AS buffers only after every queue passes a fence and skips resource_ending, which is right for objects never adopted into the title's table - active_backing reads F_BACKING, its test covers the split-segment case, and the WARP tests call skip_test when there is no WARP DXR device </details> <details><summary>How this was tested</summary> - Merged onto main `078358a0`, then `cargo build --workspace` and `cargo test --workspace --no-fail-fast -- --test-threads=4`. - The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar). - `scripts/smoke.ps1`: 60 s of a retail title on main `078358a0` and on this merge; presents per 2 s at the end: 60 60 61. - Title run: the release build of this merge launched the retail title with `XCL_RUN_SECONDS=300` and scripted A presses counted from the first frame (`XCL_PRESS_BASE=frame`, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
Kalmarv commented 2026-12-03 02:29:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-03T02:29:10Z.


Thanks for the review, @Foniass — updated pr/hw-rt-shadow to 93ac81233:

  • High #1 (cross-tile TLAS instance reads) & Nit #5 (MAX_TLAS_INSTANCES cap): Exposed pub(crate) bvh_builder::read_gpu_bytes and MAX_TLAS_INSTANCES, rewrote hw_rt::read_console_instances (via read_console_instances_with) to read LAYOUT_ARRAY, LAYOUT_ARRAY_OF_POINTERS tables, and each 64-byte element through read_gpu_bytes (view_want::cpu_run + dstorage::read_own) across 64 KiB GPU-view tile boundaries, and reject num_descs > MAX_TLAS_INSTANCES cleanly without allocating. Added unit test hw_rt::tests::read_console_instances_crosses_view_tiles_and_caps_count.
  • Archive header read (bvh_builder::read_archive_prims): Replaced readable() + read_unaligned with the same read_gpu_bytes helper (read_archive_prims_with) so both GPU-memory read paths are tile-safe and TOCTOU-free, with unit test bvh_builder::tests::read_archive_prims_crosses_view_tile_and_handles_failed_read.
  • Medium #2 / #3 / #4: Left unchanged for this PR (pool reuse stays documented under Known limitations #1; keeping this update focused on the blocking read bug).
  • PR description check: Verified scripts/pr_check.py --local passes (description ok) on 93ac81233 (the earlier red check on 150a15841 was GitHub Actions' repo-wide pull_request_target startup_failure).

Re-verified on 93ac81233: cargo build --release -p xcl (39 warnings, 0 new vs main), .\scripts\test.ps1 (2998 passed, 0 failed, 52 ignored, 24 SKIPPED: 22 no wave64, 2 no heap windows), and fresh 60 s retail smoke (1701 frames, 60 60 60 presents/2 s, 16200 MB peak commit, 0 removals, 0 crashes, exit: 0x0).

<!-- greyfinch-sync:ivall/xcl:comment:7365511947 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3700#issuecomment-7365511947). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-03T02:29:10Z. --- Thanks for the review, @Foniass — updated `pr/hw-rt-shadow` to `93ac81233`: - **High #1 (cross-tile TLAS instance reads) & Nit #5 (`MAX_TLAS_INSTANCES` cap):** Exposed `pub(crate) bvh_builder::read_gpu_bytes` and `MAX_TLAS_INSTANCES`, rewrote `hw_rt::read_console_instances` (via `read_console_instances_with`) to read `LAYOUT_ARRAY`, `LAYOUT_ARRAY_OF_POINTERS` tables, and each 64-byte element through `read_gpu_bytes` (`view_want::cpu_run` + `dstorage::read_own`) across 64 KiB GPU-view tile boundaries, and reject `num_descs > MAX_TLAS_INSTANCES` cleanly without allocating. Added unit test `hw_rt::tests::read_console_instances_crosses_view_tiles_and_caps_count`. - **Archive header read (`bvh_builder::read_archive_prims`):** Replaced `readable()` + `read_unaligned` with the same `read_gpu_bytes` helper (`read_archive_prims_with`) so both GPU-memory read paths are tile-safe and TOCTOU-free, with unit test `bvh_builder::tests::read_archive_prims_crosses_view_tile_and_handles_failed_read`. - **Medium #2 / #3 / #4:** Left unchanged for this PR (pool reuse stays documented under Known limitations #1; keeping this update focused on the blocking read bug). - **`PR description` check:** Verified `scripts/pr_check.py --local` passes (`description ok`) on `93ac81233` (the earlier red check on `150a15841` was GitHub Actions' repo-wide `pull_request_target` `startup_failure`). Re-verified on `93ac81233`: `cargo build --release -p xcl` (39 warnings, 0 new vs `main`), `.\scripts\test.ps1` (`2998 passed, 0 failed, 52 ignored`, `24 SKIPPED`: 22 `no wave64`, 2 `no heap windows`), and fresh 60 s retail smoke (`1701` frames, `60 60 60` presents/2 s, `16200 MB` peak commit, `0` removals, `0` crashes, `exit: 0x0`).
Foniass commented 2026-12-03 07:03:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T07:03:08Z.


merge-check
base: 078358a058
head: 93ac812337
merge: clean
build: ok
tests: 3030 passed, 0 failed, 52 ignored; 28 skipped, the same as on main
review: 3 medium (below)
performance: 60 s smoke run: 1669 → 1667 frames (99 % of main), peak commit 17577 → 18251 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 232 s there, 0 device removals, 0 crashes, 2.7 presents/s; run with XCL_SKIP_CS=95cc13288a27a96e (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)
verdict: not yet: PR description is red; otherwise no blocking finding, the suite passes and the smoke run is clean
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5


In short: Adds the opt-in XCL_HW_RT=1 shadow builder, which records a native DXR 1.1 BLAS, TLAS or copy after each XboxBvhBuilder build, rehydrate or copy. It is stacked on #3662 (4082300b) and #3697 (f783a5f5), both unchanged, and only 93ac8123 is its own. This push fixes the high finding and the nit from my last merge-check, and the read_archive_prims point from the #3704 review. Nothing blocks merging; the three mediums from my last merge-check are still open and the author has left them unchanged on purpose.

Medium

  1. Unexplained device hang on the 16-window layout. Known limitation 6 still reports DEVICE_HUNG in 1 of 3 XCL_HW_RT=1 runs on the 16-window layout, cause not found. The 180 s HW_RT runs were made on 3620d765, and the description says they were not repeated on 93ac8123, so the new tile-by-tile reads have not run in a live 16-window session either. It is opt-in, so this does not block, but the cause should be found, or the shadow builds ruled in or out with XCL_HW_RT=0 runs of the same length, before anything turns it on.
  2. Pools are reused by present count, not by fence. Unchanged: acquire_scratch and acquire_staging (hw_rt.rs ~918-1011) hand a buffer out again once frame >= last_used_frame + RETIRE_FRAMES, without checking a GPU fence. A list that is executed late or more than once, or a title running more than 3 frames ahead, lets a new build overwrite scratch or instance data the GPU is still reading. late_release already tracks fences for retired AS buffers; use the same for pool reuse.
  3. Its own commit is now 1795 lines. 93ac8123 is +1795/-16 across 5 files (up from about 1612), over the ~800 limit. The reason given in the description is plausible, but about 1235 production lines in one commit are hard to review. late_release::hold_owned_resource and title_list::active_backing, with their tests, could still go first as their own PR.
Checked and fine
  • Earlier finding fixed: TLAS instances read across view tiles as one block. read_console_instances_with (hw_rt.rs ~1058-1107) now reads the array, the pointer table and each 64-byte element through bvh_builder::read_gpu_bytes with view_want::cpu_run and dstorage::read_own. cpu_run gives the address back unchanged outside GPU views, so the default layout is unaffected
  • Earlier finding fixed: no cap on the instance count. A count above MAX_TLAS_INSTANCES returns None before any allocation, and the caller (~1322) counts the TLAS as skipped and invalidates its entry
  • Earlier finding fixed (from the #3704 review): read_archive_prims (bvh_builder.rs ~639-659) reads the 16-byte header through read_gpu_bytes and no longer uses readable() plus a raw read_unaligned
  • read_console_instances_crosses_view_tiles_and_caps_count covers an array whose middle element is split across two tiles that are not next to each other in CPU memory, a pointer table split across tiles that points at a split element and includes a null entry, a failed read, and counts of MAX+1 and u32::MAX (the cpu_run passed in panics if it is ever called for those)
  • read_archive_prims_crosses_view_tile_and_handles_failed_read covers a header split across a tile boundary, addr 0, and a failed read
  • Stack unchanged: range-diff shows 4082300b and f783a5f5 identical to the 150a1584 push and to the current heads of #3662 and #3697. Only hw_rt.rs and bvh_builder.rs changed since 150a1584, and no assertion was removed or weakened
  • The rehydrate hook's src_cpu_addrs read (bvh_builder.rs ~722-750) is the caller's argument array, checked with readable() the same way #3662 checks descs; it is not title GPU memory
  • #3653 no longer carries title_list::active_backing, so the two PRs do not duplicate it
How this was tested
  • Merged onto main 078358a0, then cargo build --workspace and cargo test --workspace --no-fail-fast -- --test-threads=4.
  • The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar).
  • scripts/smoke.ps1: 60 s of a retail title on main 078358a0 and on this merge; presents per 2 s at the end: 60 60 60.
  • Title run: the release build of this merge launched the retail title with XCL_RUN_SECONDS=300 and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7370537043 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3700#issuecomment-7370537043). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T07:03:08Z. --- merge-check base: 078358a058f7ba5d16690dba8dc4e55d2c88ae0a head: 93ac812337a7171f3c16bb28f007682e2d9c8f59 merge: clean build: ok tests: 3030 passed, 0 failed, 52 ignored; 28 skipped, the same as on main review: 3 medium (below) performance: 60 s smoke run: 1669 → 1667 frames (99 % of main), peak commit 17577 → 18251 MB, no device removal, no crash title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 232 s there, 0 device removals, 0 crashes, 2.7 presents/s; run with `XCL_SKIP_CS=95cc13288a27a96e` (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590) verdict: not yet: `PR description` is red; otherwise no blocking finding, the suite passes and the smoke run is clean hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 --- **In short:** Adds the opt-in XCL_HW_RT=1 shadow builder, which records a native DXR 1.1 BLAS, TLAS or copy after each XboxBvhBuilder build, rehydrate or copy. It is stacked on #3662 (4082300b) and #3697 (f783a5f5), both unchanged, and only 93ac8123 is its own. This push fixes the high finding and the nit from my last merge-check, and the read_archive_prims point from the #3704 review. Nothing blocks merging; the three mediums from my last merge-check are still open and the author has left them unchanged on purpose. #### Medium 1. **Unexplained device hang on the 16-window layout.** Known limitation 6 still reports DEVICE_HUNG in 1 of 3 XCL_HW_RT=1 runs on the 16-window layout, cause not found. The 180 s HW_RT runs were made on 3620d765, and the description says they were not repeated on 93ac8123, so the new tile-by-tile reads have not run in a live 16-window session either. It is opt-in, so this does not block, but the cause should be found, or the shadow builds ruled in or out with XCL_HW_RT=0 runs of the same length, before anything turns it on. 2. **Pools are reused by present count, not by fence.** Unchanged: acquire_scratch and acquire_staging (hw_rt.rs ~918-1011) hand a buffer out again once frame >= last_used_frame + RETIRE_FRAMES, without checking a GPU fence. A list that is executed late or more than once, or a title running more than 3 frames ahead, lets a new build overwrite scratch or instance data the GPU is still reading. late_release already tracks fences for retired AS buffers; use the same for pool reuse. 3. **Its own commit is now 1795 lines.** 93ac8123 is +1795/-16 across 5 files (up from about 1612), over the ~800 limit. The reason given in the description is plausible, but about 1235 production lines in one commit are hard to review. late_release::hold_owned_resource and title_list::active_backing, with their tests, could still go first as their own PR. <details><summary>Checked and fine</summary> - Earlier finding fixed: TLAS instances read across view tiles as one block. read_console_instances_with (hw_rt.rs ~1058-1107) now reads the array, the pointer table and each 64-byte element through bvh_builder::read_gpu_bytes with view_want::cpu_run and dstorage::read_own. cpu_run gives the address back unchanged outside GPU views, so the default layout is unaffected - Earlier finding fixed: no cap on the instance count. A count above MAX_TLAS_INSTANCES returns None before any allocation, and the caller (~1322) counts the TLAS as skipped and invalidates its entry - Earlier finding fixed (from the #3704 review): read_archive_prims (bvh_builder.rs ~639-659) reads the 16-byte header through read_gpu_bytes and no longer uses readable() plus a raw read_unaligned - read_console_instances_crosses_view_tiles_and_caps_count covers an array whose middle element is split across two tiles that are not next to each other in CPU memory, a pointer table split across tiles that points at a split element and includes a null entry, a failed read, and counts of MAX+1 and u32::MAX (the cpu_run passed in panics if it is ever called for those) - read_archive_prims_crosses_view_tile_and_handles_failed_read covers a header split across a tile boundary, addr 0, and a failed read - Stack unchanged: range-diff shows 4082300b and f783a5f5 identical to the 150a1584 push and to the current heads of #3662 and #3697. Only hw_rt.rs and bvh_builder.rs changed since 150a1584, and no assertion was removed or weakened - The rehydrate hook's src_cpu_addrs read (bvh_builder.rs ~722-750) is the caller's argument array, checked with readable() the same way #3662 checks descs; it is not title GPU memory - #3653 no longer carries title_list::active_backing, so the two PRs do not duplicate it </details> <details><summary>How this was tested</summary> - Merged onto main `078358a0`, then `cargo build --workspace` and `cargo test --workspace --no-fail-fast -- --test-threads=4`. - The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar). - `scripts/smoke.ps1`: 60 s of a retail title on main `078358a0` and on this merge; presents per 2 s at the end: 60 60 60. - Title run: the release build of this merge launched the retail title with `XCL_RUN_SECONDS=300` and scripted A presses counted from the first frame (`XCL_PRESS_BASE=frame`, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
Kalmarv commented 2026-12-03 07:23:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-03T07:23:29Z.


Thanks for the re-check, smoke run, and title run @Foniass!

  • PR description is red: every pull_request_target workflow on xcl-dev/xcl (PR checks, Auto triage, Testing feed, Discord mirror) has been failing with startup_failure repo-wide since ~22:47 UTC on 2026-12-02 (still failing at 07:18 UTC), so PR description never started on 93ac81233 (runs 47020074504 / 47020076295). Running main's scripts/pr_check.py --local against PR #3700's current description and 9-file list for 93ac812337a7171f3c16bb28f007682e2d9c8f59 passes (description ok), and Build and test (Windows, no GPU) is green (run 47020078504). Once pull_request_target recovers, I'll retrigger PR checks via a description edit without changing 93ac81233.
  • Medium #1 (live 16-window XCL_HW_RT=1 run on 93ac81233): ran a fresh 180 s XCL_HW_RT=1 XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 retail session directly on 93ac81233 (XCL_PREPARE=0, XCL_NETWORK=0, XCL_PSO_EVICT_FRAMES=600, automated title-screen advance) to exercise the new tile-by-tile read_console_instances and read_archive_prims read_gpu_bytes paths: exit: 0x0, 1841 frames shown (1842 PresentX calls), 0 device removals, 0 crashes:
    • HW RT shadow (XCL_HW_RT): live 3542 BLAS / 5 TLAS / 180 rehydrated (347 MiB AS, 136 MiB pools); built 1729 BLAS (0 updates, 1671 skipped), 193 TLAS (105 complete, 88 hybrid, 0 skipped); insts 138984 resolved / 0 null / 3387 rehydrated-skip / 42060 missing-skip; 2715 rehydrated recorded (2522 built natively, 193 count mismatch), 391 stale invalidated, 0 copy-invalidated, 0 copied natively, 0 alloc-err, 0 budget-skip
    • That brings the 16-window XCL_HW_RT=1 runs to 3 clean 180 s sessions vs. the 1 earlier 0x887a0006 (DEVICE_HUNG); agreed the hang root cause should be nailed down before anything enables hardware RT by default.
  • Medium #2 & #3 (fence-backed pool reuse & commit size): noted — leaving 93ac81233 untouched so this merge-check, title run, and green CI remain valid and the stacked PRs (#3704 / #3705) stay aligned, and keeping fence-backed pool reuse for follow-up before default-on.

(Verified and replied via Antigravity (Gemini 4 Neon).)

<!-- greyfinch-sync:ivall/xcl:comment:7370940106 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3700#issuecomment-7370940106). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-03T07:23:29Z. --- Thanks for the re-check, smoke run, and title run @Foniass! - **`PR description` is red:** every `pull_request_target` workflow on `xcl-dev/xcl` (`PR checks`, `Auto triage`, `Testing feed`, `Discord mirror`) has been failing with `startup_failure` repo-wide since ~22:47 UTC on 2026-12-02 (still failing at `07:18 UTC`), so `PR description` never started on `93ac81233` (runs `47020074504` / `47020076295`). Running `main`'s `scripts/pr_check.py --local` against PR #3700's current description and 9-file list for `93ac812337a7171f3c16bb28f007682e2d9c8f59` passes (`description ok`), and `Build and test (Windows, no GPU)` is green (run `47020078504`). Once `pull_request_target` recovers, I'll retrigger `PR checks` via a description edit without changing `93ac81233`. - **Medium #1 (live 16-window `XCL_HW_RT=1` run on `93ac81233`):** ran a fresh 180 s `XCL_HW_RT=1 XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16` retail session directly on `93ac81233` (`XCL_PREPARE=0`, `XCL_NETWORK=0`, `XCL_PSO_EVICT_FRAMES=600`, automated title-screen advance) to exercise the new tile-by-tile `read_console_instances` and `read_archive_prims` `read_gpu_bytes` paths: **`exit: 0x0`**, **`1841` frames shown** (`1842` PresentX calls), **`0` device removals**, **`0` crashes**: - `HW RT shadow (XCL_HW_RT): live 3542 BLAS / 5 TLAS / 180 rehydrated (347 MiB AS, 136 MiB pools); built 1729 BLAS (0 updates, 1671 skipped), 193 TLAS (105 complete, 88 hybrid, 0 skipped); insts 138984 resolved / 0 null / 3387 rehydrated-skip / 42060 missing-skip; 2715 rehydrated recorded (2522 built natively, 193 count mismatch), 391 stale invalidated, 0 copy-invalidated, 0 copied natively, 0 alloc-err, 0 budget-skip` - That brings the 16-window `XCL_HW_RT=1` runs to 3 clean 180 s sessions vs. the 1 earlier `0x887a0006` (`DEVICE_HUNG`); agreed the hang root cause should be nailed down before anything enables hardware RT by default. - **Medium #2 & #3 (fence-backed pool reuse & commit size):** noted — leaving `93ac81233` untouched so this merge-check, title run, and green CI remain valid and the stacked PRs (`#3704` / `#3705`) stay aligned, and keeping fence-backed pool reuse for follow-up before default-on. *(Verified and replied via Antigravity (Gemini 4 Neon).)*
Foniass commented 2026-12-03 15:32:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T15:32:08Z.


merge-check
base: 078358a058
head: 93ac812337
merge: clean
build: ok
tests: 3030 passed, 0 failed, 52 ignored; 28 skipped, the same as on main
review: 3 medium (below)
performance: 60 s smoke run: 1669 → 1667 frames (99 % of main), peak commit 17577 → 18251 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 232 s there, 0 device removals, 0 crashes, 2.7 presents/s; run with XCL_SKIP_CS=95cc13288a27a96e (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)
verdict: safe to merge: no blocking finding (the points below are medium or nits), the suite passes and the smoke run is clean
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5


In short: Adds the opt-in XCL_HW_RT=1 shadow builder, which records a native DXR 1.1 BLAS, TLAS or copy after each XboxBvhBuilder build, rehydrate or copy. It is stacked on #3662 (4082300b) and #3697 (f783a5f5), both unchanged, and only 93ac8123 is its own. This push fixes the high finding and the nit from my last merge-check, and the read_archive_prims point from the #3704 review. Nothing blocks merging; the three mediums from my last merge-check are still open and the author has left them unchanged on purpose.

Medium

  1. Unexplained device hang on the 16-window layout. Known limitation 6 still reports DEVICE_HUNG in 1 of 3 XCL_HW_RT=1 runs on the 16-window layout, cause not found. The 180 s HW_RT runs were made on 3620d765, and the description says they were not repeated on 93ac8123, so the new tile-by-tile reads have not run in a live 16-window session either. It is opt-in, so this does not block, but the cause should be found, or the shadow builds ruled in or out with XCL_HW_RT=0 runs of the same length, before anything turns it on.
  2. Pools are reused by present count, not by fence. Unchanged: acquire_scratch and acquire_staging (hw_rt.rs ~918-1011) hand a buffer out again once frame >= last_used_frame + RETIRE_FRAMES, without checking a GPU fence. A list that is executed late or more than once, or a title running more than 3 frames ahead, lets a new build overwrite scratch or instance data the GPU is still reading. late_release already tracks fences for retired AS buffers; use the same for pool reuse.
  3. Its own commit is now 1795 lines. 93ac8123 is +1795/-16 across 5 files (up from about 1612), over the ~800 limit. The reason given in the description is plausible, but about 1235 production lines in one commit are hard to review. late_release::hold_owned_resource and title_list::active_backing, with their tests, could still go first as their own PR.
Checked and fine
  • Earlier finding fixed: TLAS instances read across view tiles as one block. read_console_instances_with (hw_rt.rs ~1058-1107) now reads the array, the pointer table and each 64-byte element through bvh_builder::read_gpu_bytes with view_want::cpu_run and dstorage::read_own. cpu_run gives the address back unchanged outside GPU views, so the default layout is unaffected
  • Earlier finding fixed: no cap on the instance count. A count above MAX_TLAS_INSTANCES returns None before any allocation, and the caller (~1322) counts the TLAS as skipped and invalidates its entry
  • Earlier finding fixed (from the #3704 review): read_archive_prims (bvh_builder.rs ~639-659) reads the 16-byte header through read_gpu_bytes and no longer uses readable() plus a raw read_unaligned
  • read_console_instances_crosses_view_tiles_and_caps_count covers an array whose middle element is split across two tiles that are not next to each other in CPU memory, a pointer table split across tiles that points at a split element and includes a null entry, a failed read, and counts of MAX+1 and u32::MAX (the cpu_run passed in panics if it is ever called for those)
  • read_archive_prims_crosses_view_tile_and_handles_failed_read covers a header split across a tile boundary, addr 0, and a failed read
  • Stack unchanged: range-diff shows 4082300b and f783a5f5 identical to the 150a1584 push and to the current heads of #3662 and #3697. Only hw_rt.rs and bvh_builder.rs changed since 150a1584, and no assertion was removed or weakened
  • The rehydrate hook's src_cpu_addrs read (bvh_builder.rs ~722-750) is the caller's argument array, checked with readable() the same way #3662 checks descs; it is not title GPU memory
  • #3653 no longer carries title_list::active_backing, so the two PRs do not duplicate it
How this was tested
  • Merged onto main 078358a0, then cargo build --workspace and cargo test --workspace --no-fail-fast -- --test-threads=4.
  • The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar).
  • scripts/smoke.ps1: 60 s of a retail title on main 078358a0 and on this merge; presents per 2 s at the end: 60 60 60.
  • Title run: the release build of this merge launched the retail title with XCL_RUN_SECONDS=300 and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7383308287 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3700#issuecomment-7383308287). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T15:32:08Z. --- merge-check base: 078358a058f7ba5d16690dba8dc4e55d2c88ae0a head: 93ac812337a7171f3c16bb28f007682e2d9c8f59 merge: clean build: ok tests: 3030 passed, 0 failed, 52 ignored; 28 skipped, the same as on main review: 3 medium (below) performance: 60 s smoke run: 1669 → 1667 frames (99 % of main), peak commit 17577 → 18251 MB, no device removal, no crash title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 232 s there, 0 device removals, 0 crashes, 2.7 presents/s; run with `XCL_SKIP_CS=95cc13288a27a96e` (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590) verdict: safe to merge: no blocking finding (the points below are medium or nits), the suite passes and the smoke run is clean hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 --- **In short:** Adds the opt-in XCL_HW_RT=1 shadow builder, which records a native DXR 1.1 BLAS, TLAS or copy after each XboxBvhBuilder build, rehydrate or copy. It is stacked on #3662 (4082300b) and #3697 (f783a5f5), both unchanged, and only 93ac8123 is its own. This push fixes the high finding and the nit from my last merge-check, and the read_archive_prims point from the #3704 review. Nothing blocks merging; the three mediums from my last merge-check are still open and the author has left them unchanged on purpose. #### Medium 1. **Unexplained device hang on the 16-window layout.** Known limitation 6 still reports DEVICE_HUNG in 1 of 3 XCL_HW_RT=1 runs on the 16-window layout, cause not found. The 180 s HW_RT runs were made on 3620d765, and the description says they were not repeated on 93ac8123, so the new tile-by-tile reads have not run in a live 16-window session either. It is opt-in, so this does not block, but the cause should be found, or the shadow builds ruled in or out with XCL_HW_RT=0 runs of the same length, before anything turns it on. 2. **Pools are reused by present count, not by fence.** Unchanged: acquire_scratch and acquire_staging (hw_rt.rs ~918-1011) hand a buffer out again once frame >= last_used_frame + RETIRE_FRAMES, without checking a GPU fence. A list that is executed late or more than once, or a title running more than 3 frames ahead, lets a new build overwrite scratch or instance data the GPU is still reading. late_release already tracks fences for retired AS buffers; use the same for pool reuse. 3. **Its own commit is now 1795 lines.** 93ac8123 is +1795/-16 across 5 files (up from about 1612), over the ~800 limit. The reason given in the description is plausible, but about 1235 production lines in one commit are hard to review. late_release::hold_owned_resource and title_list::active_backing, with their tests, could still go first as their own PR. <details><summary>Checked and fine</summary> - Earlier finding fixed: TLAS instances read across view tiles as one block. read_console_instances_with (hw_rt.rs ~1058-1107) now reads the array, the pointer table and each 64-byte element through bvh_builder::read_gpu_bytes with view_want::cpu_run and dstorage::read_own. cpu_run gives the address back unchanged outside GPU views, so the default layout is unaffected - Earlier finding fixed: no cap on the instance count. A count above MAX_TLAS_INSTANCES returns None before any allocation, and the caller (~1322) counts the TLAS as skipped and invalidates its entry - Earlier finding fixed (from the #3704 review): read_archive_prims (bvh_builder.rs ~639-659) reads the 16-byte header through read_gpu_bytes and no longer uses readable() plus a raw read_unaligned - read_console_instances_crosses_view_tiles_and_caps_count covers an array whose middle element is split across two tiles that are not next to each other in CPU memory, a pointer table split across tiles that points at a split element and includes a null entry, a failed read, and counts of MAX+1 and u32::MAX (the cpu_run passed in panics if it is ever called for those) - read_archive_prims_crosses_view_tile_and_handles_failed_read covers a header split across a tile boundary, addr 0, and a failed read - Stack unchanged: range-diff shows 4082300b and f783a5f5 identical to the 150a1584 push and to the current heads of #3662 and #3697. Only hw_rt.rs and bvh_builder.rs changed since 150a1584, and no assertion was removed or weakened - The rehydrate hook's src_cpu_addrs read (bvh_builder.rs ~722-750) is the caller's argument array, checked with readable() the same way #3662 checks descs; it is not title GPU memory - #3653 no longer carries title_list::active_backing, so the two PRs do not duplicate it </details> <details><summary>How this was tested</summary> - Merged onto main `078358a0`, then `cargo build --workspace` and `cargo test --workspace --no-fail-fast -- --test-threads=4`. - The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar). - `scripts/smoke.ps1`: 60 s of a retail title on main `078358a0` and on this merge; presents per 2 s at the end: 60 60 60. - Title run: the release build of this merge launched the retail title with `XCL_RUN_SECONDS=300` and scripted A presses counted from the first frame (`XCL_PRESS_BASE=frame`, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3700:upstream-pr/3700'
git switch 'upstream-pr/3700'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3700'
git switch 'upstream-pr/3700'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3700'
git switch 'upstream-pr/3700'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3700'
git switch 'main'
git merge --squash 'upstream-pr/3700'
git switch 'main'
git merge --ff-only 'upstream-pr/3700'
git switch 'main'
git merge 'upstream-pr/3700'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
xcl-dev/xcl!3700
No description provided.