Repository navigation
Delta: re-base onto the chain root instead of storing FULL at a chain's limits (#89) - #585
Merged
Merged
Conversation
…in's limits (#89) When a payload candidate's chain is at the role's depth cap, or would exceed a chain work budget with the new object on it (judged from the chain's stored record sizes, the same sums acquisition charges), selection now runs its one PREFIX trial against the FULL root of that chain instead of storing FULL. The replaced candidate is never reconstructed; the root is acquired and authenticated, and the root plus the target is held to the same budgets. The same rule applies to inode-table branch programs at the metadata depth cap or metadata budgets. Writer-only: the records are the existing PREFIX and branch COPY/INSERT forms, the reader and codec are unchanged. Counters: DeltaCounters.rebased and BranchCounters.rebased are new; depth_capped now counts candidates found at the cap (all re-based), and work_exceeded counts only budget refusals that stored FULL. Tests: the depth-cap and work-budget tests now assert the re-base (depth 1, one trial, rebased 1, no FULL) and read every version back through a fresh reader; new tests cover a chunk chain at its cap, one trial per dependent and a corrupt root failing the Save. Handbook sections 5.3, 5.4 and 6 updated. Production LOC: 139048 -> 139127 (delta +79); core 38677 -> 38756 (+79). Method: python3 tools/production_loc.py --root <git archive of parent HEAD> vs --root <git archive of the staged tree>, combined scope, same counter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces the offline-model figures with the diagnostic measured over the Storage save path (in-memory fixture, M03 sequence, one Save per Commit): edit-Commit pack bytes 2,585,612 -> 1,201,562; final-version reconstruction average 212,662 -> 260,555 canonical bytes, maximum 515,583 -> 520,575, inside the 524,288-byte budget. Production LOC: 139127 -> 139127 (delta 0); docs only. Method: python3 tools/production_loc.py on parent and staged tree. Co-Authored-By: Claude Opus 5.5 <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.
When a delta chain hits its canonical budget or depth cap, the one PREFIX trial now runs against the chain's FULL root instead of storing the object FULL. The same rule applies to inode-branch programs at the metadata depth cap. This is a writer-only change: no format change, codec untouched. On fs-storage-quick, Q2 edit payload is −58.7%, its Commit-9 FULL spike (67,666 → 12,534 B) is gone, and Q6
new_metadatais −19.4%.Fixes Ephemeral-AI-Lab/layerfs-project#89 (parent Ephemeral-AI-Lab/layerfs-project#84). Base:
layerfs_v2_0_0@b4fa173e40.Change
encoding/delta/select.rs:trial_basereads its chain cost from the stored record sizes, the same sums acquisition charges.chain_root, a walk bounded by the maximum depth.encoding/delta/branch.rs: a predecessor at the metadata depth cap or over budget is replaced by the whole branch at its chain root, which must fit the same budgets.rebased;depth_cappednow means "found at the cap" (every such candidate is re-based);work_exceededcounts only refusals that stored FULL.Production LOC: 139048 -> 139127 (delta +79, all core).
Tests
layerfs-storagefull suite passes.delta_depth_counts,chain_budget_scaling,delta_base_budgetandinode_branch_deltas. They assert the re-base: depth 1, one trial, no FULL. Every version reads back through a fresh reader, which shows today's reader accepts every record written.inode_branch_delta_custodyandsdk_large_file_budgetpass. clippy and rustfmt are clean.fs-storage-quick (campaign q89-c2, #89 only, against the pinned base baseline)
Read amplification (DIAGNOSTIC, in-process M03 save path): average final-version decode +22.5%, maximum 520,575 B, within the 524,288 B budget.
Contract notes:
🤖 Generated with Claude Code