Status: done (2026-11-23) Priority: 3 Size: S Design ref: src/page/chunks.js; docs/cost.md Goal: A change to the overview’s colours no longer costs a frame more than the painter’s budget: the level-2 repaint goes through the same budgeted painting as the close levels, and the old picture stays up until the new one is ready. Acceptance criteria:
repaintTiles no longer runs chunkJob to its end inside the frame for a level-2 chunk: the overview’s repaint is painted by schedule() within its budget, and the chunk’s old picture stays on screen until the new one is ready (as the close levels do since VB-1492).#ps123 at ‘as fast as it goes’: the longest frame’s painting time at a change of the overview, before and after, reported in the PR.tests/page.js that every level-2 chunk stays resident and visible through a repaint.npm test and npm run verify pass.Notes:
src/page/chunks.js, as VB-1490 does: one at a time.wantedList asks for each stale one wherever the view is; schedule paints it to a fresh canvas and swaps it in the frame it is done, as levels 0 and 1. Not painted in place: a half-painted live canvas would reach the screen if its texture were uploaded again mid-paint (texture GC, context loss), and would be kept by a world set aside mid-paint.stagePainted.over, read by the minimap and by a world brought back) gets the new canvas; a chunk left stale at a swap is marked stale again when its world returns (page/loader).decision): a stale overview chunk comes first when the view is at level 2, after the close levels (bias 2e7) at levels 0 and 1, where it lies hidden; at ‘as fast as it goes’ at level 0 the close levels keep the budget busy and the overview stays stale until the view zooms out, which shows the old picture meanwhile. First always would have been the other choice.#ps123, uncapped, software-rendered Chromium at ~5 fps; burst forced: 800 land tiles into treeDirty and biomeDirty, 4 times; time inside repaintTiles plus schedule per frame): at level 2, max 62.9 ms before (p50 37 at a change), 29.4 after (p50 22.5; budget 22, overshoot one step); at level 0, max 67.5 before, 29.6 after. Texture upload is not in either figure.job.again at level 2 are not tested.tests/browser-editor.js fails the same five checks (empty farm, Play placed by hand) before and after this change: not this task’s.