perf(resource-packs): cache converted packs by content - #430
Open
AlexProgrammerDE wants to merge 1 commit into
Open
AlexProgrammerDE wants to merge 1 commit into
AlexProgrammerDE wants to merge 1 commit into
Conversation
Converting a resource-pack stack on every join repeats expensive ZIP work and can advertise stale output when the pack content changes. Cache conversions by the effective pack stack and content hash, and verify cached ZIPs before reuse. Write converted packs and their index atomically, give identical content a stable advertised hash and ID, and make ZIP entry order deterministic. Encode ResourcePackClientResponse with the current varint pack-list count; the old 16-bit count breaks game-protocol downloads. Add focused cache, load-state, and packet-layout tests. Based on ViaBedrock PR ViaVersionAddons#420.
AlexProgrammerDE
marked this pull request as ready for review
September 26, 2026 07:49
AlexProgrammerDE
force-pushed
the
stackanvil/north-star
branch
2 times, most recently
from
September 26, 2026 10:58
ea70eea to
af37749
Compare
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 this changes
Converting a resource-pack stack on every join repeats expensive ZIP work and can advertise stale output when the pack content changes. Cache conversions by the effective pack stack and content hash, and verify cached ZIPs before reuse.
Write converted packs and their index atomically, give identical content a stable advertised hash and ID, and make ZIP entry order deterministic. Encode ResourcePackClientResponse with the current varint pack-list count; the old 16-bit count breaks game-protocol downloads. Add focused cache, load-state, and packet-layout tests. Based on ViaBedrock PR #420.
This is the current north-star feature from StackAnvil's viabedrock patch stack. The PR branch contains this feature alone, based on upstream.
Review focus
Please check that a changed source pack cannot reuse an older conversion, and that reconnecting with unchanged packs avoids another conversion.
Testing
./gradlew test checkstyleMain checkstyleTeston the feature-only checkout.The live joins used the full StackAnvil patch stack and a local ViaProxy build compatible with the current ViaBedrock API.