Skip to content

Instantly share code, notes, and snippets.

@opsec-ee
Last active April 28, 2026 17:37
Show Gist options
  • Select an option

  • Save opsec-ee/d714d2bce7204ec62dc3fbc44be9bec0 to your computer and use it in GitHub Desktop.

Select an option

Save opsec-ee/d714d2bce7204ec62dc3fbc44be9bec0 to your computer and use it in GitHub Desktop.
Notation as Engineering

Notation as Engineering: What the Hardware Already Knows

H. Overman (ee) Independent Security & Systems Research — Euman Language Ecosystem Companion paper to PPO 6.5 (released 2026-04-27)


"The hardware was working perfectly. That was the problem."


The Sentence That Changes Everything

Here is what happened on February 25, 1991, in Dhahran, Saudi Arabia.

A Patriot missile battery had been running continuously for 100 hours. Its internal clock measured time in tenths of a second as an integer. To convert to seconds, the integer was multiplied by 1/10 using a 24-bit fixed-point register. The number 1/10 does not have a terminating binary representation. The register stored a truncated approximation. The error was approximately 0.000000095 seconds per tenth of a second — invisible in any single measurement, invisible in any test, invisible in any review.

Over 100 hours of continuous operation, the accumulated error reached 0.34 seconds. A Scud missile travels at 1,676 meters per second. A 0.34-second timing error displaced the predicted intercept point by 573 meters. The system classified the incoming Scud as a false alarm. No intercept was fired. The Scud struck a barracks. 28 American soldiers were killed.

  • The hardware was working perfectly.
  • The compiler had no warnings.
  • The tests had passed.

The software did exactly what the notation said. The notation did not say what anyone intended. The gap between what the notation encoded and what the engineers meant was 0.34 seconds, accumulated over 100 hours, never written down, never enforced, never visible until it was irreversible.

This paper is about that gap.


Part I: What Hardware Does

Hardware executes instructions. It does not know what they mean.

This is not a limitation of current hardware. It is the fundamental nature of computation. A processor that executes IMUL r1, r2 does not know whether the result represents a velocity, a time, a financial index, or a missile intercept offset. It multiplies. It stores the result. If the result overflows, it sets a flag — which the program may or may not check. If the result is slightly wrong due to representational error, it stores the slightly wrong value with the same confidence as a correct one.

Hardware enforces mechanics. It does not enforce meaning.

Every failure in the historical record demonstrates this in a different register:

The Patriot battery faithfully accumulated 0.000000095 seconds of error per tick across 3,600,000 ticks. The invariant — that the clock must track real elapsed time — was never stated as a structural constraint. Hardware had no mechanism to enforce it. It computed exactly what it was told.

Ariane 5 (Ariane 5 Flight 501, Kourou, French Guiana, June 4, 1996) faithfully converted a 64-bit floating-point value to a 16-bit signed integer. The value was 32,768. The maximum representable value in a 16-bit signed integer is 32,767. The hardware raised an Operand Error exception, as specified by IEEE 754. The autopilot received the exception signal and interpreted it as navigation data, as coded. The rocket destroyed itself at 3,700 meters. Every piece of hardware performed its specified function correctly.

The Pentium FDIV bug (Intel, 1994) produced slightly wrong results for specific input combinations. Not randomly wrong — wrong in a specific, reproducible pattern traceable to missing entries in an SRT division lookup table. SRT (Sweeney, Robertson, and Tocher) is an algorithm for performing floating-point division iteratively using a precomputed table of partial remainders. Five entries were absent from a table of 1,066, affecting a specific subset of dividend/divisor combinations. Hardware was certified IEEE 754 compliant. The certification was for the specification, not for correctness. These are different claims.

The Vancouver Stock Exchange (January 1982 – November 1983) faithfully truncated floating-point results on each of approximately 3,000 daily transactions for 22 months. No transaction was wrong in any detectable way. The accumulated error over 66,000 transactions caused the index to read 520 when it should have read 1,099. Hardware cannot accumulate error incorrectly. It accumulates exactly the error the representation carries.

Sleipner A (North Sea, August 23, 1991) faithfully computed finite element stresses from the mesh the engineers provided. Finite element analysis divides a structure into thousands of small elements and solves stress equations across each; the accuracy of the result depends on how fine the mesh is. The mesh was too coarse. The walls were built 47% thinner than they needed to be. At 65 meters depth, the platform sank. Hardware had no knowledge of what the numbers meant in concrete and water.

Mars Climate Orbiter (September 23, 1999) faithfully computed thruster corrections from the values it received. One ground subsystem sent thruster impulse data in pound-force seconds (lbf·s — an imperial unit of impulse equal to approximately 4.45 newton-seconds). The receiving navigation subsystem expected newton-seconds (N·s — the SI unit). The conversion factor is 4.45. Nine months of corrections were 4.45 times smaller than actual. Hardware cannot enforce units. Units are meaning. Hardware enforces mechanics.

Knight Capital (Jersey City, August 1, 2012) faithfully executed code on eight production servers for 45 minutes. A new SMARS routing algorithm had been deployed to seven of them. The eighth still ran the deprecated Power Peg code path — a routine retired in 2003 but never removed from the binary. A flag previously consumed by the deprecated path had been repurposed by the new code. The deployment turned the flag on. Seven servers used it correctly. The eighth executed the resurrected Power Peg path against the new flag's meaning. Approximately 4 million orders entered the market in 45 minutes. $440 million was lost. Hardware composed deployed code with undeleted code without warning, exactly as it would have composed any two paths the binary contained. The gap was deprecation discipline never closed: deprecated code that still executes is not deprecated.

The pattern across every failure is identical: hardware executed the notation faithfully. The notation did not carry the meaning the engineers intended. The gap between notation and meaning is where people die and spacecraft are destroyed and platforms sink and clearing accounts evaporate.


Part II: What the Compiler Misses

The common framing is: write for the compiler. The compiler will tell you when the code is wrong.

This is the wrong surface for the problem.

The compiler checks syntax. It checks types. It checks some classes of undefined behavior. These are valuable. They are not sufficient.

The compiler does not know:

  • That your clock must track real elapsed time, not just count ticks
  • That your velocity value cannot safely narrow from 64 bits to 16 bits at the trajectory your rocket will actually fly
  • That your division lookup table has five missing entries
  • That your financial index must round rather than truncate
  • That your thruster force values are in pound-force seconds when the receiver expects newton-seconds
  • That a deprecated code path you never removed is still wired to a flag the new code repurposed

In every case above, the compiler had no warning to emit. The code was syntactically correct. The types were consistent. The programs compiled clean.

The compiler checks that the notation is internally consistent. It does not check that the notation matches the intent.

That check belongs to the contract.

But hardware adds what the compiler cannot: hardware will execute wrong code across the full operational envelope, including the conditions your tests never covered. The Patriot was not tested for 100 hours of continuous operation at combat tempo. The Ariane 5 SRI was tested on Ariane 4 flight trajectories — which never produced the velocity value that caused the overflow. The Pentium was tested by sampling across a 2^128 input space. Knight Capital's deployment was tested without an integration check that all eight servers had retired the deprecated path. Sampling is not exhaustive. Hardware is.

Hardware executes whatever inputs the operational envelope delivers, without regard for test coverage. Tests cover a sample. Only the contract can make a claim that holds across the full operational envelope, because only the contract states what must be true regardless of which inputs arrive.

