RCE Compile: A Proposed 7-Part Compiler Normal-Form Contract, Per-Machine Prelude Cuts, and De Bruijn Warm-Cache Bounds
Refutes a descriptive "Law of Compilation" in favor of a proposed 7-part contract, separating Zen 5 (20.07x) vs Core i9 (15.44x) prelude cuts and up to 448.5x best-case warm De Bruijn cache hits (Linux RAPL reported_j).
Temporal & Archival Scope: Era II OpenIE Study (November 21, 2026) · Canonical OpenIE Chronicle Entry: https://blog.openie.dev/posts/rce-compile/ · Primary Paper & Methods: https://research.openie.dev/papers/rce-compile/ · Canonical Digest:
blake3:tv:d561a8e7e445f1878caa5144e08df2f7cbe006ff65dba485bc787c7361a7027aProvenance & Telemetry Hygiene: Signed Provenance · Self-Checked (automated OpenIE internal gates; not externally peer-reviewed) · Energy Class:
reported_j(measured_j ⊥ reported_j ⊥ est_j ⊥ unmetered— Verification, Licensing & AI-Use Disclosure · Glossary & Non-Mixing Rules).
Key Claims & Evidence Tags
- [M/S · Proposed Normal-Form Contract, Not a Law of Nature] The primary paper explicitly refutes the hypothesis that existing compilers obey a single “Law of Compilation,” restating it as a proposed 7-part engineering contract (
R, L, C, K, U, E, G) and disclosing in Appendix A that38of55audited external claims rested on[S]/[K]snippet checks (14partly overstated,4contradicted,17not found). - [E · Per-Machine Cold Prelude & Optimization Payback (
reported_j)] Across20integer/fixed-point kernels ×15compiler tiers (300/300matching checksums), factoring RCE’s emitted Rust runtime into pre-compiledlibrce_rt.rlibcut median per-kernelrustc -O3corereported_j20.07x(56.29 J -> 2.81 Jcore,896.93 J -> 27.05 Jpkg,24.58xfaster, lowering payback vs. Node JS from31,080to1,079runs) onAMD Ryzen AI Max+ 395(Zen 5, pinned CPU 0, co-tenant load on other cores noted), and replicated at15.44xPP0core (84.40 J -> 5.47 J,104.56 J -> 6.85 Jpkg =15.26x) on an idle dedicatedIntel Core i9-13900H(4.46 Widle pkg)—while-O2to-O3never paid back its extra compile joules on20%–30%of kernels. - [E · Warm De Bruijn Cache Hit (
up to 448.5x) vs. Cold Build] Crediting N. G. de Bruijn (1972) for nameless positional variable indexing (v0 - v1vs.v1 - v0),E5-Scale(245base programs,500verified semantic mutants,29,890cross-program pairs) recorded0 / 500false hits (whereas naive identifier-stripping collided on150 / 150(100%) variable-swap bugs) and cut rebuild work up to448.5x(1.166 J -> 2.60 mJrustc -O3corereported_j) and167.8x(0.682 J -> 4.07 mJclang -O3) strictly on warm cache hits over alpha-renamed single-file kernels (66.7%–69.2%rename hit rate;1.0xon cold unseen builds).
Methods, Baselines & Artifact Scope
- Methodological Dimension: Hardware & Telemetry · Primary-Paper Grounding & Scope: (1)
E4-Energy/E4-Prelude/E5-Scale:AMD Ryzen AI Max+ 395(Zen 5, 32 logical CPUs, pinned CPU 0, LinuxRAPLcore + pkgreported_j; co-tenants present on non-pinned cores); (2) Wave 5 idle replication: dedicatedIntel Core i9-13900H(Raptor Lake,4.46 Widle pkg, LinuxRAPLPP0+ pkgreported_j); (3)E5Wasm/object key study:Intel Xeon @ 2.80 GHz(Ubuntu 24.04.5,clang 18.1.3,rustc 1.97.0, unmetered hash comparison).measured_j = null(board_metered = false). - Methodological Dimension: Workload & Benchmark Suite · Primary-Paper Grounding & Scope:
E1: cross-directory/rename byte reproducibility;E4-Energy:20self-contained integer/fixed-point kernels ×15C/Rust/Wasm/JS/Python tiers (300cells);E5:360x86-64 objects,144Mach-O objects,288Wasm objects,288linked Wasm modules (26,208cross-kernel pairs,9,328IR mutations);E5-Scale:185W1RCE Forms +60C/Rust/Python kernels +500verified semantic mutants. - Methodological Dimension: Baseline(s) Compared · Primary-Paper Grounding & Scope: Raw
SHA-256source/command hash (ccache-style), comment/whitespace-stripped hash, naive AST identifier-stripping (ID - ID), and De Bruijn positional canonicalization (de Bruijn 1972,Maziarz et al. PLDI 2021); inlined RCE Rust prelude vs. pre-compiledlibrce_rt.rlib. - Methodological Dimension: Runs (N) & Spread / Uncertainty · Primary-Paper Grounding & Scope:
E4:20kernels (medians and per-kernel payback distributions reported;20%–30%of kernels never recover-O2 -> -O3compile energy;R^2 = 0.9999forpower × timevs.0.1154for static Wasm IR size).E5-Scale: deterministic over245programs,29,890pairs, and500mutants. - Methodological Dimension: Caching / Cold vs. Warm Scope · Primary-Paper Grounding & Scope: Explicitly separated:
448.5x(rustc -O3),167.8x(clang -O3), and17.15x(rce check+emit) apply only on warm De Bruijn cache hits (69.2%hit rate on185renamed RCE Forms;66.7%on60renamed C/Rust/Python kernels). Cold first-time builds pay100%of compiler cost plus2.60–4.59 mJcanonicalizer overhead. - Methodological Dimension: Artifact & License Availability · Primary-Paper Grounding & Scope: Kernels, mutant generators, and
E4/E5scripts public inopenIE-dev/openie-research-experimentsandopenIE-dev/rce(Apache-2.0); self-checked by OpenIE, open for independent replication.
From Refuted “Law” to Proposed Normal-Form Contract & Lineage
The manuscript opens by testing—and refuting—the claim that real compilers (gcc, clang, rustc, Go, GHC, XLA, CompCert) already satisfy a unified “Law of Compilation” [E, S]. Instead, it defines a proposed 7-part Compiler Form contract (Representation R, Lowering L, Cost C, Checker K, Reuse U, Energy E, Gate G). Nameless positional variable indexing in R directly applies N. G. de Bruijn (1972) lambda-calculus indices and Maziarz et al. (PLDI 2021) alpha-equivalent IR hashing, sitting alongside incremental build systems such as ccache, Bazel, Adapton (Hammer et al., PLDI 2014), and Rust’s Salsa query engine [S].
Per-Machine Compile Payback (Zen 5 vs. Core i9-13900H) & Warm-Cache Scope
-
Cold compile amortization (
E4-Energy&E4-Prelude)[E]: Lowering Python toclang -O3requires a median of2,490executions to pay back compilation joules; stepping from-O0to-O3requires53,464to102,720runs; and-O2to-O3never pays back on20%–30%of the 20 kernels. Pre-compiling RCE’s shared runtime intolibrce_rt.rlibcut per-kernelrustc -O3compile energy20.07x(56.29 J -> 2.81 Jcorereported_j) onAMD Ryzen AI Max+ 395(Zen 5) and15.44x(84.40 J -> 5.47 JPP0reported_j) on an idle dedicatedIntel Core i9-13900H[E]. -
Why De Bruijn positions beat naive ID-stripping (
E5-Scale)[E]: Naive identifier stripping (x - y->ID - ID) falsely collided on150 / 150(100%) variable-swap bugs (30.0%false-hit rate overall), whereas De Bruijn slot numbering (v0 - v1vs.v1 - v0) yielded0 / 500mutant collisions and0 / 29,890cross-program collisions. On best-case warm cache hits when rebuilding alpha-renamed single-file kernels on pinned CPU 0, De Bruijn lookup (2.60–4.07 mJ) avoided1.166 Jrustc -O3(448.5x) and0.682 Jclang -O3(167.8x) rebuilds[E].
Limitations, IR Debug-Path Misses & Literature Snippet Audit
-
Debug-path & comment misses (
E5&E5-Scale)[E]: Linked Rust Wasm modules missed on9/96two-directory and renamed pairs atopt-level=0/1because embedded panic column/path strings differed in the data segment; similarly, rawrce fmt namelesspreserves#comments unless stripped prior to hashing (128/185=69.2%alpha-rename hit rate)[E]. -
Single-file integer scope &
[S]/[K]citation limits:E4/E5-Scalecover single-file integer/fixed-point kernels without multi-TU C++ headers, LTO, or GPU shaders; and Appendix A flags38/55background literature claims as snippet-level checks requiring primary-text verification (§9)[S].
Energy & Telemetry Scope
All joule measurements are Regime-B Linux powercap RAPL core/PP0 and package reported_j (measured_j = null, board_metered = false), where power × wall_time explained 99.99% of RAPL variance (R^2 = 0.9999) compared with 11.54% for static Wasm byte size [E].
Related Work & References
- de Bruijn (Indag. Math., 1972) & Maziarz et al. (PLDI 2021): Nameless positional lambda-term indexing and hashing modulo alpha-equivalence
[S]. - Hammer et al. (Adapton, PLDI 2014), Rust Salsa,
ccache& Bazel: Demand-driven incremental computation and content-addressed build caching[S]. - Leroy (CompCert, CACM 2009) & Lopes et al. (Alive2, PLDI 2021): Verified compilation and translation validation
[S]. - Lattner et al. (MLIR, CGO 2021), Chen et al. (TVM, OSDI 2018), Halide & XLA: Multi-level IR lowering and cost-guided schedule search
[S].
Canonical Provenance, Primary Artifacts & Independent Replication
- Canonical OpenIE Chronicle Entry: https://blog.openie.dev/posts/rce-compile/
- Primary Study & Methods: https://research.openie.dev/papers/rce-compile/
- Public Code / Replication Harness: https://github.com/openIE-dev/openie-research-experiments
- Illustrated Video Summary (OpenIE Research TV): https://research.openie.dev/tv/?study=rce-compile (9:16 Vertical MP4)
- Signed Provenance · Self-Checked Disclosure & Licensing: E4/E5 kernel corpus and payback scripts public in openIE-dev/openie-research-experiments and openIE-dev/rce (Apache-2.0); prose CC0-1.0; self-checked, open for external replication. Full details at https://blog.openie.dev/verification/ and https://blog.openie.dev/glossary/.