Repository navigation
Conversation
…gular sizes) - rectilinear: the zarr-extensions spec says "The sum of the edge lengths MUST equal or exceed L. Overflowing L by multiple chunks is permitted." An exact sum was required, rejecting e.g. documents zarr-python writes after shrinking an array. - regular: the spec says "Chunk sizes must be greater than zero"; 0 and negative chunk_shape entries were accepted (and a 0 size silently satisfied sharding divisibility). Assisted-by: ClaudeCode:claude-opus-5 Co-Authored-By: Claude Opus 5 <[email protected]>
JSON.parse rounds 2^63 and 2^63 - 1 to the same double, so an out-of-range int64/uint64 fill value (data-types spec: "within the representable range of the data type") was indistinguishable from a valid one and passed. - decodeStoreJson(text | bytes): JSON.parse, but integer literals beyond Number.MAX_SAFE_INTEGER decode to bigint via reviver source-text access (Node >= 21; rounds as before elsewhere). loadStoreJson uses it. - bigint is a JSON integer: JSONValue, validateJson, dimension sequences. - dumpStoreJson writes bigints as exact integer literals. - Integer fills are range-checked exactly with bigint bounds; float and numpy temporal fills accept bigints. Rounded number fills keep the lenient double comparison so valid extremes aren't rejected. Assisted-by: ClaudeCode:claude-opus-5 Co-Authored-By: Claude Opus 5 <[email protected]>
Per the zarr-extensions READMEs (pinned commit 4da7b37): - struct: "Field names MUST be unique"; "Variable-length data types (e.g. "string") MUST NOT be used as field types"; core data types "MUST be a string". Duplicates previously made the fill check go silent instead of reporting. Descriptors gain a configIssues hook, applied recursively through nested struct fields. - numpy.datetime64/timedelta64: fill "within the range [-2^63, 2^63 - 1]" or "NaT"; any integer was accepted. Assisted-by: ClaudeCode:claude-fable-5-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
🤖 AI text below 🤖 Third commit, from checking the interpreted zarr-extensions data types against their READMEs (pinned commit
|
The structural v2 validators (corpus-governed, Python parity) accept any string as dtype and any JSON as fill_value. The v2 spec is stricter: "The byte order MUST be specified"; datetime/timedelta types "MUST also include the units"; float fills "MUST" use "NaN"/"Infinity"/"-Infinity"; fixed-length byte string and structured fills "MUST be encoded as an ASCII string using the standard Base64 alphabet". validateSemanticsV2 / validateArraySemanticsV2 apply these (plus NumPy item sizes, integer ranges, int64-or-"NaT" temporal fills, and structured-dtype field rules), mirroring the TS-only v3 layer; the consolidated form walks .zmetadata's .zarray entries. Assisted-by: ClaudeCode:claude-fable-5-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
🤖 AI text below 🤖 Fourth commit: a v2 semantic layer (
Plus NumPy's item sizes per kind ( This removes the "v2 dtype grammar / fill encodings unchecked" items from the not-addressed list. Remaining there: codec kind/order in the library, |
Two structural v2 rules were stricter than the spec:
- .zarray extra members were rejected. The spec: "Other keys SHOULD NOT be
present within the metadata object and SHOULD be ignored by
implementations" — a recommendation, unlike .zgroup's "Other keys MUST
NOT be present". Extras are now tolerated structurally and reported by
the v2 semantic layer as advisories.
- filters: [] was rejected ("expected at least one filter"). The spec:
"A list of JSON objects providing codec configurations, or null" — an
empty list is a list; zarr-python only warns on it.
Corpus cases 5 and 8 of conformance/v2_array.json now expect no problems.
Per conformance/README.md the corpus changes first: the Python reference
implementation's conformance run is red until it follows.
Assisted-by: ClaudeCode:claude-fable-5-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
🤖 AI text below 🤖 Fifth commit: a conformance corpus change, per the corpus-first workflow in
TS follows in the same commit ( CI on this PR is red by design until the Python package follows:
|
|
🤖 AI text below 🤖 The Python side of the corpus change is up: zarr-developers/zarr-python#4365. Against that checkout, |
|
🤖 AI text below 🤖 Corpus audit note: |
Commit-pinned zarr-specs / zarr-extensions permalinks with line ranges, so each citation points at the exact sentence. Assisted-by: ClaudeCode:claude-fable-5-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Assisted-by: ClaudeCode:claude-fable-5-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Assisted-by: ClaudeCode:claude-fable-5-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
🤖 AI text below 🤖
Fixes from a spec-compliance audit against zarr-specs (
fc7dd9c) and the zarr-extensions rectilinear README. Every change is in the TS-only semantic layer or the JSON value model. The Python conformance corpus is untouched (67/67 still pass).Changes
Rectilinear grid was too strict (
src/chunk-grid/rectilinear.ts). The spec says "The sum of the edge lengths MUST equal or exceedL. OverflowingLby multiple chunks is permitted." The library required an exact sum, so it rejected documents zarr-python writes afterresizeshrinks an array. It now reports only sums below the extent.Regular grid was too lax (
src/chunk-grid/regular.ts). The spec says "Chunk sizes must be greater than zero."chunk_shapeentries of 0 or less passed, and a 0 even silently satisfied the sharding divisibility check. Each such entry is now reported, and the grid is no longer used when checking sharding divisibility.int64/uint64 fill ranges were unverifiable.
JSON.parserounds 2^63 and 2^63 - 1 to the same double, so an out-of-range fill passed.decodeStoreJson(text | bytes)parses likeJSON.parse, but integer literals beyondNumber.MAX_SAFE_INTEGERbecomebigint. It uses the reviver'scontext.source(Node ≥ 21); on older runtimes such literals round as before.loadStoreJsonuses it.bigintis now a JSON integer inJSONValue,validateJsonand dimension sequences.dumpStoreJsonwrites bigints as exact integer literals.JSON.stringifyalone throws on them.JSON.parse, keep the old lenient double comparison, so a valid max int64 is never rejected.decodeStoreJson.The two changesets are patch (grids) and minor (bigint).
Not addressed (from the same audit)
bytesendianisn't required for multi-byte types.index_codecsis never walked.dtypegrammar and fill encodings aren't checked..zarrayextra keys are errors although the spec says SHOULD NOT; changing that needs a corpus and Python change.filters: []is rejected.Test plan
just check: typecheck, vitest (147), and Python conformance (67/67)decodeStoreJson→ rejection of 2^63decodeStoreJson/dumpStoreJsonround-trip🤖 Generated with Claude Code