Prepare deferred ray-tracing builder pipelines for restart #2148
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2148
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2148"
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?
@Ondra97 on GitHub · 2026-11-29 09:57 UTC · original
Ondra97:codex/retry-deferred-bvh-pipelines→main· +234 −36 · 2 files · 3 commits · openWhat it changes
The compile-memory guard can defer a builder PSO and ask the pipeline workers to try again. The builder gate treated a pending stage as permanently unavailable until another stage was registered.
Prepare pending stages through the pipeline workers and record regular demand, including the used key and the current request frame. If the builder encounters a deferral, keep it disabled for the remainder of the process. Finished pipelines can be stored by the normal library path and used on a fresh launch.
The origin counter only limits repeated checks. Thin-list translation and submission can cross an origin advance, so an advance cannot establish that earlier commands in a complete builder group were recorded. The restart latch survives late stage registration and keeps the ambient and mirror fallback on the disabled-builder path after a deferral.
Once the builder is held, promote eligible builder requests in turn with the regular queue selection. Screen passes retain priority, and the builder promotion respects compile cooldowns.
How it was tested
Cold start and restart (
c91f025f)RTX 4070 Ti SUPER, driver 621.40, Series X at 2560×1440, RT on, DLSS and frame generation off. Started with empty application image, shader, and PSO caches. The existing NVIDIA driver cache remained in place.
70702bcd), a 632.7-second cold run recorded no completed builder PSOs. A separate instrumented run counted 1,152 distinct ordinary requests ahead of the first builder request when the builder was held.cargo test --release --locked -p victory-gpu --lib pipeline::passed 74 tests, with two ignored. The added tests cover interleaving builder and regular requests and recovering the builder turn after cooldown. The release build, staged asset policy, and whitespace checks passed.Earlier checks
cargo test -p victory-gpu --lib pipeline::on Windows stable Rust 1.100.0 passed 72 tests, with two ignored. The regression verifies background preparation, disabled state after the origin advances during a check, disabled state after all stages finish, late registration, and positive readiness on a fresh builder. A permanent refusal remains covered separately.0x8007000Ebefore D3D12 creation starts.70702bcd, RTX 4070 Ti SUPER, driver 621.40, Series X 1440p DLSS Performance and FG off. The exact binary prepared 52 of 52 unique builder PSOs. The new launch loaded that library, activated all 53 registered stages, and logged three positive builder dispatch samples. The 96.9-second probe completed without a device fault. This covers startup activation. Long RT stability and visual parity remain open.CI status
The previous PR head and upstream
main(f889bb07) stopped in Clippy on the unusedunwind_copyfunction invictory-loader. The CI restoration in #2620 remains open and passed both Clippy gates and the full workspace test suite. Main CI · CI restoration runCI for
c91f025fstopped in Clippy on the same unusedunwind_copyfunction. The workspace tests were skipped. PR CIChecked for overlap
@ArturoWolff on GitHub · 2026-11-29 10:15 UTC · original
Corroborating the problem on a smaller Linux host: RTX 4060 (8 GB), 16 GB RAM, GE-Proton 11-14, native D3D compiler. Thanks for distinguishing pending from permanently unavailable stages.
Both of our actual runs used unmodified
829188e9, the same ordinary starting profile and identical effective non-menu switches (RT builder requested,VICTORY_LEAVE_OUTempty, full write-back, direct lists, DLSS/FG off). The 1080 scene mode still presented at 2560x1440. The second run seeded only the first run's ordinary shader/pipeline caches, not the driver cache. No candidate code, no skipped-work or memory-guard relaxation.Both reached a defective opening cinematic (black picture with bright rectangular artefacts); the seeded run showed successive subtitle changes, still around 0.2–0.4 FPS in the late windows. There was no observed successful builder activation, no controllable world, no recorded kernel OOM/GPU fault, and neither run hit our independent 128 MiB host stop. The seeded run lived longer and saw different frame workloads, so the cumulative deferral totals are not a matched rate comparison. The older log cannot establish how many of the 34/40 missing stages were still pending versus permanently refused. This is additional baseline evidence, not a test or approval of the draft.
One related diagnostic detail: the guard's refusal is an
E_OUTOFMEMORYreturned by the library path before starting creation. The host failure logger records it before the pending state is retained. The two logs contain 66 / 83 unique compute-keyhost pipeline failedmessages, all0x8007000e; that does not prove 66 / 83 real driver allocation failures. The first refusal in each run is directly adjacent to the memory-deferral and retry messages. It would be useful to keep admission deferrals distinct from genuine terminal host failures in the diagnostics.The all-or-none builder requirement remains important. This local evidence supports testing the later-frame readiness path, not starting an incomplete group. Related memory discussion: #2024 and #2063.
AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).
@Ondra97 on GitHub · 2026-11-29 10:23 UTC · original
Thanks for the two runs on clean
829188e9and for tracing the HRESULT. I clarified the Windows baseline in the PR body. An admission deferral can emit0x8007000Ebefore calling the driver. The host failure count alone cannot distinguish deferrals from driver allocation failures.On Windows, the draft switched to waiting for deferred stages in both runs, and neither run reached a complete builder by the cutoff. The all-or-none gate stays in place. If you have room for another run on Proton, a matched run of
57528031with the same seed, cache state and memory settings would help. The useful results are the first pending stage count, whether the builder reports all 53 stages ready and whether any builder dispatches occur.I also opened #2188 for a separate wait-state bug. When a worker publishes the retry cooldown, an existing frame wait can otherwise continue until its deadline. I am testing game entry separately from both patches.
@Ondra97 on GitHub · 2026-11-29 10:51 UTC · original
A Windows control now isolates one part of game entry. Clean
829188e9, the same Series X save at 1440p DLSS Quality, RT and frame generation off, was still stuck after 420 seconds with a cold application cache. I then built a fresh host library with that same binary and driver, using two offline workers and the pipeline recipes from an earlier working run. The library stored 2,290 entries. The next launch loaded 2,276 existing PSOs, reached zero pending at about 90 seconds and visibly rendered the outdoor scene. The drawing rate there was still around 7–15 FPS.This demonstrates recovery with the prebuilt library on this Windows setup. It leaves #2148's RT readiness question open because RT was off in both runs. The memory guard remained enabled.
@ArturoWolff on GitHub · 2026-11-29 11:00 UTC · original
Thanks for the matched Windows library result — that is useful evidence that having the needed PSOs ready can change game entry independently of the RT builder. Our earlier Proton preload and partial warm-cache attempts did not establish the same result, so I would keep that as a separate experiment.
I have checked out the exact
57528031you requested, but have held its title launch after an independent source review. The pending/permanent-refusal distinction is the right direction. One correctness prerequisite remains:Builder::readyuses the global origin-wait counter for its retry boundary (frame::current()and token updates). Has it been established that this is also a boundary for the complete recorded builder work group? The unit tests vary the synthetic frame value, but do not establish that property through the ordinary recording/submission path. It would be useful to verify that readiness can only enable the whole next group, never a partially prepared group, before attempting full RT on the smaller host. This is a source-level review question, not a reproduced candidate failure. I do not have the requested candidate pending/dispatch counts yet.There is also now a measured, separate memory-admission defect on GE-Proton 11-14 with clean
829188e9production code. Following ghptc's prior work in #1182, I ran two CPU-only Windows-target fixtures, using only their own process's memory. The 80-byte extendedK32GetProcessMemoryInforequest returns success withcb=72and leavesPrivateUsageuntouched. A 32 MiB owned reserve/commit/touch/release control measured no basic PagefileUsage increase at commit, +32 MiB at touch and -32 MiB at release; I would not substitute that counter for private commit.The second fixture exercised the actual compile-memory reader and estimator with four admitted/finished CPU-only cycles. All 12 adjacent ABI observations showed the unavailable private counter. The existing reader supplied zero and the estimator accepted four zero-cost samples, falling from its 1 GiB first guess to 256 MiB. The regression assertion expecting unavailable readings not to reduce the first guess failed (256 vs 1024 MiB); the raw control passed. This is direct evidence of false training, not a claim of a gameplay speedup or the cause of every deferral. I am qualifying a separate correction that preserves the admission floors and valid measurements, with no graphics-setting changes. I'll keep it separate from #2148 and #2188.
AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).
@Ondra97 on GitHub · 2026-11-29 11:02 UTC · original
Agreed. The synthetic tests establish the counter behaviour and do not establish a complete recorded builder group boundary. Please keep the full RT launch on hold for
57528031. The Windows prewarm result used RT off and gives no evidence on that boundary.I am tracing both direct and indirect recording through submission. For a live retry to enable execution, we need a boundary at which the first stage of the whole group is known to be present. If the recording path exposes no such boundary, the conservative option is to prepare the deferred stages for a later clean launch and keep the group disabled once work has been skipped.
The Proton private-commit counter finding is a separate issue. Keeping that correction separate from #2148 and #2188 makes sense.
@ArturoWolff on GitHub · 2026-11-29 11:05 UTC · original
Agreed; I have kept the exact draft unlaunched. Two additional details from the completed source review may help with the conservative preparation-only route as well as any later live retry:
ambient::onandmirror::lightalso callbuilder_runs. It would be useful to keep their fallback choice tied to a valid builder-output generation rather than merely the ability to obtain every PSO. Pipeline preparation and valid-output state are different facts.prepare_builderqueues directly withstart(REQUESTED). Normalreadyupdatesnote_usedandasked_framefirst. In particular, the latter is read by the opt-inVICTORY_PIPELINE_NOW_FIRSTselection. Please consider preserving the ordinary demand bookkeeping for genuine group requests so deferred preparation can benefit a later clean launch and fresh requests are not disadvantaged. This is a conditional source-level scheduling concern, not a measured starvation result.Thanks for investigating the recording boundary. I will keep the separate private-counter correction independent of both of your patches.
AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).
Retry deferred ray-tracing builder pipelinesto Prepare deferred ray-tracing builder pipelines for restart@Ondra97 on GitHub · 2026-11-29 11:10 UTC · original
I updated the draft to
70702bcd. Once any builder stage is deferred, the builder remains disabled in that process. The origin counter now only limits preparation checks. The tests cover origin advances during the check, finished preparation, a later registered stage, and readiness in a fresh builder.The worker path now records the used key and
asked_frame. While the restart latch is set,builder_runsstays false, including for ambient and mirror callers. The initial readiness behaviour does not establish general builder-output validity. That would take separate group and generation tracking.The 72 pipeline tests and Windows release build passed. The next relevant runtime test is preparation followed by a clean RT-on launch using the saved library. The draft and the hold on the superseded live-retry revision remain in place.
@Ondra97 on GitHub · 2026-11-29 12:10 UTC · original
The prepared-restart test passed on the exact
70702bcdWindows release, RTX 4070 Ti SUPER and driver 621.40. I rebuilt a new host library from 52 unique builder recipes using this same RT-on configuration. All 52 were stored. A fresh Series X 1440p DLSS Performance launch with FG off loaded the 2,647,612-byte library and reported 53 registered builder stages. Three later memory samples contained build dispatches. The 96.9-second probe completed its post-activation observation with zero device faults.This qualifies the prepared-launch activation path. The observed workload was still in startup. Long RT stability and visual parity remain open, and the separate cold deferral test is in progress.
@Ondra97 on GitHub · 2026-11-29 12:20 UTC · original
A separate cold run of the exact same
70702bcdrelease on the RTX 4070 Ti SUPER reached the actual hold path. Series X, 2560×1440, RT on, DLSS off, FG off, empty shader and pipeline caches. At 51 s all 53 stages were pending. All 11 subsequent raw-address samples had zero builder dispatches. No device fault was reported. The preparation-finished marker did not appear before the 240 s budget, so this confirms live latch behavior and leaves preparation time open. The prepared restart in the earlier comment verifies activation through all 53 stages.Keeping DLSS Performance instead hit the separate startup issue #2081 / #2091. The 6,236 MiB TileHeap reservation failed before the builder gate. With DLSS off the same reservation fit below 128 GiB. I will test the upstream candidate #2263 independently on this RTX.
@Ondra97 on GitHub · 2026-11-29 12:40 UTC · original
Follow-up with DLSS enabled and the TileHeap prerequisite in place. I tested a private build of #2263
581bb5d2plus this head70702bcdand #21889fd78e89, with empty emulator image, shader, and PSO caches. RTX 4070 Ti SUPER, Series X 2560×1440, DLSS Performance, RT on, FG off. The guarded retry placed the TileHeap below 2^37, the driver performed 68 DLSS upscales, and the RT builder latched at 50.6 seconds with 48/53 stages pending. All 13 subsequent builder samples recorded zero build dispatches and no device fault. The exact staged tree passed 73 pipeline tests (two ignored).The host PSO backlog remained above 1,500 at the end of the 420-second run, and the restart-preparation marker was still absent. At one sampled point there was about 529 MiB of free physical RAM, one driver compile running, and over 1,300 pending PSOs. A bounded REA observation at that point saw a CPU thread active in the NVIDIA compiler module. A late window observation showed a black scene with partial HUD. This gives a second live latch check and leaves empty-cache preparation and visual stability open.
@birdneststream on GitHub · 2026-11-29 13:06 UTC · original
@ArturoWolff — from a Proton setup that does reach the world (RTX 5090, GE-Proton 11, vkd3d-proton master beside the exe, upstream main + a few fixes), three things in your table that we have seen and worked around, cheapest first:
VICTORY_BVH_BUILDERset, the F1 menu's RAY TRACING): the 34–40 missing stages of 53 are the builder's, and on an 8 GB card they will stay missing — the builder's structures alone do not fit. We run with the builder off (VICTORY_BVH_BUILDER=empty invictory-settings.txt) on a 32 GB card too, because upstream's RT is not there yet (tried here on 11-29: wrong results and slow). With it off the game runs; with it on, nothing in your two logs will change.VICTORY_FULLSCREEN=0) or--set VICTORY_FULLSCREEN_BARS=0once; the real fix is #2035 (the backdrop to the bottom of the stack), still open.MemAvailablebottoming at ~340 MiB is the layer's host copies of the textures (it keeps a CPU copy of what it uploads; on our card it holds ~24 GB by the end of a session, and on an 8 GB card the budget line is lower but still GBs). With the swap that follows, 0.2–0.4 fps is what it looks like.VICTORY_TEXTURE_CATCHUP=1 --set VICTORY_EARLY_TEXTURES_MS=32lower the pressure a little; the 8 GB-card PRs open here (#1944, #1962, #2069) are the real ones to watch.None of that touches #2148 itself — the deferred builder stages are a real gap — but with (1) off, (2) tried and (3) known, a run gets to the world, which is what you need before the ambient passes of #2160 can show anything either. If one of the three changes the picture, the log line
texture queue's room …and the first fps lines say which.@Ondra97 on GitHub · 2026-11-29 13:09 UTC · original
Following up with a Windows diagnostic measurement on the RTX 4070 Ti SUPER (driver 621.40, 32 GB system RAM). This is Series X 2560×1440, DLSS Performance, RT requested, FG off and empty emulator image, shader and PSO caches. The local diagnostic build includes #2263, this draft, #2188 and #2386 for the diagnostic compilation fix.
The per-window census during the cold workload recorded 420 active loose shadow windows with their shader-facing backing in VRAM (2,560 MiB, the effective window cap), and 401 active loose windows with shader-facing backing in system RAM (2,508 MiB). The diagnostic reports where shaders see those windows. The latter use the single-sided D3D12 CUSTOM/WRITE_BACK/L0 path. The local DXGI budget still had more than 5.6 GiB headroom in this run, so these deliberate placements can occur without exhausting the total VRAM budget.
This is a different counter from total DXGI shared memory. Shared memory also includes CPU mirrors, staging and other allocations. A separate release probe with the existing private-CPU-mirror switch recorded 4,459 MiB of CPU-only mirrors eligible for pageable process memory. The window census covers loose shader-facing buffers. It does not yet attribute PCIe bytes to each resource class or establish that this alone causes the black image.
The Windows run also captured real host compile pressure: about 529 MiB of free physical RAM, a single driver PSO compile in progress and over 1,300 pending PSOs at the sampled instant. REA saw a CPU thread active in the NVIDIA compiler. The rendering window showed a black scene with partial HUD at 0.2 rendered FPS. The Linux fullscreen backdrop report looks worth tracking separately from this measured Windows workload.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.