fix(arrow-ipc): write 8-byte i64 length prefix for compressed IPC buffers on wasm32 - #10989
Merged
Merged
Conversation
Rich-T-kid
approved these changes
Sep 4, 2026
Rich-T-kid
left a comment
Contributor
There was a problem hiding this comment.
- https://arrow.apache.org/docs/format/Columnar.html#encapsulated-message-format
-
- 'A 32-bit little-endian length prefix indicating the metadata size'
- https://arrow.apache.org/docs/format/Columnar.html#variable-size-binary-view-layout
make sense to me, nice catch @Narendran-KT
| } else { | ||
| // write compressed data directly into the output buffer | ||
| output.extend_from_slice(&uncompressed_data_len.to_le_bytes()); | ||
| output.extend_from_slice(&(uncompressed_data_len as i64).to_le_bytes()); |
Contributor
There was a problem hiding this comment.
nice catch.
did you check if there other similar call sites like this?
Jefffrey
approved these changes
Sep 5, 2026
Jefffrey
left a comment
Contributor
There was a problem hiding this comment.
thanks for this @Narendran-KT, and the review @Rich-T-kid
i think our 32-bit support is quite wonky indeed, see related issue:
so fixes like this are quite appreciated
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.
Which issue does this PR close?
Rationale for this change
On
wasm32,usizeis 32-bit, causing the compressed IPC buffer length prefix to be written as 4 bytes instead of the required 8-bytei64value.What changes are included in this PR?
Serialize the uncompressed buffer length explicitly as
i64to ensure the IPC compression prefix is always 8 bytes across platforms.Are these changes tested?
Yes. Verified the generated compressed IPC buffer and confirmed the 8-byte length prefix is correctly written on
wasm32.Are there any user-facing changes?
No. This is a bug fix for IPC compression compatibility on
wasm32; there are no API or breaking changes.