Skip to content

perf(elf): make output-section part maps sparse - #102

Merged
zackees merged 11 commits into
mainfrom
perf/sparse-output-section-map-101
Sep 1, 2026
Merged

zackees merged 11 commits into
mainfrom
perf/sparse-output-section-map-101

Conversation

@zackees

@zackees zackees commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • keep built-in output-section parts in the existing dense prefix while storing discovered custom-section parts lazily in an ordered standard-library BTreeMap
  • preserve deterministic part order and empty-custom-section layout behavior across ELF, Mach-O, compression, thunk, verification, and writer callers
  • add committed RED→GREEN map coverage plus a native ELF relocatable/custom-section acceptance fixture
  • publish and lock an LLVM/Clang llvmorg-22.1.8 final-link corpus, with a separate manual Linux workflow that times only repeated final links for about 30 seconds
  • enforce two baseline and two candidate raw-artifact comparisons plus an exact native Clang oracle before reporting timing

Closes #101

Artifact and performance evidence

Controlled 71,604-custom-section ELF replay, same non-git-build version provenance:

  • two baseline and two candidate outputs are byte-identical: SHA-256 8003e4465e75f7e1ca6f35ca44645a0c8d2bc82620655b6c7c562cd24724c423
  • every output exits 42 with empty stdout/stderr
  • 10 balanced samples: median wall 0.320→0.190 s (40.6% lower)
  • mean peak RSS 334,336→101,704 KiB (69.6% lower)
  • phase trace: total 305.18→181.75 ms; Layout 172.95→108.81 ms; total sizes 34.71→8.64 ms; group offsets 23.53→3.78 ms; buffer split 44.70→4.07 ms

Published Clang corpus: https://github.com/zackees/reld/releases/tag/clang-link-corpus-llvmorg-22.1.8-v1

  • archive: 73,413,916 bytes, locked SHA-256 beb1f73eaab4257572ff60d04f08391b605990e4377c5d137fbf254db8ad5440
  • true pinned baseline/candidate URL replay: 204 fixed --no-fork samples totaling 31.675 s after one excluded calibration link
  • all four Clang artifacts are byte-identical: SHA-256 3a2654c7294db5865f387d1dd2df465b94433d957ce89a2de28161bc353ff9e5
  • exact native Clang oracle passed after every identity, calibration, and timed link
  • compilation, download, extraction, native execution, and evidence writing are outside timing
  • copied .o/.a inputs use documented GNU binutils 2.40 strip --strip-debug with attached pre/post manifests so the hosted workload fits; it is explicitly non-debug representative

Validation

  • cargo check --locked --workspace --all-targets --all-features
  • cargo clippy --locked --workspace --all-targets --all-features -- -D warnings
  • cargo fmt --all --check
  • cargo test -p reld-core --lib: 173 functional tests passed; only the two tidy subprocess checks could not run in the diagnostic image because taplo and clang-format were absent
  • exact acceptance elf/x86_64/custom-section-relocatable/default: passed, native exit 42
  • full Python CI suite: 213 passed
  • focused Clang lock/workflow tests: 18 passed
  • dependency-policy check: passed; no manifest, lockfile, baseline, or crate dependency change
  • actionlint and git diff --check: passed
  • /clud-review: clean after one medium timing-invariant finding was fixed with a negative --no-fork lock test

Issue evidence and corpus provenance are also recorded at #101 (comment).

@zackees
zackees merged commit b28c25e into main Sep 1, 2026
17 of 20 checks passed
@zackees
zackees deleted the perf/sparse-output-section-map-101 branch September 1, 2026 00:54
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.

perf(elf): make OutputSectionPartMap sparse and add pinned Clang link replay

1 participant