The vocabulary for writing that contract — Gate-X, and the FRONT/LEAD/REAR standpoints — is defined in Part III, where it is needed.


Part III: The First Principle

Foundational Axioms

Three axioms underwrite everything that follows. They are not derived. They are the load-bearing surface every section in this paper rests on.

CARDINAL RULE. Assumptions are the mother of all bugs. Never assume. State preconditions explicitly. Enforce structurally — or return Gate-X.

FOUNDING AXIOM. Hardware enforces mechanics. It does not enforce meaning.

PROJECTION PRINCIPLE. 255 and 0xFF are the same number.

The Cardinal Rule names the discipline. The Founding Axiom names what discipline the discipline is fighting. The Projection Principle names the move that closes the gap.

The Projection Principle, Worked

255 and 0xFF are the same number.

The number does not change. The surface you read it from does.

In decimal, the byte boundary is hidden. In hex, it is right there on the surface. You did not compute your way to it. The structure announced itself from the right projection.

This is the entire discipline in one example. Everything else is a consequence of it.

A surface is a projection of invariant structure onto something you can see and reason about.


The 144,000 Ratio System (ratio144k) — definition

ratio144k is an exact integer arithmetic system. Every number is represented as an integer pair (numerator p, denominator q) in canonical reduced form: gcd(|p|, q) = 1, q > 0. Arithmetic on ratio pairs is exact — no mantissa, no exponent, no rounding, no representational error possible.

The basis 144,000 = 2^7 × 3^2 × 5^3 is a highly composite number with 96 divisors. It covers all binary fractions (denominators 2, 4, 8, 16, 32, 64, and 128 — powers of 2 up to 2^7), all decimal fractions with up to three decimal places, common time fractions (1/60, 1/1440), and standard engineering ratios. Denominators that divide 144,000 are handled on a fast path; all other rationals are represented exactly as arbitrary pairs.

The contrast with IEEE 754: float tick_interval = 0.1 stores an approximation of 1/10, because 1/10 in binary is a non-terminating repeating fraction 0.000110011001100.... As a ratio pair (1, 10) it is exact. The Patriot battery's 0.34-second drift does not occur: 3,600,000 × (1/10) = exactly 360,000 seconds.


Gate-X — the error signal of the contract system

Gate-X is one of four explicit states in a 4-state gate algebra: Z (precondition boundary — domain not entered), X (structural failure — invariant broken, operation cannot complete), 0 (valid deny — correct answer is no), 1 (valid allow — correct answer is yes).

The kernel-level identifiers are GATE_Z, GATE_X, GATE_0, GATE_1; the formal Lean enumeration uses Z, X, G0, G1. The two namings are the same algebra written for two readers — prose and proof.

Gate-X is not a hardware exception and not an IEEE 754 NaN. It is a named, typed return value that fires at the point where a structural invariant is violated and propagates causally through the call chain. The system cannot proceed past Gate-X without explicitly handling it.

A hardware exception (like the Ariane 5 Operand Error) can be caught, redirected, or silently misinterpreted as data. Gate-X cannot: the receiving code must explicitly branch on it. NaN propagates silently through downstream arithmetic with no forced check; Gate-X propagates explicitly and absorbs under sequential composition (X followed by any operation yields X).

Valid return values from any function: X, 0, 1. Z annotates precondition boundaries in documentation only — it is never returned from a live code path.


FRONT / LEAD / REAR — contract standpoints, definition

FRONT/LEAD/REAR is a formal contract discipline derived from Hoare triples {P} C {Q} (Hoare, 1969, An Axiomatic Basis for Computer Programming, CACM 12(10)).

FRONT: What the caller must provide. The specific precondition, in the highest enforcement class it can reach. If it can be a static_assert, it must be. If it requires runtime information, it must be a Gate-X check at function entry.

LEAD: The specific operation that collapses the before-state into the after-state — the single crossing point where the speculative becomes authoritative, and Gate-X fires if the structure fails.

REAR: What is guaranteed after commit. What the next function's FRONT will read. If REAR and the next FRONT describe different things, the functions do not compose correctly — and hardware will execute the composition regardless.

A contract with only FRONT and REAR is two open systems pretending to be connected. Without a named LEAD, the failure point is unspecified and error handling cannot fire at the right place.


The multiplication table mod 10 projected as a color grid makes modular arithmetic visible. An exact integer ratio basis — 144,000 = 2^7 × 3^2 × 5^3, covering all common engineering fractions — projected onto exact arithmetic makes representational error structurally impossible. The FRONT/LEAD/REAR contract projected onto a function makes its three standpoints impossible to miss.

The wrong projection hides the invariant. IEEE 754 hides that 0.1 is not exactly representable. A float tick_interval = 0.1 hides that this value will accumulate error over time. A 16-bit signed integer type hides that it cannot represent all values a 64-bit float might produce. These are not hidden by accident. They are hidden by projection — the decimal surface was chosen, and the decimal surface hides the hex.

The right projection makes the invariant impossible to miss. TICK_INTERVAL_NUM = 1, TICK_INTERVAL_DEN = 10 — two integers, exact, no approximation possible. The projection reveals what the decimal hid. The Patriot's failure is visible in the representation before a single line of logic is written.

Three rules for choosing a projection:

1. State the invariant before choosing the surface. The invariant is what does not change under your operations. It precedes the representation. If you cannot state the invariant in one sentence, you do not have one yet. The invariant of the Patriot's clock: the computed time must equal real elapsed time within the system's tracking tolerance across the full operational deployment window. One sentence. It was never written. Hardware had no surface to project it onto.

2. The surface must make the invariant visible without explanation. A surface that requires explanation is the wrong surface. IEEE 754 requires the explanation: "0.1 is not exactly representable in binary, and errors accumulate over repeated addition." Exact integer ratios require no explanation: these are integers, integers are exact, multiplication of integers is exact, there is no error to accumulate. The right representation makes the invariant impossible to violate silently.

3. Multiple projections of the same invariant must agree. If two systems project the same invariant onto different surfaces, and their boundary values agree, this is structural proof — not coincidence. If they disagree, one has the wrong invariant or the wrong projection.

The third rule fires three times in the structural assurance stack and is the mechanism the rest of this paper, and PPO 6.5, build on. It is named directly in Part V.


Part IV: What the Seven Papers Prove

Bloch (2006) — How to Design a Good API and Why It Matters

Bloch's principle: APIs reflect the structure of the underlying problem, not the convenience of the implementer. The Patriot battery's tick-counting interface conflated two distinct concepts — counting ticks and measuring elapsed time. The convenience of treating them as the same field hid the structural failure: ticks accumulate without error; time as ticks-times-1/10 accumulates with error. A clean API would have separated ticks (exact integer) from seconds(ticks) (a derivation with a stated invariant). The structural separation was available. It was not chosen.

Uddin & Robillard (2015) — How API Documentation Fails

Their empirical study found that missing preconditions cause more downstream bugs than all other documentation failures combined. A precondition in a comment is skipped by the majority of developers under deadline pressure.

Ariane 5 is the canonical example. The precondition for safe conversion of horizontal velocity to 16-bit integer: the value must not exceed 32,767. This was known. It was enforced in four of seven conversions. In the three unprotected cases, the reasoning was: this value never exceeded 32,767 on Ariane 4, so protection is unnecessary. The unstated assumption — that Ariane 5 dynamics would produce the same value range as Ariane 4 — was the missing precondition. Hardware flew Ariane 5 on Ariane 5's trajectory. The assumption was wrong.

