[pr-feature][startup][shaders] Preload: print the progress line before each title file is read #184
Loading…
Reference in a new issue
No description provided.
Delete branch "Jesper-A/Darner:up-preload-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?
Refs #128, Refs #166
Contributor role (optional)
What it changes
While the preload runs, its window first says "Reading what is already made". It stays on that text until the first progress line arrives.
precompile(apps/darner/src/translate.rs) printed that line only at every 1000th shader. On this PC the title folder has 35 files that can hold shaders (3.76 GB). The first 26 of them (about 3.25 GB) hold fewer than 1000 shaders between them, and file 27 holds nearly all the rest. So the window showed no progress for 17 to 20 s (8 s when the files were still in the OS cache).Now
precompileprints the same progress line once per file, before the file is read. The preload window already reads that line as "Step 1 of 3 ... file f of 35", so it leaves "Reading what is already made" after about 1 s and shows the file count while the big files are read.progress_linebecamepub(crate)so the new test inpreload_ui.rscan build a real line.a_file_start_line_with_no_shaders_yet_moves_the_window_to_step_one. It feeds a "0 shaders in the cache, file 19 of 35" line to the window's parser and expects step 1, file 19 of 35.Related, not replaced: #128 and #166 are about the preload window, and this only makes its first phase show movement. It does not fix either.
How it was tested
e232e684d, on top of0b362cdec(themainof 2026-12-04, before #179).cargo clippy --workspace --all-targets --locked -- -D warnings: clean.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: clean.cargo test -p darner --bin darner -- translate preload_ui: 10 passed, 0 failed, 1 ignored. The new test is inpreload_ui::tests; I did not confirm it by name in the run.cargo test --workspace --locked(gate 3). There is no CI upstream, so nothing else has checked this.precompilecode, not seen on screen with this commit.cargo test --workspacenot run; the Wine/Proton window and the PowerShell launcher window were not looked at. The extra line is printed 35 times per preload on this PC, once per file, to the console only.Spec dependence
Checklist
main.docs/asset-policy.md.Checked for overlap
translate.rs; itsprecompilehunk is next to the line this adds, so expect a small textual conflict whichever lands second. It skips files; this prints progress for the files that are read. They do not do the same thing.translate.rsnear the start ofprecompile. Same note.preload_ui.rs(its own parser and tests hunks). Different lines from this change.This is a draft and is posted as it stands on
0b362cdec. It has not been rebased onto newermain.Drafted with AI assistance (Claude Code).
WIP: [pr-feature][startup][shaders] Preload: print the progress line before each title file is readto [pr-feature][startup][shaders] Preload: print the progress line before each title file is readSecond-opinion review: merge as is.
precompileprints the progress line once per file, before reading it, so the window leaves "Reading what is already made" after about a second.atis computed beforebytes_beforegrows, so the percentage is right, and the new test covers the window's parsing. Output only, no default change. It conflicts with #142 in translate.rs (both add code beforestd::fs::read); there the progress line should stay before #142's skip check, so skipped files still move the window.