Skip to content

test: Benchmark Rust hot paths against C oracles - #668

Merged
zackees merged 1 commit into
masterfrom
test/142-port-benchmarks
Oct 14, 2026
Merged

zackees merged 1 commit into
masterfrom
test/142-port-benchmarks

Conversation

@zackees

@zackees zackees commented Oct 14, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #142.

  • Add 70 paired Criterion comparisons (140 benchmark cases) for all requested bmem, dstr, vec2/3/4, CRC32 and AVC/HEVC/AV1 parser shims. Check outputs before timing; bound allocation batches and retain C variadic printf controls.
  • Add a reproducible recorder with source fingerprints, toolchain/CPU metadata, five-run medians, ranges and confidence intervals. Commit the measured baseline and preserve the existing 10% hot-path / 5% recording thresholds.
  • Investigate a full Linux ON ThinLTO build with Rust LLVM 22 and Clang/LLD 22. Document stock Clang warning failures and the subsequent shared-library TLS relocation failure; aligning target triples reproduces it. No production LTO flags change.

Evidence

  • Optimized Criterion fixture smoke: all 140 cases pass.
  • Recorded baseline: 70 paired comparisons across five complete runs. 21 medians exceed the 10% bound; dstr/safe_printf/4096 is 59.47x C. This records needed performance work and does not claim the default-flip performance gate passes.
  • Cross-language LTO: after probe-only downgrades of two C warning errors, shared linking fails with R_X86_64_TPOFF32 against thread_graphics. C and Rust bitcode record PIC level 2; matching target triples produces the same failure.
  • clud-review: clean, one cumulative reviewer.

This is benchmark infrastructure and evidence, not a new port or a behavioral bug fix; RED/GREEN stub commits do not apply. Production implementations, public headers and existing C tests are unchanged. The normal local gate and CI must pass before merging.

Local-Gate: v1 tree=41a82638db92a4115de349a4641cc32827832f78 secs=328 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1791942902,"gate":"rust/all/fmt","host":"linux-x86_64","key":"4c924e7f14ed776a6cfda0cec833057d9be2d442be66218aeb047b9ae9798d4f","lane":"lint","parents":["bace91ba957d9e55dd36eb10578dda8b519d81a2"],"secs":27,"stamp":"8aef37e559a3e612cb7dcdf70dce67bd","tree":"41a82638db92a4115de349a4641cc32827832f78","v":1,"via":"run"}
Ci-Attestation: {"at":1791942902,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"4c924e7f14ed776a6cfda0cec833057d9be2d442be66218aeb047b9ae9798d4f","lane":"lint","parents":["bace91ba957d9e55dd36eb10578dda8b519d81a2"],"secs":27,"stamp":"4a61af4417fcd8bd6d3d0cd33a490de6","tree":"41a82638db92a4115de349a4641cc32827832f78","v":1,"via":"run"}
Ci-Attestation: {"at":1791942902,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"dc80657895c6f8785ac231a400101c52d4157319706b270d55eb9a2c5c3da25c","lane":"rust-test","parents":["bace91ba957d9e55dd36eb10578dda8b519d81a2"],"secs":92,"stamp":"e260fd481f2d6634c426dcbc89e3e31d","tree":"41a82638db92a4115de349a4641cc32827832f78","v":1,"via":"run"}
Ci-Attestation: {"at":1791942902,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"b63942618dd44fdc20e71e7a2a897d0679eaa56ce1e7d46a15b141e67a4cc392","lane":"cross","parents":["bace91ba957d9e55dd36eb10578dda8b519d81a2"],"secs":73,"stamp":"ff537e6cf7385779b0467a622f6ee017","tree":"41a82638db92a4115de349a4641cc32827832f78","v":1,"via":"run"}
Ci-Attestation: {"at":1791942902,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"b63942618dd44fdc20e71e7a2a897d0679eaa56ce1e7d46a15b141e67a4cc392","lane":"cross","parents":["bace91ba957d9e55dd36eb10578dda8b519d81a2"],"secs":73,"stamp":"7fbc91ac0142337cd9e708247eecdde7","tree":"41a82638db92a4115de349a4641cc32827832f78","v":1,"via":"run"}
Ci-Attestation: {"at":1791942902,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"b63942618dd44fdc20e71e7a2a897d0679eaa56ce1e7d46a15b141e67a4cc392","lane":"cross","parents":["bace91ba957d9e55dd36eb10578dda8b519d81a2"],"secs":73,"stamp":"4ea395657e1c7f02129f8126448aed99","tree":"41a82638db92a4115de349a4641cc32827832f78","v":1,"via":"run"}
Ci-Attestation: {"at":1791942902,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"b63942618dd44fdc20e71e7a2a897d0679eaa56ce1e7d46a15b141e67a4cc392","lane":"cross","parents":["bace91ba957d9e55dd36eb10578dda8b519d81a2"],"secs":73,"stamp":"e97ee2024fa64acde6a99df3d9a74e56","tree":"41a82638db92a4115de349a4641cc32827832f78","v":1,"via":"run"}
Ci-Attestation: {"at":1791942902,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"b63942618dd44fdc20e71e7a2a897d0679eaa56ce1e7d46a15b141e67a4cc392","lane":"cross","parents":["bace91ba957d9e55dd36eb10578dda8b519d81a2"],"secs":73,"stamp":"08df0d957e7e9ad9ae51a2bd74b92877","tree":"41a82638db92a4115de349a4641cc32827832f78","v":1,"via":"run"}
Ci-Attestation: {"at":1791942902,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"b63942618dd44fdc20e71e7a2a897d0679eaa56ce1e7d46a15b141e67a4cc392","lane":"cross","parents":["bace91ba957d9e55dd36eb10578dda8b519d81a2"],"secs":73,"stamp":"b5eef4dc757d90d3c78203001d2345aa","tree":"41a82638db92a4115de349a4641cc32827832f78","v":1,"via":"run"}
Ci-Attestation: {"at":1791942902,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"11188d152710df3d230dbcdf94c466f2bcc6f7cf7afc6f1e7a21b4695b30d934","lane":"tier2-linux","parents":["bace91ba957d9e55dd36eb10578dda8b519d81a2"],"secs":135,"stamp":"f9f2fe96025e9fdf87ef8c4d0e39876e","tree":"41a82638db92a4115de349a4641cc32827832f78","v":1,"via":"run"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

quality: Benchmark Rust ports against C on hot paths

1 participant