The enforcement class determines reality:

Class Mechanism When it fires
1 static_assert Before the binary exists — compile-time proof
2 Gate-X check at function entry Every call, every context, every input
3 assert() in debug + Gate-X fallback in release Debug: assert fires. Release: Gate-X fires. Half a contract — never used alone.
4 Comment When the developer reads it, understands it, and acts

Ariane 5 relied on Class 4. Hardware operated in Class 0 — all inputs, all contexts, all operational envelopes. Every precondition belongs in the highest enforcement class it can reach. A precondition that lives only in a comment is not a precondition. It is a note to the reader that hardware will execute through on the first unexpected input.

Class 3 deserves its own discipline: an assert() that fires in debug and is silenced by -DNDEBUG in release is half a contract. The release binary — the binary hardware actually executes in the field — has no enforcement. A Class 3 precondition must always be paired with a Class 2 Gate-X fallback. Both lines. Both purposes. Neither pretends to be the other.

Maalej & Robillard (2013) — Patterns of Knowledge in API Reference Documentation

Their taxonomy identifies six knowledge types in documentation. Pattern knowledge — how multiple components compose — is the most underrepresented type. Individual function contracts cannot substitute for it.

Mars Climate Orbiter is the pattern-knowledge failure. Every function worked correctly. The pound-force to newton-second conversion was correct for its assumed units. The trajectory computation was correct for its received values. The problem was at the composition boundary: the interface between two subsystems carried no unit specification. The canonical pattern for data crossing a subsystem boundary — state the units, state the range, state the contract between systems — was not stated.

Nine months of correct individual computations composed into a fatal systematic error because the composition pattern was missing. Hardware composed the subsystems in the order they were called. Hardware had no access to the engineers' intent about what units should cross the boundary.

The principle: every module boundary must carry a composition pattern — the canonical sequence of calls, the data that crosses each boundary, the units of each value. Individual contracts say what each function does. The composition pattern says how they must be chained. Without the pattern, hardware executes whatever composition the code produces.

Ernst et al. (2015) — Measure It? Manage It? Ignore It?

Their finding: debt that is not named and measured will not be paid. Teams that plan to fix it later never do.

Vancouver ran for 22 months with a truncation error per transaction of sub-penny magnitude. Hardware executed 3,000 transactions per day, faithfully, for 22 months. The fix was one line of code. The decision not to fix it was ordinary human deferral of a cost that felt small in isolation.

Hardware does not defer. It executes at hardware speed. Sub-penny per transaction becomes 578 index points over 66,000 transactions.

The principle: every approximation must be named, given a maximum error bound, and tracked. Not the approximations that feel important — all of them. "Close enough per transaction" is not a verifiable claim. "Maximum error per transaction is 0.001; over 66,000 transactions maximum accumulated error is 66; we accept this" is a verifiable claim. If you cannot write the second form, you have not measured the debt. Hardware will measure it for you, in the field, at scale, in the conditions you did not test.

Eick et al. (2001) — Does Code Decay?

Their finding: code decay concentrates in frequently-modified files that lack contract updates. The files most likely to have silent assumptions are the ones most recently changed.

The Patriot battery was identified as having timing drift eleven days before the attack. A patch was developed. The patch arrived the day after. The gap between identification and remediation was eleven days of continued operation with a known decaying time reference.

The original notation failure was the approximation of 1/10. The secondary failure was operational: once the drift was known, the system continued executing the known-incorrect computation for eleven days. Hardware does not pause because engineers are working on a fix. It executes.

The principle: every commit that modifies a function must verify the function's contract is still correct. Not that the code compiles — that the preconditions, the named operation, and the guarantees still accurately describe the post-change function. A contract that does not track with code changes decays. In hardware-adjacent systems, decay executes at hardware speed.

Mens & Tourwé (2004) — A Survey of Software Refactoring

Refactoring is any transformation of source code that preserves observable behavior while improving its internal structure. The paper surveys techniques including: rename (changing a name without changing logic), extract method (moving a code block into a new function), inline (the reverse), move (relocating to a different class), and introduce parameter. Their finding: rename is the most dangerous refactoring because it changes the surface without changing the logic. The regression test for a refactoring is the contract, not the output.

The Ariane 5 SRI reuse is a refactoring decision with fatal consequences. The component was taken from Ariane 4 and reused in Ariane 5. Output behavior was preserved — same code, same logic, same output format. The contract was not preserved — same code, operating in a different flight dynamic envelope, producing values outside the original contract's domain.

Before-state: horizontal velocity on Ariane 4 trajectories, bounded by Ariane 4 dynamics, always within 16-bit range. After-state: horizontal velocity on Ariane 5 trajectories, unbounded by Ariane 4 assumptions, exceeding 16-bit range.

The invariant — that horizontal velocity would remain convertible — was never stated. When the deployment context changed, hardware executed in the new context with no awareness of the old assumptions.

The principle: every structural change carries a transformation record. Before-state, after-state, invariant both preserve, evidence the invariant holds in the new context. A commit message that says "refactor" satisfies none of these. Hardware will execute the post-change code in all contexts. The transformation record is the proof that all contexts are safe.

The Liskov & Wing (1994) formal criterion makes the transformation record verifiable: a transform preserves equivalence iff the new FRONT is no stronger than the old (preconditions weakened or unchanged) and the new REAR is no weaker than the old (postconditions strengthened or unchanged). Both conditions required. The criterion turns "the change is safe" into a claim a reviewer can check without trusting the author.

Lawall & Muller (2018) — Coccinelle: 10 Years of Automated Evolution in the Linux Kernel

Coccinelle is a program transformation tool for C code used extensively in the Linux kernel. It operates via semantic patches: formal descriptions of a code pattern to match, a replacement pattern, and constraints defining where the transformation is safe. The paper demonstrates that automated large-scale transformation of a 30-million-line codebase is tractable when every transformation states its equivalence proof explicitly — before-pattern, after-pattern, and the invariant both preserve.

The Pentium FDIV bug is a hardware-level failure of this principle. Intel's table generation was a transformation from the SRT division algorithm. Five entries were missing from the division lookup table — the transformation from the SRT algorithm to the table was applied incorrectly to a specific subset of the input space. The transformation was not stated as an equivalence with a verifiable proof. It was implemented, tested by sampling, and shipped.

Testing by sampling of a 2^128 input space is not a proof. Hardware executed the incorrect entries faithfully for every computation that landed in that region, for the operational life of every affected Pentium. The untested cases were the ones that were wrong.

The principle: every transformation is a proof obligation, not an assertion. State the before-pattern, state the after-pattern, state why they are equivalent under the named invariant. Without the proof, the transformation is a guess that hardware will test in the full input space.


Part V: The Engineering Standard

From the seven proofs and the hardware record, a coherent standard emerges.

The Knowledge Stack (L-1 through L6)

Before writing code, eight questions must be answered in order. Hardware can enforce none of them. Only notation can.

L-1: What proof kernel does the composition close over?

Before the domain is chosen, the algebra that will mechanically verify your composition must already exist. The proof kernel is finite, frozen, mathlib-free, and shared across every module that uses it. It defines four states (Z/X/G0/G1) and three operators (gnot, gand, gor) and the laws those operators satisfy. The laws — X-absorption, G1 identity, commutativity, associativity, idempotence, De Morgan — are theorems closed by exhaustive case analysis over the four-element gate type. rfl is the reviewer.

