fix: bound large schematic NBT imports - #129
Merged
Merged
Conversation
Contributor
Author
Release follow-up requiredThe implementation/CI evidence is sufficient for the measured Probe B blocker, but this PR intentionally leaves After this PR merges, a release PR must bump the importer to a new patch version (expected 0.2.6, unless the repository release baseline has advanced), update runtime/version metadata consistently, pack/test it, and publish it. The current publish workflow skips versions already present on npm, so triggering publish while the package remains 0.2.5 would not deliver this fix. Only after the new importer version is published should MinePilot update its pinned dependency and rerun the missing Probe B 512 stages. |
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.
Summary
prismarine-nbt@2.8.0/protodef@1.19.0parser rejectsBlockDatalength 16,777,216 at the0xffffffguard.BlockDatabound, 1,000,000-item cap for other NBT collections, and a 1,000,000 occupied-block cap for the large-array path.parseUncompressed(data, "big", { noArraySizeCheck: true })option for the oversized top-levelBlockDatacase.Probe B evidence
.schem: 107,799 bytes.PASS_HEAVY: import succeeds, but peak memory remains substantial. MinePilot's measured export remains about 5.81 s / 925 MiB; exporter was not changed.Safety boundary and limitation
Large imports are bounded to 16 MiB compressed input, 32 MiB uncompressed NBT, 16,777,216 cells, 24 MiB BlockData, 1,000,000 total items across other NBT collections, 100,000 tags, depth 64, and 1,000,000 occupied blocks. Larger volume, payload, or occupied output remains rejected. The parser option is not applied to arbitrary NBT: a structural preflight checks declared lengths before parsing.
Verification
pnpm buildpnpm --filter @i365dev/craftdag-importer-schem test— 12 passedpnpm --filter @i365dev/craftdag-core test— 191 passedpnpm --filter @i365dev/craftdag-exporter-schem test— 7 passedpnpm lintnode scripts/bench-probe-b-512.mjsCloses #128.