-
Notifications
You must be signed in to change notification settings - Fork 106
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
Rust: Port anduril/mcap-rs #611
Conversation
9f4265f
to
247221d
Compare
- Make field names match. - Extract chunks. - Flatten record headers. - Skip data_len header fields
Duplicated data invites inconsistency - the slices we return for schemas, messages, and attachments know their length. Inside the codec, just serialize the length fields separately.
247221d
to
aef7062
Compare
Discuss tradeoffs of memory-mapped vs streaming reads.
rust/README.md
Outdated
@@ -1,31 +1,18 @@ | |||
# Rust MCAP reading library | |||
# mcap-rs |
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.
Out of date?
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.
Yep! Thanks, fixed in ae22506
} | ||
|
||
// Hard mode: randomly access every message in the MCAP. | ||
// Yes, this is dumb and O(n^2). |
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.
7 minute CI isn't a terrible situation - with this test rust is the long pole, taking the crown from C++ (5 mins). I think we can speed this up a little by writing a custom MCAP with only 10 messages as part of this test instead of using demo.mcap
. Happy to do that as a separate PR.
14c345c
to
ae22506
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.
Re: serde
as an optional dependency, I think this is impossible without duplicating a large amount of record struct declaration. Probably the right path there is to just write a manual transformation from serde_json::Value
objects to Records.
👏 🥳 |
Public-Facing Changes
Description
Adds a more fully-featured Rust library that supports indexed reading, CRC validation, record writing, chunking, and automatic summary writing.
TODOs
serde
an optional dependency that we only pull in for the conformance reader. (I can't imagine users wanting to serialize random chunks of an MCAP file to JSON/CBOR/Bincode/etc.)tests/round_trip.rs
) checks the message indexes by individually seeking each message from its respective chunk. This is... slow. Should we axe that part of the test to avoid bogging down CI?