The kernel is L-1 because it pre-exists every L0 choice. You cannot pick a mathematical domain and then decide what algebra will verify the composition you write inside it. The verifier substrate comes first. A module that redefines Gate, gand, gor, or gnot locally is a module that has stepped outside the discipline; the kernel hash on that module's record will not match.

In v6.5 the kernel is plural by construction. The same algebra is verified by multiple verifiers (Lean, MM0, Coq, others), each with its own native mechanics. The set of artifacts is the matrix. Convergence across the matrix is what makes the kernel real, not any single verifier's "yes." The matrix discipline is named in Convergence Across Independent Witnesses below.

L0: What mathematical domain?

The domain determines which approximations are acceptable and which are fatal. IEEE 754 is the wrong domain for decimal fractions — it approximates 1/10, and hardware executes that approximation faithfully across 3,600,000 ticks. The Vancouver Stock Exchange chose truncation in a domain where the correct operation is rounding — a domain choice made silently, never stated, wrong for 22 months. Exact integer ratios (ratio144k) are the right domain for both cases — represent 1/10 as the integer pair (1, 10), represent each transaction increment as (1, 1000), and hardware cannot accumulate representational error because there is none to accumulate. The domain choice is made before the first line of code. Hardware implements whatever domain you chose, faithfully, for the operational life of the system.

L1: What is the invariant — one sentence?

The invariant is what does not change under the operations you are implementing. If you need two sentences, you have two invariants or a description. Keep dissolving. For the Patriot's clock: the computed time must equal real elapsed time within tracking tolerance across the full operational deployment window. For Sleipner A: the computed stress at every point in the structure must equal the actual load the concrete will bear at installation depth. Neither invariant was ever written. Hardware cannot enforce an unstated invariant. The finite element mesh that underestimated Sleipner's shear stresses by 47% was not wrong by accident — it was wrong because the invariant it was supposed to satisfy was never named as a structural constraint that the mesh density was required to meet.

L2: Which projection makes the invariant visible?

The same invariant can project onto many surfaces. Choose the one that makes the invariant impossible to miss. float tick_interval = 0.1 hides the approximation. uint64_t tick_num = 1, tick_den = 10 makes it visible — these are integers, they are exact, there is no approximation to hide.

L3: What is the LOGOS — what is the name?

A name applied before L-1–L2 is a label. A name applied after L-1–L2 is notation. Labels go stale because they were assigned before the structure was understood. Notation does not go stale because it was derived from the invariant. thruster_force_ns versus thruster_force — one carries the unit in the name, one does not. Hardware executes both identically. The name is for the next engineer who will write the next function that uses this value.

L4: What is the LOGIC — what are the operations?

The operations that preserve the invariant. Each one has three standpoints that must be named precisely: FRONT, LEAD, and REAR (defined in Part III). The contract operator encodes the mapping geometry:

Operator Meaning Example
(AS/.\IS) Bijective. Reversible. Round-trip preserves identity. feistel_encrypt_36: every input maps to a unique output; the inverse recovers the original exactly.
(AS/--\IS) Lossy to timeless invariant. Same input always yields same output. No before-state consumed. Hash positions, divisibility gates. The output IS the invariant regardless of when the function is called.
(AS/--\WAS) Lossy with temporal consumption. The output describes what the input WAS. Elapsed time intervals, state transitions, consumed buffers. A before-state existed; the LEAD consumed it.
(AS/+\{IS}) Expanding. One input produces a set of outputs. Set membership IS the contract. Factorization returns all prime factors. A query returns a result set.
-- Procedural. Not a data mapping. State construction, side effects, tests, builders. sieve_generate(), self-test routines.

The WAS/IS distinction is not stylistic. A hash function is (AS/--\IS) — same input always yields same output, no before-state consumed. Calling it (AS/--\WAS) is a structural lie: WAS implies a temporal before-state that was destroyed, which does not exist for a pure mathematical projection. The grammar enforces this distinction.

L5: Write the code.

If L-1–L4 are correct, L5 is largely mechanical. If L5 is hard, that difficulty is a diagnostic signal pointing upward to the level where an assumption is wrong. Do not push through difficulty at L5. Read it. The Ariane 5 engineers' difficulty in protecting all seven conversions within the CPU budget was a signal from L1: the invariant was not achievable in the chosen implementation context. The signal was managed as a resource constraint. Hardware flew through the gap.

L6: Does the code agree with itself?

After L0–L5 are complete, one obligation remains: prove that the composition the C code performs across the gate algebra matches the contract's structural claim. For every function returning a GateResult, two theorems close by rfl:

  • Positive obligation: under the phase where every anchor reads GATE_1, the composition returns GATE_1.
  • Anti-poisoning obligation: under any phase where any single anchor reads GATE_X, the composition returns GATE_X.

Both close by reflexivity over the four-element Gate inductive — exact enumeration of the 4^N input space, no SMT solver, no heuristic, no sample. The Pentium FDIV bug is the canonical case for why this matters: a 1,066-entry table tested by sampling shipped with five wrong entries. Sampling is not exhaustive. Hardware is. Reflexivity over a finite algebra is.

Unprovability at L6 is a signal, not a defect to weaken. If the obligation does not close by rfl, one of L1, the contract, the phase constructor, or the C code is wrong. Return to the level where the assumption is wrong. Do not add sorry. Do not substitute a non-rfl tactic. Do not proceed past L6 with an unclosed obligation.

Two structural rules govern the stack:

  1. You cannot skip levels. Starting at L3 without L-1–L2 produces code that compiles, passes tests, and implements the wrong invariant on the wrong surface in the wrong domain. This is the most dangerous class of bug: it looks finished.
  2. Each level constrains the level below it. A violation at level N cannot be fixed at level N+1.

The Möbius Topology of Every Contract

Möbius strip — topological metaphor used here

A Möbius strip is a one-sided surface constructed by taking a rectangular strip, giving it a half-twist, and joining the ends. Unlike a cylinder (two distinct sides), a Möbius strip has only one face and one edge. If you draw a line along the centre, you traverse what feels like both "sides" before returning to the start — because there is only one side.

Used here as a structural metaphor: a FRONT and a REAR without a named LEAD are two separate open systems (a cylinder — two distinct sides). Joining them with a named LEAD (the half-twist) produces one continuous surface. There is no "inside" or "outside" — only the traversal. A contract missing any of the three standpoints is topologically an open system.

A contract is not a pair of endpoints. It is a single closed surface. Take the precondition state (FRONT) as one open system. Take the postcondition state (REAR) as another. Join them at the operation (LEAD) with a half-twist. The result is a Möbius strip — one face, no inside or outside, no front or back. There is only the traversal.

The practical consequence: a contract without all three standpoints named is an open system. The caller knows what to provide (FRONT) and what to expect (REAR), but not what commits the transition (LEAD). That gap — the unnamed pivot — is where Gate-X must fire if the invariant fails. If the pivot is not named, the failure point is unspecified, and error handling cannot fire at the right place.

Gate-X is causal, not terminal. It fires at the point where the structure fails — not at the point where you notice. The Ariane 5 SRI emitted an exception at the moment of overflow — at the LEAD. The autopilot received diagnostic data at the REAR and acted on it as navigation data. The Gate-X signal fired correctly. The downstream system had no contract specifying that this signal meant abort rather than navigate. The missing contract between the SRI and the autopilot is the missing Möbius — two open systems that hardware connected without the half-twist.

