feat: add chunk data recording and chunk-enabled binary replay playback#49
Closed
DriftN2Forty wants to merge 25 commits into
Closed
feat: add chunk data recording and chunk-enabled binary replay playback#49DriftN2Forty wants to merge 25 commits into
DriftN2Forty wants to merge 25 commits into
Conversation
…chive format Co-authored-by: Copilot <copilot@github.com>
…on entry structure Co-authored-by: Copilot <copilot@github.com>
- Add WorldChunkPacketFriendlyCaptureService for capturing live world chunks into packet-friendly BRCP snapshot payloads. - Introduce PacketFriendlyChunkColumnBuilder to build chunk columns from captured data. - Create ReplayChunkSnapshot interface with implementations for legacy and packet-friendly snapshots. - Implement ReplayChunkSnapshotSender interface for sending chunk snapshots to players. - Define BinaryChunkPayloadFormat enum for supported chunk payload formats. - Develop BinaryPacketFriendlyChunkPayloadCodec for encoding and decoding packet-friendly chunk payloads. - Add tests for BlockEntityNbtReflectionSupport, WorldChunkPacketFriendlyCaptureService, and BinaryPacketFriendlyChunkPayloadCodec to ensure functionality and correctness. Co-authored-by: Copilot <copilot@github.com>
… for fluid state detection
…rror diagnosis and add light data handling
- Updated the send method in ReplayChunkSnapshotSender interface to accept PacketFriendlyChunkColumnBuilder.PreparedChunkPacket instead of BinaryPacketFriendlyChunkPayloadCodec.PacketFriendlyChunkPayload. - Modified ReplayBlockManagerTest to accommodate the new PreparedChunkPacket type, ensuring proper mocking and verification of interactions with ReplayChunkSnapshotSender. - Introduced new ReplayChunkPacketPreparer interface for preparing chunk packets, enhancing separation of concerns and improving code maintainability. Co-authored-by: Copilot <copilot@github.com>
…for fluid palette handling
…e palette resolution Co-authored-by: Copilot <copilot@github.com>
…hit logging Co-authored-by: Copilot <copilot@github.com>
…optimize playback performance Co-authored-by: Copilot <copilot@github.com>
…and cache hit metrics Co-authored-by: Copilot <copilot@github.com>
…unk being sent Co-authored-by: Copilot <copilot@github.com>
…nced chunk restore semantics
…torage and chunk-aware playback features. Also cleaned up based on all commits after upstream/master
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
This PR adds end-to-end chunk data recording for BetterReplay's binary replay format and wires that data through recording, persistence, loading, playback, diagnostics, and teardown.
The branch starts with the chunk archive contract and recording pipeline, then carries the feature through chunk-enabled replay loading and playback, and finishes with packet-friendly
BRCPplayback, viewer-facing tuning knobs, teardown hardening, diagnostics, caching, and documentation updates.At a high level, this means saved binary replays can now include chunk sidecar data, replay viewers can see chunk state around the replay subject instead of relying only on timeline block mutations, and the runtime has the controls and safeguards needed to make that practical in production.
What This Adds
Binary chunk recording pipeline
.brregionarchive layout.Chunk-enabled replay loading
Playback support for chunk-enabled replays
BRCSpayload path and the packet-friendlyBRCPpayload path.Packet-friendly
BRCPplaybackRuntime tuning and diagnostics
Playback.Chunk-View-Radiusso replay chunk loading can use a replay-specific radius.Playback.Chunk-Timing-Diagnosticsfor per-stage replay chunk timing and async preparation diagnostics.Playback.Chunk-Modewith two restore strategies:1: moving-window restore as replay chunks leave the replay window2: deferred restore that cooperates with natural client chunk unloads and resends replay chunks when the viewer returns/replay debug info, including region counts, chunk counts, and compressed versus decompressed chunk payload sizes.Performance and hardening work included with the feature
Key Implementation Areas
Recording and artifact persistence
Loading and storage
Playback and restore lifecycle
ReplayBlockManagernow owns the chunk-enabled playback lifecycle, including replay chunk preparation, application, resend behavior, live restore queueing, teardown, residency tracking, and mode-aware restore decisions.Docs and operator guidance
Config and Behavior Notes
This PR adds or finalizes the following chunk-related config surface:
Recording.Chunks.EnabledRecording.Chunks.Capture-RadiusRecording.Chunks.Max-Unique-ChunksPlayback.Chunk-View-RadiusPlayback.Chunk-Timing-DiagnosticsPlayback.Chunk-ModeOperationally, the biggest user-visible change is that chunk-enabled binary replays can now restore surrounding chunk state for the replay viewer, and BRCP recordings can do that with real chunk packet playback rather than only block-by-block rewriting.
Validation
mvn testNotes For Reviewers
ReplayBlockManager, the binary storage codec/manifest path, and the packet-friendly capture/build helpers.