Skip to content

[WIP] refactor(scheduler): unify hybrid cache model boundaries.#243

Open
SimonCqk wants to merge 2 commits into
lightseekorg:mainfrom
SimonCqk:feat/hybrid-cache-abstraction
Open

[WIP] refactor(scheduler): unify hybrid cache model boundaries.#243
SimonCqk wants to merge 2 commits into
lightseekorg:mainfrom
SimonCqk:feat/hybrid-cache-abstraction

Conversation

@SimonCqk
Copy link
Copy Markdown
Contributor

@SimonCqk SimonCqk commented May 25, 2026

Motivation

The scheduler path previously mixed scheduling logic with Mamba and paged-cache-specific lifecycle details. This refactor makes the scheduler depend on
a smaller cache lifecycle surface while keeping concrete family behavior inside the hybrid cache layer.

This is intentionally a concrete module split, not a broad virtual CacheFamily framework or universal allocator.

Summary

  • Make HybridPrefixCache the concrete lifecycle boundary for MatchPrefix, Admit, StepCommit, FinishRequest, and Stats.
  • Add family-oriented types for registry, recovery plan, resource demand, and lifecycle requests/results.
  • Split implementation into internal family modules: family_registry, mamba_family_ops, paged_cache_family_ops
  • Move Mamba / paged-cache admission, match augmentation, publication, metadata, and cleanup logic out of scheduler/FSM code.
  • Add/adjust tests around durable facade behavior instead of intermediate phase helpers.

Test Plan

  • Focused hybrid/Mamba/PagedCache tests: 69 passed
  • Full scheduler C++ tests: 210 passed
  • Regression test report Ongoing :
    • Accuracy
    • Multi-turn cache hit ratio

@SimonCqk SimonCqk requested a review from a team as a code owner May 25, 2026 03:21
@SimonCqk SimonCqk removed the request for review from a team May 25, 2026 03:21
@SimonCqk SimonCqk changed the title refactor(scheduler): unify hybrid cache model boundaries. [WIP] refactor(scheduler): unify hybrid cache model boundaries. May 25, 2026
SimonCqk added 2 commits May 25, 2026 11:56
Unify the scheduler-facing hybrid cache lifecycle around HybridPrefixCache so
scheduler/FSM code calls lifecycle methods instead of spelling Mamba and
paged-cache choreography directly.

Add the family registry/recovery/lifecycle request types, RequestCacheContext,
and focused diagnostics/stat helpers needed for the unified cache model. Split
family-specific implementation into registry, Mamba, and paged-cache modules,
while keeping concrete allocator semantics and avoiding a broad virtual family
framework.

Consolidate tests around durable facade behavior: request-local accounting,
Mamba slot release/protection, worker metadata propagation, paged-cache matching,
admission, eviction, and registry behavior.

Signed-off-by: SimonCqk <cqk0100@gmail.com>
Signed-off-by: SimonCqk <cqk0100@gmail.com>
@SimonCqk SimonCqk force-pushed the feat/hybrid-cache-abstraction branch from 8590a0d to 0bb1c85 Compare May 25, 2026 03:58
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