Skip to content

P2-C: Full Metroid Recalc (DELIVERS: graph maintenance) #31

@github-actions

Description

@github-actions

Why: Incremental fast insert is approximate; need periodic full recalc. Recalc batch size must be bounded by H(t)-derived maintenance budget to avoid blocking the idle loop.

  • P2-C1: Implement daydreamer/FullMetroidRecalc.ts

    • Query MetadataStore.needsMetroidRecalc(volumeId) for dirty volumes; prioritise dirtiest first
    • Load all pages in volume; compute pairwise similarities
    • Bound batch: process at most HotpathPolicy.computeCapacity(graphMass) pairwise comparisons per idle cycle (O(√(t log t)))
    • Select policy-derived max neighbors for each page; update MetadataStore.putMetroidNeighbors
    • Clear dirty flag via MetadataStore.clearMetroidRecalcFlag
    • Recompute σ(v) for affected nodes via SalienceEngine.batchComputeSalience; run promotion sweep
  • P2-C2: Add Metroid recalc test coverage

    • tests/daydreamer/FullMetroidRecalc.test.ts
    • Test dirty flag cleared after recalc
    • Test neighbor quality improved vs fast insert
    • Test batch size respects O(√(t log t)) limit per cycle
    • Test salience recomputed and promotion sweep runs after recalc

Exit Criteria: Dirty volumes are recalculated in background within bounded compute budget; salience updated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2: mediumMedium priority — targets v1.0layer: daydreamerBackground consolidation (LTP/LTD, recalc)

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions