fix(vk): count a first start's load at create on the start-up bar #1575

Open
dukenheimer wants to merge 2 commits from dukenheimer/Longshot:fix/start-bar-at-create into main
Contributor

Type: fix · Risk: low · Tested on: Windows 11 (llvm-mingw clang) and Linux (WSL Ubuntu 24.04, g++), game-free; in the game: Steam Deck OLED (RADV) · Needs: none

TL;DR

On the first start after preparing shaders, the start-up screen's bar read 100% while the game was still building pipelines: about 90 seconds on a Steam Deck, with "Loading pipelines 100%" on screen the whole time. The start does its work in two passes, and the bar counted only the first. This PR counts both passes in one total, so the bar stays under 100% and keeps moving until the second pass ends. A new test fails on main and passes here, on Windows and Linux. This changes the bar only: nothing is built differently and nothing gets faster.

Breakdown

  • Who it helps: anyone whose first start after a shader preparation builds pipelines before the title, most visibly Steam Deck players.
  • What was wrong: the first pass reached its own total, and the bar never goes back, so it showed 100% through the second pass.
  • What changes: the bar counts the second pass's steps from the start, so it shows the real progress through both.
  • What does not change: what the start builds and how long it takes; --prepare-shaders' own bar; later starts; every switch and setting.
  • How it was checked: a new game-free test (fails on main, passes here, Windows and Linux), three updated source checks, teeth checks, a syntax build of the changed files against main; in the game: Steam Deck OLED (RADV).
  • What is still open: #1522's slow build and resumability questions, which this PR does not address.
  • Risk: low: a wrong count could only make the bar move unevenly; it can't stop the start or change what is built.

Why

Under RX_VK_LOAD=create, the first start after a preparation runs two passes before the title, both on the bar's last part:

  1. the warm (precompile_warm): every noted pipeline built into the pipeline cache;
  2. load at create (precompile_at_create): each mesh fallback program's compute pipelines, then the kept programs' noted pipelines.

Each reported its own done of total. The warm reached its total, PrepareBar never goes back, so the screen read 100% for the whole second pass. On a Steam Deck at main 7daafa7a that was 91 s, with the log saying "start-up: pipelines 1883 of 4568, 100% of all". This is the same plateau family as #714, which fixed it for the predicted pipelines.

See #1522: its "stuck at Loading Pipelines 100%" matches this symptom. #1522 also asks about the slow build itself, a UI that stopped taking clicks, and whether a restart resumes the work. This PR does none of those, and #1522 has no log tying them to this cause, so it doesn't close the issue.

How to reproduce

Seen on: Steam Deck (SteamOS, RADV), main 7daafa7a
Settings and switches: defaults (RX_VK_LOAD=create); a GPU that draws mesh programs through the compute fallback, as the Deck does
Steps: prepare the shaders (--prepare-shaders), then start the game for the first time after that preparation, and watch the start-up screen and longshot_log.txt
Expected: the bar under 100% while "load at create: X of Y steps" is still counting
Actual: "start-up: pipelines N of 4568, 100% of all" from N = 31 to 1883, for about 90 s, then "load at create: its pipelines took 91 s"

What changed

The two passes are counted as one, as #714 did for the predicted pipelines. The warm's steps come first. The second pass's steps are counted before the warm, from the same programs it will be given, and they stand in the total until the pass counts them itself.

  • vk: new gpu/vk/start_steps.h:
    • begin / warm / create / end wrap the progress callback. The warm reports done of total + steps; load at create reports warm + done of warm + total; end reports the full count when the pass returns.
    • create_steps(taken, programs) counts the second pass's steps as precompile_at_create does (total = fallbacks + kept):
      • every variant of each key whose kind-4 records program_cache_load_some(..., fallbacks) takes;
      • those keys' variants already in memory;
      • the mesh fallback programs in memory under other keys (fallback_loaded::each).
    • At least one step is held whenever a second pass follows, so the warm's end is never the bar's.
  • vk: precompile_run (gpu/vk/vk_draw.cpp) wraps both passes' progress through start_steps:
    • a --prepare-shaders run (LONGSHOT_PREPARE_ONLY) has no second pass, so it holds no steps and its warm still ends at 100%;
    • a start whose notes are already covered runs the second pass alone, from 0.
  • vk: program_cache_fallback_steps() (gpu/vk/vk_progcache.cpp, declared in vk_progcache.h and vk_pipelines.h): a snapshot of the records program_cache_load_some(..., fallbacks) would take (under disk_mu), then create_steps under shader_mu. The warm only borrows programs, so the count taken before it still holds.
  • tests: new tests/test_start_progress_at_create.py:
    • it cuts precompile_run's at-create branch from the source, runs it with stand-ins for the two passes, and feeds the real PrepareBar;
    • plus a count case against the real create_steps, and source checks that the snapshot takes what load_some takes and that precompile_at_create still counts fallbacks + kept.
  • tests: test_bounded_wait, test_cold_cache_check and test_warm_bounded pinned precompile_run's old call text. They now read the new calls and keep their guards: the lost-sample check still comes before the covered-notes decision.

