Skip to content

fix(arrow-ipc): write 8-byte i64 length prefix for compressed IPC buffers on wasm32 - #10989

Merged
Jefffrey merged 2 commits into
apache:mainfrom
Narendran-KT:fix/wasm_ipc_compression
Sep 5, 2026
Merged

fix(arrow-ipc): write 8-byte i64 length prefix for compressed IPC buffers on wasm32#10989
Jefffrey merged 2 commits into
apache:mainfrom
Narendran-KT:fix/wasm_ipc_compression

Conversation

@Narendran-KT

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

On wasm32, usize is 32-bit, causing the compressed IPC buffer length prefix to be written as 4 bytes instead of the required 8-byte i64 value.

What changes are included in this PR?

Serialize the uncompressed buffer length explicitly as i64 to 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.

@github-actions github-actions Bot added arrow Changes to the arrow crate arrow-ipc labels Sep 4, 2026

@Rich-T-kid Rich-T-kid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} 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());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch.

did you check if there other similar call sites like this?

@Jefffrey Jefffrey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Jefffrey Jefffrey added the bug label Sep 5, 2026
@Jefffrey
Jefffrey merged commit b1aa94b into apache:main Sep 5, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate arrow-ipc bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

arrow-ipc compression writes a 4-byte length prefix on wasm32 instead of the required 8 bytes

4 participants