Skip to main content

Module codegen_mx

Module codegen_mx 

Source
Expand description

LOGOS → mixed-signal XPU — the unification of the digital whole-program engine (crate::codegen_sva’s wprog engine, exact ≡VM) and the analog plane (crate::codegen_ana, ε-certified floats / ½-grid-certified-exact integers).

§The dispatch covenant (settled 2026-08-30)

The analog plane is an ACCELERATOR, never a correctness dependency. A region function dispatches to the plane iff its certificate ADMITTED it (the float budget or the integer exactness gate, calibrated); the DIGITAL lowering of every region remains available in the same artifact, so stripping every binding leaves a program the engine runs ≡VM unchanged. SoC correctness is therefore the digital story; analog changes only energy and latency — inside the compiler’s own ε, or exactly, per binding.

This module owns the PARTITION (which functions bind to which lane, with ledgered refusals for the rest) and, in later phases, the composed artifact (engine config + region configs + the MixedCertificate) and the port models. Region compilation itself is entirely crate::codegen_ana::try_region — panic-safe, typed refusals, never a crash on arbitrary program shapes.

Structs§

MixedPartition
The program’s analog/digital split. bindings dispatch; refusals stay on the engine; nothing is silently skipped — every function appears in exactly one list.
RegionBinding
One region function bound to the analog plane, certificate-admitted.
RegionRefusal
One region function that stays digital, with the NAMED reason — the ledger the partition lock pins (shrink-toward-binding is the win condition).
StackBinding
One binding PLACED on the stack, with its certified thermal map — the S6 composition.
StackPartition
The stacked partition: every certificate-admitted region placed on the stack’s analog tiers with a certified temperature map that MEETS the declared cooling budget; a region that placed but cannot be cooled is a LEDGERED refusal, not a hot surprise. The accelerator covenant is unchanged — stripping every binding leaves the digital program.

Enums§

Fabric
The four faces of the machine (R4): which laws of physics serve a region.

Functions§

fabrics
Classify every function’s fabric AFFINITY: a certificate-admitted region is Dataflow; a body reaching the Solve desugar (solveLinear) is Dynamics; one reaching the Minimize desugar (minimizeQuadratic) is Relaxation; everything else is Digital — the face that refuses nothing. Deterministic, total.
partition
Partition every function of source against target: certificate-admitted regions bind (int-exact or float-ε per try_region’s lane decision); everything else is ledgered with its typed reason. Deterministic: same source + target ⇒ the same partition, always.
partition_on_stack
Partition source onto a STACK: region compilation against the stack’s analog tier, 3D placement, the exact-ℚ thermal solve, and the cooling gate — in that order, each failure a named ledger entry. Deterministic end to end.