fix(vk): build every predicted pipeline before the game (the prediction found nothing on fresh builds; no 90 s budget; one progress bar) #2032
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2032
Loading…
Reference in a new issue
No description provided.
Delete branch "predict-all-in-prepare"
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?
The pipelines the prediction makes are meant to be built before the game. On a fresh build, though, none were predicted at all. Where they were, a 90 s budget left most of them to be compiled in play, each one a stall on its first draw. This PR builds every predicted pipeline in the preparation, on a progress bar that counts them from the start.
What changes
program_cache_loadandprogram_cache_load_sometake a key's records out ofdisk_recordswhen they read a program in.state_list_prepare) just beforepredict_run.program_cache_eachlisteddisk_recordsalone, so no note found its program. Every new build loggedpredicted 0 pipelines from 1261 notes for 0 program variants.disk_taken, andprogram_cache_eachlists both.state_list_prepare(for example, a start after a driver update) predicted fine, which is why this went unnoticed.RX_VK_PREDICT_Sno longer defaults to 90 s; setting it still sets a budget.precompile_runalready does; nothing else runs before the game. They used half the CPUs below normal priority. (#1610's job limit would apply here the same way.)prepare_stopped(). What the driver has built is kept.--prepare-shadersbar now cover the programs, the predicted pipelines and the noted pipelines together (PrepareBar). The total holds all three from the start.prepare_guess: the seed's program count, the notes and the lists).Numbers
Setup: RTX 3090, Ryzen 9 7900X (24 threads), Linux, OoT 1.1.1, an empty NVIDIA shader cache, and the shipped 1,261-pipeline list.
RX_VK_PREDICT_S=90Tests
tests/test_predict_sees_loaded.py(new): checks that both take-out sites keep what they take, and thatprogram_cache_eachlists those records too.tests/test_startup_progress.pycoversPrepareBar:predict_runhas no default budget, and does not use half the CPUs or lower its priority.tests/test_prepare_cache_save.pyandtests/test_program_cache_cleanup.py: stubs updated.Not tested: the Windows start-up screen and Windows builder bar (the logic is shared and tested here), and AMD or Intel GPUs.