Releases: albert-einshutoin/quant-cache
v0.3.0 — Policy IR, Search Engine, Deployment Scaffolds
quant-cache v0.3.0
Economic cache control plane — Phase B-D release.
New: Policy Intermediate Representation (Phase B)
Declarative cache policy configuration as JSON/TOML:
{
"backend": "sieve",
"capacity_bytes": 50000000,
"admission_rule": { "type": "score_threshold", "threshold": 0.5 },
"bypass_rule": { "type": "size_limit", "max_bytes": 10485760 },
"prewarm_set": ["/images/hero.jpg"],
"ttl_class_rules": [
{ "content_type_pattern": "image/", "ttl_seconds": 7200 }
]
}qc policy-eval --input trace.csv --policy config.json --preset ecommerce
New: Policy Search Engine (Phase C)
Automatic search over backend × admission × bypass × prewarm × TTL class rules:
qc policy-search --input trace.csv --capacity 50M --preset ecommerce
New: Deployment Scaffold Generators (Phase D)
qc compile --target cloudflare— Cache Rules + Workers scriptqc compile --target cloudfront— CacheBehaviors + CloudFront Functionsqc compile --scores policy.json— populate admission scores from optimizer
New Tests
11 new tests for PolicyIR (serde round-trip, equivalence, admission, bypass, prewarm).
CLI Commands (10 total)
import, generate, optimize, simulate, compare, calibrate,
policy-eval, policy-search, compile, help
Full Changelog
v0.2.0 — QUBO Solver, Belady, Calibration, CloudFront Import
quant-cache v0.2.0
Major feature release completing V1.1 through V2.0 milestones.
New Features
V1.1: CDN Log Import
qc import --provider cloudfront— convert CloudFront access logs to canonical trace CSVOriginCostConfigwith fallback chain (rule → content-type → latency → global default)ProviderLogParsertrait for future provider extensions
V1.5: Belady Oracle & Calibration
- BeladyPolicy: optimal eviction oracle using pre-indexed future access map
qc compare --include-belady— hit-rate ceiling comparisonqc calibrate: automatic coefficient tuning (coordinate descent + random restarts)- Optimizes replay estimated_cost_savings on validation set
- Outputs calibrated TOML config + sensitivity report
V1.6: Reuse Distance
reuse_distance::compute_reuse_distances()— stack distance distribution per objectObjectFeaturesextended withmean_reuse_distance,p50,p95
V2.0: QUBO with Simulated Annealing
qc optimize --solver sa— simulated annealing for quadratic optimizationQuadraticProblemwith sparsePairwiseInteractionlistco_access::extract_co_access()— time-window co-occurrence counting--co-access-window-msand--co-access-top-kflags- SA with co-access bonus outperforms greedy on heterogeneous traces
CLI Commands (7 total)
qc import Import CDN provider logs
qc generate Generate synthetic trace data
qc optimize Optimize cache policy (greedy/ilp/sa)
qc simulate Replay trace against policy
qc compare Compare against baselines (LRU/GDSF/Belady/ILP)
qc calibrate Auto-tune economic parameters
qc help Help
Full Changelog
v0.1.0 — Initial Release
quant-cache v0.1.0
Economic CDN cache optimization engine.
What it does
Formulates CDN cache admission as a 0-1 knapsack problem maximizing expected economic benefit (latency savings + origin cost reduction) under capacity and freshness constraints.
Highlights
- Scoring: per-object expected benefit with Poisson-based stale probability model
- Solvers: GreedySolver (O(n log n)) + ExactIlpSolver (HiGHS, n < 10k)
- Evaluation: trace replay with LRU/GDSF baselines, stale detection (TTL + version mismatch)
- CLI:
qc generate,qc optimize,qc simulate,qc compare - Presets: ecommerce, media, api — with configurable stale penalty overrides
Key Results
| Metric | Result |
|---|---|
| Optimality gap (median, n=1000) | 0.01% |
| Optimality gap (p95, n=1000) | 0.72% |
| Greedy solve 10k objects | 0.6ms |
| Trace replay 1M events | 825ms |
| 75 tests + 5 acceptance guards | All passing |
Quick Start
cargo build --workspace --release
qc generate --num-objects 10000 --num-requests 1000000 --output trace.csv
qc optimize --input trace.csv --output policy.json --capacity 50000000 --preset ecommerce
qc simulate --input trace.csv --policy policy.json
qc compare --input trace.csv --capacity 50000000 --preset ecommerceWhat's Next
- V1.1: CloudFront/Cloudflare log import + real trace validation
- V1.5: Belady baseline, offline coefficient calibration
- V2.0: QUBO with quadratic terms (co-access, purge-group, origin-group)
See docs/roadmap.md for the full plan.