The contract operator is a STATIC property of the function — what it IS, permanently. A traversal of the Möbius is a DYNAMIC event that returns mirror-reversed: what was AS is now WAS. The operator never changes; the traversal state changes per call. Confusing the two — annotating dynamic state on a static operator — is the same class of error as conflating Gate-0 and Gate-X.

Emergence vs. Imposition

A label is assigned by the programmer. A measurement is read off the structure that already exists.

These look identical from outside. They have opposite failure modes.

A stored classification goes stale silently. A computed measurement is wrong at call time, in front of you.

The Vancouver Stock Exchange stored its index as a field to be updated on each transaction. The field was the index. But the index was never the field — the index was the computed sum of all transaction values from the starting point. Storing it as a mutable field opened the gap where truncation error could accumulate invisibly. If the index had been computed on demand from the underlying transaction log, the truncation error would have appeared as a wrong result on the first computation, not as 578 invisible index points over 22 months.

If you can compute it, compute it. Nothing stores what can be computed. Nothing recomputes what is already in scope.

Choke Point Sealing

You do not need to protect every layer.

You need to identify and seal the single boundary that all data must pass through. Everything above a sealed choke point is protected by construction — not by convention, not by audit. By the seal itself.

The choke point has three states: Buffer → Page → Stream.

mprotect(PROT_READ) — definition

mprotect is a POSIX system call (sys/mman.h) that changes the access permissions of a page-aligned memory region. PROT_READ marks the region read-only. Any subsequent write to that region causes SIGSEGV — a hardware-enforced access violation raised by the MMU (Memory Management Unit), the hardware component that enforces virtual memory permissions.

In the context of choke point sealing: once a data buffer has been validated and committed, mprotect(region, size, PROT_READ) seals it. No subsequent thread, signal, race condition, use-after-free, or buffer overflow can corrupt it. The operating system enforces this at the hardware level. It is not a software convention; it is a physical property of the address space.

Buffer is raw, mutable, unverified. Data exists here before the invariant is confirmed. Dangerous by definition.

Page is sealed — mprotect(PROT_READ) after the phase commits. Post-seal write is SIGSEGV. Before the seal: speculative. After: authoritative. The invariant is confirmed at the moment of sealing.

Stream is what flows out of the seal — read-only to all downstream consumers. No consumer can corrupt it. No race can touch it. The seal is the proof.

The relationship to Gate-X: Gate-X fires at the LEAD crossing — the moment Buffer becomes Page. If the invariant fails at the crossing, Gate-X propagates and the seal does not happen. Buffer remains Buffer. Downstream consumers receive Gate-X, not a corrupted Page. The choke point and the Gate-X point are the same boundary.

The Door Stack

Just as types denote mathematical domains and contracts denote behavioral boundaries, memory protections denote trust domains. The Door Stack applies the notation principle to physical memory layout: a boundary that is not named cannot be sealed, and a boundary that is not sealed cannot be enforced.

The choke point principle scales. One sealed door protects one phase. Six sealed doors in sequence protect the system.

1D.Stream : Frame : Buffer : MM : IO : NN

Stream — data in motion, unstructured, untrusted by definition. Nothing enters Frame without passing the Stream door.

Frame — structured unit. The framing seal confirms structure before content is interpreted. Malformed frames do not reach Buffer.

Buffer — mutable working memory, sealed to Page on commit. After sealing, Buffer becomes Page. Nothing written after the seal survives.

MM — memory management. The allocator is the door. Data that was never allocated cannot be reached.

IO — the hardware boundary. Data that crosses IO is explicitly requested. The interface to physical devices and the kernel.

NN — the outermost envelope. The boundary between this system and everything external to it.

The invariant of the door stack: if it is inside, it is meant to be inside. A sealed door cannot be crossed by accident. Presence inside a sealed layer is the proof of authorization. You do not need a separate security audit. The architecture is the audit.

Most security failures occur because a boundary was never named. Buffer overflows reach memory that was never sealed. Injection attacks reach IO because Frame did not seal. Seal all six doors in order and these attack surfaces do not exist.

Phase Ordering Is an Invariant

Causal sequence is not a preference. It is a structural requirement that hardware will either enforce or violate, with no middle ground.

MEASURE before CORRECT. SIFT before RECONCILE. RECONCILE before AMPLIFY.

A phase ordering bug is invisible from the logic surface. It is only visible from the structure surface — the causal graph that must exist before the code. The code cannot show you the phase ordering error. The graph can.

When phase ordering can be enforced in hardware, enforce it in hardware. When it cannot, enforce it in the type system. When it cannot be enforced structurally, enforce it with Gate-X checks at each phase boundary. When none of these are available, at minimum state it as a verified invariant and verify it in the self-test suite.

The Four-State Gate Algebra

The contract carries states. The algebra carries structure. They are the same four states viewed twice.

Z (precondition boundary), X (structural failure), 0 (valid deny), 1 (valid allow) operate on two orthogonal orderings. In the truth ordering, 0 and 1 are incomparable — they are the two answers to a well-formed question, neither weaker nor stronger than the other. In the evaluation ordering, Z < {0, 1} < X — Z names a domain not yet entered, X names a structural collapse, the two valid truth values sit between.

X is not "worse 0" or "worse 1." X is not a truth value at all. X is a structural abort: the operation could not complete because the invariant the operation depends on is broken. Treating X as a low-truth answer is the Vancouver Stock Exchange — 22 months of structural truncation read as ordinary business denial, 578 index points of accumulated error before the surface revealed what the algebra always said.

The discriminating test, when uncertain: is the system still in a valid state after this return? Yes → GATE_0. No → GATE_X. If uncertain, default to GATE_X. The Vancouver failure is what default-to-GATE_0 looks like at scale.

Composition under the algebra is governed by three laws:

  • X absorbs. gand X a = X and gand a X = X. If any input to a sequential composition is X, the composition is X. Hardware that proceeds past X is hardware computing on a broken invariant.
  • G1 is the AND identity. gand G1 a = a. A function that only checks that its input is valid does not change the answer; it confirms it.
  • Z never composes. Z is never returned from live execution. It annotates the FRONT of a function — what was not reached — and never propagates as a runtime value. If code returns Z, the contract is wrong: reclassify as X.

These laws are not conventions the author follows by discipline. They are theorems closed by rfl over the four-element Gate inductive in the proof kernel. The author writes the composition; the kernel proves the composition follows the laws. Every author. Every composition. Every input combination in the 4^N state space. The kernel is the reviewer.

The classical two-valued logic {0, 1} embeds into the algebra as the truth sub-lattice. The four-state system extends classical logic to name the two states classical bivalence leaves silent: the precondition boundary (Z) and the structural collapse (X). Hardware that operates over silent states operates over a logic that cannot enforce its own discipline. The four-state algebra makes the silent states explicit and audit-time enforced.

The fail-closed pattern is structural, not cultural. At every check site:

#define GATE_CHECK_OR_RETURN(g)                                       \
    do {                                                              \
        GateState _gate_check_result = (g);                           \
        if (_gate_check_result != GATE_1) return _gate_check_result;  \
    } while (0)

Every AXIOM_* check site in a v6.5-adopted module is followed by GATE_CHECK_OR_RETURN. Gate-X propagation is no longer a rule the author must enforce by hand. Deviation is grep-detectable. The pattern makes the discipline structural rather than convention.

Perfected Primitives

