Repository navigation
Verify FixedSizeBinary FlatBuffers DType and align Serde deserializers - #12337
lwwmanning wants to merge 1 commit into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Merging this PR will improve performance by 16.79%Warning vortex-data has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed. 2 warnings
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
lwwmanning
left a comment
There was a problem hiding this comment.
Posted by Claude Opus 5.5 on Will's behalf.
Wire format note: nothing that Serialize or the FlatBuffers writer emits changes, but both readers now accept more. Will plans to review it by hand before approval.
- vortex-array/src/dtype/serde/flatbuffers/verify.rs line 68: since #12192, from_flatbuffer runs this verifier, and it rejected FixedSizeBinary as an unknown variant. So develop cannot open any file with a FixedSizeBinary column. Please say this in the description, because it is the most important user-facing fix here.
- vortex-array/src/dtype/serde/serde.rs lines 216 to 300: the hand-written DTypeVariant identifier visitor is what #[derive(Deserialize)] with #[serde(variant_identifier)] generates for a unit-only enum. Using the derive removes about 75 lines and the index table that must stay in step with Serialize.
- vortex-array/src/dtype/serde/mod.rs: the removed test_serde_union_dtype_json_roundtrip pinned the exact Union JSON. The Hegel test only checks that a value roundtrips, so a change to the serialized form of Union, Map or FixedSizeBinary would still pass. The token tests pin Union only for deserialization. Please keep the Union JSON golden, or use assert_tokens for it.
- Two removed tests, the FlatBuffers roundtrip and the nested-map JSON test, used a map keyed by a map. The draw_dtype generator only draws primitive keys (generate.rs line 69), so that case is now untested. The verifier's map key check depends on it. Drawing a non-nullable child key in draw_extended_dtype would restore it.
|
Addressed all four points in f655bef:
|
lwwmanning
left a comment
There was a problem hiding this comment.
Posted by Claude Opus 5.5 on Will's behalf.
Commit f655bef addresses my code points. The derived variant_identifier lists the variants in the order that Serialize numbers them, from Null at 0 to FixedSizeBinary at 13. So numeric identifiers keep their meaning. The Union JSON golden is back, and the generator now draws map keys that are not primitive. Will still plans to review the reader change by hand.
lwwmanning
left a comment
There was a problem hiding this comment.
Posted by Claude Opus 5.5 on Will's behalf.
Commits 19f3b0b and 3867eb7 resolve the earlier review. StructFields::new already panics on a length mismatch, so the new check only turns that panic into an error and rejects nothing that Serialize writes. The positional, mismatched length and corner case tests are short and cover the new reader paths.
Will still plans to review the reader change by hand.
lwwmanning
left a comment
There was a problem hiding this comment.
Review by Gemini 4 Carbon on behalf of @lwwmanning.
Each of the three fixes here addresses a real bug—and the FixedSizeBinary FlatBuffers verifier fix in vortex-array/src/dtype/serde/flatbuffers/verify.rs resolves a regression from #12192 that currently prevents opening any file with a FixedSizeBinary column. However, bundling three unrelated changes across four crates (+1,000/-414), plus test-only additions on untouched files, makes this too broad for a single squash-merged commit and holds up the #12192 regression fix.
Remediation Plan
Please split this into three focused single-crate PRs and tighten the generator/test scope:
- PR 1 —
vortex-array:DTypeFlatBuffersFixedSizeBinaryverification & Serde reader alignment (vortex-array/src/dtype/serde/flatbuffers/verify.rs,flatbuffers.rs,serde.rs,mod.rs, andvortex-array/src/dtype/generate.rs):- Move
DType::FixedSizeBinary(and arbitrary non-nullable child map keys) intodraw_dtypeinvortex-array/src/dtype/generate.rsinstead of only drawing them at depth 0 incoherence_tests::draw_extended_dtype. That way bothflatbuffers.rsandcoherence_testsexerciseFixedSizeBinarynested insideStruct/List/Map/Union(where lazyViewedDTypeparsing runs), anddraw_extended_dtypeindtype/serde/mod.rsonly needs to add registeredExtensiondtypes on top ofdraw_dtype.
- Move
- PR 2 —
vortex-arrow: ArrowDurationdictionary packing (vortex-arrow/src/executor/dictionary.rs):- Keep the
arrow_packs_dictionary+decode_to_dictionaryzero-copyInt64reinterpretation andsparse_duration_dict_slices_repack_to_arrow_dictionary(+90/-2). - Drop the unrelated test-only additions in
vortex-arrow/src/scalar.rs(+45) andvortex-functions/src/change_time_unit.rs(+45), where no production code changed.
- Keep the
- PR 3 —
vortex-mask: Canonical slice coalescing (vortex-mask/src/lib.rs,vortex-mask/src/tests.rs):- Extract
Mask::coalesce_slicesinfrom_slices_uncheckedandfrom_buffer_with_slicesalong with thevortex-mask/src/tests.rsupdates (+69/-8).
- Extract
Fixes a regression from #12192 where files containing FixedSizeBinary columns could not be opened because the DType FlatBuffers verifier rejected FixedSizeBinary as an unknown variant. Also aligns DTypeSerde variant indices, tuple/newtype deserialization, positional record decoding, and StructFields length validation with Serialize, and extends draw_dtype to generate nested FixedSizeBinary and arbitrary non-nullable map keys. Co-Authored-By: Antigravity <noreply@google.com> Signed-off-by: Will Manning <will@willmanning.io>
3867eb7 to
ece306f
Compare
Fixes a regression from #12192 where files containing
FixedSizeBinarycolumns could not be opened because theDTypeFlatBuffers verifier rejectedFixedSizeBinaryas an unknown variant. Also alignsDTypeSerdevariant indices, tuple/newtype deserialization, positional record decoding, andStructFieldslength validation withSerialize, and extendsdraw_dtypeto generate nestedFixedSizeBinaryand arbitrary non-nullable map keys across FlatBuffers, Proto, and JSON coherence tests.Assisted by Antigravity and Devin.