fix(vk): the start-up bar counts the compute pipelines, not 100% through them #256
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!256
Loading…
Reference in a new issue
No description provided.
Delete branch "gab9281/Longshot:fix/startup-bar-compute"
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?
Why
On the first start after a shader preparation, the start-up screen sits at "100%, a few seconds left" for about 5 minutes (RTX 3060 Laptop), which looks like being stuck on the last shader. The bar counted only the noted pipelines, then stayed full while every compute program's pipeline was built.
What changed
precompile_warm()ingpu/vk/vk_draw.cpplists the compute programs' keys (program_cache_compute_keys()) before it starts. Both steps count on one total, the noted pipelines and then the compute pipelines, so the bar moves through the compute step instead of sitting at 100%. The work done is the same: only the count given to the bar changes.tests/test_warm_bounded.pychecks that the compute step reports its own progress against the whole. It fails on main, where it reportsprogress(total, total).Flags and settings
None.
Measurements
What changes is the number the start-up screen shows, not the time: the same pipelines are built in the same order. So the measurement is the bar's value at the start of the compute step, from the start-up log line, with the shaders' time on this PR for reference.
main:
36a12f6f(2026-11-13;precompile_warm's bar code is the same on main @514591a3, which this PR is on: main's renderer changes since, #234 and #260, are elsewhere invk_draw.cpp)this PR: fix/startup-bar-compute @ 2af5f18e (measured there;
82271725, the head now, changes only the count after a stopped noted step, which this start didn't have)Hardware: RTX 3060 Laptop (NVIDIA 620.70.06), Ryzen 7 6800H, 15 GB, CachyOS (Linux 7.3.3), KDE Wayland
Scene: the start-up screen of the first start after a preparation (
RX_VK_LOAD=create), default settingsMethod: the start-up screen's
vk: start-up: pipelines … of …log line once the noted pipelines are done, one start each, started throughgame-performanceHow to reproduce: prepare the shaders (a build with
--prepare-shaders), start the game, and watch the start-up screen andlongshot_log.txt36a12f6f29473 = 25346 noted + 4127 compute programs. The two starts had different numbers of noted pipelines (main's folder was prepared at another commit), and this start had the compute pipelines cached (11.3 s), so the times aren't compared. A run-to-run timing table wouldn't show anything: no pipeline is added or removed.
Testing
Tested:
82271725, rebased on main @514591a3with no conflict), a first start after a preparation. The start-up screen counted through the compute step to the end, with the log lines above.python -I -B tests/test_warm_bounded.pypasses, and fails on main.RX_CPM=<the CPM cache> python -I -B tests/run_all.pyat82271725(main @514591a3): 517 passed, 1 failed, 15 skipped (Windows only). The failure,tests/test_menu_i18n.py(a pt_BR text of a menu line main changed), fails on main514591a3too.Not tested:
precompile_warmisn't platform-specific). The game builds for Windows with llvm-mingw at 2c2100d1 (4:38, the same code on the main before); not run on Windows.Needs other testers:
None (this is the bar's count, the same on every GPU).
Screenshots
Nothing new on screen: the same start-up screen, with a percentage that keeps moving.
Risk and rollback
The progress callback gets a larger total. If the compute step is skipped (the preparation was stopped), the bar ends below 100%, as any stopped preparation does. Reverting the commit is enough.
Reviewer notes
The compute keys were already listed, after the noted pipelines; this lists them once, before.
A
/code-review(high) found 7 things:total + computes_done); it now reportsdone + computes_done;total.precompile_run) already counts its notes, computes and fallbacks on one total. The time left comes from the bar's rate over the last 15 s (ProgressClock), so it slows down with the step instead of saying "a few seconds" for minutes. A weight per kind would change both paths and is a follow-up.prepare_guess) counts the computes play dispatched, not every kept one. The normal precompile has the same gap on a first start (computes_plan's "every kept one"). The bar never goes back, so at worst it holds still for a moment when the count replaces the guess. Same follow-up.Issues
None: found while testing #206 (the start-up screen "stuck on the last shader").
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.mainand passing here.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
https://claude.ai/code/session_015KgSKoUqUvce5UXG89NBgi
WIP: fix(vk): the start-up bar counts the compute pipelines, not 100% through themto fix(vk): the start-up bar counts the compute pipelines, not 100% through them2c2100d1028227172508Test request T-RZC9: pass (Windows startup progress)
The baseline shows 100% while compute pipelines are still being built. PR 256 includes those compute-program keys in the total and shows unfinished progress until that work completes. Both versions reached the title sequence and all four runs exited normally (code 0).
Hardware: Windows 11 Home, build 26300; Core i7-13700F, 32 GB RAM (31.8 GiB usable); RTX 4070 12 GB, NVIDIA 621.01; llvm-mingw Windows renderer build.
Baseline: main @
514591a30d707fe9f3ad31eae148c3cc1e750bff(the PR's merge base).Candidate: PR head @
822717250837ccebbdcb00d6556f200766c0550a, confirmed unchanged after testing.Built using
scripts/dev_packs.py, renderer-only pack over the existing base. The host was unchanged and matched in all runs; candidate renderer SHA-256c2bc287de365f76351e73110acb4232e393b101e04ed21ad76769bf674b0787b.Method: four real-window starts, baseline / PR / baseline / PR. Identical runtime and compatible prepared shader caches,
RX_VK_LOAD=create, 1280x720, frame generation and HDR off, audio disabled. Cleared only the disposable runtime'slongshot_pipelines.bin.builtand.built.warmingbefore each start to repeat the first-play warm pass. Original saves and shared base left untouched. The existing NVIDIA driver cache persisted; this was not a cold-driver-cache or startup-speed comparison.Representative log lines:
Screenshots of the actual startup windows were inspected locally. No screenshot is uploaded with this report. The compute stage lasted about 5-6 seconds with these warm caches; no claim of reproducing the reporter's five-minute cold wait, accurate ETA, or faster startup.
Checks:
tests/test_warm_bounded.pypasses on the candidate. Its added progress assertion, run against the baseline source, fails withprecompile_warm does not count its compute pipelines in the bar's total. Renderer compilation: 0 failed.Full game-free suite with the bundled Python dependencies: 496 passed, 4 failed, 33 skipped. The same four checks were rerun on unchanged baseline and all four also fail there:
nx2/test_nup_paths.py(Windows symlink privilege),tests/test_check_third_party.py(baseline provenance/fixture failures),tests/test_menu_i18n.py(stale pt_BR text),tests/test_release.py(Windows command/line-ending fixtures). No new failing check was identified. An earlier system-Python run had 487 passed / 7 failed / 39 skipped; missing project dependencies caused the additional failures/skips, so the bundled-Python run is the final suite result.Limits: no Linux run, no uncached-driver run, and no interrupted-preparation runtime test. This tests the submitted head on its own base, not today's main.
Tested-configuration rows for the PR author/maintainer to add as distinct
docs/tested/records:514591a3, unchanged host and renderer82271725over main514591a3host514591a3, unchanged host and renderer82271725over main514591a3hostCold-cache result on Windows, RX 9070 XT, AMD driver 26.10.2: this fixes a real false timeout. With the old progress callback, All preparation stopped at the default 300-second stall watchdog while compute work was still advancing (866 to 887 programs between progress reports).
With this PR's progress change backported over main
82886e89plus the separate pipeline-input cache fix, the recovered preparation completed with the default watchdog unchanged: 24,458 graphics and 9,687 compute pipelines, zero not made and zero missing compute variants. Compute preparation took 546 seconds across 4,058 programs. The completed prediction stage was retained from the interrupted run; this was a recovery, not one uninterrupted preparation pass.The source-cut regression also checks that a genuinely stalled compute phase still times out. This result covers preparation; it does not claim gameplay performance or testing the untouched PR head.
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.