Sim Analyze sim-analyze

Analyze a cache trace file to understand its characteristics and recommend policies

Works in Claude, ChatGPT, Codex and more
Our test
—
not tested yet
GitHub stars
18k
ben-manes/caffeine
Added by
0
members
Updated
Dec 6
commit a618bb9
Content
1 file
no scripts · 3 KB
License
Apache 2.0
free to use

What our test found

Not tested yet. Our model tries every skill on a realistic request and scores the result, the most popular skills first. Until then, the safety checks on the right still apply.

View on GitHub ↗
name: sim-analyze
description: Analyze a cache trace file to understand its characteristics and recommend policies
argument-hint: "<trace-file>"
context: fork
disable-model-invocation: true
allowed-tools: Read, Grep, Glob, Bash

Analyze the given cache trace to understand its access pattern characteristics and recommend which cache policies would perform best.

Input

Trace file: $ARGUMENTS

Workflow

  1. Identify the trace format and read the trace:
  2. Check file extension, try to parse first lines
  3. Determine: key-only or weighted? Timestamps included?
  4. Count total accesses and distinct keys
  1. Compute trace statistics. Write a small analysis script or use the simulator's synthetic tools to characterize:
  2. Working set size: number of distinct keys
  3. Temporal working set: distinct keys in sliding windows
  4. Frequency distribution: how many keys account for 80% of accesses? (Zipfian? Uniform? Bimodal?)
  5. Recency patterns: what fraction of accesses are repeats within the last N accesses?
  6. Scan detection: are there bursts of sequential unique keys?
  7. Temporal shifts: does the popular set change over time? (Compare first half vs second half frequency rankings)
  1. Characterize the workload:
  2. Frequency-biased: few hot keys dominate → LFU/TinyLFU excel
  3. Recency-biased: recent items are reaccessed → LRU/LIRS excel
  4. Mixed: both signals matter → W-TinyLFU, ARC
  5. Scan-heavy: sequential scans pollute → scan-resistant policies (S3-FIFO, 2Q)
  6. Shifting: popular set changes over time → adaptive policies (hill climber)
  1. Recommend policies for comparison:
  2. Match trace characteristics to policy strengths
  3. Suggest cache sizes based on working set (10%, 25%, 50% of distinct keys)
  4. Predict which policies will likely win and why
  1. Run a quick validation. Execute a single-size simulation using simulator:run (not simulator:simulate which does multi-size): ``bash ./gradlew simulator:run -q \ -Dcaffeine.simulator.files.paths.0="format:path" \ -Dcaffeine.simulator.maximum-size=SIZE \ -Dcaffeine.simulator.policies.0=product.Caffeine \ -Dcaffeine.simulator.policies.1=opt.Clairvoyant \ -Dcaffeine.simulator.policies.2=linked.Lru `` Note: each policy creates instances per admission filter (default: Always, TinyLfu, Clairvoyant). If a trace has no weight data, weighted-only policies are silently skipped.
  1. Report:
  2. Trace summary (accesses, distinct keys, frequency distribution shape)
  3. Workload characterization (frequency vs recency bias)
  4. Recommended policies with reasoning
  5. Quick validation results
  6. Suggested /sim-compare invocation for full analysis