Some structures appear in module after module. The four-state gate algebra. The exact rational arithmetic on a smooth basis. The bijective hash with proven collision bound. The choke point seal under mprotect(PROT_READ). These are not utility functions to be reimplemented per project. They are perfected primitives — sealed reusable foundations that carry their own proof.

A perfected primitive has five properties:

  • Single-purpose. Its invariant is one sentence with no qualification.
  • Proven once. Its provability record exists; consumers prove only their usage of it.
  • Sealed. Its internal implementation is not modified by consumers.
  • Versioned. Breaking changes are deprecation events, not silent revisions.
  • Reusable. Two or more modules import it. A primitive used by one module is a helper, not a primitive.

The promotion path is structural: a helper becomes a primitive when a second module needs it. Two is the threshold. The promotion produces its own provability record and, in v6.5-adopted modules, two or more matrix rows that prove the primitive's invariant under structurally different verifier mechanics.

The reason to name the unit: a consumer module does not pick its primitive by what is available. A consumer picks the primitive whose algebraic shape matches the consumer's L1 invariant. Forcing a module through a primitive of the wrong shape flattens the invariant — the L1 sentence stops being one sentence and grows qualifications until the structure is hidden again. The primitive is chosen by the invariant, not by the cabinet.

The six algebraic shapes recognized at v6.5:

Shape Pattern
Gate-algebra conjunction AND-compositions of four-valued gate states with explicit fail-closed semantics
Lattice climb with bounded uncertainty Monotonic progress toward certainty with widening at a stated bound
Monotonic storage with sealed commit Write-once assertion followed by mprotect(PROT_READ)
Exact rational arithmetic over a smooth basis Integers and rationals on a fixed prime factor set; no IEEE 754
Bijective hash with proven collision bound One-to-one mapping with verified zero-collision over stated input space
Fail-closed structural enforcement Canonical macro used consistently at every check site

A primitive that does not fall into one of these shapes is either novel structural work — adding to the catalog — or a helper masquerading as a foundation.

The Quad Instrument

Verification surfaces are not interchangeable. Each instrument proves a different kind of claim. Substituting one for another is the gap.

Instrument Direction Proves
Hoare (provability record) over-approximation absence of bugs on valid inputs
Incorrectness (bug-presence scanner) under-approximation presence of confirmed bugs, zero false positives
Kernel (mechanical proof, v6.4) exact composition correctness over the finite gate algebra
Matrix (cross-verifier convergence, v6.5) exact the kernel's algebra survives translation between verifier traditions

Hoare logic shows that valid inputs produce valid outputs. It does not catch bugs that hide on the paths it does not enumerate. Incorrectness logic finds bugs the scanner reaches. It does not certify the absence of bugs on paths it does not explore. The kernel proves composition exactly over the four-state algebra — no sample, no heuristic, exhaustive over 4^N. The matrix proves the kernel itself is real: the same algebra verified by multiple independent verifiers using different native mechanics, with convergence on the canonical inventory of theorems.

Each instrument closes a gap the others leave open. Each instrument has a matching failure where the gap was visible: Vancouver hid in the Hoare-only era because no incorrectness scanner under-approximated the truncation path. Pentium FDIV survived sampling because no kernel proved the table's transformation. The matrix discipline was forced into existence because individual verifier "yes" answers can mask features the source verifier provided for free that the target does not.

The four instruments are orthogonal. The gap between any two is where hardware operates. Close all four. Convergence across the four is the discipline.

Convergence Across Independent Witnesses

When two systems built independently from the same invariant agree at their boundaries, agreement is not coincidence. It is structural proof that the invariant is real and both systems projected it correctly.

The worked example is the {2, 3, 5}-smooth divisibility structure. One system represents it as exact integer arithmetic on the basis 144,000 = 2^7 × 3^2 × 5^3 — a highly composite number with 96 divisors that covers all binary fractions to 2^7, all decimal fractions to three places, and the common time and engineering ratios. A second system represents it as a depth-stratified prime categorization engine: depth-1 primes are those whose successor p+1 factors only over {2, 3}; depth-k primes are those whose successor includes at least one factor of category k-1.

The two systems are entirely different surfaces. Different code. Different operations. Different vocabularies. The boundary check:

Boundary Arithmetic system Categorization engine
mod 144 144 | 144,000 28 seed boundaries in [0, 4096]
mod 12 12 | 144,000 5 primes in [0, 12]: {2, 3, 5, 7, 11}
mod 3 3 | 144,000 3 = non-binary base factor of depth-1

Convergence at three orthogonal boundaries. Same invariant. Different projection. The agreement is the proof.

The principle generalizes. Any time two implementations built from the same L1 invariant agree at a stated boundary, the invariant is confirmed. When they diverge, one has drifted — the right move is to read the divergence as a signal and find which projection lost the invariant, not to silence the divergence.

