docs(xet): correct shard/xorb format specs and stale client defaults - #2742
Open
rajatarya wants to merge 1 commit into
Open
docs(xet): correct shard/xorb format specs and stale client defaults#2742rajatarya wants to merge 1 commit into
rajatarya wants to merge 1 commit into
Conversation
Aligns the public Xet specs with xet-core v1.6.0, which is the ground truth for all five changes. shard.md - CASChunkSequenceEntry: split the trailing 8-byte `_unused` into `flags: u32` + `_unused: u32`. `flags` is real and load-bearing — it carries MDB_CHUNK_WITH_GLOBAL_DEDUP_FLAG (1 << 31). Adds a bitfield table and a reserved-bit masking rule. - MDBShardFileFooter: document all 17 fields. The two `_buffer` spans masked nine real fields — six lookup offsets/counts and three accounting totals. Renames `cas_info_offset` to `xorb_info_offset` to match source. Total stays 200 bytes, so no offset shifts. - Document the three lookup tables: truncated (first 8 bytes) hash keys, index values, per-entry sizes, and the rule that a truncated match must be confirmed against the full hash. - Add the lookup tables to both layout diagrams, and correct the CAS info section's stated end boundary, which is its bookend rather than footer_offset now that tables may sit in between. - Correct the footer deserialization step that said to read every field as u64; the HMAC key is 32 bytes and `_buffer` is 48. xorb.md - Replace "no explicit limit on the number of chunks" with the 8192-chunk cap (MAX_XORB_CHUNKS), scoped correctly: it is producer-side cut logic, not a wire-format or server-enforced limit. - Document the XorbObjectInfo footer and the trailing info_length u32 — previously absent entirely, which left readers no documented way to locate the footer. Includes the uniqueness nonce (leading 4 of the 16-byte buffer), and that it is excluded from the xorb hash, so identical content need not serialize to identical bytes. api.md - /v2/shards falls back to /v1/shards on 404 or 501, not 404 alone. The sibling note for reconstructions already said 404 or 501. using-xet-storage.md - Three stale defaults: AC initial upload concurrency 1 -> 2, initial download concurrency 1 -> 4, read timeout 120s -> 300s. Byte-layout diagrams were regenerated programmatically and their offset rulers verified against column borders. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V9zKbiUwGKaZFVH2oWwFeE
Contributor
Author
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
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.
Aligns the public Xet specs with xet-core
v1.6.0, which is the ground truth for every change here. Five findings from the xet doc-drift audit (open drift issues) — tracked as #1045, #1152, #1176, #1247, #1264.Each change is described below, so the PR is self-contained for review.
docs/xet/shard.md(#1045)The involved one — two layout-level drifts, both field-labeling rather than size changes, so no byte offsets shift.
CASChunkSequenceEntry: the trailing 8-byte_unusedis actuallyflags: u32+_unused: u32.flagsis load-bearing — it carriesMDB_CHUNK_WITH_GLOBAL_DEDUP_FLAG(1 << 31), which marks a chunk eligible for global dedup. Adds a bitfield table and a rule that readers mask undefined bits rather than compare for equality. Entry stays 48 bytes.MDBShardFileFooter: documented 9 fields; source has 17. The two_bufferspans masked six lookup offset/count fields (bytes 24–72) and three accounting totals (bytes 168–192). Footer stays 200 bytes.cas_info_offset→xorb_info_offsetto match source, with a note recording the old name. The section it points at is still called the CAS Info Section here.u64) and values are indices, not byte offsets — so a match is inconclusive and must be confirmed against the full hash. Also documents per-entry sizes and that a0count means the table is absent.footer_offset, now that tables may sit between), and footer deserialization can't read every field asu64(the HMAC key is 32 B,_bufferis 48 B).docs/xet/xorb.md(#1176, #1264)MAX_XORB_CHUNKS), scoped precisely: it's producer-side cut logic in the reference client, not in the wire format and not server-enforced. This is the reconciliation the issue asks for — internal docs presented 8192 as a hard maximum while this doc said there was no limit; neither was quite right.XorbObjectInfofooter and the trailinginfo_length: u32, previously absent entirely, which left readers no documented way to locate the footer (the old diagram's trailing...read as "more chunks"). Adds the reader entry point (end - 4, length excludes itself), the fixed-size tail layout, and the uniqueness nonce — leading 4 bytes of the 16-byte buffer, excluded from the xorb hash, so identical content need not serialize to identical bytes. Pre-nonce xorbs carry an all-zero buffer and stay valid.docs/xet/api.md(#1247)One-line fix:
/v2/shardsfalls back to/v1/shardson a404or501, not404alone. A client built strictly from the old text would treat501as fatal, and501is classed as permanent so no retry papers over it. The sibling reconstruction note already said "404 or 501", so the two notes in this file disagreed. Also notes that the reference client caches the detected version per session.docs/hub/xet/using-xet-storage.md(#1152)Three stale defaults:
HF_XET_CLIENT_AC_INITIAL_UPLOAD_CONCURRENCY12HF_XET_CLIENT_AC_INITIAL_DOWNLOAD_CONCURRENCY14HF_XET_CLIENT_READ_TIMEOUT120s300sVerification
xet-core v1.6.0source rather than taken from the issue text. Two issues were stale and corrected in the process: Update model-card-guidebook.md #1264 calls the footerCasObjectInfo, a name no longer in source (XorbObjectInfoV1), and Improve search on papers page #1176's original "debug-assert only" framing understates the cap, which is real release-path cut logic.shard.mdhad 9 diagrams whose offset rulers didn't line up with their borders onmain; this branch has 6. The 3 fixed are the ones regenerated here; none were introduced.Deliberately out of scope
Broader
CAS*→Xorb*terminology alignment acrossshard.md(section headings,CASChunkSequenceHeader, bookend prose). Onlycas_info_offsetis renamed, because it's a field name clients bind to; the rest is prose and a larger public-terminology decision.Note
Low Risk
Changes are documentation only; they correct spec drift and env-var defaults without altering runtime code or deployed behavior.
Overview
Documentation-only update to match xet-core v1.6.0 and fix doc drift across Hub env vars and Xet wire-format specs.
shard.mdexpands the shard layout: optional lookup tables after the CAS info section; footer documentsxorb_info_offset(renamed fromcas_info_offset), six lookup offset/count fields, and accounting totals;CASChunkSequenceEntrynow exposesflags(including global-dedup) instead of an 8-byte_unusedfield; parsing notes clarify CAS info ends at the bookend and footer field types.xorb.mdadds the 8192-chunk producer cap (not wire/server enforced), theXorbObjectInfofooter with trailinginfo_length, and the uniqueness nonce behavior relative to the xorb hash.api.mdstates clients should fall back from/v2/shardsto/v1/shardson404or501, with per-session version caching.using-xet-storage.mdupdates documented defaults: initial upload concurrency 2, download 4, read timeout 300s.Reviewed by Cursor Bugbot for commit bc810d6. Bugbot is set up for automated code reviews on this repo. Configure here.