Repository navigation
Conversation
The title's acceleration-structure builder (`XboxBvhBuilder.dll`) builds and refits the ray-tracing structures in title memory every frame through some fifty compute dispatches. A dispatch without a host pipeline is dropped on its own (`State::dispatch`, `execute_indirect`), and some of the builder's lack one for a long time or for good: refused on hosts of 32-lane waves (they ask for 64-lane waves), not translated, or still being made. The stages that do run then work on data the missing ones never wrote, and write the result into title memory. On fxceless/victory-fork, where this happened, the builder wrote garbage bounds that crashed the title; that fork's rule is the one taken here. Its dispatches now run only in frames where every pipeline the builder has created has its host pipeline; otherwise none run, and the structures keep what they held. The decision is made once per frame, so a frame never runs part of the builder. Its pipelines are known by origin: bytecode in the builder's image, or a return address in it on the stack when the pipeline is created (`run` passes the DLL's range as it maps it, at start and when the title loads it). They are started at once, so no frame's wait budget holds the builder back. New tests (no game data): - `pipeline::builder::tests::the_builder_runs_only_with_every_pipeline_made` - `pipeline::builder::tests::builder_pipelines_are_known_by_their_origin` - `pipeline::tests::builder_dispatches_wait_for_every_builder_pipeline`: a compute pipeline created from bytecode in the registered image is the builder's, is started at once, is refused (no shader container), and holds back builder dispatches; another pipeline is not held back.
The world's ray-traced pass (f607780aa8e502d0) walks the acceleration structures with image_bvh64_intersect_ray, in a loop the title bounds at 65,535 steps per wave. When the builder has not built them, it walks whatever lies in that memory and outlasts the host's GPU timeout: the device is lost (DXGI_ERROR_DEVICE_HUNG). On a host of 32-lane waves some builder programs are refused, the builder is held back for good (Marvisak#2118), and every run ended that way at world entry (RTX 5090). A pipeline with an image_bvh*_intersect_ray program now waits, like the builder's own dispatches, until the builder has run whole once. Titles without XboxBvhBuilder.dll are not held. held_back says why, and the dispatch and indirect paths log it once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Not a request to change how this issue works, just a note for people who want a running build to try pull requests together, and for authors whose PRs may already be in it. VIctory V2 is an integration fork: it merges community pull requests, keeps each author in the history, and runs What would help us:
If you want your PR exercised together with others in a running build, tell us its number. |
catminou4
left a comment
There was a problem hiding this comment.
Programs walking the BVH wait until the builder finishes (note_title_dll wiring + draw.rs gate). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Xvania7
left a comment
There was a problem hiding this comment.
Verified 481a9ae on Windows 10 + NVIDIA GeForce RTX 5060:
pipeline::builder::tests::builder_pipelines_are_known_by_their_origin(passed)pipeline::builder::tests::the_builder_runs_only_with_every_pipeline_made(passed)pipeline::tests::builder_dispatches_wait_for_every_builder_pipeline(passed)pipeline::tests::programs_that_intersect_rays_walk_the_structures(passed)pipeline::tests::walks_wait_for_the_builder_to_run_whole(passed)cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warningscargo xtask policy: 183 files ok
Approving.
|
With The two controls used the same binary without this PR. The second skipped just one shader.
With this PR and no skip filter, the gate reported 53 builder pipelines, 48 made, 5 refused. The trace confirmed an indirect BVH walk was held back. Total run time was 200 s. The intro still ran at about 1 fps with credits over a dark background. Playable rendering remains unverified. Driver 621.01, Windows 11 build 26200, D3D12 debug layer and DRED enabled. All three runs used a fresh cache and a scripted Enter at 15 s. The fixed run reused the first control's saved setup. The common base was |
|
@Bullet18x Thanks for this important stability fix. The reported hardware results are encouraging. I reviewed Pipeline readiness is not builder completionIn However, this happens during command recording, before resource binding and actual dispatch recording. In
Consequently,
A subsequent traversal can then pass the gate without a successfully constructed BVH. Synthetic verificationI attached an executable Python state model of a hypothetical two-stage builder, including eight regression tests and 128 deliberately constructed combinations. Completion policy | False-ready states -- | -- Current readiness-based gate | 127 First successful submission fence | 29 Verified complete, ordered construction | 0All eight tests pass. These are abstract model results, not measured gameplay failure rates. The complete-construction model assumes knowledge of the required stages; identifying those stages in the actual runtime remains an open question. Suggested follow-upI would recommend separating pipeline readiness from verified construction completion. Moving Similarly, setting it after the first successful fence would not prove that every required builder stage has completed. A stronger implementation could track:
Until such a boundary is established, the existing gate should be understood as a stability heuristic rather than proof of successful BVH construction. This is not a request to discard the current protection, which has already demonstrated useful hardware results. It is a follow-up correctness concern worth addressing before enabling the full builder on additional adapters. Attachment: No native Rust, DXIL or GPU execution was performed in this review. I have not established that these counterexamples occur in the title. AI-assisted source review and independent synthetic verification. No game files or proprietary assets were used. @Bullet18x Thanks for this important stability fix. The reported hardware results are encouraging.I reviewed Pipeline readiness is not builder completionIn if open && !states.is_empty() && !BUILT.swap(true, Ordering::Relaxed) {
tracing::info!(frame, "BVH builder ran whole: programs that walk its structures run from here on");
}However, this happens during command recording, before resource binding and actual dispatch recording. In
Consequently,
A subsequent traversal can then pass the gate without a successfully constructed BVH. Synthetic verificationI attached an executable Python state model of a hypothetical two-stage builder, including eight regression tests and 128 deliberately constructed combinations.
All eight tests pass. These are abstract model results, not measured gameplay failure rates. The complete-construction model assumes knowledge of the required stages; identifying those stages in the actual runtime remains an open question. Suggested follow-upI would recommend separating pipeline readiness from verified construction completion. Moving Similarly, setting it after the first successful fence would not prove that every required builder stage has completed. A stronger implementation could track:
Until such a boundary is established, the existing gate should be understood as a stability heuristic rather than proof of successful BVH construction. This is not a request to discard the current protection, which has already demonstrated useful hardware results. It is a follow-up correctness concern worth addressing before enabling the full builder on additional adapters. Attachment: No native Rust, DXIL or GPU execution was performed in this review. I have not established that these counterexamples occur in the title. |
|
Concur with @FunWithFlagsDev's analysis on separating pipeline readiness from verified construction completion. Looking at the dispatch recording flow in
Tracking builder work per command list (e.g. marking the host list as containing active builder dispatches) and advancing the |
|
Automated triage for the maintainers. Needs rebase. This PR no longer merges cleanly into From the earlier needs-work note, still open: set Generated by Claude Code |
GPU: programs that walk the BVH wait until the builder has run whole (NVIDIA device hang at world entry) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Upstream main merged Marvisak#2143, Marvisak#2162, Marvisak#158, Marvisak#1906 and Marvisak#1152 and took up what Marvisak#1769 (LDS bounds, Marvisak#1949) and Marvisak#1763 (typed UAV formats, Marvisak#2462) did; main's code is kept for those. - emit/lower.rs: ds_bpermute within each half (main's Marvisak#573, same as Marvisak#439's); LDS bounds as main's Marvisak#1949 (Marvisak#1769's test-only counter kept, its and_guard dropped); title-memory marks: main's straddling-write lookup (Marvisak#2484) with Marvisak#2167's current head (3cb308d, rebased on 63bcca4): guarded dirty atomics, raw_dword2, memory_null, synthetic_mark_dxil in lower/mark_tests.rs; the old Marvisak#2167 head taken out first. - emit/host.rs: main's shared WARP device and lock (Marvisak#244) with Marvisak#439's adapter list and Host::on (create_device takes an optional adapter). - descriptor/host.rs: main's Marvisak#2462 format checks; Marvisak#1763's tests kept. - gpu host.rs: main's multi-plane present with Marvisak#2310's crumbed copy. - pipeline.rs: Marvisak#2118/Marvisak#2311's builder and BVH checks with main's skip hashes (Marvisak#1320); draw.rs, shadow.rs, main.rs: both sides. - Tests main added since get Marvisak#439's Parts fields and emit's Target. - README: base 63bcca4; rows of PRs merged upstream, superseded or closed taken out, with a note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous renderer (old upstream base 940d32f) is the first parent and is also kept as the branch renderer-2026-11-25-oldbase; the second parent is the rebuild: fork main (upstream main 63bcca4 + our pull requests) with the renderer stack merged on it: Marvisak#439 (on main: update/439-main's resolution), Marvisak#2309, Marvisak#2167, Marvisak#2118, Marvisak#2311, Marvisak#1722, Marvisak#1751, Marvisak#688, Marvisak#1872, Marvisak#2292, Marvisak#2310, Marvisak#2112 (opt-in), Marvisak#2230 (latch on by default), Marvisak#2389, Marvisak#2088 (small windows opt-in), Marvisak#2099's new head, and tonight's Marvisak#491 journal fixes. Merged upstream since: Marvisak#2143, Marvisak#2162, Marvisak#158, Marvisak#1906, Marvisak#1152; superseded by main: Marvisak#1769, Marvisak#1763, Marvisak#2366. The picture on this base still shows the overlay that plain upstream main shows too; that is being looked into. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l it has run With VICTORY_BVH_BUILDER=1 the programs that walk the ray-tracing structures (an image_bvh*_intersect_ray in their native code) ran from the first frame, before the builder had built anything: they walk whatever lies in that memory, in a loop the title bounds at 65,535 steps a wave, which on an RTX 5090 outlasted the driver's timeout at world entry in every run of the source. Their draws and dispatches (direct and indirect) are now dropped, counted and logged once, until the builder has run whole once. Pipelines are looked at for node tests only with the builder on; with it off (the default) nothing changes, and what the walkers return then is the shader side's question (no hit while the builder does not run). Source: Marvisak/VIctory PR Marvisak#2311 (its last commit, 481a9ae; the all-or-none builder it is stacked on we have as pipeline::Builder). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…whole once (upstream Marvisak#2311; still only with VICTORY_BVH_BUILDER=1)
Stacked on #2118 ("the BVH builder runs whole or not at all"); only the last commit, 481a9ae, is new here. If #2118 changes, I'll rebase.
Problem
On a host of 32-lane waves the BVH builder never runs: some of
XboxBvhBuilder.dll's 64-lane programs are refused (with #1960, the ones that share LDS within one wave64 group:28918b7150a7aad5,caa78b8ca62bc3d6and 3 more), so #2118 holds the builder back for good. The structures are never built.The world's ray-traced pass (
f607780aa8e502d0, #1968/#2098) still runs. It walks the structures withimage_bvh64_intersect_ray, in a loop the title bounds at 65,535 steps per wave, over whatever lies in that memory. That outlasts the GPU timeout:DXGI_ERROR_DEVICE_HUNGat world entry, every run.RTX 5090, driver 621.40, DRED, main + #2177 #2178 #1868 #2180 #1780 #2098 #2118 #1960 + #2286:
Without #2118 or #1960 it hangs at the same point, inside the half-run builder instead (
caa78b8ca62bc3d6/28918b7150a7aad5).Fix
A pipeline with an
image_bvh*_intersect_rayprogram (found from its containers' native code at creation,pipeline::walks_bvh) is held back like the builder's own dispatches, until the builder has run whole once (builder::built, set whenruns()opens with builder pipelines). Titles withoutXboxBvhBuilder.dllare not held.held_backnow returns why, and the dispatch and indirect paths log it once and pass it to the diagnostics' drop reasons.On a host where the builder runs (64-lane waves), walks start at most one frame later than before. On a host where it cannot, ray-traced passes do not run (their output stays as on main without the builder: no ray-traced lighting) and the device survives.
Tested
an indirect call held back why="a BVH walk held back: the builder has not built its structures". Before: device hung at frame ~1,185, every run.programs_that_intersect_rays_walk_the_structures(narrow and NSAimage_bvh*encodings vs. plain code),walks_wait_for_the_builder_to_run_whole.cargo test -p victory-gpu: 146 passed, 2 failed. The 2 are NVIDIA's 1,000,000 view-heap cap, same as on main (GPU+shader: clamp and place null buffer views within capped host descriptor heaps #2177 / fix: clamp shader heap indices to the host's view-heap cap (NVIDIA) #2185).cargo clippy --workspace --all-targets --locked -- -D warnings: clean.Not covered
The builder itself on 32-lane hosts: its LDS-sharing wave64 programs need both halves of a console wave in one control flow (#1929's console flow, or #1960 extended). This only keeps the title alive until then.
AI-assisted (Claude Code).
🤖 Generated with Claude Code