Skip to content

feat: add exact sparse checkpoint placement planner - #3

Merged
PhilipJohnBasile merged 1 commit into
codex/moe-dflash-integration-20260730from
codex/sparse-complete-state-checkpoints-20260811
Aug 11, 2026
Merged

feat: add exact sparse checkpoint placement planner#3
PhilipJohnBasile merged 1 commit into
codex/moe-dflash-integration-20260730from
codex/sparse-complete-state-checkpoints-20260811

Conversation

@PhilipJohnBasile

Copy link
Copy Markdown
Owner

Summary

  • add a pure-CPU exact sparse checkpoint placement planner based on the recurrence in Sparse Prefix Caching
  • add balanced and geometric-tail comparison policies plus a bounded exponentially decayed overlap histogram
  • make placement decisions with exact integer-scaled arithmetic for accepted real weights and deterministic reverse-lexicographic ties
  • add exact brute-force oracle coverage, block-alignment tests, dynamic-range regressions, and a no-MLX import gate

Scope

This is phase 1 only: planner and oracle infrastructure. It does not change SessionBank capture, restore, placement, SSD, cache ownership, or runtime defaults, and it makes no M5 speed claim.

The architecture audit found that MTPLX already has hybrid snapshots and geometric recurrent boundaries. Runtime integration should therefore modify the existing SessionBank path only after real overlap traces show that an optimal oracle beats the incumbent policy. Separate pre-existing exactness/identity/lifecycle gaps must be fixed before any complete-state release claim.

Follow-up GO gate: equal-byte-budget trace replay must beat the incumbent geometric policy by at least 10%, with a paired 95% lower bound above zero and wins in at least two non-append overlap buckets. Only then should an opt-in M5 runtime experiment begin.

Verification

  • python -m pytest tests/test_checkpoint_placement.py — 28 passed
  • independent exact oracle — 777,128 cases passed, including blocked positions, ties, subnormals, max-finite floats, and 400-digit integers
  • former review failures fixed:
    • (10**16, 10**16, 1), budget 1 → (2,)
    • (2, 3, 2), budget 2 → (1, 2)
  • Ruff check and format — passed
  • py_compile and git diff --check — passed
  • 128K depths / budget 8 / block 256 — 0.234 s CPU sanity measurement
  • wheel and sdist build — passed; Twine checks passed; wheel contains mtplx/checkpoint_placement.py
  • independent frozen-diff Sol review — approved with no blockers

Relationship

Follow-up implementation work from #2. Kept separate so the evidence-only research PR remains unchanged.

@PhilipJohnBasile

Copy link
Copy Markdown
Owner Author

Exact-head public build receipt: release run 31492969642 passed on 8915442da1981185d76473dc7460c1d9aaa4259b. The build, Twine checks, fresh-venv smoke, and artifact upload passed; PyPI publication was intentionally disabled.

@PhilipJohnBasile
PhilipJohnBasile marked this pull request as ready for review August 11, 2026 17:04
@PhilipJohnBasile
PhilipJohnBasile merged commit 5df9af9 into codex/moe-dflash-integration-20260730 Aug 11, 2026
2 checks passed
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.

1 participant