feat(skippy): wire benefit admission into L3 serving - #1856
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (14)
📝 WalkthroughWalkthroughThe change adds benefit-based L3 admission. The server supplies cold-prefill and restore costs. The cache tracks reuse, delays measured candidates in probation, promotes recurring entries, evicts selected manifests, and reports new activity counters. ChangesBenefit-based L3 admission
Estimated code review effort: 4 (Complex) | ~45 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant GenerationServiceEstimator
participant KvStageIntegration
participant L3Tier
participant L3CacheManager
GenerationServiceEstimator->>KvStageIntegration: provide estimated prefill cost
KvStageIntegration->>L3Tier: restore or spill with cost
L3Tier->>L3CacheManager: observe restore or memory hit
L3CacheManager-->>KvStageIntegration: admission or rewarm decision
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request is currently a draft. Reviews will not take place until the PR is marked as ready for review. |
Problem and resulting behavior
The benefit-per-exclusive-byte policy on #1838 was pure library code with no serving caller. Durable L3 writes and capacity eviction therefore remained unconditional reference-aware LRU.
This stack wires measured benefit admission into local OpenAI exact-state serving. Once a stage has a real L3 restore sample, new candidates use the generation service estimator's cold-prefill cost and the stage restore-cost EWMA. First-seen entries remain in L1 probation, two observed reuses promote them to L3, and disk pressure asks the shared node manager for the lowest-benefit inactive manifests before the store's hard-budget reservation. Segment references receive fractional shared-byte accounting, manifest bytes are charged exclusively, and active pins remain protected.
When timing data is unavailable, the writer deliberately keeps the existing LRU write-through behavior. This covers startup, binary serving, and any sparse or invalid telemetry rather than allowing the policy to suppress caching without comparable cost data.
The existing L3 status activity object now exposes probation, persistence, fallback, and policy-eviction counters.
Validation
Validated at exact head
589df86ef70b4aa67cee8376be5a833e64ceea54:cargo test -p skippy-cache --lib— 266 passed, 2 ignoredcargo test -p skippy-server --lib— 745 passed, 3 ignoredcargo clippy -p skippy-cache -p skippy-server --all-targets -- -D warningscargo fmt --all -- --checkjust ci-validate— 1,453 passed, 9 skippedThis remains a draft until the required Thoughtworks and c64/c128/c256 serving traffic compares benefit admission against reference-aware LRU.
Summary by CodeRabbit
New Features
Documentation