A semantic diff tool for validating reproducible Rust builds.
Binate compares two Rust binaries and tells you whether they are truly identical, not just byte-for-byte, but semantically. It masks known sources of non-determinism (build IDs, timestamps, absolute paths) before comparing, so you only see genuine differences. When it finds one, it maps it back to the source symbol and DWARF file/line location.
cargo install --path .# Compare two builds (exit 0 if identical after normalization)
binate compare left.elf right.elf
# Show disassembly diff for changed symbols (x86/x86-64)
binate compare left.elf right.elf --disasm
# Machine-readable output for CI
binate compare left.elf right.elf --format json
binate compare left.elf right.elf --format sarif
# Fail with exit code 1 if any differences are found (CI gate)
binate compare left.elf right.elf --strict
# List sections
binate inspect ./target/debug/mybinary
# List symbols
binate symbols ./target/debug/mybinaryBinate runs a five-stage pipeline:
- Load: memory-maps both binaries via
memmap2, no full read into RAM - Normalize: masks build IDs, timestamps, linker version strings, and absolute paths before comparison
- Diff: O(n) linear scan over each section in parallel (
rayon), identical sections are skipped instantly - Attribute: maps each differing byte range to a symbol via a
BTreeMap-indexed symbol table - Enrich: resolves each changed symbol to a source file and line number using DWARF debug info (
gimli)
| Name | What it masks |
|---|---|
build-id |
.note.gnu.build-id, Mach-O LC_UUID |
timestamp |
4-byte Unix timestamps in .comment and PE COFF headers |
absolute-path |
Host-absolute paths in .debug_str / .debug_line_str |
linker-version |
Linker version banners in .comment |
Skip individual normalizers with --skip-normalizer <name>, or disable all with --no-normalize.
| Format | Use case |
|---|---|
terminal |
Human-readable, colored diff (default) |
json |
Structured output for scripting |
sarif |
GitHub Actions / CI annotation integration |
| Crate | Role |
|---|---|
object |
Binary parsing (ELF, Mach-O, PE) |
gimli |
DWARF debug-info traversal |
iced-x86 |
x86/x86-64 disassembly |
memmap2 |
Memory-mapped file access |
rayon |
Parallel section analysis |
similar |
Disassembly text diff in terminal output |
clap |
CLI argument parsing |
| Code | Meaning |
|---|---|
0 |
Identical (or differences found without --strict) |
1 |
Differences found under --strict |
2 |
Fatal error |
