Audit duplicate crypto backends while preserving the one-binary release #85
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem and evidence
The stripped release binary measured 33,465,288 bytes, 8,465,288 bytes over the 25,000,000-byte cap. Symbol attribution found four duplicated AVX-512 AES-GCM routines across AWS-LC/OpenSSL occupying 1,375,609 bytes; other named lower bounds were AWS-LC 1,465,545 bytes, OpenSSL 1,061,138 bytes, OpenAPI construction 283,256 bytes and shared error-schema composition 141,033 bytes. These byte counts are load-independent. The current release dependency graph includes rustls/AWS-LC and server/OpenSSL (Cargo.toml:42; crates/server/Cargo.toml:26; cargo tree -p infraternal --all-features).
See binary-attribution.json and symbol-sizes.txt. There is no runtime flamegraph for a load-independent size measurement.
Recommendation
Audit why both cryptographic backends are linked and whether a supported shared backend or pre-generated/compressed OpenAPI artifacts can safely reduce the shipped binary. Preserve supported CPUs and SSH/TLS algorithms. Measure each candidate on the normal stripped release binary.
Payoff, effort and risk
Expected gain: up to 1.38 MB is attributable to the duplicated routines. Compression plus that candidate totals about 2.77 MB and still leaves roughly 5.70 MB to explain; no individual optimization is represented as sufficient.
Quick win vs deeper change: a ≤1-day dependency/size audit is the quick first step; backend consolidation is estimated at 2–5 days.
Risk: high crypto and portability risk; independent security review is required. Do not disable AVX-512 arbitrarily.
Priority: Next milestone.
2026-10-04 owner decisions: Keeping one Rust binary for server and infraternal agent is settled. Splitting server and infraternal agent artifacts, suggested as an alternative in the audit, conflicts with that decision and is not the default action here. The compiled-in provider approach supports measuring feature costs without dynamic plugins. Related: #66 and #69.
Report: perf-audit report
Source: perf-audit 2026-10-04