-
Notifications
You must be signed in to change notification settings - Fork 585
RRD footers 1: framing #12044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
RRD footers 1: framing #12044
Conversation
|
Web viewer built successfully.
View image diff on kitdiff. Note: This comment is updated whenever you push a commit. |
7929d56 to
440537c
Compare
440537c to
80ff0a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces the foundational framing infrastructure for RRD stream footers, which will enable richer metadata and improved stream navigation. It establishes the protocol-level types and state machine changes needed to support footers without yet populating them with content.
Key changes include:
- Addition of
RrdFootermessage types at both transport (protobuf) and application levels - Introduction of
StreamFooterframe for locating and validating RRD footers - Enhanced decoder state machine to handle the new footer frames
- Updated encoder to emit footers with basic state tracking infrastructure
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| rerun_py/rerun_sdk/rerun/recording_stream.py | Added TODO comment about flushing behavior on garbage collection |
| crates/store/re_server/src/store/layer.rs | Moved use sha2::Digest import to local scope |
| crates/store/re_protos/src/v1alpha1/rerun.log_msg.v1alpha1.rs | Generated protobuf code for new RrdFooter message type |
| crates/store/re_protos/proto/rerun/v1alpha1/log_msg.proto | Defined RrdFooter protobuf message with documentation |
| crates/store/re_log_encoding/tests/footer_roundtrip.rs | Added test validating footer encoding/decoding roundtrip |
| crates/store/re_log_encoding/src/transport_to_app.rs | Renamed conversion functions and added RrdFooter transport/application conversions |
| crates/store/re_log_encoding/src/rrd/mod.rs | Reorganized module structure and exports for footer support |
| crates/store/re_log_encoding/src/rrd/log_msg.rs | Implemented Encodable/Decodable for ArrowMsg and RrdFooter |
| crates/store/re_log_encoding/src/rrd/frames.rs | Added StreamFooter frame type with encoding/decoding logic |
| crates/store/re_log_encoding/src/rrd/footer/mod.rs | Created footer module structure |
| crates/store/re_log_encoding/src/rrd/footer/instances.rs | Defined application-level RrdFooter type |
| crates/store/re_log_encoding/src/rrd/errors.rs | Added frame decoding and CRC error variants |
| crates/store/re_log_encoding/src/rrd/encoder.rs | Updated encoder to track state and emit footers |
| crates/store/re_log_encoding/src/rrd/decoder/stream.rs | Updated async decoder state check for new naming |
| crates/store/re_log_encoding/src/rrd/decoder/state_machine.rs | Refactored decoder state machine to handle footer frames |
| crates/store/re_log_encoding/src/rrd/decoder/iterator.rs | Updated iterator state check for new naming |
| crates/store/re_log_encoding/Cargo.toml | Added dependencies for itertools and xxhash-rust |
| Cargo.toml | Added xxhash-rust workspace dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
| // * Backward compatibility: the payload is empty (i.e. `header.len == 0`) because the | ||
| // `End` message was written by a legacy encoder that predates the introduction of footers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's bit of a spoiler: obviously as of this PR, the footer is still always empty.
|
@rerun-bot full-check |
|
Started a full build: https://github.com/rerun-io/rerun/actions/runs/19868769655 |
emilk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love it
| byte_offset_excluding_header, | ||
| byte_size_excluding_header, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: could use re_span::Span for this if you like
| "fragile-send-sync-non-atomic-wasm", | ||
| ] } | ||
| xshell = "0.2.7" | ||
| xxhash-rust = { version = "0.8", features = ["xxh32"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious: why this particular hash?
| pub rrd_footer_byte_offset_from_start_excluding_header: u64, | ||
|
|
||
| /// The size in bytes of the serialized [`RrdFooter`] payload, excluding the message header. | ||
| /// | ||
| /// This is guaranteed to be the same value as the `len` found in the associated message | ||
| /// header, but duplicating it here makes it possible for decoders to get everything they | ||
| /// need using a single IO. | ||
| /// | ||
| /// [`RrdFooter`]: [crate::RrdFooter] | ||
| pub rrd_footer_byte_size_excluding_header: u64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, could be using re_span::Span just to reduce the number of variables the reader has to have in their head
| // TODO(cmc): It shouldn't be the job of the StreamFooter to carry checksums for a specific | ||
| // message's payload. All frames should have identifiers and CRCs for both themselves and their | ||
| // payloads, in which case this CRC would belong in the MessageHeader. | ||
| pub crc_excluding_header: u32, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also should document what checksum algo is being used here
LLM summary:
To which I would add the following:
This introduces all the framing infrastructure so that RRD streams are now capable of carrying footers in all circumstances (including pipes).
Specifically, this introduces a couple new types:
RrdFooter, a(n empty) protobuf message that will from now on act as the payload for messages of typeMessageKind::End.MessageKind::Endisn't new, it's something that was always there, but until now was always empty.StreamFooter, a simple binary frame that mirrorsStreamHeader, and whose main job is to keep track of where theRrdFooter.RrdFooter, e.g. when registering data on a Redap-compliant server.For now, these footers are always an empty protobuf messages. We will be filling them up in the following PRs.
Part of RRD footers series of PRs:
TODO
@rerun-bot full-check