fix(vk): shader preparation shows progress while it builds compute pipelines #555
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!555
Loading…
Reference in a new issue
No description provided.
Delete branch "zeldaootr/Longshot:precompile-warm-compute-progress"
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 GPUs with mesh shaders (the Steam Deck among them), the shader preparation's progress stood still for the whole compute pass, which can take minutes, so the start-up screen looked frozen and the build's
--prepare-shaderswatchdog could stop a run that was still working and skip preparation for good.What changed
precompile_warm()ingpu/vk/vk_draw.cppreports the compute pipelines as part of the progress (total + computes_doneoftotal + computes.size()) instead of a full count that stands still.tests/test_precompile_warm_progress.pycompilesprecompile_warmfrom the source with stand-ins for the driver and the files, and checks that the count moves through the compute pass and that the watchdog (prepare_watchdogingpu/vk/vk_main.cpp), fed as that run feeds it, lets a slow but moving pass finish.Flags and settings
None.
Measurements
Not measured in the game yet: this is the game-free proof only, and the PR stays WIP until the Steam Deck run (a cold preparation, the bar and the
@@progresslines during the compute pass).main:
7ff5256e(2026-11-14)this PR: precompile-warm-compute-progress @
8f003d46Hardware: Linux x86-64 server (no GPU or game used)
Scene: none (game-free check)
Method:
python3 -I -B tests/test_precompile_warm_progress.py --cxx g++at the test-only commitbb480287(main plus the test) and at8f003d46, twice each, alternatingHow to reproduce: check out each commit and run the command above
7ff5256e(with the test,bb480287)8f003d46Testing
Tested: Linux x86-64, game-free. The new test fails on the test-only commit
bb480287and passes at8f003d46, twice each, alternating (python3 -I -B tests/test_precompile_warm_progress.py --cxx g++). Onland/integration27553c83 (main7ff5256ewith this PR and twelve other fixes merged), the thirteen fixes' own tests and the checks their fix commits edit pass, 16 of 16. The fullpython3 -I -B tests/run_all.pyhas not run on7ff5256eyet (PENDING). On the previous main,1be60eae, it ran on an integration branch with this PR and eight of the others (undernice -n 10, with the Vulkan headers): 517 passed, 8 failed, 50 skipped, against 516 passed, 5 failed, 50 skipped on that main. The five failing on main failed on both (test_bake_portability,test_lift_cache,test_walk_key,test_pipeline_cache_save,nx2/test_texture_init_barrier); the other three were timeouts on a loaded PC that passed 3 of 3 alone (test_recorder_sync,test_fpx_sticky,test_appimage_package_retry).Steam Deck run (a tester's, test request T-2SXU: pass): dukenheimer ran this PR's head
8f003d46(in a build of main7ff5256ewith #550 to #558 merged) on a Steam Deck OLED, SteamOS 3.9.5, three cold starts in new game folders through Steam in Game Mode; the comment of 2026-11-14 22:48 on this PR has the table and the pictures. On a Steam Deck the programs load before the title by default, and then the first start never runs the pass this PR changes (precompile_warm); withRX_VK_LOAD=createit runs: 5.3 s and 7.3 s (the compute pipelines 1.4 s and 1.8 s), and the count keeps moving through it: 21,057 of 24,448, then the total grows to 28,506 and the count goes 24,675, 26,484, 28,329, 28,506. NoSTOPPEDline in any start. The count's fraction steps back when the compute pass starts while the percentage shown does not (86%, 92%, 99%), and "About 4 min left" stayed up until the last second of a 7 s pass: a stale estimate, left for a follow-up. Not reproduced on the Deck: a compute pass longer than the 300 s watchdog, which is the case this fixes (the game-free test forces it).Not tested: A cold shader preparation in the game: the bar's movement and the
--prepare-shadersbuild's watchdog with real driver timings.Needs other testers: None
Screenshots
The bar through the compute pass on a Steam Deck OLED, this PR @
8f003d46withRX_VK_LOAD=create(the tester's capture, 6 of 17 pictures); on main the count stands at its full value for the whole pass, which the game-free test shows:Risk and rollback
The total grows when the compute pass starts, so the bar, which had reached the end of the graphics pipelines, steps back a little (to graphics / (graphics + compute)) and then moves to the end; before, it sat at full. Nothing else reads the counts. Reverting the fix commit restores the old behaviour.
Reviewer notes
None.
Issues
None filed.
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above). Run on the combined branch (main@7ff5256ewith this fix and twelve others merged, 27553c83): 523 passed, 6 failed, 50 skipped. Five fail onmain@7ff5256etoo:test_bake_portability,test_lift_cache,test_walk_key,test_cpm_discovery(#561 fixes it) andnx2/test_texture_init_barrier.py; the sixth,test_crash_record, is a timing check that passed 2 of 2 when run alone on that branch.third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.mainand passing here.RX_VK_ONLY=1 RX_RELEASE=1 RX_TARGET=windowswith llvm-mingw 20261104 linkedlongshot_vk.dll(sha256 25117493...), and the same withoutRX_TARGETlinkedlongshot_vk.so; the changed file has no new warning under-Wall -Wextraon either platform againstmain.precompile_warmcounts its compute pipelines as progress, so the watchdog sees them move bb48028723precompile_warmreports its compute pipelines as progress instead of a full count that stands stillFilled in: the full game-free suite on the combined branch, the Windows and Linux builds, and the test request T-2SXU. Still work in progress until a Steam Deck run is in.
Test request T-2SXU: pass
Hardware: Steam Deck OLED (AMD Custom APU 0932, RADV VANGOGH, 16 GB), Mesa 26.2.0-devel git-5c65d4fc31, SteamOS 3.9.5 (build
20261023.100), kernel 7.2.7-valve2.
Built from main
7ff5256ewith #550 to #558 merged in order (all clean); this PR at its head8f003d46. Built for x86-64-v3 with therelease play profile and LLVM 23.1.5. Each start was the first in a new game folder with no caches, started through Steam in Game
Mode, docked. Mesa's own shader cache was warm.
What I checked
On a Steam Deck the programs load before the title by default ("this GPU draws mesh programs through the compute fallback"), and then
the first start never runs the pass this PR changes (
precompile_warm). So I made three cold starts:RX_VK_LOAD=createRX_VK_LOAD=createThe bar during the compute pass (start 3, "Step 2 of 2 · Building pipelines", 6 of the 17 pictures):
26,484, 28,329, 28,506 / 28,506.
86%, 92%, then 99% from 24,675 / 28,506 on.
Neither of those is what this PR changes; I mention them because the request expects the bar to step back.
Log lines
The default start (1):
None of the three starts logged a
compute pipelines: N of M pipelinesprogress line: the pass ended within the 10 s between them.What this doesn't show. With Mesa's cache warm, the compute pass takes under 2 s here, far from the watchdog's 300 s, so these
starts show the count moving and finishing, not a stop avoided. I also tried a start with Mesa's cache empty as well. It reached 114
of 38,809 shader programs in about 2 minutes (the warm-cache starts were at about 18,000 by then), hours at that rate, so I stopped
it in step 1.
Thank you for the Deck run, dukenheimer: your result is in the description as you reported it, including what it did not cover. Marking this ready for review.
WIP: fix(vk): shader preparation shows progress while it builds compute pipelinesto fix(vk): shader preparation shows progress while it builds compute pipelinesRebased onto main
e090cc48. #404 (Intel quick compute) callsprecompile_compute_quickinsideprecompile_warm, so the check's stand-ins get a one-lineprecompile_compute_quick(in the test commit); the fix is unchanged.The check still fails at the test commit for the bug's reason and passes at the tip, with g++ and clang. The tester's Deck result still holds: #404 changes how a compute pipeline is built, not what counts as progress.
8f003d46e924df1cb012Closing as superseded by #721, which landed the same fix on
main:precompile_warmnow reports the compute pass asprogress(total + computes_done.load(), all_n)withall_n = notes + compute pipelines, the same numbers this PR reported, so the count moves during the compute pass and the--prepare-shaderswatchdog sees it move (#721 also counts the cache write as its own watchdog part).Checked game-free: this PR's own test,
tests/test_precompile_warm_progress.py(with aprepare_saving_nowstand-in for #721), run against cleanmain@aa95d35fpasses both parts with g++ and clang (the count moves past the notes, and the watchdog with a 2 s stall limit lets a ~5 s compute pass finish); against the commit before #721 it fails both (last_total == notes_n + computes_n, andSTOPPED: nothing moved for 2 s in the noted pipelines). Nothing of this PR is left to land; thanks to #721 for covering it.Closing as superseded by #721, which is on main: it reports the compute pass as progress the same way this PR did and feeds the watchdog. This PR's own test passes on main
aa95d35fand fails on the commit before #721, with g++ and clang. Thanks to dukenheimer for the Deck run on it.Pull request closed