A follow-up idea for HumanBean, not in this PR: the preparation's own process returns before load at create (LONGSHOT_PREPARE_ONLY), so the mesh fallback programs' compute pipelines (2284 programs, 4568 steps on the Deck) are compiled only at the game's first start after each preparation. That's the Deck's ~90 s first start; later starts find them in the caches ("none built", ~9 s). Building them in --prepare-shaders would move that time into the preparation.

Measurements

Verdict: nothing to time: this changes what the bar shows, not how long anything takes. The before and after are the new test's output, and the start-up log lines in the game run.

Hardware: Windows 11, llvm-mingw clang (the builder's); Linux: WSL Ubuntu 24.04, g++
Scene: game-free (the test's stand-ins for the two passes); in the game, the first windowed start after a Most preparation on a Steam Deck OLED, defaults (RX_VK_LOAD=create)
Method: python -I -B tests/test_start_progress_at_create.py on main and on this PR; the touched checks through tests/run_all.py; in the game, the log's start-up: pipelines N of M, X% of all lines beside load at create: X of Y steps, one attended run
How to reproduce: python -I -B tests/test_start_progress_at_create.py [--cxx g++]; in the game, --prepare-shaders, then start the game and read longshot_log.txt's start-up lines

Before: main @ 430eef4f After: this PR @ 5c835025
New check, Windows clang fails (bar at 100% through the second pass) passes
New check, Linux g++ fails (same) passes
main (Windows and Linux):
FAIL: the start-up bar through a first start's two passes:
FAIL line 88: under
FAIL line 89: after_warm.size() > 2 && after_warm[after_warm.size() - 2] > after_warm.front()
FAIL line 98: under

this PR (Windows and Linux):
PASS: the bar counts the load-at-create pass after the warm: under 100% until it ends

Teeth checks, each breaking the fix on purpose; each makes the new check fail:

  • the count by keys instead of variants: fails at line 148 (the count case);
  • resident programs left out: fails at lines 148 and 149;
  • no step held for the second pass: fails at line 106 (under 100%).

Before the rebase onto 430eef4f, run_all.py --changed (151 checks) gave Windows 142 pass / 9 fail and Linux 117 pass / 8 fail. The same checks fail on main 7daafa7a on each OS: on Windows test_fsr_uniform_ownership, test_draw_stream_visibility, test_dev_packs, test_pipeline_play_cache, test_compute_warm_apart, test_linux_pressure, test_upscaler_rows, test_vk_occlusion_queries and test_recorder_sync; on Linux byte_compile_tracked, test_bake_ds, test_dev_packs, test_linux_pressure, test_pipeline_cache_save, test_pipeline_play_cache, test_shader_module_guard and test_upscaler_rows. test_recorder_sync's failure is the missing vk_new.h that #1363 fixes.

A syntax build of vk_draw.cpp and vk_progcache.cpp with the build's flags gives the same diagnostics on main and here (117 and 1).

After the rebase onto 430eef4f (which changed the warm, #1567): the new check fails on main 430eef4f and passes here, on Windows and Linux. The new check, test_bounded_wait, test_cold_cache_check, test_warm_bounded, test_fallback_loaded, test_doc_anchors, test_compute_warm_apart, test_precompile_warm_computes and test_pipeline_state_computes all pass on both (9 of 9). The syntax build again matches main (117 and 1).

Flags and settings

None. The diff reads LONGSHOT_PREPARE_ONLY, which already exists (the preparation's own process; switches.def), and changes nothing about it.

Testing

Tested: In the game on a Steam Deck OLED (AMD Custom GPU 0932, RADV VANGOGH, Mesa 26.2.0-devel git-5c65d4fc31, SteamOS Game Mode, 1280x800 at 90 Hz, 15 W), run by our Deck agent. The renderer was built from 5c835025 on the m430 base (main 430eef4f). The copy was freshly prepared on Most, and this was its first windowed start after that preparation, the case in How to reproduce.

  • The bar's total is now the warm's 34,710 steps plus load at create's 4,568 (39,278).
  • Through load at create, the log's bar lines rose from "pipelines 35041 of 39278, 89%" (load at create 205 of 4568, 10 s) to "36533 of 39278, 93%" (1337 of 4568, 70 s). They reached the end of the count with "load at create: its pipelines took 88 s". On main 7daafa7a the same stretch logged "pipelines N of 4568, 100% of all" throughout.
  • The log prints "100% of all" at 39276 of 39278 (two steps left) because of its "%.0f" rounding; the screen floors to 99% until the work is done.
  • Screen captures, sampled about every 15 s, showed "Loading pipelines" at 90% (35,369 / 39,278) and 93% (36,554 / 39,278), then the title. They are kept on the PC.
  • The shaders took 101.6 s in total, against m430's 101.0 s. That's one sample each, as expected for a display-only change, not a speed comparison.
  • The game then played normally, with no GPU fault, timeout or reset.

Game-free, on Windows (llvm-mingw clang) and Linux (WSL, g++): the new check fails on main and passes here. test_bounded_wait, test_cold_cache_check, test_warm_bounded, test_fallback_loaded and test_doc_anchors pass. The three teeth checks fail as expected.

Not tested: the time-left estimate, which still jumps during load at create (about 15 s, then 1 to 4 min); that is outside this fix. The bar on a GPU with mesh shaders, where load at create has no fallback programs: the held step and end() keep the bar's end where it was, and the test covers that case (an empty second pass ends at 100%). The full run_all.py was not rerun after the rebase: the --changed run was on 7daafa7a, and the touched and warm-related checks were rerun on 430eef4f.

Must be tested: None.

Risks

What could break: the bar's movement on the first start after a preparation. A count that differs from the second pass's own total can only make the bar move unevenly; it can't stop the start, change what is built, or touch later starts.

Turning it off: revert the commit.

Compatibility: Nothing changes: no caches, saves, options or the vk ABI.

Issues

See #1522

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what
    can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and
    in Risks.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Linux: the Deck's renderer build from this branch. Windows: vk_draw.cpp and vk_progcache.cpp compiled with the build's flags, -fsyntax-only, with the same diagnostics as main.)
**Type:** fix · **Risk:** low · **Tested on:** Windows 11 (llvm-mingw clang) and Linux (WSL Ubuntu 24.04, g++), game-free; in the game: Steam Deck OLED (RADV) · **Needs:** none ## TL;DR On the first start after preparing shaders, the start-up screen's bar read 100% while the game was still building pipelines: about 90 seconds on a Steam Deck, with "Loading pipelines 100%" on screen the whole time. The start does its work in two passes, and the bar counted only the first. This PR counts both passes in one total, so the bar stays under 100% and keeps moving until the second pass ends. A new test fails on main and passes here, on Windows and Linux. This changes the bar only: nothing is built differently and nothing gets faster. ## Breakdown - **Who it helps:** anyone whose first start after a shader preparation builds pipelines before the title, most visibly Steam Deck players. - **What was wrong:** the first pass reached its own total, and the bar never goes back, so it showed 100% through the second pass. - **What changes:** the bar counts the second pass's steps from the start, so it shows the real progress through both. - **What does not change:** what the start builds and how long it takes; --prepare-shaders' own bar; later starts; every switch and setting. - **How it was checked:** a new game-free test (fails on main, passes here, Windows and Linux), three updated source checks, teeth checks, a syntax build of the changed files against main; in the game: Steam Deck OLED (RADV). - **What is still open:** #1522's slow build and resumability questions, which this PR does not address. - **Risk:** low: a wrong count could only make the bar move unevenly; it can't stop the start or change what is built. ## Why Under `RX_VK_LOAD=create`, the first start after a preparation runs two passes before the title, both on the bar's last part: 1. the warm (`precompile_warm`): every noted pipeline built into the pipeline cache; 2. load at create (`precompile_at_create`): each mesh fallback program's compute pipelines, then the kept programs' noted pipelines. Each reported its own done of total. The warm reached its total, `PrepareBar` never goes back, so the screen read 100% for the whole second pass. On a Steam Deck at main 7daafa7a that was 91 s, with the log saying "start-up: pipelines 1883 of 4568, 100% of all". This is the same plateau family as #714, which fixed it for the predicted pipelines. See #1522: its "stuck at Loading Pipelines 100%" matches this symptom. #1522 also asks about the slow build itself, a UI that stopped taking clicks, and whether a restart resumes the work. This PR does none of those, and #1522 has no log tying them to this cause, so it doesn't close the issue. ## How to reproduce **Seen on:** Steam Deck (SteamOS, RADV), main 7daafa7a **Settings and switches:** defaults (`RX_VK_LOAD=create`); a GPU that draws mesh programs through the compute fallback, as the Deck does **Steps:** prepare the shaders (`--prepare-shaders`), then start the game for the first time after that preparation, and watch the start-up screen and `longshot_log.txt` **Expected:** the bar under 100% while "load at create: X of Y steps" is still counting **Actual:** "start-up: pipelines N of 4568, 100% of all" from N = 31 to 1883, for about 90 s, then "load at create: its pipelines took 91 s" ## What changed The two passes are counted as one, as #714 did for the predicted pipelines. The warm's steps come first. The second pass's steps are counted before the warm, from the same programs it will be given, and they stand in the total until the pass counts them itself. - vk: new `gpu/vk/start_steps.h`: - `begin` / `warm` / `create` / `end` wrap the progress callback. The warm reports `done of total + steps`; load at create reports `warm + done of warm + total`; `end` reports the full count when the pass returns. - `create_steps(taken, programs)` counts the second pass's steps as `precompile_at_create` does (`total = fallbacks + kept`): - every variant of each key whose kind-4 records `program_cache_load_some(..., fallbacks)` takes; - those keys' variants already in memory; - the mesh fallback programs in memory under other keys (`fallback_loaded::each`). - At least one step is held whenever a second pass follows, so the warm's end is never the bar's. - vk: `precompile_run` (`gpu/vk/vk_draw.cpp`) wraps both passes' progress through `start_steps`: - a `--prepare-shaders` run (`LONGSHOT_PREPARE_ONLY`) has no second pass, so it holds no steps and its warm still ends at 100%; - a start whose notes are already covered runs the second pass alone, from 0. - vk: `program_cache_fallback_steps()` (`gpu/vk/vk_progcache.cpp`, declared in `vk_progcache.h` and `vk_pipelines.h`): a snapshot of the records `program_cache_load_some(..., fallbacks)` would take (under `disk_mu`), then `create_steps` under `shader_mu`. The warm only borrows programs, so the count taken before it still holds. - tests: new `tests/test_start_progress_at_create.py`: - it cuts `precompile_run`'s at-create branch from the source, runs it with stand-ins for the two passes, and feeds the real `PrepareBar`; - plus a count case against the real `create_steps`, and source checks that the snapshot takes what `load_some` takes and that `precompile_at_create` still counts `fallbacks + kept`. - tests: `test_bounded_wait`, `test_cold_cache_check` and `test_warm_bounded` pinned `precompile_run`'s old call text. They now read the new calls and keep their guards: the lost-sample check still comes before the covered-notes decision. **A follow-up idea for HumanBean, not in this PR:** the preparation's own process returns before load at create (`LONGSHOT_PREPARE_ONLY`), so the mesh fallback programs' compute pipelines (2284 programs, 4568 steps on the Deck) are compiled only at the game's first start after each preparation. That's the Deck's ~90 s first start; later starts find them in the caches ("none built", ~9 s). Building them in `--prepare-shaders` would move that time into the preparation. ## Measurements **Verdict:** nothing to time: this changes what the bar shows, not how long anything takes. The before and after are the new test's output, and the start-up log lines in the game run. Hardware: Windows 11, llvm-mingw clang (the builder's); Linux: WSL Ubuntu 24.04, g++ Scene: game-free (the test's stand-ins for the two passes); in the game, the first windowed start after a Most preparation on a Steam Deck OLED, defaults (RX_VK_LOAD=create) Method: `python -I -B tests/test_start_progress_at_create.py` on main and on this PR; the touched checks through `tests/run_all.py`; in the game, the log's `start-up: pipelines N of M, X% of all` lines beside `load at create: X of Y steps`, one attended run How to reproduce: `python -I -B tests/test_start_progress_at_create.py [--cxx g++]`; in the game, `--prepare-shaders`, then start the game and read `longshot_log.txt`'s start-up lines | | Before: main @ 430eef4f | After: this PR @ 5c835025 | |---|---|---| | New check, Windows clang | fails (bar at 100% through the second pass) | passes | | New check, Linux g++ | fails (same) | passes | ``` main (Windows and Linux): FAIL: the start-up bar through a first start's two passes: FAIL line 88: under FAIL line 89: after_warm.size() > 2 && after_warm[after_warm.size() - 2] > after_warm.front() FAIL line 98: under this PR (Windows and Linux): PASS: the bar counts the load-at-create pass after the warm: under 100% until it ends ``` Teeth checks, each breaking the fix on purpose; each makes the new check fail: - the count by keys instead of variants: fails at line 148 (the count case); - resident programs left out: fails at lines 148 and 149; - no step held for the second pass: fails at line 106 (under 100%). Before the rebase onto 430eef4f, `run_all.py --changed` (151 checks) gave Windows 142 pass / 9 fail and Linux 117 pass / 8 fail. The same checks fail on main 7daafa7a on each OS: on Windows test_fsr_uniform_ownership, test_draw_stream_visibility, test_dev_packs, test_pipeline_play_cache, test_compute_warm_apart, test_linux_pressure, test_upscaler_rows, test_vk_occlusion_queries and test_recorder_sync; on Linux byte_compile_tracked, test_bake_ds, test_dev_packs, test_linux_pressure, test_pipeline_cache_save, test_pipeline_play_cache, test_shader_module_guard and test_upscaler_rows. test_recorder_sync's failure is the missing `vk_new.h` that #1363 fixes. A syntax build of `vk_draw.cpp` and `vk_progcache.cpp` with the build's flags gives the same diagnostics on main and here (117 and 1). After the rebase onto 430eef4f (which changed the warm, #1567): the new check fails on main 430eef4f and passes here, on Windows and Linux. The new check, test_bounded_wait, test_cold_cache_check, test_warm_bounded, test_fallback_loaded, test_doc_anchors, test_compute_warm_apart, test_precompile_warm_computes and test_pipeline_state_computes all pass on both (9 of 9). The syntax build again matches main (117 and 1). ### Flags and settings None. The diff reads `LONGSHOT_PREPARE_ONLY`, which already exists (the preparation's own process; `switches.def`), and changes nothing about it. ## Testing **Tested:** In the game on a Steam Deck OLED (AMD Custom GPU 0932, RADV VANGOGH, Mesa 26.2.0-devel git-5c65d4fc31, SteamOS Game Mode, 1280x800 at 90 Hz, 15 W), run by our Deck agent. The renderer was built from 5c835025 on the m430 base (main 430eef4f). The copy was freshly prepared on Most, and this was its first windowed start after that preparation, the case in How to reproduce. - The bar's total is now the warm's 34,710 steps plus load at create's 4,568 (39,278). - Through load at create, the log's bar lines rose from "pipelines 35041 of 39278, 89%" (load at create 205 of 4568, 10 s) to "36533 of 39278, 93%" (1337 of 4568, 70 s). They reached the end of the count with "load at create: its pipelines took 88 s". On main 7daafa7a the same stretch logged "pipelines N of 4568, 100% of all" throughout. - The log prints "100% of all" at 39276 of 39278 (two steps left) because of its "%.0f" rounding; the screen floors to 99% until the work is done. - Screen captures, sampled about every 15 s, showed "Loading pipelines" at 90% (35,369 / 39,278) and 93% (36,554 / 39,278), then the title. They are kept on the PC. - The shaders took 101.6 s in total, against m430's 101.0 s. That's one sample each, as expected for a display-only change, not a speed comparison. - The game then played normally, with no GPU fault, timeout or reset. Game-free, on Windows (llvm-mingw clang) and Linux (WSL, g++): the new check fails on main and passes here. `test_bounded_wait`, `test_cold_cache_check`, `test_warm_bounded`, `test_fallback_loaded` and `test_doc_anchors` pass. The three teeth checks fail as expected. **Not tested:** the time-left estimate, which still jumps during load at create (about 15 s, then 1 to 4 min); that is outside this fix. The bar on a GPU with mesh shaders, where load at create has no fallback programs: the held step and `end()` keep the bar's end where it was, and the test covers that case (an empty second pass ends at 100%). The full `run_all.py` was not rerun after the rebase: the `--changed` run was on 7daafa7a, and the touched and warm-related checks were rerun on 430eef4f. **Must be tested:** None. ## Risks **What could break:** the bar's movement on the first start after a preparation. A count that differs from the second pass's own total can only make the bar move unevenly; it can't stop the start, change what is built, or touch later starts. **Turning it off:** revert the commit. **Compatibility:** Nothing changes: no caches, saves, options or the vk ABI. ## Issues See #1522 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Linux: the Deck's renderer build from this branch. Windows: `vk_draw.cpp` and `vk_progcache.cpp` compiled with the build's flags, `-fsyntax-only`, with the same diagnostics as main.)
Under RX_VK_LOAD=create the first start after a preparation runs precompile_warm and then precompile_at_create on the bar's one part. The warm reaches its own total and the bar never goes back, so the screen reads 100% through the second pass (91 s on a Steam Deck). The check cuts precompile_run's at-create branch and feeds its progress into the real PrepareBar. It fails on main.

Assisted-by: GitHub Copilot (Claude Opus 5.5)
Co-authored-by: Copilot App <[email protected]>
fix(vk): count a first start's load at create on the start-up bar (#1522)
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 4s
Website / Website on Cloudflare (pull_request_target) Has been skipped
5c835025b4
Under RX_VK_LOAD=create the first start after a preparation runs precompile_warm and then precompile_at_create on the bar's one part. Each reported its own done of total. The warm reached its total, the bar never goes back, and the screen read 100% through the second pass: 91 s on a Steam Deck ("start-up: pipelines 1883 of 4568, 100% of all").

start_steps (gpu/vk/start_steps.h) makes the two passes one count, as #714 did for the predicted pipelines. The warm's steps come first. The second pass's steps are counted before the warm by program_cache_fallback_steps(): a snapshot of what program_cache_load_some(..., fallbacks) will give precompile_at_create, through start_steps::create_steps. That is every variant of each key whose kind-4 records it takes, the variants of those keys already in memory, and the mesh fallback programs in memory under other keys (fallback_loaded.h), each a step and each fallback one more, as precompile_at_create counts them. At least one step is held for the second pass, so the warm's end is never the bar's. The pass's end reports the full count, so a pass with nothing to do ends the bar too. A --prepare-shaders run, which has no second pass, still ends its warm at 100%. A start whose notes are covered already runs the second pass alone, from 0.

This changes the progress display only. It doesn't change what the start compiles, or how long it takes.

The three checks that pin precompile_run's calls (test_bounded_wait, test_cold_cache_check, test_warm_bounded) now read the new calls. The lost-sample guard must still come before the covered-notes decision.

Assisted-by: GitHub Copilot (Claude Opus 5.5)
Co-authored-by: Copilot App <[email protected]>
Author
Contributor

Tested in game: Steam Deck OLED (AMD Custom GPU 0932, RADV VANGOGH, Mesa 26.2.0-devel git-5c65d4fc31, SteamOS Game Mode, 1280x800 at 90 Hz, 15 W), renderer built from 5c835025 on m430 (main 430eef4f), first windowed start after a fresh Most --prepare-shaders. The bar total is the warm plus load at create (34,710 + 4,568 = 39,278). Through load at create the start-up lines rose from "pipelines 35041 of 39278, 89%" (205 of 4568 steps, 10 s) to "36533 of 39278, 93%" (1337 of 4568, 70 s), and reached the end of the count with "load at create: its pipelines took 88 s". On main 7daafa7a the same stretch read "N of 4568, 100% of all" throughout. Screen captures showed "Loading pipelines" at 90% and 93%, then the title. Shaders took 101.6 s (m430: 101.0 s, one sample each). The game then played normally, with no GPU fault, timeout or reset. Run by our Deck agent.

Tested in game: Steam Deck OLED (AMD Custom GPU 0932, RADV VANGOGH, Mesa 26.2.0-devel git-5c65d4fc31, SteamOS Game Mode, 1280x800 at 90 Hz, 15 W), renderer built from 5c835025 on m430 (main 430eef4f), first windowed start after a fresh Most --prepare-shaders. The bar total is the warm plus load at create (34,710 + 4,568 = 39,278). Through load at create the start-up lines rose from "pipelines 35041 of 39278, 89%" (205 of 4568 steps, 10 s) to "36533 of 39278, 93%" (1337 of 4568, 70 s), and reached the end of the count with "load at create: its pipelines took 88 s". On main 7daafa7a the same stretch read "N of 4568, 100% of all" throughout. Screen captures showed "Loading pipelines" at 90% and 93%, then the title. Shaders took 101.6 s (m430: 101.0 s, one sample each). The game then played normally, with no GPU fault, timeout or reset. Run by our Deck agent.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 4s
Website / Website on Cloudflare (pull_request_target) Has been skipped
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/start-bar-at-create:dukenheimer-fix/start-bar-at-create'
git switch 'dukenheimer-fix/start-bar-at-create'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1575
No description provided.