bench: 21'b — closure-pair + HOF/poly fixtures, 47-metric baseline

Two new throughput fixtures targeting blind spots in the 21'a
corpus:

- bench_closure_chain exercises the build_pair_drop_fn codegen
  path (the 18c.4 doubled-braces trigger). Each iteration of
  run_loop allocates a {thunk, env} closure pair via the
  let-rec-name-as-value escape route. Sizes 10k / 100k / 500k.
  rc/bump = 4.14x — materially worse than the 2.91x / 2.59x of
  the linear/tree fixtures, exposing that closure work pays the
  RC alloc tax twice (pair + env-struct).

- bench_hof_pipeline exercises poly-ADT instantiation and
  indirect dispatch via fold_with_fn over List<a>. Sizes 100k /
  1M / 3M elements. Ratios essentially match bench_list_sum,
  confirming the 13b static-template-plus-ctor-inline design
  has zero measurable overhead at this scale.

Baseline file extends from 31 to 47 metrics. The two new fixtures
build clean under all three allocators; the rc-arm build exercises
the per-type drop fn for the closure-pair, providing a tripwire
for any future 18c.4-class IR malformedness.

JOURNAL records both surprises (4.14x closure tax, ~zero HOF/poly
overhead) and explicitly notes the dispersion observation on
explicit_at_rc.p99 — three captures today (357.5 / 294.6 / 251.5)
confirm wide run-to-run variance on that fixture. Methodology
upgrade (n>=10 captures or tighter fixture) deferred to 21'c.

bench/run.sh fixtures array updated. bench/check.py needed no
changes — its parser handles the wider table by metric name.
This commit is contained in:
2026-05-09 00:55:57 +02:00
parent 2e40699cb1
commit 07bff24527
7 changed files with 319 additions and 1 deletions
+20
View File
@@ -24,6 +24,26 @@
"gc_rss_kb": { "baseline": 73260, "tolerance_pct": 5 },
"bump_rss_kb": { "baseline": 55208, "tolerance_pct": 5 },
"rc_rss_kb": { "baseline": 108956, "tolerance_pct": 5 }
},
"bench_closure_chain": {
"gc_s": { "baseline": 0.013, "tolerance_pct": 25 },
"bump_s": { "baseline": 0.007, "tolerance_pct": 25 },
"rc_s": { "baseline": 0.029, "tolerance_pct": 20 },
"gc_over_bump": { "baseline": 1.86, "tolerance_pct": 15 },
"rc_over_bump": { "baseline": 4.14, "tolerance_pct": 15 },
"gc_rss_kb": { "baseline": 13688, "tolerance_pct": 15 },
"bump_rss_kb": { "baseline": 15836, "tolerance_pct": 15 },
"rc_rss_kb": { "baseline": 39644, "tolerance_pct": 10 }
},
"bench_hof_pipeline": {
"gc_s": { "baseline": 0.134, "tolerance_pct": 10 },
"bump_s": { "baseline": 0.048, "tolerance_pct": 10 },
"rc_s": { "baseline": 0.136, "tolerance_pct": 10 },
"gc_over_bump": { "baseline": 2.79, "tolerance_pct": 8 },
"rc_over_bump": { "baseline": 2.83, "tolerance_pct": 8 },
"gc_rss_kb": { "baseline": 103788, "tolerance_pct": 5 },
"bump_rss_kb": { "baseline": 97448, "tolerance_pct": 5 },
"rc_rss_kb": { "baseline": 193640, "tolerance_pct": 5 }
}
},