Skip to content

perf: add correctness-gated allocator benchmark - #99

Merged
zackees merged 3 commits into
mainfrom
perf/issue-93-allocator-benchmark
Aug 27, 2026
Merged

zackees merged 3 commits into
mainfrom
perf/issue-93-allocator-benchmark

Conversation

@zackees

@zackees zackees commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Closes #93
Part of #97

Outcome

Adds the reproducible correctness-first allocator decision harness. This PR does not claim that mimalloc is faster and does not change linker behavior. It creates the evidence gate that will decide whether the already-landed allocator remains or is reverted.

Controlled comparison

  • system baseline is the exact archived e2d6be5a Git tree
  • mimalloc candidate is the exact archived e0868677 Git tree
  • archives, Git tree IDs, lockfiles, binary hashes, workload manifest/lock, effective captured linker command/arguments/cwd, tool paths, and machine provenance are recorded
  • both release builds use Rust 1.95.0, isolated Cargo state, fixed Clang, identical explicit features and an empty inherited build environment
  • candidate feature-tree plus nm proof rejects sampled pprof hooks; all documented pprof/DHAT controls are scrubbed and a dedicated output directory must remain empty before, during, and after timing

Correctness before timing

Every no-LTO, ThinLTO, and full-LTO cell links twice with each allocator, requires one raw SHA-256 artifact identity across all four outputs, and checks exact native exit/stdout/stderr. Every timed artifact is hash-checked against that oracle and natively executed outside timing.

Statistics and decision

  • two excluded warmups and ten balanced interleaved samples per allocator/workload
  • GNU time wall/user/system/peak-RSS raw samples and MAD
  • paired round bootstrap 95% CIs per workload
  • paired-within-workload geometric aggregate CIs
  • keep only when aggregate wall lower CI is above zero and every workload plus aggregate wall/CPU/RSS lower CI stays within the declared 3% non-regression margin
  • otherwise report inconclusive_or_worse; meta(perf): externalize mimalloc-pprof and optimize the standalone LLVM COFF driver #97 then requires reverting the allocator default

Diagnostic evidence

A separate non-timing runner builds default, sampled-pprof, and exact-DHAT modes, requires artifact identity and exact native behavior, and uploads nonempty profile evidence. Diagnostic runs never enter timing cells.

Safety and observability

All capture/link/native phases are bounded. Exact temporary archive trees are created with mktemp; EXIT cleanup accepts only the exact passed directories after fixed-parent, basename, symlink/junction, and containment validation. The GitHub job runs in a pinned Rust container digest, pins native package versions and action SHAs, and uploads raw evidence even on failure.

Host validation

  • ruff check: pass
  • allocator/benchmark focused pytest: 59 passed
  • bash -n ci/allocator_benchmark.sh ci/allocator_profiles.sh: pass
  • git diff --check: pass
  • clud-review: clean

The PR must not merge until the manual allocator workflow completes and its authoritative JSON decision has been applied.

@zackees

zackees commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

Authoritative allocator evidence: https://github.com/zackees/reld/actions/runs/33068576290 (artifact ID 9645699405, allocator-evidence-bacc628ae2f14f15db198b1587ce6e524edb3435).

All correctness gates passed for no-LTO, ThinLTO, and full-LTO: repeated raw artifact identity across allocators, exact native output, profiler-off contamination checks, and separate successful pprof/DHAT diagnostic profiles.

Wall medians were identical in every cell: no-LTO 0.38/0.38s, ThinLTO 0.43/0.43s, full-LTO 0.28/0.28s (system/mimalloc). Aggregate wall improvement was 0.000%, paired bootstrap 95% CI [-1.610%, +0.385%]. Aggregate CPU was 0.000%, CI [-14.471%, +12.642%]; RSS was -0.098%, CI [-0.384%, +0.361%].

The machine-readable decision is inconclusive_or_worse, keep_allocator=false. Mimalloc did not demonstrate a speed improvement and CPU fails the uncertainty-aware non-regression gate. Per #97, production/default mimalloc will be reverted in a separate causal PR while this PR retains the reproducible harness and raw evidence path.

@zackees
zackees merged commit 0b46e0b into main Aug 27, 2026
13 of 14 checks passed
@zackees
zackees deleted the perf/issue-93-allocator-benchmark branch November 5, 2026 05:51
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.

Phase 1b: prove allocator artifact equivalence and benchmark/profile the Linux matrix

1 participant