Conversation
Each data type's definition declares the JSON shape of its fill value and the rules for one of that shape, and the v3 array validators judge a document's fill value against the data type the scope read. A field that is read keeps the fields it read inside, by location, so a struct judges each field's fill value by that field's own type. Assisted-by: ClaudeCode:claude-opus-5-5
…resolve kept The simplest spelling of a field that read spells each field it holds from its reading in `Resolved.nested`, rather than reading every subtree again at each level. A nested field of a field without problems has none, so the branch for one without a spelling could not be taken. Assisted-by: ClaudeCode:claude-opus-5-5
…see past unknown keys - The JSON check walks one frame per level of nesting, as `refine_json` does, so a fill value checked against a JSON-typed shape reads as deep as `refine_json` reads: a struct fill value 600 levels deep raised `RecursionError`. - The integer, float and complex fill value rules are partial applications of module-level functions, so a scope's definitions pickle again. - A key a fill value's shape does not declare is reported and left out, and the fill value rules still judge the rest, as `judge` does for a configuration. - A struct whose reading holds no reading of a field's type leaves that field's fill value unjudged. - `fill_value_problems` takes the reading of any data type, whatever its configuration's type. - `create_default` says that an overridden `data_type` needs its own `fill_value`. Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-opus-5-5
d-v-b
force-pushed
the
feat/zarr-metadata-fill-values
branch
from
September 28, 2026 07:55
1274ca0 to
4c24bb4
Compare
Documentation build overview
4 files changed± index.html± api/model/index.html± api/v3/data_type/index.html± api/v3/definition/index.html |
This was referenced Sep 28, 2026
Closed
d-v-b
marked this pull request as ready for review
September 28, 2026 07:59
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
The first of four pieces of layer 4, the field among fields, on top of layer 3 (#4436): a v3 array's
fill_valueis judged against itsdata_type. The other three pieces follow as draft PRs, each depending on the one before: 4b the grid against the shape, 4c the codec pipeline, 4d sharding.What a data type knows.
DataTypeDefinitiongainsfill_value, the JSON shape of a fill value as an annotation the checker reads (each module's existing<X>FillValuealias), andfill_value_rules(configuration, nested, value), what the spec disallows in a fill value of that shape. It mirrorsconfigurationplusrules: the type check stays declarative, the rules are plain functions in the extension's module. Every package data type has both:boola boolean;stringa string;"NaN","Infinity","-Infinity", or a hex string of the type's own width; complex a pair of those, judged by the component type's own rules;r16takes two);bytesbyte values or base64;"NaT";unknown_key).A data type that says nothing of its fill value takes any JSON, and one nothing in scope claims leaves its fill value unjudged.
What a read field keeps.
Resolved.nestedholds the fields a configuration holds, as the scope read them, by where each sits in the configuration: a struct's field types at("fields", i, "data_type"), a shard's codecs, a cast's target. A definition's functions receive it (Nested), which is how a struct reaches its field types.canonicalizenow spells nested fields from it rather than reading each subtree again.Where it is judged.
fill_value_problems(data_type, value)is public: not JSON is its first verdict, then the shape, then the rules, which see past a key the shape does not declare.validate_array_metadata_v3uses it, and sofrom_json,from_key_value,to_key_value, the pydantic types and each array in an inlineconsolidated_metadata.Breaking. A document whose fill value its data type refuses, which the package accepted, now has a problem at
fill_value:"NaN"onuint8,0onbool. Two tests did exactly that and now use a fitting type;create_defaultsays an overriddendata_typeneeds its ownfill_value.Choices worth a look
r<N>takes N/8 byte values. The spec's text saysN, butNcounts bits (r16is two bytes), which reads as a spec defect."AB==") is accepted, asbase64_bytesonmainaccepts it.boolfill judged by truthiness, integral floats and numeric strings for integers, float hex of any width,str()of anything forstring, a struct fill missing fields) and refusesr*entirely.Reviews. Two, with separate lenses. The correctness review compared 25,000 generated fill values against a reference written from the spec text (no mismatches) and found four bugs, each fixed with a test: the JSON check took two stack frames per level, so a struct fill value 350 deep raised
RecursionError(it now walks one frame per level, asrefine_jsondoes); the rule factories returned closures, so definitions stopped pickling (they are partial applications of module-level functions); an undeclared key hid the rules' findings; a hand-built struct reading withoutnestedraisedKeyError. The design review's changes are in too: one annotation-derived check that a definition's function members are functions,fill_value_problemsowning the JSON check, complex rules reusing the float rules, a plain-dictnested, and thecanonicalizecut above.The stack. Layers 0 (#4420, #4421, #4422), 1 (#4432), 2 (#4434) and 3 (#4436) have merged. This is 4a; 4b (#4441), 4c (#4442) and 4d (#4443) follow.
🤖 Generated with Claude Code