Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixes

- (constants) fix memmaps types correctly, by inferring from constant_schema.

### Removed

## [0.1.15] - 2026-03-25
Expand Down
9 changes: 6 additions & 3 deletions src/plaid/storage/common/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,12 @@ def save_constants_to_disk(path, constant_schema, flat_cst):
arr = np.asarray(value)
assert arr.ndim == spec["ndim"]

# FORCE contiguous + little-endian
arr = np.ascontiguousarray(arr)
arr = arr.astype(arr.dtype.newbyteorder("<"), copy=False)
# Enforce schema dtype (e.g. float32 for floating leaves),
# little-endian, contiguous. This keeps constants aligned
# with the dtype declared in constant_schema.yaml (and with
# the variable side, which is stored as float32 for floats).
target_dtype = np.dtype(spec["dtype"]).newbyteorder("<")
arr = np.ascontiguousarray(arr, dtype=target_dtype)

f.write(arr.tobytes(order="C"))

Expand Down
Loading