fix(arrow-ipc): pad the IPC file magic to 8 bytes so the file embeds a valid stream #12334
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.35) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 163 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.305
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #12334"
general
weight: 0.35
Mola-maker
Which issue does this PR close?
Rationale for this change
The IPC file format is
ARROW1, padding to 8 bytes, then a valid IPC stream (spec). Since #5554,FileWriterpads the magic to the write alignment (64 bytes by default), so a stream reader starting at byte 8 sees zeros and fails with "Expected schema message, found empty stream." pyarrow fails the same way.What changes are included in this PR?
FileWriteralways pads the magic to 8 bytes.StreamWriter,StreamEncoderandwrite_messageoutput is unchanged, and there are no public API changes (unlike #6321, which added a parameter towrite_message).Are these changes tested?
Yes, a new test in
arrow-ipc/src/writer.rscovers alignments 8–64 and the legacy format.Are there any significant user-facing changes?
No API changes. Files written with alignment above 8 now embed a readable stream at byte 8; alignment-8 files are byte-identical.
AI usage disclosure
Written with help from Claude Code. I read the full diff and ran the new test locally; it fails on main and passes with this change.