Skip to content

Batch retained trie writes by page, leaf, and dependency depth #851

Description

@flyingrobots

Symptom

The corrected v19 reference benchmark still opens 641 Git children for a cold materialization and 349 for an incremental materialization. The cold census includes 233 hash-object, 66 commit-tree, 67 symbolic-ref, and 67 update-ref operations.

Root cause

TrieFlusher writes each dirty leaf and branch individually through TrieStorePort. GitCasTrieStoreAdapter turns one leaf into one page write followed by one bundle write, while GitCasMaterializationWorkspace serializes every stage operation. The current port documentation explicitly excludes batch writes, so git-warp cannot express the natural dependency waves now supported by git-cas.

Required behavior

  • Extend the semantic storage boundary with bounded ordered leaf and branch batch operations while retaining per-item fallbacks.
  • Stage dirty leaf pages in bounded batches, then stage their leaf bundles in bounded batches.
  • Stage branch bundles in descending dependency-depth waves so every child handle exists before its parent wave.
  • Consume git-cas workspace pages.putBatch() and bundles.putOrderedBatch(); do not expose raw Plumbing sessions to domain code.
  • Preserve byte-identical roots, deterministic order, structural sharing, typed failure behavior, and bounded memory.
  • Prove fallback compatibility for custom stores and staging ports that only implement the existing singleton methods.
  • Recalibrate the reference performance policy in CI and rerun the current-Think witness against released packages.

Acceptance evidence

  • Golden singleton-versus-wave root identity for empty, leaf-only, split, and multi-depth dirty tries.
  • Exact call-count tests for page, leaf-bundle, and per-depth branch waves.
  • Bounds, wrong-cardinality, cancellation, and earliest-failure tests.
  • Counterbalanced base/head CPU, Git-command, memory, and oversized-streaming gates.
  • Materially lower cold and incremental Git child counts than 641 and 349 with identical semantic fingerprints.

Depends on git-stunts/git-cas#120.

Activity

  1. added this to the v19.1.0 milestone on Aug 24, 2026
  2. added
    type:featureNew capability or product behavior.
    priority:asapImmediate release pressure.
    status:activeSomeone is actively working this issue.
    area:storagePrimary work area: storage.
    status:blockedBlocked by an explicit dependency or external condition.
    and removed
    status:activeSomeone is actively working this issue.
    on Aug 24, 2026
  3. flyingrobots commented on Aug 24, 2026

    @flyingrobots
    MemberAuthor

    Temporarily blocked on #849 / #855. The batched-write branch is preserved; the release gate first needs a calibrated multi-patch corpus so its next base/head comparison measures real causal depth. Resume this issue immediately after #855 lands.

  4. added
    status:activeSomeone is actively working this issue.
    and removed
    status:blockedBlocked by an explicit dependency or external condition.
    on Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:storagePrimary work area: storage.priority:asapImmediate release pressure.status:activeSomeone is actively working this issue.type:featureNew capability or product behavior.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions