-
Notifications
You must be signed in to change notification settings - Fork 142
Open
Description
What happened?
Summary
There appears to be an internal contract mismatch in Vortex sparse encoding:
- slicing a
SparseArraypreserves a non-zero patch offset - serialized sparse metadata keeps that offset
- deserialization then asserts that sparse patches must start at offset
0
That makes some sliced sparse arrays unreadable after round-trip.
Relevant Code
SparseArray::slice() delegates to Patches::slice():
vortex-sparse/src/ops.rsvortex-array/src/patches.rs
Patches::slice() preserves the logical offset:
Some(Self {
array_len: range.len(),
offset: range.start + self.offset(),
indices,
values,
chunk_offsets,
offset_within_chunk,
})But SparseVTable::build() asserts offset must be 0:
assert_eq!(
metadata.0.patches.offset(),
0,
"Patches must start at offset 0"
);Observed Behavior
At read time we hit panics like:
assertion `left == right` failed: Patches must start at offset 0
left: 16384
right: 0
Steps to reproduce
- create a sparse array
DictArray- whose
codeschild is aSparseArray - the dict array is sliced with a non-zero row offset
- the sliced value is serialized and read back
- slice it with a non-zero start
- serialize it
- deserialize it
Environment
- Vortex version:
0.58.0 rustc:1.94.0 (4a4ef493e 2026-03-02)cargo:1.94.0 (85eff7c80 2026-01-15)
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels