Repository navigation
Load structure assets concurrently in world placement - #344
Merged
Merged
Conversation
…k objects Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
InventivetalentDev
marked this pull request as ready for review
October 21, 2026 19:08
…object results Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
placeMultiBlockon a world withsectionMeshingno longer waits for one asset request at a time.SectionModels.prepareloads every variant's merged model and atlas at the same time. Results are still read in variant order: the first rejection is thrown, and the first unusable variant makes the state unprepared, as before.MineRenderWorld.placeBlocks(no executor) startsSectionModels.preloadfor every distinct non-air palette entry before it places the first chunk. Block entities are skipped, because they keep individual objects and never use section models. It reuses the block states from the existingBlockStates.getAllcall and does not await the preloads, so states that first appear in later chunks load while earlier chunks are placed.Chunk.replaceBlocksandreplaceSectioncreate the blocks that keep individual objects (block entities and other non-merged blocks) concurrently. When a placement repeats an index, only the last one creates an object. Errors are still reported for the earliest failing placement in input order.Chunk.createBlockObjectsets the block's position beforeinit, so its models, fluid surface, and block entities are placed where they belong instead of at the origin until the position arrives.Why
A small schematic took several seconds to appear, because each variant, model, atlas, and block object waited for the previous request to finish. Requests take 30–350 ms each.
Risk
Medium. Placement order of asynchronous work changes for every structure placed without an executor. Blocks with several variants or block entities could show a wrong model or position if a result is matched to the wrong variant or index; the new tests cover both. Placement with a
BatchedExecutoris unchanged.Testing
yarn workspace minerender typecheck,yarn build:lib: pass.yarn test: 836 tests pass, including the newSectionModels.test.ts(concurrent start, variant order, missing model, first rejection) andWorld.test.tscases (objects created at their positions, last placement at a repeated index, one preload per distinct state, no preload for block entities).Note
AI-assisted.