All 57 Entries
Era I · Feb 2026 Essay (Verbatim + Nov 2026 Addendum) engineering reported_j · On-Chip Counter Unifying Framing & Synthesis Feb 2026 Essay · Verbatim Text + Nov 2026 Errata

Deterministic Code Generation: Trust, but Verify

AI-generated code is probabilistic by nature. That's fine for prototypes — and terrifying for production. Deterministic coding replaces hope with proof.

David Charlot • • Addendum & Errata: Nov 25, 2026 • 8 min read • Glossary • Verification & AI-Use Disclosure
deterministic code-generation verification lean4 rce-vc

Here’s a question that keeps me up at night: how do you trust code that was written by a system that doesn’t understand what it wrote?

Large language models generate code the same way they generate prose — by predicting the next likely token given the preceding context. The output looks correct. It compiles. It passes the tests you thought to write. And then, six months later, it fails in a way that no human would have introduced, because the failure mode exists in a region of the state space that the model’s training data never covered.

This isn’t a hypothetical. It’s happening now, at scale, across every organization that uses AI-assisted development. The code works until it doesn’t, and when it doesn’t, the failure is alien — not the kind of bug a human writes, because it wasn’t written by a human.

Deterministic coding is our answer to this problem.

The Entropy Problem

Every line of AI-generated code carries entropy — uncertainty about whether it does what you think it does. Traditional software engineering manages entropy through testing, code review, and type systems. But these mechanisms were designed for human error patterns.

Human errors are systematic. We forget edge cases, misread documentation, copy-paste incorrectly. These errors are detectable because they follow predictable patterns.

AI errors are stochastic. The model might generate a correct algorithm with a subtly wrong boundary condition. It might use an API correctly 99% of the time and hallucinate a parameter the other 1%. It might produce code that’s semantically different from what it appears to do, because the model optimized for token-level plausibility rather than semantic correctness.

Standard testing catches the first category. It misses the second, because you can’t write tests for failure modes you can’t predict.


Bounded-Entropy Theory

Our approach starts with a formal framework we call bounded-entropy theory. The core idea is simple: for any code generation task, there exists a maximum acceptable entropy — a bound on how much uncertainty the output can carry. (Superseded / corrected — informal February framing; in standard information theory Shannon conditional entropy H(Y|X) is distinct from specification conformance, and program equivalence is undecidable in general by Rice’s theorem; see Nov 25, 2026 Errata & Addendum below)

If the task is generating a configuration file, the entropy bound is near zero. The output should be deterministic given the inputs. If the task is generating a novel algorithm, the entropy bound is higher, but still finite and measurable.

Bounded-entropy theory gives us two things:

A metric. We can measure the entropy of generated code by analyzing its semantic distance from a verified specification. This isn’t just “does it compile and pass tests” — it’s “does it provably implement the stated behavior and nothing else.” (Superseded / corrected — exact behavioral proof holds only within decidable or mechanically proof-carrying subsets, and only up to the fidelity of the human-authored specification; see Nov 25, 2026 Errata & Addendum below)

A rejection criterion. If the measured entropy exceeds the bound for the task class, the code is rejected before it enters the codebase. No review needed. No human in the loop for the rejection decision.


Cortex: Neural-Symbolic Programming

Cortex is our neural-symbolic programming system. It sits between the LLM and the codebase, translating probabilistic model output into deterministically verified code. (Superseded / corrected — February 2026 architecture prototype, not yet backed by the six-kernel Lean 4 quorum described in the Nov 25, 2026 Addendum below)

The workflow:

  1. The developer describes intent in natural language or structured specification
  2. The LLM generates candidate code
  3. Cortex extracts the semantic structure of the candidate
  4. AI-Verify (our static analysis engine) checks the candidate against the specification
  5. If verification passes, the code is accepted. If not, the failure analysis feeds back to the LLM for a corrected attempt

This isn’t prompt engineering. It’s not chain-of-thought. It’s formal verification applied to generated code, with the verification happening automatically and the results feeding a closed-loop correction system.


Why This Matters Now

The adoption curve for AI-generated code is exponential. Developers who resist it will be outpaced by those who embrace it. But developers who embrace it without verification are building on sand.

Deterministic coding doesn’t slow down AI-assisted development. It makes it safe. The verification overhead is small compared to the cost of debugging alien failures in production.

We’re not arguing against AI code generation. We’re arguing for mathematical certainty that the generated code does what it claims to do. Trust, but verify — and make the verification automatic.


Probabilistic generation is powerful. Deterministic verification makes it trustworthy. Together, they’re the future of software engineering.

Strength and Honor.


View Repository OpenIE Research (URL updated Nov 25, 2026 from retired Feb 2026 subdomain — see Changelog)

Learn more at openie.dev (URL updated Nov 25, 2026 from retired Feb 2026 subdomain — see Changelog)


Archival Note & Technical Errata

