Group page deltas into authenticated macro objects - #33
Closed
FujitsuPolycom wants to merge 1 commit into
Closed
Conversation
Per-file overhead dominated the 256K restore because physical delta objects followed the 256-token logical boundary. Page-delta manifest v2 stores ordered 64-MiB authenticated extents and reads or publishes them in bounded batches. Version 1 remains readable; cache identity, digest salts, logical chunk geometry, page sharing, and the page-tail namespace are unchanged. GPU-free tests cover exact restore, corruption, bounded memory, file count, compatibility, and capacity behavior.
This was referenced Aug 30, 2026
Owner
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.
Resulting behavior
Page-delta publication writes
sparkcache-page-delta-manifest/v2roots over ordered, content-addressed byte extents of at most 64 MiB. A 1,575,821,491-byte delta therefore uses at most 24 physical delta objects instead of the 1,024 objects implied by a 262,144-token logical boundary.Restore verifies every object digest, copies ordered batches into one authenticated delta buffer, verifies the complete delta digest, applies the page-semantic reconstruction, and verifies the reconstructed snapshot before placement. Reads retain at most four object payloads in addition to the assembled delta; publication retains at most two object payloads per durability batch.
The existing page codec still shares every byte-identical base page and writes only changed or extended page tails. A boundary inside an HMA page still replaces the complete intersecting page.
Technical reason
A recorded 262,144-token restore processed 1,024 delta chunks and took 5,842.236 ms. Storage read and verification consumed 4,437.355 ms, compared with 961.720 ms for host-to-device submission and 313.987 ms for CUDA synchronization. The eight-worker v1 reader still paid one open/read/hash lifecycle per 256-token-derived file and retained all decoded chunks before joining them.
The v2 physical layout removes the dominant per-file scaling without changing logical digest or admission geometry. Increasing the thread count cannot remove that object lifecycle cost.
Compatibility and cache namespace
Cache namespace impact: none.
CacheIdentity, digest salts, 256-token admission geometry, chunk geometry for flat snapshots, page codec bytes, andpage-tail-cow-v1remain unchanged.Schema impact: page-delta roots written by this source use
sparkcache-page-delta-manifest/v2. Version 1 page-delta roots remain fully readable and participate in capacity accounting, integrity sweep, invalidation, and reconstruction. Unknown schemas cleanly miss as incompatible. Concurrent v1 and v2 writers for one exact context cannot alias different bytes because manifest publication remains immutable and content-checked.Direct native placement from separate base and delta extents is unsupported by v2. Restore still materializes one authenticated delta buffer and the verified reconstructed snapshot before Python or native page placement.
Validation
python -m pytest sparkcache -q— 754 passed, 7 skippedpython -m pytest deploy -q— 108 passed, 1 skippedpython -m ruff check .— passedgit diff --check— passed9b8b2a6863d91f07354dab67d608cc15f551f1a5a7682b89873c7ae6ba468ee5No image was built or published. No serving process or host configuration was changed.
Composition with the recurrent-boundary contract
A dry integration with SparkCache pull request #31 head
9e779c32b285e00577a7829a75192069d12685dcpasses 759 SparkCache tests with 7 skips, 108 deployment tests with 1 skip, and Ruff. The code and regression changes merge without semantic conflict. Git requires three expected textual resolutions: the two deployment source-digest pins and the shared page-delta README paragraph.The combined deployable SparkCache source SHA-256 is
9fa4ee21963bc8756c43854847a42fe3c2094c3f21b5be47c6b220811f490456. A combined integration commit must write that digest todeploy/deepseek_v4/tp4_profile.jsonanddeploy/glm52_35bpw/profile.json.Pull request #31's vLLM contract receipt remains valid without regeneration: its contract SHA-256 is
45d7a92b38b836a4f829f02df85e339cfeea860e1080e4663a8340af6c125125, and the combined tree reproduces that hash. A SparkRing image integration must nevertheless regenerate its SparkCache source pin and image/source receipt against the combined commit, Git tree, and deployable source digest, and must use the pull request #31 contract SHA-256.