gpu(native): the ray-tracing structure builder's pipelines are never put off, and held back together if one fails (#492) #495
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/495"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Tarraga on 2026-11-27T22:15:22Z.
Refs #492. A port of VIctory-macOS #481 to the native host.
What this changes
Problem
XboxBvhBuilder.dll, a title DLL that runs in our process, builds and refits the ray-tracing structures in title memory with 52 compute programs embedded in its image. The host put its pipelines off like any other once a frame had spent its budget for new pipelines (glue::pipe,glue::thread_pipe), and a put-off pipeline's dispatches are dropped. Its stages depend on each other, and many run only while a level streams in, so a dropped dispatch is never rebuilt.Evidence
From one run to the world (M4 Pro, 48 GB, Series S, a cold cache, a working branch that carries main's pipeline budget): 28 of the 52 programs lost about 7,700 dispatches in the 77 s of the world load, and the log has "a dispatch of thread counts without a host compute pipeline" there. The structures stay partly built for the rest of the run. I have not run the game on this branch's tree, so I do not claim any change in the picture here; what is shown is that the dispatches are no longer dropped, by the test below.
Fix
pipeline::note_title_dll(called from the loader'snote) records whereXboxBvhBuilder.dllis mapped. A pipeline is the builder's if its bytecode lies in that image (pipeline::builder_pipeline).BUILDER_WAIT, 120 s), for group counts and for thread counts.a BVH builder pipeline is not made), so no stage runs on what a missing one never wrote.How it was tested
bvh_tests::the_bvh_builders_pipelines_are_made_past_the_frames_budget_or_held_back_together(victory-gpu, x86_64 with D3DMetal 4.0b3's converter viaVICTORY_MSC_DYLIB). With the frame's budget spent on the test's thread: an ordinary pipeline is put off, the builder's pipeline is made (by group counts and by thread counts), one that cannot be made holds every builder pipeline back, and the hold can be undone.made at once: ShaderStats { pipelines: 0, cached: 0, put_off: 0, refused: [] }.x86_64-pc-windows-gnullvm): not run locally (no such target on this Mac); left to CI. Host clippy shows no warning on the changed lines.VICTORY_MSC_DYLIB, release): 412 passed, 1 failed, 6 ignored. The one failure,list::tests::unordered_access_clears_have_the_same_slots_in_both_layouts(it compares function addresses in a release build), fails the same on main (b998bb65: 411 passed, 1 failed, 6 ignored).Checklist
VICTORY_*variable and documented (none added; two log lines)Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T02:00:37Z.
Thanks for this PR! An offline check of
4684dc49:Measured offline on main
86cefd22withexamples/sweep+tools/corpus/compare.sh, on our 21,600-shader world corpus. The PR alone was swept over the 10,319 world shaders that the combination below changes. "Passes/frame" is an estimate from four traced world frames of an earlier preview run: the dropped passes whose only refused shader this PR translates.#495 alone: no translator output changes (0 newly translated, 0 changed, 0 regressions), as expected for a pipeline-scheduling change.
GPU errors and fps: I can't isolate #495's effect from the run below, because there was no matching run without it. In the combination run, there were no GPU errors and the world ran at about 1.4 fps.
In combination with #418 #466 #420 #409 #448 #433 #495 #497 on
86cefd22(a local integration build, plus the pass-trace fix from #509):Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T17:19:24Z.
Review: APPROVED
Read the diff:
XboxBvhBuilder.dll's 52 embedded compute programs are now recognised as the ray-tracing structure builder's (pipeline.rs) and their pipelines are never put off for the frame budget, and are held back together when one fails — a port of the Windows-side #481, refs #492. Verified on the head4684dc49: the newbvh_testspass under the darwin target, the fullvictory-gpudarwin lib suite is green at--test-threads=4(413 passed / 0 failed), and the workspace windows clippy with-D warningsis clean. Approving.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.