Skip to content

feat(bench): reld participates in the benchmark via its driver shim (BR-4a) - #24

Merged
zackees merged 1 commit into
mainfrom
br4a-bench-reld
Aug 7, 2026
Merged

zackees merged 1 commit into
mainfrom
br4a-bench-reld

Conversation

@zackees

@zackees zackees commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Implements a focused slice of BR-4 (#17). Closes #23. Follows BR-1 (#20) and BR-2 (#22).

What

Makes reld produce a real measurement in reld-bench instead of the hardcoded n/a — the user-facing goal of "reld participates in the benchmark."

reld is a native ELF linker on Linux (inherited from wild), driven via clang -fuse-ld=<ld.reld>; ci/install-driver-shims.sh already produces the ld.reld shim next to the reld binary. reld-bench now:

  • discovers the shim (--reld <path> override, else ld.reld next to the bench binary),
  • probes it once and times it per scenario exactly like the other linkers,
  • prints the real seconds in the reld column, or a clean n/a + an explanatory <!-- linker reld not available: ... --> comment when no shim is found or the probe fails.

The published Linux benchmark now gets a real reld number. The clang/-fuse-ld harness can't drive reld on Windows/macOS (there reld integrates via rustc -Clinker), so it honestly shows n/a on those hosts — a Windows/macOS bench path is future work (BR-4b), along with the SCHEMA_VERSION=2 mode/engine/target fields and the 3-OS workflow matrix.

Contract

The stdout table scraped by ci/benchmark_stats.py is unchanged: same ## Link Benchmark: <triple> heading, same columns in the same order with reld always last, same header/separator shapes, same n/a cell format.

Testing

  • Scoped to crates/reld-testkit/src/bin/reld-bench.rs only. fmt/clippy -p reld-testkit --all-targets clean.
  • Windows bench run renders correctly: competitors measured, reld n/a with the new comment, table shape intact.
  • Rusqlite regression e2e (the committed ci/e2e/sqlite-bridge fixture) still links via reld and runs (OK, exit 0) — the bridge is untouched by this change.
  • Unit tests for shim discovery are hermetic (injected temp directory) and pass 5/5 under default cargo test parallelism.

Review

Independent review confirmed the table-scraping contract is preserved and no competitor column can be dropped/misaligned. It reproduced a flaky test (two tests racing on the real executable directory); that is fixed here by making discover_reld's sibling-dir lookup injectable so tests use temp dirs — verified non-flaky across repeated runs.

A real (non-n/a) reld measurement only occurs on Linux with a genuine shim, so it is validated by inspection + the discovery unit tests here and will be exercised by the Linux benchmark job, not by this PR's CI.

🤖 Generated with Claude Code

Replace the hardcoded `n/a` reld column with a real measurement. reld is a
native ELF linker on Linux (inherited from wild), driven via
`clang -fuse-ld=<ld.reld>`; the shim is produced by ci/install-driver-shims.sh.
reld-bench discovers it (`--reld <path>` or `ld.reld` next to the bench binary),
probes it once, and times it per scenario exactly like the other linkers. When
no shim is found or the probe fails, the column stays `n/a` with an explanatory
comment — honest rather than implied. The published Linux benchmark now gets a
real reld number; the clang-based harness can't drive reld on Windows/macOS
(rustc `-Clinker` path), so it shows `n/a` there.

The stdout table contract with ci/benchmark_stats.py is unchanged: same columns,
order, and `n/a` format, with reld always the final column.

discover_reld's sibling-directory lookup is injectable so the unit tests run
hermetically against temp dirs instead of racing on the real executable dir.

Closes #23

Co-Authored-By: Claude Fable 5 <[email protected]>
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.

BR-4a: reld participates in the benchmark — reld-bench measures the reld driver shim

1 participant