diff --git a/plans/2026-11-18-breeze-startup-speed.md b/plans/2026-11-18-breeze-startup-speed.md index 8d562886b..61afd7d2c 100644 --- a/plans/2026-11-18-breeze-startup-speed.md +++ b/plans/2026-11-18-breeze-startup-speed.md @@ -26,8 +26,5 @@ then about 3 s drawing that frame. - [ ] Practice banners are 2048×1024 WebP for a card a few hundred pixels tall: about 760 ms each in the debug build. Decode at the drawn size (Kryon's Pixmap) or ship smaller banners. -- [ ] The WHM banner decodes twice. When the Practices app opens after the - start, `practice_downloads.zi` reports `assets/practices` as changed, which - reloads pictures whose bytes stayed the same. - [ ] Measure a gplay release on the owner's Pixel 3a once these land; debug builds log each picture's load time as `APP PROBE: picture`. diff --git a/src/practices/practice_downloads.zi b/src/practices/practice_downloads.zi index 0810c36b5..978ac41f3 100644 --- a/src/practices/practice_downloads.zi +++ b/src/practices/practice_downloads.zi @@ -622,12 +622,16 @@ PracticeDownloadsCancel :: () { practice_transfer_index = -1 } +// Pictures load again only when a closing pack served some. The first +// catalog closes no pack, so the pictures the first frame drew stay. PracticeDownloadsClose :: () { PracticeDownloadsCancel() + images := false for index: cast(s32)0..practice_pack_count - 1 { PracticeContentWorkRetire(practice_load_work[index]) practice_load_work[index] = null practice_content_used[index] = 0 + images = images || PracticePackServesImages(practice_packs[index], practice_packs[index].bundle) CloseBundle(practice_packs[index].bundle) practice_packs[index] = PracticePack.{} } @@ -639,7 +643,7 @@ PracticeDownloadsClose :: () { practice_narration_selected = false practice_guide_narration_selected = false practice_catalog_invalid = false - AssetNotifyChangedUnder(PRACTICE_ASSET_FOLDER) + PracticePackContentChanged(images) } PracticeCatalogParse :: (data: string, output: []PracticePack) -> s32 { diff --git a/tests/practice_downloads_behavior.zi b/tests/practice_downloads_behavior.zi index 2f574fa8f..3fcba6743 100644 --- a/tests/practice_downloads_behavior.zi +++ b/tests/practice_downloads_behavior.zi @@ -80,10 +80,17 @@ CheckPracticeDownloads :: () -> s32 { AssetBindProvider(FixtureProvider) practice_grant = FixtureGrant practice_owned = FixtureOwned + unused AssetTakeChanges() FixturePracticePump(0, false, false, true) if practice_pack_count != 11 || PracticeContentReady(0) { return 1 } + // The first catalog closes no pack, so the pictures already on screen + // stay: the practice banners decoded once, not again when it loaded. + first_catalog := AssetTakeChanges() + if first_catalog.all || first_catalog.folders.count != 0 { + return 132 + } PracticeContentRequest(0) FixturePracticePump(0, false, false, true) // Repeated requests while transferring must not enqueue the pack twice.