Skip to content

Feature/benchmarks - #201

Merged
Levalicious merged 2 commits into
developfrom
feature/benchmarks
Jun 28, 2026
Merged

Levalicious merged 2 commits into
developfrom
feature/benchmarks

Conversation

@Levalicious

Copy link
Copy Markdown
Owner

No description provided.

Levalicious and others added 2 commits June 27, 2026 17:49
Per-op rdtsc microbenchmark for the v3 graph store:
- Adaptive sampling (riff RE=CV/sqrt(n) criterion, 2% target, batch-means),
  resolved in-run rather than persisted; auto-sizes iterations per op (~0.1s/run).
- Frequency-reference op so comparisons cancel cross-run CPU-turbo drift;
  median is the headline metric.

CI tooling, no committed baselines (nothing for git to churn):
- bench-compare: base-vs-head on one runner, freq-corrected median, median of
  N interleaved runs, soft-fail + PR comment (benchmark.yml).
- bench-aggregate + bench-creep: reference-normalized time-series on an orphan
  bench-history branch + slow-creep detector vs rolling baseline
  (benchmark-history.yml, on push to master).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EfzTKfjTRRNQ828crWoJf1
fc_graph.c: WP/ACSL proofs (memory-model-clean abstractions, fc_index idiom) of
the adjacency edge encoding that every traversal decodes.
- adj_pack / adj_pack_injective: the (target<<2)|dir packing is a lossless
  round-trip and injective for target<2^62, dir<4. Modeled arithmetically as
  target*4+dir (decode /4, %4 — bit-identical for these field widths); the
  literal bitwise form is opaque to WP's integer model, the same abstraction
  boundary fc_index uses for hash32.
- read_edges_model: iterating count 24-byte entries at adj+8+i*24 is memory-safe
  and terminating. 42/42 goals discharged by Alt-Ergo.

CI (proofs.yml, path-filtered to proof changes): opam frama-c + alt-ergo, runs
`make proofs`. scripts/run-proofs.sh gates the result — frama-c exits 0 even with
unproved goals, so it parses "Proved goals: P / T": clean files must be 100%,
fc_tree is safety-only (mf_fit_model termination needs an acyclicity measure, the
documented free-list-cycle frontier). Verified locally: fc_proofs 25/25,
fc_index 27/27, fc_graph 42/42, fc_tree 12/13.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EfzTKfjTRRNQ828crWoJf1
@github-actions

Copy link
Copy Markdown
Contributor

Per-op benchmark — p50 cycles (base vs head)

base runs: 5, head runs: 5 (median of mins) · freq-correction ×0.9848 · threshold head−base > max(40 cyc, 5%)

op base head* Δ Δ%
lookup 124.1 127 +2.9 +2.3%
read_entity 39.3 39 -0.3 -0.8%
neighbors_d1 794.5 788 -6.5 -0.8%
neighbors_d2 2611.2 2597 -14.2 -0.5%
find_path_d6 186641 176878 -9763.0 -5.2% 🟢 faster
search 1171835 1157029 -14806.0 -1.3%
entities_by_type 14038 13824 -214.0 -1.5%
random_walk_d5 1362.5 1338 -24.5 -1.8%
inc_walker_visit 16.6 17 +0.4 +2.4%
structural_sample 2617139 2544160 -72979.0 -2.8%
compute_merw_psi 925635 908710 -16925.0 -1.8%
create_entity 808 772 -36.0 -4.5%
create_relation 784 772 -12.0 -1.5%

* head frequency-corrected to base via the reference op.

No regressions beyond threshold.

@Levalicious
Levalicious merged commit 042368f into develop Jun 28, 2026
13 checks passed
@Levalicious
Levalicious deleted the feature/benchmarks branch June 28, 2026 07:50
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