Skip to content

tools: add traceReuseStat (reuse-locality profile, sigma_cross) + doc - #6

Open
lindicaphxag-tech wants to merge 7 commits into
cacheMon:mainfrom
lindicaphxag-tech:trace-reuse-stat
Open

lindicaphxag-tech wants to merge 7 commits into
cacheMon:mainfrom
lindicaphxag-tech:trace-reuse-stat

Conversation

@lindicaphxag-tech

Copy link
Copy Markdown

Adds tools/traceReuseStat, a single-pass CLI that reads a TraceReader (*.lcp / .lcp.zst) and reports reuse locality metrics that none of the existing tools expose:

  • sigma_cross: share of reuse accesses (distinct-block hit) whose previous accessor belongs to a different request stream (session). This is the quantity that decides whether cross-tenant memory is worth caching.
  • gap distribution for same-session vs cross-session reuse (p50/p90/max), plus cross-user share when user_id is present.
  • optional --gap-hist and --per-request-out for downstream plotting/aggregation.

Motivation: tracePrint gives totals and prefixsim gives simulated hit ratios, but neither tells you who the reuse comes from. In our measurements the same eviction policy is +24.6% on one workload and +0.014 pp / -1.70 pp on two public production traces; the discriminating variable is sigma_cross, which costs one pass over the trace to obtain.

No behaviour change for existing targets; new target is built only when the corresponding source is present. Smoke-tested on the small traces in data/ (handles traces without a session field by reporting sigma_cross = 0 and same-session share = 1.0).

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