In v6.5 the principle fires three times in the structural assurance stack:

  • At the algebra layer. Two systems built from the same invariant agree at boundaries. The invariant is real. (This section's worked example.)
  • At the kernel layer. The same algebra verified by multiple verifiers using different native mechanics — Lean's CIC, MM0's raw axiomatic substrate, Coq's CIC variant, Isabelle's HOL, Agda, ACL2, Metamath ZFC. The set of artifacts is the matrix. Each artifact is a surface in the §5 sense. Each row pins to its own SHA. The kernel is plural by construction.
  • At the detection layer. Hardware finds gaps, audits find gaps, divergent verifiers find gaps. Three independent detection mechanisms. The notation that survives all three is notation hardware can execute faithfully.

The matrix has a deeper grammar. The disciplined question for any kernel artifact is not just "does it close?" but "what is the weakest verifier in the matrix that still closes it?" A weaker floor is a stronger structural claim. A theorem that closes in MM0's raw axiomatic substrate is a theorem that does not depend on any feature CIC provides for free. The matrix is therefore a reverse-mathematics instrument applied per-artifact: it tells you the proof-theoretic strength your invariant actually requires, not the strength your favorite verifier happens to give you.

When the matrix diverges — when the same theorem closes in one verifier and not in another — divergence is not noise. It is signal. The four-response discipline runs in order:

  1. Per-proof feature classification. Does the proof actually use the divergent feature? If not, the divergence is a port defect.
  2. Port structural gap discharge. If the proof uses a feature the target lacks at the framework level, add an explicit axiom for that feature.
  3. Genuine descent. If a weaker form of the theorem closes in the target, mark the original as REVERSE-DESCENT.
  4. Genuine impossibility. If the proof uses a feature that cannot be encoded in the target's logical framework in any way that is sound and complete (proof irrelevance, coinductive types, certain shallow embeddings of linear logic), mark the theorem SOURCE-EXCLUSIVE. Consumers depending on it pin directly to the source-verifier artifact.

Never escalate before reverse-classifying. Never declare impossible before checking axiomatic discharge or descent. The divergence is read; it is not silenced.

The structural maturity inflection the matrix unlocks: a primitive's correctness is not contingent on the correctness of any single verifier. A primitive whose canonical inventory is closed across multiple matrix rows survives the failure of any one verifier. Its kernel TCB has effectively shrunk to the intersection of all verifiers in its matrix. Convergence is the mechanism. The matrix is the surface.

The Provability Record

The provability record is the artifact that demonstrates an unbroken invariant chain from origin to present. Because hardware operates before, during, and after review, every claim in a codebase must be verifiable without the author's presence.

Every claim is either:

  • Machine-verifiable: compile the code, run the test, grep the output, run the proof script.
  • Hand-derivable: execute this derivation, compare to the constant.

Nothing else. A claim that cannot be verified by either method is an assertion. Assertions are where silent debt lives. Hardware will find the cases where the assertion is wrong.

The base mechanisms (twelve sections, v6.3 era):

  • Every constant has a derivation: the formula, a runnable snippet, a CONFIRMED marker.
  • Every numerical table has three spot-checks against the formula.
  • Every self-test runs before any external interaction and halts on failure.
  • Every contract has all three standpoints named specifically.
  • Every structural change has a transformation record.
  • Every claim about build integrity, contract compliance, performance, or sign-off is recorded with evidence.

At v6.4 the record extends downward to the composition layer. A thirteenth section names the kernel hash, the module proof file, the anchor parity diff, the predicate parity diff, the obligation closure, the fail-closed pattern audit, the two-person review of phase constructors, and the triple-instrument attestation. A module that closes its Phase 6.5 obligations by rfl over the four-element gate inductive has proved that its composition matches the contract's claim across all 4^N input combinations. The author writes the contract; the kernel verifies the contract; the record shows the verification ran clean.

At v6.5 the record extends laterally to cross-verifier convergence. Two further subsections name the matrix attestation: which verifier rows were produced, which features each verifier provides for free that other rows must discharge as explicit axioms (the "freebies" set difference), the conservativity verification, and the carrier structure obligation. The carrier structure obligation deserves its own line: pairwise distinctness of the four gate states must be positively proved in every kernel row, not merely undisproved. The difference is what separates a real kernel from a kernel that compiles by accident.

The record is no longer one verifier's transcript. It is the convergence of multiple independent verifiers on the same canonical inventory of theorems. A primitive's correctness is no longer contingent on the correctness of any single verifier. The matrix is the proof. Convergence is the mechanism. Plural by construction is the discipline.

The Pentium FDIV table had no provability record. The transformation from the SRT algorithm to the 1,066-entry lookup table was implemented and tested by sampling — not verified by spot-checks against the formula for each entry. Five entries were wrong. Hardware executed those entries faithfully for every computation that landed in that region, in every affected Pentium shipped, for the full operational life of the chip. A provability record requiring three spot-checks per table section, plus a kernel obligation closing by rfl over the algebra the table implements, plus matrix attestation of the kernel itself, would have found the missing entries before a single chip was fabricated.


Part VI: What Profoundly Correct Code Looks Like

Profoundly correct code does not just work. It makes it structurally impossible for hardware to execute the wrong thing without a detectable signal.

Every precondition in the highest enforcement class it can reach. Hardware that violates a static_assert never produces a binary. Hardware that violates a Gate-X check returns an error on that call, not a wrong value downstream. Hardware that violates a comment-only precondition executes faithfully through the violation for the operational life of the system.

Every constant with a derivation. Hardware that receives a wrong constant will compute with it faithfully forever. The derivation is the only mechanism to catch wrong constants before hardware runs them. A table without spot-checks is a table that may be wrong in exactly the way the Pentium FDIV table was wrong — in specific regions of the input space that tests did not cover.

Every composition pattern stated. Hardware composes functions in the order they are called, in the inputs they receive, across the full operational envelope. The pattern is the statement of the correct composition. Without it, hardware executes whatever composition the code produces. Mars Climate Orbiter executed 4.45× the correct correction for nine months because the composition pattern — state the units at every subsystem boundary — was not stated.

Every transformation recorded. Hardware executes post-transformation code in all inputs, not just the inputs that motivated the transformation. The Ariane 5 SRI reuse was a transformation without a record: before-context, after-context, invariant both preserve, evidence the invariant holds in the new context. Without the record, hardware executed in the Ariane 5 context with Ariane 4 assumptions.

Every choke point sealed. Hardware cannot corrupt data above a sealed boundary. mprotect(PROT_READ) is not a performance hint. It is a structural guarantee that the operating system enforces. Every phase boundary in a multi-phase system is a choke point. Every choke point must be sealed before the next phase reads it. Sleipner A had no sealed boundary between the finite element computation and the structural conclusion drawn from it. The mesh density was a free variable — there was no gate between "this is what the model computed" and "this is what the structure can bear." The structural conclusion was read directly from an unsealed computation. At 65 meters depth, the platform paid the cost of that missing seal.

Every error signal explicit and causal. Gate-0 (valid-deny) is a business logic rejection — the structure is intact, the invariant holds, the answer is no. Gate-X (failed) is a structural violation — the invariant is broken, the operation cannot complete, the state is undefined. Conflating them produces systems that treat structural failures as recoverable business conditions and let corrupted state propagate. Name which gate state applies at every LEAD crossing before writing the function body.

NaN propagates silently. Gate-X propagates explicitly. When the Ariane 5's conversion overflowed, the hardware raised an exception. The exception was a correct Gate-X signal. The signal was not handled as an abort because no contract specified that this signal meant abort. The missing contract made the correct Gate-X invisible to the receiving system. Hardware executed faithfully through the gap.

Every composition mechanically proved. A composition that holds across the 4^N input space is a composition the four-state gate kernel certifies by exhaustive case analysis. rfl is the reviewer. The Pentium FDIV table shipped because sampling looked like proof. Hardware tested the entries sampling missed. A composition under PPO 6.5 ships only when the kernel has confirmed the composition by enumeration over the finite algebra — every state, every anchor, every combination, no sample, no heuristic. If the obligation does not close, the obligation is not weakened. The level above is wrong. Return there.

Every kernel itself convergent. The kernel that proves the composition is not one verifier's word. It is multiple verifiers' agreement on the same canonical inventory, each closed under its own native mechanics. A kernel artifact that survives the matrix has a TCB shrunk to the intersection of the verifiers that prove it. No single verifier's failure invalidates the kernel; only convergent failure does. Hardware that runs code certified by a converged matrix is hardware running code whose proof is independent of any single tool's correctness.

Every deprecated path retired. Knight Capital lost $440 million in 45 minutes because a code path that had been "deprecated" in 2003 was still wired into the production binary nine years later. Hardware does not know the difference between a path the engineers consider obsolete and a path they consider current. Hardware executes whatever the linker emits. Deprecation that does not end with grep returning zero callers and the function removed from the binary is not deprecation. It is a label on a code path hardware will still execute.

The measure of profoundly correct code is: when hardware encounters an input that no human anticipated, it either executes correctly, or it returns a named, detectable, propagated error signal. It does not execute wrong values silently. It does not accumulate error across 3,600,000 operations. It does not convert overflow into navigation data. It does not resurrect deprecated routines.


Conclusion: Hardware Is the Test That Never Ends

Test suites end. Code reviews end. Deployments ship. Hardware keeps executing.

Hardware executes in the field, at operational tempo, under conditions not anticipated in testing, for durations not covered in the design specification, on inputs no engineer considered. Hardware does not stop to ask whether the code is correct for this particular input in this particular context at this particular time. It executes.

The gap between what the notation says and what the engineers meant is the gap where hardware operates. Every undeclared precondition, every unverified constant, every missing composition pattern, every unstated transformation equivalence, every unproved composition over the gate algebra, every kernel artifact pinned to a single verifier, every undeleted deprecated path is a region of that gap. Hardware will find it — not by searching, but by executing. Eventually, in the field, under operational load, the gap will be an input, and hardware will execute through it faithfully.

The engineering discipline described in this paper is not about satisfying reviewers or passing audits. It is about closing the gap so that hardware, executing faithfully through all inputs across all operational conditions, has no gap to find.

When the notation carries meaning — when preconditions are in the highest enforcement class, when constants have derivations, when transformations have proof obligations, when composition patterns are stated, when error signals are explicit and causal, when composition is mechanically proved over the finite algebra, when the kernel itself has converged across multiple verifiers — hardware executing faithfully is hardware executing correctly. The mechanics and the meaning are the same thing.

The reader who finishes this paper and writes float tick_interval = 0.1 in a system that will run for 100 hours should feel the weight of what they just did. They handed hardware a gap. Hardware will execute through it exactly as many times as the system runs, as faithfully as the Patriot battery executed through its gap, until the accumulated error reaches 573 meters.

The reader who stores an index value as a mutable field instead of computing it from the underlying record has handed hardware a different gap — the gap where truncation compounds invisibly across 66,000 transactions.

The reader who reuses a component in a new operational context without a transformation record has handed hardware the gap that destroyed Ariane 5 at 3,700 meters.

The reader who generates a lookup table without spot-checking entries against the source algorithm has handed hardware the gap that shipped inside every affected Pentium.

The reader who builds a structure from a finite element model without stating the invariant the mesh density must satisfy has handed hardware the gap that sank Sleipner A at 65 meters.

The reader who passes values across a subsystem boundary without stating their units has handed hardware the gap that sent Mars Climate Orbiter into the Martian atmosphere at the wrong angle.

The reader who deploys new code on top of deprecated code without confirming the old path is gone from every production server has handed hardware the gap that cleared $440 million through Knight Capital's order book in 45 minutes.

The reader who writes a composition function over the four-state gate algebra without proving by reflexivity that anti-poisoning holds for every anchor has handed hardware the gap that shipped inside every affected Pentium — sampling is not exhaustive, and the gap is whatever sampling missed.

The reader who pins a consumer module to a kernel artifact verified by exactly one verifier — and never reproduces the kernel under a structurally different verifier — has handed hardware the gap of a single tool's correctness. The matrix exists because tools fail, and the convergence is the discipline that survives the failure.

All these gaps were invisible at compile time. All were silent at test time. All were found by hardware, in the field, executing faithfully.

Seal the choke point. The higher layers protect themselves.

INVARIANT before LOGOS.
LOGOS before LOGIC.
LOGIC before CODE.
CODE before PROOF.
PROOF before MATRIX.
MATRIX before GUARD.
Always.

The notation is the spec. The proof is the notation agreeing with itself. The matrix is the proof agreeing with itself across verifiers. Hardware reads the spec literally, completely, and without mercy.

Write accordingly. Prove accordingly. Validate accordingly.

Convergence across independent witnesses is the discipline.


References

  1. Bloch, J. (2006). How to Design a Good API and Why It Matters. OOPSLA 2006 Companion. ACM.
  2. Uddin, G. & Robillard, M.P. (2015). How API Documentation Fails. IEEE Software, 32(4), 68–75.
  3. Maalej, W. & Robillard, M.P. (2013). Patterns of Knowledge in API Reference Documentation. IEEE Transactions on Software Engineering, 39(9), 1264–1282.
  4. Ernst, N.A. et al. (2015). Measure It? Manage It? Ignore It? FSE 2015. ACM.
  5. Eick, S.G. et al. (2001). Does Code Decay? IEEE Transactions on Software Engineering, 27(1), 1–12.
  6. Mens, T. & Tourwé, T. (2004). A Survey of Software Refactoring. IEEE TSE, 30(2), 126–139.
  7. Lawall, J. & Muller, G. (2018). Coccinelle: 10 Years of Automated Evolution in the Linux Kernel. USENIX ATC 2018.
  8. Arnold, D.N. (1992). The Patriot Missile Failure. University of Minnesota.
  9. Ariane 501 Inquiry Board (1996). Report by the Inquiry Board. ESA/CNES.
  10. General Accounting Office (1992). Patriot Missile Defense: Software Problem Led to System Failure at Dhahran. GAO/IMTEC-92-26.
  11. NASA/JPL (1999). Mars Climate Orbiter Failure Board Report.
  12. Hoare, C.A.R. (1969). An Axiomatic Basis for Computer Programming. Communications of the ACM, 12(10), 576–580.
  13. Overman, H. (2026). The 144,000 Ratio System: Why IEEE 754 Cannot Be Trusted. Euman Language Ecosystem.
  14. Nicely, T.R. (1994). Pentium FDIV Flaw. Lynchburg College, Virginia. Published online October 30, 1994.
  15. SINTEF / Norwegian Geotechnical Institute (1991). Sleipner A GBS Loss Investigation Reports. Statoil / Norwegian Petroleum Directorate.
  16. McCullough, B.D. & Vinod, H.D. (1999). The Numerical Reliability of Econometric Software. Journal of Economic Literature, XXXVII, 633–665.
  17. SEC (2013). Order Instituting Administrative and Cease-and-Desist Proceedings against Knight Capital Americas LLC. Release No. 70694. October 16, 2013.
  18. Liskov, B. & Wing, J.M. (1994). A Behavioral Notion of Subtyping. TOPLAS 16(6), 1811–1841.
  19. O'Hearn, P.W. (2020). Incorrectness Logic. POPL 2020. ACM.
  20. O'Hearn, Reynolds, Yang (2001). Local Reasoning About Programs That Alter Data Structures. CSL 2001.
  21. Belnap, N.D. (1977). A Useful Four-Valued Logic. In: Modern Uses of Multiple-Valued Logic. D. Reidel.
  22. Necula, G.C. (1997). Proof-Carrying Code. POPL 1997. ACM.
  23. Cousot, P. & Cousot, R. (1977). Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs. POPL 1977. ACM.
  24. Meyer, B. (1992). Applying "Design by Contract." IEEE Computer, 25(10), 40–51.
  25. de Moura, L. & Ullrich, S. (2021). The Lean 4 Theorem Prover and Programming Language. CADE-28. LNCS 12699.
  26. Friedman, H. (1976). Systems of second-order arithmetic with restricted induction. Journal of Symbolic Logic, 41(3), 558–559.
  27. Simpson, S.G. (2009). Subsystems of Second-Order Arithmetic. Cambridge University Press.
  28. Harper, R., Honsell, F. & Plotkin, G. (1993). A framework for defining logics. JACM 40(1), 143–184.
  29. Cousineau, D. & Dowek, G. (2007). Embedding Pure Type Systems in the lambda-Pi-calculus modulo. TLCA 2007. LNCS 4583, 102–117.
  30. Assaf, A. (2015). A framework for defining computational higher-order logics. PhD thesis, École Polytechnique.
  31. Dowek, G. (2017). Analyzing individual proofs as the basis of interoperability between proof systems. PxTP 2017.
  32. Klein, G., et al. (2009). seL4: Formal Verification of an OS Kernel. SOSP 2009. ACM.
  33. Leroy, X. (2015). The CompCert C verified compiler. Journal of Automated Reasoning, 54(4), 415–451.
  34. Overman, H. (2026). * (PPO), v6.5.* Released 2026-04-27. Euman Language Ecosystem.

© 2026 H. Overman (ee). MIT License — attribution required. Companion paper to PPO 6.5. Updated 2026-04-28.

Comments are disabled for this gist.