The February 21, 2026 essay above is preserved verbatim from founding commit 5e5f2a3 (with only two retired OpenIE subdomain links updated in the footer). Our November 2026 review records three important technical clarifications:

  1. “Bounded-Entropy” vs. Formal Verification & Rice’s Theorem: In February 2026, we used “entropy” loosely to describe specification ambiguity and candidate variance, and claimed we could measure “semantic distance from a verified specification” so code “provably implement[s] the stated behavior and nothing else.” Strictly speaking, Shannon token/tree entropy (H(Y | X)) measures distribution spread, whereas specification satisfaction is a Boolean/logical refinement relation. By Rice’s theorem, arbitrary semantic equivalence of Turing-complete programs is undecidable; automatic sound-and-complete rejection requires restricting targets to decidable fragments (total DSLs, finite-state machines, SMT-decidable Refinement Types) or requiring candidate edits to carry machine-checkable proof terms (Lean 4). Furthermore, formal verification only guarantees conformance to the written specification—if a natural-language intent is formalized into a flawed specification, the specification gap remains.
  2. February 2026 Prototype Scope (Cortex & AI-Verify): At publication on February 21, 2026, Cortex and AI-Verify were early AST/contract-checking wrappers in openIE-dev/Deterministic-Coding, not a full deductive theorem-proving pipeline.
  3. Statistical Bounds on Zero-Failure Gate Counts & Warm-Cache Telemetry: Where our later November 2026 benchmarks observed zero broken repository commits behind admission gates, finite-sample binomial bounds apply—never an unqualified 0.00% population failure rate:
    • 0 / 60 gated bad commits on the 60-task Python repair benchmark (59 / 60 solved, 1 / 60 cleanly abstained): two-sided 95% Clopper–Pearson exact confidence interval [0.00%, 5.96%] (one-sided 95% upper bound 4.87%).
    • 0 / 40 gated broken commits across 40 SWE-bench Verified worktrees: two-sided 95% Clopper–Pearson exact interval [0.00%, 8.81%] (one-sided 95% upper bound 7.22%).
    • 70 µs and 317 µJ admission latency/energy in RCE-VC (100,000 De Bruijn-indexed items) reflects in-memory warm-cache incremental admission measured via host on-chip energy counters (reported_j, not physical DC board shunts measured_j, and excluding cold disk deserialization or full downstream test-suite execution).

The generate-and-verify paradigm builds on decades of programming-languages, software-engineering, and constrained-decoding research that the February essay should have cited directly:

  • Statistical Regularity & Code Entropy: Abram Hindle, Earl T. Barr, Zhendong Su, Mark Gabel, and Premkumar Devanbu, “On the Naturalness of Software,” ICSE (2012)—establishing empirically that human-written software has low cross-entropy under statistical language models, while highlighting where rare/novel constructs diverge.
  • Design by Contract & Deductive Verification: Bertrand Meyer, “Applying ‘Design by Contract’,” IEEE Computer 25(10), 40–51 (1992); Floyd–Hoare logic, Dafny (Leino, 2010), and proof-carrying code (Necula, POPL 1997).
  • Grammar- and Type-Constrained LLM Decoding: Torsten Scholak, Nathan Schucher, and Dzmitry Bahdanau, “PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Models,” EMNLP (2021); Gabriel Poesia et al., “Synchromesh: Reliable Code Generation from Pre-trained Language Models,” ICLR (2022); Brandon T. Willard and Rémi Louf, “Efficient Guided Generation for Large Language Models” (Outlines), arXiv:2307.09702 (2023); Georgi Gerganov et al., llama.cpp GBNF (GGML BNF) context-free grammar masks (2023).

How This Seed Evolved by November 2026

  • Six-Kernel Sandboxed Lean 4.36.0 Proof Quorum + Mechanical Rust Extraction: In Time-Indexed Claims & Six-Kernel Proofs, we replaced heuristic static checks with 1,422 domain theorems (5,496 kernel-checked obligations, 0 sorry, zero custom axioms) verified across six independent type-checking kernels, paired with Inria Charon + Aeneas translation from safe Rust subsets into pure Lean 4.
  • Semantic Admission Gates (RCE-VC & Downward LUT6 Compilation): In RCE-VC and Downward LUT6 Compilation, warm-cache De Bruijn admission checks (70 µs, 317 µJ reported_j at 100,000 items) paired with test/type gates reached 90.62% on BigCodeBench, 0 / 40 broken commits on SWE-bench Verified (95% CP <= 8.81%), and 59 / 60 gated Python repairs (0 / 60 bad commits, 95% CP <= 5.96%).
  • 10-Camp Synthesis (The Communication Tool Avalanche): In The Communication Tool Avalanche, combining symbolic solvers, Bayesian inference, evolutionary search, and LLMs behind 26 µs (unmetered wall-clock latency) cryptographic WAI1 admission gates lifted benchmark completion from <= 49 / 100 for any isolated paradigm to 98 / 100 (95% CP [92.96%, 99.76%]).

Diff & Changelog (commit 5e5f2a3 → 2026-11-25)

  • Body text: Restored 100% verbatim from 5e5f2a3; updated two retired February 2026 subdomain links in the closing footer to https://research.openie.dev and https://openie.dev with explicit inline notes; added three inline bracketed errata pointers.
  • Frontmatter: Added track, artifactStatus, licenseNote, and primaryClaim; replaced unqualified zero-percent broken-commit phrasing in headlineMetric, evolutionSummary, and evolvedInto with exact 0/N ratios, 95% Clopper–Pearson upper bounds, and warm-cache reported_j labels.
  • Addendum: Added Hindle et al. (2012), Meyer (1992), PICARD, Synchromesh, Outlines, and llama.cpp GBNF citations; clarified Rice’s theorem and specification-gap limits.
DC

David Charlot

Open Interface Engineering, Inc. · Signed Provenance · Self-Checked

Essay text CC0-1.0; openIE-dev/Deterministic-Coding public repo holds early specification/gate prototypes, while November 2026 Lean 4 proof artifacts ship at research.openie.dev. Full licensing & AI-use disclosure →

Feb 2026 Essay · Verbatim Text + Nov 2026 Errata

Check the primary artifacts or run an independent replication

Inspect signed provenance manifests, rerun our public Apache-2.0 commodity-hardware replication kits, review our November 25, 2026 outside-review errata, or browse primary manuscripts on the Research Hub.