Repository navigation
Batch ready world columns - #339
Merged
Merged
Conversation
…n placements, check drift in the web build
scheduler.yield() continuations ran back to back for about 55 ms without a frame between them. Grouped placement chains 2-4 columns of placement, culling, and dispatch without real async waits, so its 8 ms yields produced 66-83 ms frame-callback gaps. MessageChannel lets rendering run between slices. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… share placement cleanup, name the yield interval
InventivetalentDev
force-pushed
the
perf/batch-column-placement
branch
from
October 17, 2026 15:12
502b5dd to
4bf8b10
Compare
InventivetalentDev
changed the base branch from
main
to
perf/world-placement-profile
October 17, 2026 15:12
InventivetalentDev
marked this pull request as ready for review
October 17, 2026 19:44
# Conflicts: # AGENTS.md # apps/web/benchmarks/world.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Streaming adjacent parsed columns currently rebuilds shared neighbor sections after each column. #337's placement profile shows the cost: of 965 section builds per pass on the Etho route, 537 happen while neighbouring columns are placed. This adds
MineRenderWorld.placeChunksand letsWorldStreamerplace the nearest ready columns together, so neighbor faces, fluids, lighting, ambient occlusion, and biome colors refresh once per group.The placement profiler is provided by #337.
Behavior
placeChunkskeep their existing serial path.YIELD_INTERVAL_MS(8 ms) of work.MessageChannelinstead ofscheduler.yield(). Chrome runsscheduler.yield()continuations ahead of rendering, so a grouped placement's chained slices produced 66–100 ms frame-callback gaps; a trace of one 68 ms gap showed about 55 ms of back-to-back continuations with no frame between them. WithMessageChanneltasks, frames render between slices.Measured result
With #337's profiler on the same route, each pass now builds 788 sections: 428 during their own column's placement, as before, and 360 during neighbouring placements instead of 537. The 126 placed columns take 70 placement operations instead of 126.
Three baseline (
a53d0983) and three candidate invocations alternated in one session, using the same read-only Java 1.16.2 Etho save, route, settings, viewport, and hardware GPU. Warm results:The slowest candidate is faster than the slowest baseline but slower than the fastest baseline. Cold passes had a 16.8 ms maximum gap in every candidate run; their streaming time is dominated by asset loading and is similar for both. Median sampled peak JS heap was 269.6 → 257.4 MiB, including shared assets and benchmark records and excluding GPU memory.
Conditions: route
[-15,8] → [-7,8] → [1,8] → [9,8]and return; seven stops per pass; load/unload radii 1/2; 1,000 ms settle; 1280×720 at pixel ratio 1; section meshing on; saved light, AO, blending, and mobs off; Chrome 155 on Apple M5 Pro (ANGLE Metal). The two raw regions fit in the source cache. Each pass placed 63 logical columns, unloaded 54 during streaming and nine at cleanup, and had nine loaded columns at every stop with no missing/failed/pending columns or worker fallback. Draw-call counts agree at every stop.A heavier run with radii 2/3, saved light and AO, and blend radius 1 streamed in 1,810.5 ms warm here versus 2,285.6 ms on main. Main's maximum callback gap reached 50.1 ms warm and 83.4 ms cold; this branch stayed at 16.8 ms. That save lacks modern biome palettes, so blended-color equivalence is covered by the test fixture.
These results are specific to this route and cache state. Timing stages overlap; callback gaps are not displayed FPS. Raw reports and the save are not committed.
Validation
yarn test: 818 passed;yarn test:package(11),yarn test:api(18),yarn test:embed(15), andyarn test:node(6) pass.yarn build,yarn typecheck, andyarn workspace @minerender/web build:productionpass.Regression tests cover input snapshots and signed/duplicate columns; sequential/grouped section geometry across fluid, light, AO, and biome boundaries; partial placement failure and retry; ready-prefix ordering and the four-column window; a full window holding a decoded column while the nearest column has no read, after a center move and after a retry; center changes and disposal; ignored cancellation; primitive errors; and cleanup failure ownership.
🤖 Generated with Claude Code