Commit 9628172
feat: optional RAM promotion for octad acceleration
Tiered storage with per-modality RAM promotion/demotion.
DISABLED by default. EXPLICIT opt-in only.
Constraints:
- Max 2 octads promoted simultaneously (crash safety)
- Max 5 minutes in RAM before forced demotion
- Only if estimated speedup >= 2x (MIN_SPEEDUP_FACTOR)
- RAM budget enforced (default 1GB)
- All data ALWAYS on disk via WAL — RAM is read cache only
- WAL on disk is source of truth, never tmpfs
- On crash: WAL replays, RAM overlay lost, zero data loss
API:
- PromotionManager::new() — disabled by default
- enable(budget) / disable()
- decide(modalities, data_size, disk_time, ram_time) → Promote/Skip/Blocked
- promote(modality, size) / demote(modality) / demote_all()
- enforce_timeouts() — auto-demotes expired promotions
- history() — full promotion/demotion event log
8 tests: disabled default, enable+promote, max-2 limit, demote frees slot,
RAM budget enforcement, speedup threshold, demote_all, history tracking.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 5bb3b94 commit 9628172
2 files changed
Lines changed: 476 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
0 commit comments