Repository navigation
Conversation
XciD
force-pushed
the
feat/chunk-byte-sizes-in-reconstruction-term
branch
2 times, most recently
from
March 10, 2026 12:18
5aeeff9 to
0d63046
Compare
Optional uncompressed size of each chunk of a term, filled by CAS when the client asks for it. A client that caches the plan of a range (hf-mount) can then trim terms to chunk boundaries and derive the plan of a sub-range locally, without fetching whole terms. The field is skipped when empty, so older servers and clients are unaffected.
XciD
force-pushed
the
feat/chunk-byte-sizes-in-reconstruction-term
branch
from
October 4, 2026 08:30
0d63046 to
cc4e943
Compare
Add client.reconstruction_chunk_byte_sizes (HF_XET_CLIENT_RECONSTRUCTION_CHUNK_BYTE_SIZES, off by default). When set, RemoteClient adds ?chunk_byte_sizes=true to its V1 and V2 reconstruction requests, so that the CAS server fills the new field.
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.
Summary
chunk_byte_sizes: Vec<u32>toXorbReconstructionTerm: the uncompressed size of each chunk of the term's range, in chunk order. It is skipped when empty, so the wire format does not change for clients that do not ask.client.reconstruction_chunk_byte_sizes(HF_XET_CLIENT_RECONSTRUCTION_CHUNK_BYTE_SIZES, off by default). When set,RemoteClientadds?chunk_byte_sizes=trueto its V1 and V2 reconstruction requests.api_changes/update_261004_reconstruction_chunk_byte_sizes.md.Why
hf-mount (huggingface/hf-mount#246) reads files in bounded fetches of up to 32 MiB, one
FileReconstructoreach, and xet splits each fetch in 3 reconstruction queries (8 + 16 + 8 MiB). A sequential read therefore makes about 96 CAS queries per GiB (304 for a 3.09 GB file), where a single stream made 3 or 4 per file.hf-mount already caches reconstruction plans (
CachedXetClient) and can derive the plan of a sub-range from a cached plan, but without chunk sizes a derived plan keeps whole terms: up to a 64 MiB xorb range for a small read. With the sizes, the client trims terms at chunk boundaries as the server does. It can then ask for the plan of a window of up to 1 GiB once and derive the plan of each fetch in it locally: about 1 query per GiB instead of 96.History
This was closed in March together with xetcas#510, over the size of the field (one value per chunk, about 16K per GiB of range) and the server memory for large ranges. xetcas#510 now lists the sizes only for ranges up to 1 GiB, and hf-mount would ask for windows within that limit.