spec: the message form's base encoding, envelope batch, quantization rule and terminal refusal; retain-unknown's recursive exclusion and record lifetime (#569, #570) - #575
Merged
Conversation
The shape paragraph names the facts its rows carry: base beside bits for the ranged integer kinds, min, max and res for the quantized float. Zigzag is defined where the base encoding is stated. A quantized index above count is rejected as the packet wire rejects it, never reconstructed and clamped, stated in the quantization paragraph, the ranged-offset paragraph, the damage list and the test row. A retained record discarded under a reset ancestor moves neither retain_lost nor retained, stated in the record lifetime paragraph, the report, the safety check and the test row. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
rowan-claude
pushed a commit
that referenced
this pull request
Sep 5, 2026
…e batch, and schema#571 (#530) Merges origin/main (#562, #564, #573) and lands the page's second round (#575) on both engines: a ranged base encoded by its kind's signedness, the quantized f32 row as min, max and res in float32 with the step count and the width derived by SPEC.md §4.3's rule, quantization in float32 with two roundings on each side, a refused first announcement terminal, and the Envelope over a union of the three messages as the batch vector (244 bytes, the singles at 52, 148 and 43, the announcement at 361). Unbounded arrays ride the C++ message wire with the count the data decides and the elements carved from the node's extent. schema#571's six findings are fixed with a vector and a control each: surplus elements decode into scratch (M1), a ranged 128-bit value is one arithmetic for measure, write and read (M2), a width above the kind's domain is refused in both shape parsers and the bit reader (M3), the Go engine writes the count as its offset from the minimum (M4), one quantization rule (M5), and the C++ reader clamps while wide and narrows after (M6). The bases unit (test/tables/Bases.schema) holds the vectors in both engines. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Lands the rulings on schema#569 and schema#570 on docs/SPEC-TABLES.md, with the figures that depend on them moved in docs/USAGE.md and docs/VERSIONING.md. Prose only.
#570, the message form (§3.3)
D1, the ranged base. The shape row for kinds 2 to 9 now encodes the base by the kind's signedness: zigzag LEB128 for the signed kinds 2 to 5, unsigned LEB128 for 6 to 9, both canonical on §3's rule, sixteen bytes for 18 and 19 as before. A normative paragraph after the shape table states it with the 2^63 case. Test row "The base's two encodings" pins four announcements as bytes with the recovered values:
[2^63, 2^63 + 1](base80 x9 01),[2^64 - 2, 2^64 - 1](baseFE FF x8 01),int32 [-5, 10](bits04, base zigzag09), anduint8 [7, 7](bits00, base07).D2, the batch. The envelope, not the fallback. The batch is three bodies of one root
Envelope { payload Payload }overunion Payload { login LoginRequest, match MatchResult, purchase StorePurchase }. A root is a table on this wire (§3), so the ruling's union rides as the one field of a table root, on §2.6's ownToolMessageshape. The envelope adds five entries tobackenddemo(the field at kind 15, three arms at kind 13, the table's name id in the tail), soEgoes 28 to 33 and every reference in the unit goes from 5 bits to 6. Every figure that depends on it moved, with the arithmetic shown bit by bit on the page:sku's align), file form 128 + 296 + 126 = 550, byte body 64 + 232 + 54 = 350.client_build max = 65535gives 50,price_minor max = 9999gives 41.USAGE.md and VERSIONING.md carry the new table and the over-by lines. The goldens section declares
PayloadandEnvelopein the corpus block and pinsbackend_roundat 244 with the three envelopes alone at 54 / 150 / 45.Quantization. The QUANTIZED shape is now
min,max,resas float32, which is what SPEC.md §4.3's rule takes, and the page states the rule in full:delta,count = ceil(delta / res)clamped to[1, 4294967040],bits_required(0, count), the writer's clamp, product rounded to float32,+ 0.5, floor, integer clamp, and the reader'sindex / count, product rounded to float32,+ min. The oldmin + index * stepwith an announced rounded step is gone. The round-trip paragraph names three cross-form value changes (mask width, names, quantized index) with the mask and the float as the two round-trip exceptions, and the §4 "whole list" sentence now says it lists §4's rows. Test row "The quantized index across the forms":[0, 10] @ 0.01carrying 0.005 (tie, index 1), 0.123 (off grid, 12), 11.0 (clamp, 1000), file codec againstserialize_compressed_float, and the6666 / 20000decode at0xC2055C2A.The refused first announcement. Refusal is terminal: a new bullet in the scope section, a sentence in the storm bullet, and test row "A refused first announcement" (refused as
vocabulary_too_large, then a valid one refusing assecond_announcement, then a body refusing asno_vocabulary).#569, retain-unknown (§6.6)
V2. The kind-17 exclusion row now covers a node index met anywhere in a recursively walked payload, rejecting the whole record for one
retain_lostand stating the sibling trade. The sentence claiming kind 17 never reaches the walk is replaced by the rule that the walk looks for it at every depth. Test row: an unknown outer table holding a nested pointer three bodies down beside an unknown scalar, retained nothing,retain_lostone.V3. New paragraph after the collision argument: a retained record belongs to the body occurrence that carried it and is discarded when a known ancestor is reset or replaced by a later legal occurrence (repeated table field, union arm written again, duplicate map key, keyed slot written again). Test row:
child { future = 7 }thenchild { known = 2 }, the save carrying nofuture.Applied, not decided
bits: the width derives from the triple by the rule, on the array row's precedent (min,maxderive the count width). A triple whosedeltaordelta / resis not finite, whoseminis not belowmax, or whoseresis not above zero is refused as a hostile shape, which is SPEC.md's non-conforming declaration meeting the page's existing "every width is checked before it is used". The hostile-shape test row gains those two cases.Silences, left as found
retain_lost, andretainedwas already incremented when they were kept. Not decided.counton the message wire. The page's existing ranged-offset rule (reconstruct and clamp, not damage) reads on it. The packet wire's read rejects. Not restated either way.tables/backend/Backend.schemadoes not yet declarePayloadandEnvelope, and the build version,backend_conn.binand the batch vector's manifest line are the codec PR's to re-pin, as the page already says of every form-2 golden. The manifest line kind for a batch vector is unchanged.🤖 Generated with Claude Code