Skip to content

feat(bench): turn on the reld benchmarker — reld charts real numbers (fix output-path bug, surface failures) - #39

Merged
zackees merged 3 commits into
mainfrom
bench-surface-failures
Aug 7, 2026
Merged

zackees merged 3 commits into
mainfrom
bench-surface-failures

Conversation

@zackees

@zackees zackees commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

reld now participates in the benchmark with real numbers. Closes #36, #37, #38.

Three stacked changes that together turn the reld column from n/a into a real measurement:

  1. Turn on the benchmarker (Turn on the reld linker benchmarker: build reld + install driver shims in the nightly benchmark so the reld column is measured, not n/a #36) — benchmark-stats.yml builds reld (release) and runs ci/install-driver-shims.sh before the bench, so reld-bench discovers the ld.reld shim.
  2. Surface link failures (reld-bench: surface link failures (emit the linker error) instead of silently charting n/a #38) — reld-bench no longer silently charts n/a when a link fails; it emits <!-- linker <name> link failed (<scenario>): <error> --> (sanitized single-line: --> neutralized, whitespace-collapsed, length-capped). This is an honesty fix and how the real cause was found.
  3. Fix the output-path bug (resolves reld charts n/a in the benchmark: links a trivial probe but fails reld-bench multi-object workloads (blocks #36) #37) — the surfaced error showed reld failing to open its output file at a bogus nested path: time_link built bench-{linker}.bin, and for reld {linker} is the absolute shim path, so dir.join treated its / as directories. Flatten /, \, : in the output name (bench_output_name helper + test). reld's ELF linking was never broken — reld charts n/a in the benchmark: links a trivial probe but fails reld-bench multi-object workloads (blocks #36) #37's "reld fails the workloads" was this harness bug.

Result — dispatched benchmark on this branch (Linux runner)

Scenario bfd lld mold wild reld
small (16) 0.039 0.0414 0.0366 0.0282 0.0277
medium (128) 0.0614 0.0507 0.0553 0.0328 0.0328
large (512) 0.1996 0.0911 0.1182 0.0523 0.051

reld charts a real native-engine number (mode: native) and is competitive — matching/edging upstream wild and ahead of lld/mold/bfd. (Windows/macOS still chart n/a in this clang harness — reld links there via rustc -Clinker, not -fuse-ld — a separate follow-up, not this PR.)

Testing

  • reld-bench.rs: fmt/clippy clean; unit tests for format_failure_comment (sanitization) and bench_output_name (path flattening) pass.
  • Dispatched the benchmark on this branch twice: first surfaced the exact error; after the fix, reld charts the numbers above.
  • Rusqlite ci/e2e/sqlite-bridge regression still links via reld and runs (OK) — the bridge is untouched.
  • Publish step + its default-branch guard untouched (dispatch on this branch produced artifacts without publishing).

Review

Independent review of the surfacing change: APPROVE (adversarially verified the failure comment can never break the benchmark_stats.py scrape or emit a malformed/-->/multi-line comment).

🤖 Generated with Claude Code

zackees and others added 3 commits August 7, 2026 04:15
…iver shims

The nightly benchmark charted reld as n/a because the workflow never built the
reld binary or installed its ld.reld driver shim, so reld-bench had nothing to
measure (published latest.json showed seconds:null on every scenario). Add a
step before the benchmark run that builds reld in release and runs
ci/install-driver-shims.sh, placing ld.reld next to the reld-bench binary so
reld-bench's auto-discovery finds it and measures a real reld number on Linux
(native wild engine). Pure activation of already-merged capability (BR-4a);
no source change. Publish step and its default-branch guard untouched.

Closes #36

Co-Authored-By: Claude Fable 5 <[email protected]>
…g n/a

reld-bench discarded a linker's stderr when time_link failed, charting a bare
n/a — indistinguishable from a slow linker, and the reason reld's benchmark
failure (#37) was invisible. Record each (linker, scenario, error) and emit a
sanitized single-line comment after the table:
  <!-- linker <name> link failed (<scenario>): <error> -->
The error is capped in length, whitespace-collapsed, and has any `-->` sequence
neutralized so it's always a valid single comment line. The table cells still
show n/a and the benchmark_stats.py scraping contract is unchanged.

Closes #38

Co-Authored-By: Claude Fable 5 <[email protected]>
The dispatched benchmark (via the new failure-surfacing) revealed the real
reason reld charted n/a — NOT a reld linking bug:

  reld: error: Failed to open
  `/tmp/reld-bench/small/bench-/home/runner/.../target/release/ld.reld.bin`

time_link built the output name as `bench-{linker}.bin`, where for the reld
column `{linker}` is the ABSOLUTE path to the ld.reld shim. dir.join() then
interpreted its `/` separators as nested directories that don't exist, so reld
(correctly) failed to open its output. Competitors use short names (bench-lld.bin)
so they were unaffected. Flatten `/`, `\`, `:` in the output filename via a
tested `bench_output_name` helper. reld's ELF linking was never the problem.

This unblocks the benchmark reld column (#36) and resolves the mis-attributed
#37 (reld does not actually fail these workloads).

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

1 participant