Wait for a stand-in's compile at first bind instead of skipping its dispatches #587
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-30T10:51:05Z.
Measurement (RTX 3080 Ti, NVIDIA 620.73.04, cold launch, ProjectScarlett): 931 compute pipelines took ≥5 s to create, about 46,700 s in all; graphics took about 3,700 s. For the 168 compute pipelines over 60 s (up to 1015 s for 35af8e6d), the launcher had finished DXC before the provider started creating the pipeline. Their time is vkd3d-proton and the driver, on DXIL that is often -O0. The title showed a black or loading screen for about an hour of that.
Today: past TUXBOX_PIPELINE_DEADLINE a large compute pipeline gets an empty stand-in so loading goes on, and dispatches recorded before the compile ends are skipped. FOCUS lists the stand-in count as a problem: skipped compute can leave later draws with missing or stale input.
Proposal: at a stand-in's first bind, wait for its compile (bounded) instead of using the stand-in. The title still creates every pipeline without waiting and only waits for the programs it actually binds; nothing is skipped unless the wait runs out. Combined with a short deadline, loading would overlap the driver's compiles.
Prototype: opt-in TUXBOX_LATE_BIND_WAIT= in late_pipeline::current, a condvar on the existing slot that a failed compile also ends, title watchdog paused while waiting. About 60 lines plus tests, off by default. I'll run it on the 3080 Ti with TUXBOX_PIPELINE_DEADLINE=2 against a run without it and post time to world entry and the skipped-dispatch count. Graphics pipelines would need a stand-in of their own, so they're out of scope for now.
Does this direction work for you before I open a PR?
Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T11:37:31Z.
Yes, this direction works, as an opt-in experiment first. Stand-ins that skip dispatches are one of the things FOCUS lists, and waiting only for programs the title actually binds is the right scope.
Things to watch, and to include in the PR:
Also note that #579 (merged today) replays recorded pipelines on several threads during preparation, and #585 should make far more of those records replayable. With a warm driver cache, many of these waits may never happen, so say which cache state each run had.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T11:53:57Z.
@ReverendOzmund some data that may help size this, from one 20-minute run (RTX 5090, 620.70.10, GE-Proton11-14, main
8ece312fplus PRs, warm driver and vkd3d caches, 12 large compiles at once,TUXBOX_PIPELINE_DEADLINEdefault), 10.6 min in the world. We log a compute pipeline's shader digest when a dispatch is skipped because it is a stand-in, and whether its real compile is still running.1b1f74ad(8,192 or more),4522ad9a(2,048 or more),c05c6ba9(128 or more); counts are logged at powers of two.So with warm caches the skipped dispatches we see come from refusals, not from the deadline. Your cold-run question stays open.
Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-30T12:09:20Z.
Thanks both. Correction to my numbers: the 818 "empty" I quoted from the overlay includes translator refusals. The log has 16 deadline stand-ins in that cold run (27 in the earlier one), which fits Nick's finding.
What the logs do show is that a translated compute pipeline below the large-compile size never gets the deadline: the title waits in CreatePipelineState for the whole driver compile. That's most of the ~44,000 s, and the title sits on its loading screen meanwhile. So the prototype now does both, behind the one setting: with TUXBOX_LATE_BIND_WAIT set, every translated compute pipeline gets the deadline and a stand-in carrying its compiled bindings, and a bind waits for it. It logs the longest single wait, the count, the total, and how many ran out and used the stand-in. The watchdog pause is a guard, so it ends on timeout, failed compile and device loss (a lost device ends the compile, which ends the wait).
Test plan on the 3080 Ti: same build and caches with and without it, time to world, longest wait, waits that ran out and skipped dispatches, warm first, then cold if I can clear the caches cleanly. I'll say which cache state each run had.
Imported from brcly/TuxBox. Originally posted by brcly on 2026-12-01T15:13:55Z.
@ReverendOzmund that plan looks right. Please open it as a draft PR behind
TUXBOX_LATE_BIND_WAIT, with the before/after runs on the 3080 Ti and the cache state of each, as you list.One data point from here: on a warm cache, a launch right after a full pipeline replay had no in-game compiles over the slow-compile threshold (one run, RTX 4070 Ti SUPER). So the warm case may show little, and the cold run is the one that tells. With
TUXBOX_PIPELINE_DEADLINEunchanged, please also report how many binds waited past it.