-
Notifications
You must be signed in to change notification settings - Fork 585
RRD footers 3: encoding/decoding manifests #12048
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: cmc/rrd_footers_2_rrd_manifests
Are you sure you want to change the base?
RRD footers 3: encoding/decoding manifests #12048
Conversation
|
Web viewer built successfully.
View image diff on kitdiff. Note: This comment is updated whenever you push a commit. |
|
Latest documentation preview deployed successfully.
Note: This comment is updated whenever you push a commit. |
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 implements encoding and decoding of RRD manifests in footers for the Rerun RRD file format. The changes enable random access to chunks within RRD files by storing metadata about chunk locations and properties in footer manifests.
Key changes:
- Adds manifest building during encoding, tracking chunk metadata (offsets, sizes, entity paths, etc.)
- Implements manifest parsing during decoding with transport-to-application conversion
- Adds CLI support for displaying parsed footers (
--footersflag) and recomputing manifests during routing (--recompute-manifestsflag)
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/content/reference/cli.md | Documents new CLI flags for footer display and manifest recomputation |
| crates/top/rerun/src/commands/stdio.rs | Updates stream reading to return RRD manifests alongside messages |
| crates/top/rerun/src/commands/rrd/route.rs | Adds --recompute-manifests flag to enable footer generation during routing |
| crates/top/rerun/src/commands/rrd/print.rs | Implements --footers flag to display parsed footer manifests |
| crates/top/rerun/src/commands/rrd/merge_compact.rs | Updates to handle new return signature with footer metadata |
| crates/top/rerun/src/commands/rrd/filter.rs | Updates to handle new return signature with footer metadata |
| crates/store/re_log_encoding/tests/snapshots/* | Adds test snapshots for manifest data and schema validation |
| crates/store/re_log_encoding/tests/footer_roundtrip.rs | Comprehensive roundtrip test for footer encoding/decoding |
| crates/store/re_log_encoding/src/rrd/log_msg.rs | Implements Encodable/Decodable traits for RrdManifest |
| crates/store/re_log_encoding/src/rrd/encoder.rs | Implements manifest building during message encoding |
| crates/store/re_log_encoding/src/rrd/decoder/stream.rs | Adds rrd_manifests() method to async decoder |
| crates/store/re_log_encoding/src/rrd/decoder/state_machine.rs | Accumulates manifests during decoding and implements manifest extraction |
| crates/store/re_log_encoding/src/rrd/decoder/iterator.rs | Adds rrd_manifests() method to sync decoder iterator |
| crates/store/re_log_encoding/Cargo.toml | Adds insta test dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
964c086 to
c1e6776
Compare
f1ad3fb to
92b97b9
Compare
| } | ||
|
|
||
| #[test] | ||
| fn footer_roundtrip() { |
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.
Arguably the most important part of this PR.
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.
(really nice test!)
zehiko
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.
went through all 3 PRs, it was really nicely documented and easy to follow, from the state machine updated, through rrd manifest builder (which I luckily knew bit about). nice work!
| } | ||
|
|
||
| #[test] | ||
| fn footer_roundtrip() { |
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.
(really nice test!)
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.
Yay!
| /// RRD manifests are parsed from footers, of which there might be more than one e.g. in the | ||
| /// case of concatenated streams. | ||
| /// | ||
| /// This is not cheap: it automatically performs the transport to app level conversion. |
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.
Maybe add a re_tracing::profile_function!(); to it then
| /// RRD manifests are parsed from footers, of which there might be more than one e.g. in the | ||
| /// case of concatenated streams. | ||
| /// | ||
| /// This is not cheap: it automatically performs the transport to app level conversion. |
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.
Maybe add a re_tracing::profile_function!(); to it then
| if !bytes.is_empty() { | ||
| let rrd_footer = | ||
| re_protos::log_msg::v1alpha1::RrdFooter::from_rrd_bytes(&bytes)?; | ||
| _ = rrd_footer; // TODO(cmc): we'll use that in the next PR, promise. |
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.
a man of your word 👍
| struct ManifestState { | ||
| /// The accumulated recording IDs of each individual chunk, extracted from their `LogMsg`. | ||
| /// | ||
| /// This will only be used if [`FooterState::recording_id_scope`] is empty. | ||
| recording_ids: Vec<re_log_types::StoreId>, |
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.
This will in most cases be the same store id repeated, correct?
| byte_offset: u64, | ||
| byte_size: 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.
Can use re_span::Span here
| byte_offset: u64, | |
| byte_size: u64, | |
| bytes: Span<u64>, |
| // bit weirder on the other hand, but then again this is generally not a new a | ||
| // problem: we tend to perform Sorbet migrations a bit too aggressively all over | ||
| // the place. We really need a layer that sits between the transport and | ||
| // application layer where one can accessed the parsed, unmigrated data. |
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.
100%
| // Right now, the implemented behavior is that we end up with an empty footer, i.e. there are | ||
| // no manifests in it. | ||
| // Whether that's the correct behavior is another question, but at least it is defined for now | ||
| // and can be changed. |
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 these kind of comments ⭐⭐⭐
|
@rerun-bot full-check |
|
Started a full build: https://github.com/rerun-io/rerun/actions/runs/19887096962 |
LLM summary:
To which I actually don't have all that much to add.
This PR is basically all the remaining glue so that, whenever one uses our
Encoderor one of ourDecodervariants, RRD footers and manifests will automagically be computed, injected and serialized/deserialized.The most important part of this PR is arguably the addition of a
footer_roundtriptest, that encodes a recording and then manually decodes all of its chunks directly using the generated RRD manifest, instead of using aDecoder.Part of RRD footers series of PRs: