Skip to content

Belt SCM capture: read each re-bound object shard once (recapture 30x re-read) - #13616

Closed
gunbai-bot[bot] wants to merge 2 commits into
mainfrom
session/deep-boar-718
Closed

gunbai-bot[bot] wants to merge 2 commits into
mainfrom
session/deep-boar-718

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Chain re-derivation (DESIGN §6b)

Repeated demand originates in belt_scm_delta_bind_text → belt_scm_delta_resident_for → materialize_if_rostered, called per re-bound path in the tick fold, the recapture (committed-revision) fold and the BaseAdvance fold. materialize_objects reads a whole shard to admit one demanded member, so a shard holding k re-bound objects was read k times — matching srv2's 30/24/13 reads. The earliest boundary that re-demands: the per-path bind. The change population is known once its bytes are read.

Fix (carry, not cache)

  • Bytes are read first (belt_scm_worktree_texts for the tick; belt_scm_advance_texts for recapture and advance).
  • belt_scm_rebind_fold derives one demand from the whole population (belt_scm_rebound_identities) → one materialize_objects plan (dedups shards) → pure belt_scm_advance_fold.
  • Deleted belt_scm_delta_fold_step, belt_scm_delta_fold_step_at_revision, belt_scm_delta_resident_for; tick and recapture now share one fold with the advance (shared mint ⇒ tick had the same defect, fixed together).

Control

a_rebound_population_plans_each_shard_once: population demand = 1 shard; same identities one-at-a-time = k.

Not verified here

No local build (CI-sized). The srv2 before/after Filesystem.Read counts and wall time still need a run of belt_scm_recapture_cli on srv2; remaining single-identity reads (tip/base root, candidate manifest if already persisted) are one each and unchanged. Relies on CI for compile + witnesses.

🤖 Generated with Claude Code

Brian Searls and others added 2 commits October 9, 2026 05:40
…once, not per path

The delta fold, the base advance and recapture each called materialize_if_rostered per
re-bound path; materialize_objects reads a whole shard to admit one member, so a shard
holding k re-bound objects was read k times (30x on srv2). The bytes are now read first
(one reader shared by tick worktree / committed revision / advance), the persisted
objects they may shadow are demanded together through one materialize_objects plan, and
the fold is pure. Deletes belt_scm_delta_fold_step{,_at_revision}; adds a plan control.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… it)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

review 78241: confirmed — I dropped the materialize_if_rostered import but the manifest readback still calls it (base-advance and delta-capture). Restored in 57794d9. — sent from deep-boar-718

@gunbai-bot
gunbai-bot Bot added this pull request to the merge queue Oct 9, 2026
@gunbai-bot
gunbai-bot Bot removed this pull request from the merge queue due to a manual request Oct 9, 2026
@gunbai-bot

gunbai-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #13641 at 634453d: this PR's head is an ancestor of integration/v1-closeout. The source branch is kept for archaeology; this PR is no longer an independent merge authority. — sent from neat-wolf-604

@gunbai-bot gunbai-bot Bot closed this Oct 9, 2026
@gunbai-bot gunbai-bot Bot mentioned this pull request Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants