# logicaffeine_base > Foundation types for Logicaffeine: arenas, string interning, spans, and exact integers, decimals, quantities, money, dates and UUIDs Every public module and item of `logicaffeine_base`, module by module, each with its one-line summary and its address. Item pages hold the full signature, documentation, trait implementations and a link to the source. - Crate page: [logicaffeine_base](https://docs.logicaffeine.com/logicaffeine_base/) - All items on one page: [logicaffeine_base/all](https://docs.logicaffeine.com/logicaffeine_base/all) - Source: [src/logicaffeine_base/lib.rs](https://docs.logicaffeine.com/src/logicaffeine_base/lib.rs) - Every crate: [llms.txt](https://docs.logicaffeine.com/llms.txt) ## logicaffeine_base - [mod algebraic](https://docs.logicaffeine.com/logicaffeine_base/algebraic/): Real algebraic numbers: exact roots of integer polynomials, with decidable equality and order. - [mod arena](https://docs.logicaffeine.com/logicaffeine_base/arena/): Arena allocation for stable AST references. - [mod closure](https://docs.logicaffeine.com/logicaffeine_base/closure/): The real closure of the values of several infinitesimals: `√(dt + dx)`, `∛(h + dt)`, every root the program’s arithmetic reaches among the values of more than one infinitesimal, held exactly. - [mod complex_algebraic](https://docs.logicaffeine.com/logicaffeine_base/complex_algebraic/): Complex algebraic numbers `re + im·i` with real algebraic parts, and every complex root of a polynomial with rational coefficients. - [mod describe](https://docs.logicaffeine.com/logicaffeine_base/describe/): Integer-sequence description-length codec (the MDL primitive) - [mod dimension](https://docs.logicaffeine.com/logicaffeine_base/dimension/): Physical dimensions as an abelian group of rational exponent vectors. - [mod elimination](https://docs.logicaffeine.com/logicaffeine_base/elimination/): Elimination: polynomials in several variables over the rationals, held sparse, and their resultants. - [mod error](https://docs.logicaffeine.com/logicaffeine_base/error/): Error types with source location tracking. - [mod exact_codec](https://docs.logicaffeine.com/logicaffeine_base/exact_codec/): Canonical byte encodings of the exact numbers — the one form they cross a task boundary, the wire and storage in. - [mod exact_real](https://docs.logicaffeine.com/logicaffeine_base/exact_real/): Exact real numbers: every computable real, to any precision, with equality decided wherever a theorem decides it. - [mod expansion](https://docs.logicaffeine.com/logicaffeine_base/expansion/): Expansions of the values of several infinitesimals in their smallest one. - [mod extension](https://docs.logicaffeine.com/logicaffeine_base/extension/): The builtins of the exact extension, read and run once for every value model. A program calls them by name (`infinitesimal`, `standardPart`, `tripCount`, …), the declarations and the supertask engine’s resolved loops call them too, and the interpreter and a compiled program both answer through `call`, so a builtin computes the same value and refuses in the same words on every tier. - [mod fec](https://docs.logicaffeine.com/logicaffeine_base/fec/): Reed-Solomon forward error correction — the erasure codec that lets a lossy transport reconstruct dropped packets without a retransmit round-trip. - [mod germ](https://docs.logicaffeine.com/logicaffeine_base/germ/): Germs at `dt = 0`: the hyperreals a loop of infinitely many infinitesimal steps leaves, known by the series of their expansion in `dt` with exact computable-real coefficients. - [mod gf256](https://docs.logicaffeine.com/logicaffeine_base/gf256/): GF(2^8) — the finite field with 256 elements, the shared substrate for erasure coding, multivariate cryptography (Oil-and-Vinegar / Rainbow), and the algebraic (XL) cryptanalysis engine. - [mod hash](https://docs.logicaffeine.com/logicaffeine_base/hash/): Cryptographic hash primitives — MD5 (RFC 1321) and SHA-1 (RFC 3174), rolled in pure Rust. - [mod hybrid](https://docs.logicaffeine.com/logicaffeine_base/hybrid/): Hybrid flows: loops of infinitesimal steps whose state flows between jumps — a bouncing ball, a thermostat — run exactly, as the ideal hybrid system their steps follow to within an infinitesimal. - [mod hypernatural](https://docs.logicaffeine.com/logicaffeine_base/hypernatural/): Infinite integers generated by the program’s generator `H` (`dt = 1/H`) — the trip counts of supertasks. - [mod hyperreal](https://docs.logicaffeine.com/logicaffeine_base/hyperreal/): Hyperreal numbers generated by the program’s infinitesimal `dt` — exact, ordered, decidable. - [mod intern](https://docs.logicaffeine.com/logicaffeine_base/intern/): String interning for O(1) equality comparison. - [mod limit_value](https://docs.logicaffeine.com/logicaffeine_base/limit_value/): Values at the end of a supertask: what depends on the infinite generator’s residue, the limit rules that turn such a value into one number, and the provisional answer of an unfinished search. - [mod matrix_exp](https://docs.logicaffeine.com/logicaffeine_base/matrix_exp/): The exact matrix exponential `e^{t·M}` of a rational matrix. - [mod money](https://docs.logicaffeine.com/logicaffeine_base/money/): Money — an exact monetary amount in a specific currency (UNIVERSAL_TYPES Part V). - [mod multi](https://docs.logicaffeine.com/logicaffeine_base/multi/): Values of several ordered infinitesimals: `dt`, `dx` declared much smaller than `dt`, and so on. - [mod nested](https://docs.logicaffeine.com/logicaffeine_base/nested/): Germs of several infinitesimals: a value of `dx`, declared much smaller than `dt`, known by its expansion in `dx` whose coefficients are values of `dt` and of the infinitesimals larger than it, not all of them exact — `exp(dt + dx) = Σ (e^dt/k!)·dx^k`, `ln(1 + dt + dx)`, the state a loop stepped by `dx` leaves when its rate is a value of `dt`. - [mod nested_flow](https://docs.logicaffeine.com/logicaffeine_base/nested_flow/): Flows across infinitesimals: the state a loop stepped by one infinitesimal leaves when its affine update holds values of others. - [mod number](https://docs.logicaffeine.com/logicaffeine_base/number/): A number of the exact tower as base holds one itself: the coefficient of an expansion of a value of several infinitesimals whose coefficients are not all exact — `exp(dt + dx)`, whose coefficients in `dx` are the germ of `e^dt` — and the value the flows of such expansions start from. - [mod numeric](https://docs.logicaffeine.com/logicaffeine_base/numeric/): The numeric tower’s foundation: a hand-rolled arbitrary-precision integer. - [mod ode](https://docs.logicaffeine.com/logicaffeine_base/ode/): Validated integration of a polynomial differential equation `x' = f(x)`. - [mod ordered_field](https://docs.logicaffeine.com/logicaffeine_base/ordered_field/): Polynomials over an ordered field with exact arithmetic, the coefficient rings of the hyperreals. - [mod ordinal](https://docs.logicaffeine.com/logicaffeine_base/ordinal/): Ordinals below ε₀ in Cantor normal form — the stage counter of transfinite execution. - [mod poly](https://docs.logicaffeine.com/logicaffeine_base/poly/): Exact univariate polynomials over ℚ — the algebra under the real algebraic numbers. - [mod puiseux](https://docs.logicaffeine.com/logicaffeine_base/puiseux/): The real closure of the hyperreals: real algebraic Puiseux series in `dt`, exactly. - [mod quantity](https://docs.logicaffeine.com/logicaffeine_base/quantity/): Quantities: an exact magnitude carrying a physical `Dimension` and a unit. - [mod sha_ops](https://docs.logicaffeine.com/logicaffeine_base/sha_ops/): The four Intel SHA-1 (SHA-NI) operations, in SOFTWARE — the exact bit-for-bit semantics of `sha1rnds4` / `sha1msg1` / `sha1msg2` / `sha1nexte`. These are the spec the tree-walker runs so that SHA-1 written in LOGOS over these ops produces the identical result whether it is interpreted (software here) or AOT-compiled to the real hardware instruction (`core::arch::x86_64`). Same idea as the scalar-lane spec behind `Lanes8Word32` → AVX2. - [mod si](https://docs.logicaffeine.com/logicaffeine_base/si/): SI-dimensioned f64 newtypes — the characterized-descriptor surface types. - [mod span](https://docs.logicaffeine.com/logicaffeine_base/span/): Source location tracking for error reporting. - [mod supertask](https://docs.logicaffeine.com/logicaffeine_base/supertask/): The run-time half of the supertask engine: the exact operations the statements it writes call, generic over a value model (`ValueAlgebra`) so the interpreter and a compiled program run one implementation. - [mod temporal](https://docs.logicaffeine.com/logicaffeine_base/temporal/): Exact calendar primitives — the bedrock of the time tower. - [mod tower](https://docs.logicaffeine.com/logicaffeine_base/tower/): The exact real types in a program’s value model: real algebraic numbers, computable reals, the program’s infinitesimal and the hyperreals it generates, infinite integers, ordinals, and the values a supertask leaves. - [mod union_find](https://docs.logicaffeine.com/logicaffeine_base/union_find/): Union-Find (disjoint set) with path compression and union by rank. - [mod uuid](https://docs.logicaffeine.com/logicaffeine_base/uuid/): UUID — a 128-bit universally-unique identifier (RFC 9562, superseding RFC 4122). - [mod word](https://docs.logicaffeine.com/logicaffeine_base/word/): Fixed-width wrapping integers — the ring ℤ/2ᵏℤ. ## logicaffeine_base::algebraic Real algebraic numbers: exact roots of integer polynomials, with decidable equality and order. - [struct Algebraic](https://docs.logicaffeine.com/logicaffeine_base/algebraic/struct.Algebraic): A real algebraic number. See the module documentation. ## logicaffeine_base::arena Arena allocation for stable AST references. - [struct Arena](https://docs.logicaffeine.com/logicaffeine_base/arena/struct.Arena): An owning arena for stable references. ## logicaffeine_base::closure The real closure of the values of several infinitesimals: `√(dt + dx)`, `∛(h + dt)`, every root the program’s arithmetic reaches among the values of more than one infinitesimal, held exactly. - [struct AlgValue](https://docs.logicaffeine.com/logicaffeine_base/closure/struct.AlgValue): A value of the real closure of several infinitesimals at its smallest. See the module documentation. ## logicaffeine_base::complex_algebraic Complex algebraic numbers `re + im·i` with real algebraic parts, and every complex root of a polynomial with rational coefficients. - [struct ComplexAlgebraic](https://docs.logicaffeine.com/logicaffeine_base/complex_algebraic/struct.ComplexAlgebraic): `re + im·i` with real algebraic parts. - [fn complex_roots](https://docs.logicaffeine.com/logicaffeine_base/complex_algebraic/fn.complex_roots): Every complex root of `p` (nonzero), once each: the real roots ascending, then each conjugate pair by its upper root, upper before lower. ## logicaffeine_base::describe Integer-sequence description-length codec (the MDL primitive) - [struct AnnihilatorWitness](https://docs.logicaffeine.com/logicaffeine_base/describe/struct.AnnihilatorWitness): A re-checkable annihilator witness: `coeffs` is the ANF (over `monomials(n_vars, degree)`) of a nonzero `g` of degree `degree` that vanishes on `C`’s support (`annihilates_complement = false`) or on `C`’s zero-set (`= true`, i.e. `g` annihilates `C ⊕ 1`). - [struct CorrelationAttack](https://docs.logicaffeine.com/logicaffeine_base/describe/struct.CorrelationAttack): The certified result of a correlation attack on one target LFSR: the recovered initial state and the statistical edge it carries. The `init_state` is a re-checkable witness — regenerate the LFSR from it and it reproduces the register the keystream leaks. - [struct Gf2](https://docs.logicaffeine.com/logicaffeine_base/describe/struct.Gf2): GF(2) — a single bit. - [struct Gf256](https://docs.logicaffeine.com/logicaffeine_base/describe/struct.Gf256): GF(2⁸) — the Rijndael/AES field (reduction polynomial `x⁸+x⁴+x³+x²+1`), one byte per element. - [enum GenCmp](https://docs.logicaffeine.com/logicaffeine_base/describe/enum.GenCmp) - [enum GenExpr](https://docs.logicaffeine.com/logicaffeine_base/describe/enum.GenExpr): A restricted, pure, TOTAL expression over the element index `i`. Every op is total (div/mod by zero is 0, wrapping i64 arithmetic), and a malformed/hostile tree is bounded at decode by a node budget + depth cap, so evaluation can never panic, diverge, overflow, or escape. - [enum PolySolveResult](https://docs.logicaffeine.com/logicaffeine_base/describe/enum.PolySolveResult): The outcome of an XL solve over GF(2). - [const MAX_GEN_DEPTH](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.MAX_GEN_DEPTH): …or this deep — bounds both decode recursion and eval. - [const MAX_GEN_NODES](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.MAX_GEN_NODES): A hostile/garbage `GenExpr` tree is rejected past this many nodes. - [const MAX_POLY_DEGREE](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.MAX_POLY_DEGREE): The highest polynomial degree the generator detector will fit (degree 1 is the affine case). - [const MAX_RECUR_ORDER](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.MAX_RECUR_ORDER): The highest constant-coefficient linear-recurrence order the detector will fit. Order 2 already covers Fibonacci / Lucas / Pell and any LFSR of that length (this is Berlekamp–Massey over ℤ). - [const T_BYTES](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.T_BYTES) - [const T_GEN](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.T_GEN) - [const T_INTS](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.T_INTS) - [const T_INTS_AFFINE](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.T_INTS_AFFINE) - [const T_INTS_DELTA](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.T_INTS_DELTA) - [const T_INTS_DICT](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.T_INTS_DICT) - [const T_INTS_DOD](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.T_INTS_DOD) - [const T_INTS_FCSR](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.T_INTS_FCSR) - [const T_INTS_FOR](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.T_INTS_FOR) - [const T_INTS_GEOMETRIC](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.T_INTS_GEOMETRIC) - [const T_INTS_LFSR](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.T_INTS_LFSR) - [const T_INTS_LRECUR](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.T_INTS_LRECUR) - [const T_INTS_PERIODIC](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.T_INTS_PERIODIC) - [const T_INTS_POLY](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.T_INTS_POLY) - [const T_INTS_RLE](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.T_INTS_RLE) - [const T_INTS_SPARSE](https://docs.logicaffeine.com/logicaffeine_base/describe/constant.T_INTS_SPARSE) - [trait FieldElem](https://docs.logicaffeine.com/logicaffeine_base/describe/trait.FieldElem): The minimal field interface Berlekamp–Massey needs. - [fn algebraic_complexity](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.algebraic_complexity): The algebraic complexity of a bit sequence at maximal degree `max_degree`: the smallest order `l` for which `detect_algebraic_recurrence` recovers a degree-`≤ max_degree` feedback, together with the ANF coefficient count `M` (the true description size — `O(lᵈ)`, not the `2^l` truth table). `None` if no order `≤ bits.len()/2` admits such a feedback at that degree. - [fn algebraic_degree](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.algebraic_degree): The algebraic degree of a Boolean function: the largest number of variables in any monomial present in its ANF (0 for a constant, 1 for affine, up to `n`). `None` for a malformed table. - [fn algebraic_filter_attack](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.algebraic_filter_attack): Recover the initial state of a filter generator by the algebraic attack: a length-`l` LFSR with feedback `taps` drives a filter `C` (truth table `filter_truth` over its `m = log₂` inputs, read as `m` CONSECUTIVE state bits), emitting `keystream[t] = C(seq[t], …, seq[t+m−1])`. Using a min-degree annihilator `g` of `C`, each applicable keystream bit becomes `g(⟨r_t,s₀⟩, …) = 0`, a degree-`AI` equation in the initial state `s₀`; expanding over `s₀`-monomials of degree `≤ AI` and solving the GF(2) system recovers `s₀`. Returns the `l`-bit initial state (verified by regeneration), or `None` if there is no low-AI annihilator, the system is underdetermined, or `l > 64`. - [fn algebraic_generate](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.algebraic_generate): Replay a degree-`d`, order-`l` algebraic feedback register from ANF coefficients over `monomials(l, d)` and an `l`-bit seed: `s[i] = ⊕ₘ coeffsₘ · monomialₘ(s[i-1],…,s[i-l])`. The inverse of `detect_algebraic_recurrence`. - [fn algebraic_immunity](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.algebraic_immunity): The algebraic immunity of a Boolean function given as its `2ⁿ` truth table: the minimum degree of a nonzero annihilator of `C` or of `C ⊕ 1`, together with a re-checkable witness. Searching degrees ascending, the first hit is the minimum (no lower-degree annihilator exists, or an earlier degree would have found it). `None` for a malformed table. `AI ≤ ⌈n/2⌉` always. - [fn anf](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.anf): The algebraic normal form (ANF) of a Boolean function: coefficients over the `2ⁿ` monomials `∏_{i∈S} xᵢ` (S a variable bitmask), via the binary Möbius transform — the GF(2) dual of the Walsh–Hadamard butterfly, and its own inverse over GF(2) (applying it to the ANF returns the truth table). `anf[S]` is `true` iff the monomial `∏_{i∈S} xᵢ` is present. `None` for a malformed table. - [fn attack_shrinking_generator](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.attack_shrinking_generator): Attack the shrinking generator: recover the initial states of both the clock register `A` (feedback `a_taps`) and the data register `S` (feedback `s_taps`) from `output` alone, by divide-and-conquer on the clock. Each of the `2^{L_A}` clock states is tried; a guess fixes the emit positions, turning every output bit into a linear equation `⟨r_{iₖ}, s₀⟩ = output[k]` in `S`’s initial state, solved over GF(2) and verified by regeneration. Returns `(a_state, s_state)` for the first guess that reproduces the output, or `None` (clock register too large — `L_A > 22` — or no consistent state). Exponential in `L_A` only, not `L_A + L_S`. - [fn autocorrelation](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.autocorrelation): The autocorrelation spectrum of a Boolean function: `r_f(a) = Σ_x (−1)^{f(x) ⊕ f(x⊕a)}`, the correlation of `f` with its shift by `a`. Computed by Wiener–Khinchin — the Walsh transform of the squared Walsh spectrum, scaled by `2ⁿ` — so it costs one extra butterfly over `walsh_spectrum`. `r_f(0) = 2ⁿ` always; `|r_f(a)| = 2ⁿ` exactly when the derivative `f(x⊕a) ⊕ f(x)` is CONSTANT — i.e. `a` is a linear structure. `None` for a malformed table. - [fn berlekamp_massey_field](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.berlekamp_massey_field): Berlekamp–Massey over a field. Returns `(L, taps)` where `L` is the linear complexity and `taps` are the connection-polynomial coefficients `c₁..c_L`; the recurrence is `s[i] = -Σⱼ c_{j+1}·s[i-1-j]`. - [fn berlekamp_massey_gf2](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.berlekamp_massey_gf2): Berlekamp–Massey over GF(2) — the shortest bit-LFSR. Thin wrapper over `berlekamp_massey_field` (see it for the full semantics). For an LFSR keystream `L` is the register length; for random ≈ n/2. - [fn best_linear_approximation](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.best_linear_approximation): The best linear approximation of a Boolean function: the mask `w` maximizing `|Ŵ(w)|`, with its bias `|Pr[C(x)=⟨w,x⟩] − ½| = |Ŵ(w)| / 2^{n+1}`. When `skip_zero`, the trivial constant mask `w = 0` (which measures `C`’s own imbalance) is excluded. Returns `(mask, bias)`, or `None` for a malformed table. - [fn bitpack](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.bitpack): Pack `vals` LSB-first at `width` bits each (1..=64). The inverse of `bitunpack`. - [fn bits_to_bytes](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.bits_to_bytes): Pack an LSB-first bit sequence back into bytes (the inverse of `bytes_to_bits`); a trailing partial group is zero-padded. - [fn bitunpack](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.bitunpack): Read `count` LSB-first `width`-bit values from `bytes`. `None` if `bytes` is too short. The inverse of `bitpack`. - [fn bytes_to_bits](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.bytes_to_bits): Expand a byte column to its LSB-first bit sequence (bit `j` of byte `i` is `(byte_i >> j) & 1`). - [fn consider](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.consider): Keep `cand` if it is smaller than the current `best` — the MDL argmin over candidate encodings. - [fn correlation_attack](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.correlation_attack): Siegenthaler’s basic correlation attack: recover the initial state of the length-`L` LFSR with feedback `taps` that best correlates with `keystream`, by exhaustive search over the `2^L − 1` nonzero initial states (each scored by agreement with the keystream). Returns the best state with its bias — significant only when `bias` clears `spurious_bias_floor``(L, n)`. Cost `O(2^L·n)`; returns `None` for an empty register, a register longer than the keystream, or `L > 20` (past the exhaustive cap — the domain of the fast-correlation attack, its scaling successor). - [fn correlation_immunity_order](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.correlation_immunity_order): The correlation-immunity order of a Boolean function (Xiao–Massey): the largest `m` such that every Walsh coefficient at a mask of Hamming weight `1..=m` vanishes. Order `≥ 1` ⇒ IMMUNE to the first-order correlation attack (Rung E finds nothing) — yet a higher-weight coefficient may still leak, which `best_linear_approximation` surfaces. `None` for a malformed table. - [fn decode_int_column_body](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.decode_int_column_body): Decode one int column whose tag byte has already been read as `tag`. The inverse of `emit_best_int_column`; returns `None` for a non-int tag or a corrupt/hostile body. `max_elements` caps generator expansion; `depth` bounds the periodic-block recursion. - [fn decode_int_seq](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.decode_int_seq): Decode a full `describe_int_seq` byte string back to the exact sequence. Requires the whole buffer to be consumed (a clean round-trip witness). Uses a default element cap. - [fn delta_encode](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.delta_encode): Delta: first value then zig-zag successive differences. Wins on monotone columns. - [fn describe_int_seq](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.describe_int_seq): The computable upper bound on Kolmogorov complexity of `v` over this description language: the shortest self-delimiting program (from the generator menu) that reproduces `v`. The returned bytes are a re-checkable witness — `decode_int_seq` reproduces `v` exactly. - [fn deserialize_gen](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.deserialize_gen): Parse a generator under a node `budget` and `depth` cap — a garbage/hostile tree returns `None`. - [fn detect_affine](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.detect_affine): If `v` is an exact affine progression `base + stride·i`, return `(base, stride)`. - [fn detect_algebraic_recurrence](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.detect_algebraic_recurrence): Recover the algebraic normal form of a degree-`≤ d`, order-`l` nonlinear feedback: the ANF coefficient vector over `monomials(l, d)` such that replaying `s[i] = ⊕ₘ cₘ · monomialₘ(window)` reproduces `bits` exactly. Returns `None` if no such low-degree feedback fits (the GF(2) system is inconsistent, or the recovered coefficients fail to regenerate the sequence). This is the degree-`d` generalization of `berlekamp_massey_gf2` (which is the `d = 1` case): it compresses low-degree nonlinear generators that fool the linear, 2-adic, and maximal-order tests. - [fn detect_geometric](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.detect_geometric): If `v` is an exact geometric progression `base · ratioⁱ` (≥3 elements, confirmed by replaying the decoder’s wrapping arithmetic), return `(base, ratio)`. - [fn detect_linear_recurrence](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.detect_linear_recurrence): Recognize `v` as a constant-coefficient linear recurrence `v[i] = Σⱼ cⱼ·v[i-1-j]` of minimal order `k ≤ [`MAX_RECUR_ORDER`]` with integer coefficients, and return `(coeffs, seeds)` — `k` coefficients + the first `k` values. This is exactly Berlekamp–Massey over ℤ: it captures Fibonacci, Lucas, Pell, and any linear-feedback sequence — none of which the polynomial detector can reach (their finite differences never settle). The coefficients are solved exactly (Cramer over `i128`) from the smallest `2k` terms and then CONFIRMED by replaying the recurrence with the SAME wrapping arithmetic the decoder uses, so a match certifies a bit-exact reconstruction. - [fn detect_modular_affine](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.detect_modular_affine): Recognize `v[i] = a + b·(i mod p)` for a small period `p` and synthesize the generator. - [fn detect_period](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.detect_period): If `v` is an exact cyclic repetition of a minimal block of period `2 ≤ p ≤ min(len/2, cap)`, return `p`. - [fn detect_poly_generator](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.detect_poly_generator): Recognize `v` as a polynomial column (degree ≤ `MAX_POLY_DEGREE`) via finite differences and return `(degree, seeds)` — the k+1 leading-edge seeds, confirmed by exact reconstruction. - [fn detect_sparse](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.detect_sparse): If one value dominates the column (covers ≥ ¾), return it and the sorted `(index, value)` exceptions. - [fn dict_encode](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.dict_encode): Dictionary: distinct values (first-seen order) then a bit-packed index column. Wins on low-cardinality columns. - [fn dod_encode](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.dod_encode): Delta-of-delta: first value, first delta, then zig-zag second differences. Wins on near-linear progressions (timestamps with jitter). - [fn emit_best_int_column](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.emit_best_int_column): Build every applicable column encoding and append the smallest to `out`. The plain-varint baseline is always a candidate, so the result is never larger than the varint form. - [fn fast_correlation_attack](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.fast_correlation_attack): Meier–Staffelbach fast correlation attack: recover the initial state of the length-`L` LFSR with feedback `taps` from a noisy keystream `keystream` (a `z = a ⊕ noise` binary symmetric channel), by iterative bit-flip decoding against the low-weight parity checks the feedback recurrence and its Frobenius squares generate. Returns the recovered `L`-bit initial state when decoding converges to a valid LFSR output that agrees with the keystream noticeably better than chance, else `None` (too much noise or too few low-weight checks — the register resists). Polynomial in `L` — no `2^L` search. - [fn fast_walsh_hadamard](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.fast_walsh_hadamard): The Walsh–Hadamard transform in place (the `±1` butterfly), on a slice whose length is a power of 2. `a[w]` becomes `Σₓ a[x]·(−1)^{⟨w,x⟩}`. - [fn fcsr_generate](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.fcsr_generate): Generate `n` bits of the FCSR keystream for `p/q` (`q` odd) — the 2-adic expansion, by repeated 2-adic division. The inverse of `two_adic_reconstruct`. - [fn for_encode](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.for_encode): Frame-of-reference: subtract the column minimum, bit-pack the residuals. Wins on clustered columns (a small range around any base). - [fn gen_eval](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.gen_eval): Evaluate a generator at index `i`. TOTAL: div/mod by zero is 0; all arithmetic wraps. - [fn leb128_encode](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.leb128_encode): The plain baseline column (`T_INTS`): an adaptive-sign header (`(n << 1) | signed`) then a varint per element — zig-zag when any value is negative, plain LEB128 otherwise. - [fn lfsr_generate](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.lfsr_generate): Replay a GF(2) LFSR: `s[i] = ⊕ⱼ tapsⱼ · s[i-1-j]`. The inverse of `berlekamp_massey_gf2`. - [fn lfsr_generate_field](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.lfsr_generate_field): Replay a field LFSR: emit `seed`, then `s[i] = -Σⱼ tapsⱼ·s[i-1-j]` (the connection recurrence). - [fn maximal_order_complexity](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.maximal_order_complexity): The maximal order complexity (Jansen) of a bit sequence: the length of the shortest feedback shift register — linear OR nonlinear — that generates it, i.e. the smallest `L` such that every length-`L` window has a unique successor (`s[i] = f(s[i-1],…,s[i-L])` for some feedback function `f`). It is the TOP of the FSR complexity hierarchy — `MOC ≤ 2-adic complexity` and `MOC ≤ linear complexity` — so it catches nonlinear generators (NFSRs, algebraic combiners with memory) that fool both Berlekamp–Massey and the 2-adic Rational Approximation. Low relative to `n` ⇒ a short-register generator; `≈ n/2` for a random sequence. Consistency is monotone in `L`, so we binary-search it. - [fn nonlinearity](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.nonlinearity): The nonlinearity of a Boolean function: `2^{n-1} − ½·maxₘ|Ŵ(w)|` — its Hamming distance to the nearest affine function. High ⇒ resistant to linear approximation; maximal (bent, `n` even) ⇒ `2^{n-1} − 2^{n/2−1}`. `None` for a malformed table. - [fn read_uvarint](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.read_uvarint): Read a LEB128 unsigned varint. `None` on an overlong/overflowing encoding or a short buffer. - [fn reconstruct_poly](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.reconstruct_poly): Replay a polynomial column from its finite-difference seeds via a difference engine. - [fn rle_encode](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.rle_encode): Run-length: (value, run-length) pairs. Wins on columns of repeated runs. - [fn serialize_gen](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.serialize_gen): Serialize a generator pre-order: a 1-byte node tag, then children. Self-delimiting. - [fn shrinking_generator](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.shrinking_generator): The shrinking generator: clock register `A` (feedback `a_taps`, seed `a_seed`) gates data register `S` (feedback `s_taps`, seed `s_seed`), emitting `S`’s bit exactly when `A`’s bit is `1`, until `out_len` bits are produced. Its output is a data-dependent decimation of `S` with very high linear complexity. - [fn solve_polynomial_system_gf2](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.solve_polynomial_system_gf2): Solve a Boolean polynomial system over GF(2) by XL (eXtended Linearization). Each equation is an XOR of monomials (bitmasks over the `n_vars` variables, `x²=x`; mask `0` is the constant) that must be `0`. For each operating degree `d = 1..=max_degree`, every equation is multiplied by all monomials of degree `≤ d − deg(eq)`, the enlarged system is linearized over the degree-`≤ d` monomials (with the constant pinned to `1`) and solved: an inconsistency proves the system unsatisfiable (`Refuted`), a solution whose degree-1 part satisfies the original equations is returned (`Solved`), otherwise the degree is raised. This solves systems the plain degree-`d` linearization cannot, and refutes ones it cannot see contradictory. - [fn spurious_bias_floor](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.spurious_bias_floor): The spurious-bias floor: the expected maximum `|agreement − ½|` when the best of `2^register_len` uncorrelated states is chosen on `n` samples — `≈ √(L·ln2 / 2n)`, from the tail of the maximum of `2^L` centered binomials. A recovered `CorrelationAttack::bias` well above this floor is a genuine correlation (a certified combiner leak); at or below it, the register does not measurably leak. - [fn two_adic_complexity](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.two_adic_complexity): The 2-adic complexity of a bit sequence: `≈ log₂ max(|p|,|q|)` for its FCSR rational `p/q`. Low ⇒ a carry-based keystream (an FCSR / add-with-carry generator); `≈ n/2` for a random sequence. - [fn two_adic_reconstruct](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.two_adic_reconstruct): Rational reconstruction of a bit sequence as a 2-adic number. Returns `(p, q)` with `q` odd and positive and `p/q ≡ Σ sᵢ2ⁱ (mod 2ⁿ)` — the shortest FCSR generating the sequence. `None` when no odd-denominator rational fits (an algorithmically-random sequence has no small FCSR). - [fn unzigzag](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.unzigzag): The inverse of `zigzag`. - [fn uvarint_byte_len](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.uvarint_byte_len): The number of bytes `write_uvarint` would emit for `x`. - [fn verify_annihilator](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.verify_annihilator): Re-check an `AnnihilatorWitness` against a truth table with zero trust in the producer: the witness is nonzero and vanishes on the required set (support of `C`, or of `C ⊕ 1`). Confirms the algebraic-immunity claim independently. - [fn walsh_spectrum](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.walsh_spectrum): The Walsh spectrum of a Boolean function given as its `2ⁿ`-entry truth table: `Ŵ(w) = Σₓ (−1)^{C(x) ⊕ ⟨w,x⟩}`, the signed correlation of `C` with every linear function `⟨w,x⟩`. Index `w` is the linear mask (bit `i` selects variable `i`). `None` if the length is not a positive power of two. - [fn write_uvarint](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.write_uvarint): LEB128 unsigned varint: 7 bits per byte, high bit = continuation. - [fn zigzag](https://docs.logicaffeine.com/logicaffeine_base/describe/fn.zigzag): Map a signed integer to an unsigned one with small magnitudes near zero (for varint). ## logicaffeine_base::dimension Physical dimensions as an abelian group of rational exponent vectors. - [struct Dimension](https://docs.logicaffeine.com/logicaffeine_base/dimension/struct.Dimension): A physical dimension: a vector of rational exponents over `BaseDim`. The group operation is `mul` (axiswise exponent addition); the identity is `Dimension::DIMENSIONLESS`; the inverse is `Dimension::recip`. - [struct Exp](https://docs.logicaffeine.com/logicaffeine_base/dimension/struct.Exp): A signed rational exponent in lowest terms with a strictly positive denominator — so equal exponents share one representation (`Eq`/`Hash` are structural). Admits fractional powers (`L^(1/2)`) while the common integer case is just `den == 1`. - [enum BaseDim](https://docs.logicaffeine.com/logicaffeine_base/dimension/enum.BaseDim): The base dimensions: the SI seven, plus the extensions Logos tracks end-to-end. Plane angle and solid angle are SI-dimensionless but tracked here to catch radian/steradian mix-ups; information (the bit) is tracked so data sizes are first-class. “Dimensionless” is the all-zero vector, not an axis. ## logicaffeine_base::elimination Elimination: polynomials in several variables over the rationals, held sparse, and their resultants. - [struct Polynomial](https://docs.logicaffeine.com/logicaffeine_base/elimination/struct.Polynomial): A polynomial in variables numbered from 0, with rational coefficients. No coefficient is zero, so equal polynomials are structurally equal. ## logicaffeine_base::error Error types with source location tracking. - [struct SpannedError](https://docs.logicaffeine.com/logicaffeine_base/error/struct.SpannedError): An error annotated with its source location. - [type Result](https://docs.logicaffeine.com/logicaffeine_base/error/type.Result): Alias for `std::result::Result`. ## logicaffeine_base::exact_codec Canonical byte encodings of the exact numbers — the one form they cross a task boundary, the wire and storage in. - [const MAX_WIRE_DEGREE](https://docs.logicaffeine.com/logicaffeine_base/exact_codec/constant.MAX_WIRE_DEGREE): The largest minimal-polynomial degree a decoder accepts: an irreducibility check is a factorization, and this bound keeps a hostile encoding from demanding an expensive one. - [const MAX_WIRE_DEPTH](https://docs.logicaffeine.com/logicaffeine_base/exact_codec/constant.MAX_WIRE_DEPTH): The deepest nesting a decoded ordinal or expression may have. - [const MAX_WIRE_LEN](https://docs.logicaffeine.com/logicaffeine_base/exact_codec/constant.MAX_WIRE_LEN): The most elements a decoded collection may claim. - [const MAX_WIRE_MAGNITUDE](https://docs.logicaffeine.com/logicaffeine_base/exact_codec/constant.MAX_WIRE_MAGNITUDE): The most magnitude bytes a decoded integer may claim. - [trait ExactCodec](https://docs.logicaffeine.com/logicaffeine_base/exact_codec/trait.ExactCodec): A canonical, self-delimiting byte encoding. See the module documentation. - [fn read_byte](https://docs.logicaffeine.com/logicaffeine_base/exact_codec/fn.read_byte): One byte. - [fn read_len](https://docs.logicaffeine.com/logicaffeine_base/exact_codec/fn.read_len): A length, at most `bound`. - [fn read_list](https://docs.logicaffeine.com/logicaffeine_base/exact_codec/fn.read_list) - [fn write_len](https://docs.logicaffeine.com/logicaffeine_base/exact_codec/fn.write_len) - [fn write_list](https://docs.logicaffeine.com/logicaffeine_base/exact_codec/fn.write_list): A length-prefixed list. ## logicaffeine_base::exact_real Exact real numbers: every computable real, to any precision, with equality decided wherever a theorem decides it. - [struct ExactReal](https://docs.logicaffeine.com/logicaffeine_base/exact_real/struct.ExactReal): A computable real number. See the module documentation. - [enum Closeness](https://docs.logicaffeine.com/logicaffeine_base/exact_real/enum.Closeness): The answer of a comparison within a tolerance: which side, or within the tolerance. - [enum Definition](https://docs.logicaffeine.com/logicaffeine_base/exact_real/enum.Definition): How a program’s function gives its real number. - [enum RealError](https://docs.logicaffeine.com/logicaffeine_base/exact_real/enum.RealError): Why an exact real could not answer. - [const DEFAULT_BUDGET](https://docs.logicaffeine.com/logicaffeine_base/exact_real/constant.DEFAULT_BUDGET): The precision budget, in bits, of a comparison whose budget the caller does not state. - [const DISPLAY_DIGITS](https://docs.logicaffeine.com/logicaffeine_base/exact_real/constant.DISPLAY_DIGITS): Significant digits a general computable real prints with. - [const STAYS_WITH_ITS_PROGRAM](https://docs.logicaffeine.com/logicaffeine_base/exact_real/constant.STAYS_WITH_ITS_PROGRAM): What a real number built from a function a program defines is, where a task, a channel or the wire refuses it: it stays with the program that defines it. - [trait Approximant](https://docs.logicaffeine.com/logicaffeine_base/exact_real/trait.Approximant): A program’s function a real number is defined by, as the tier running the program calls it from inside a refinement. The tier evaluates the function in a context of its own, so a call made in the middle of another computation changes nothing the program can see. - [fn not_a_rational_answer](https://docs.logicaffeine.com/logicaffeine_base/exact_real/fn.not_a_rational_answer): The refusal of a function’s answer at `n` that is a value of `type_name`, not a rational. - [fn not_sendable](https://docs.logicaffeine.com/logicaffeine_base/exact_real/fn.not_sendable): The sentence a program stops with when it hands a task, or sends through a channel, a value that holds a real number a function of the program defines. ## logicaffeine_base::expansion Expansions of the values of several infinitesimals in their smallest one. - [struct Expansion](https://docs.logicaffeine.com/logicaffeine_base/expansion/struct.Expansion): An expansion in the smallest infinitesimal of a value. See the module documentation. - [enum ExpansionError](https://docs.logicaffeine.com/logicaffeine_base/expansion/enum.ExpansionError): Why a coefficient or an operation of an expansion is not given. - [trait Coefficient](https://docs.logicaffeine.com/logicaffeine_base/expansion/trait.Coefficient): The values an expansion’s coefficients are: a field with the operations the recurrences ask for, each refused in the coefficient’s own words when it cannot be done. - [trait Source](https://docs.logicaffeine.com/logicaffeine_base/expansion/trait.Source): A source of coefficients defined outside the operations here: a value of one infinitesimal read as a value of several, a flow’s state. ## logicaffeine_base::extension The builtins of the exact extension, read and run once for every value model. A program calls them by name (`infinitesimal`, `standardPart`, `tripCount`, …), the declarations and the supertask engine’s resolved loops call them too, and the interpreter and a compiled program both answer through `call`, so a builtin computes the same value and refuses in the same words on every tier. - [enum Builtin](https://docs.logicaffeine.com/logicaffeine_base/extension/enum.Builtin): A builtin of the exact extension. - [fn call](https://docs.logicaffeine.com/logicaffeine_base/extension/fn.call): `builtin` applied to `args`, which number as many as the builtin takes (the checker refuses a call with any other count before a program runs). ## logicaffeine_base::fec Reed-Solomon forward error correction — the erasure codec that lets a lossy transport reconstruct dropped packets without a retransmit round-trip. - [struct ReedSolomon](https://docs.logicaffeine.com/logicaffeine_base/fec/struct.ReedSolomon): A systematic Reed-Solomon erasure code with `k` data shards and `m = n − k` parity shards. Cheap to clone (holds only the `n×k` generator matrix); construct once with `ReedSolomon::new` and reuse across many messages of the same shape. ## logicaffeine_base::germ Germs at `dt = 0`: the hyperreals a loop of infinitely many infinitesimal steps leaves, known by the series of their expansion in `dt` with exact computable-real coefficients. - [struct Flow](https://docs.logicaffeine.com/logicaffeine_base/germ/struct.Flow): `N` steps of an affine update, the shared part of each component’s germ. - [struct Germ](https://docs.logicaffeine.com/logicaffeine_base/germ/struct.Germ): A germ at `dt = 0`. See the module documentation. - [enum GermError](https://docs.logicaffeine.com/logicaffeine_base/germ/enum.GermError): Why a coefficient or a sign is not given. - [const SIGN_ORDERS](https://docs.logicaffeine.com/logicaffeine_base/germ/constant.SIGN_ORDERS): How many orders of `dt` a sign or a standard part looks through before it is refused. ## logicaffeine_base::gf256 GF(2^8) — the finite field with 256 elements, the shared substrate for erasure coding, multivariate cryptography (Oil-and-Vinegar / Rainbow), and the algebraic (XL) cryptanalysis engine. - [fn add](https://docs.logicaffeine.com/logicaffeine_base/gf256/fn.add): Field addition. In characteristic two this is XOR, and it is its own inverse, so subtraction is the same operation. - [fn div](https://docs.logicaffeine.com/logicaffeine_base/gf256/fn.div): Field division `a / b`. `0` has no inverse, so a zero divisor yields `0` — a safe, defined sentinel (NOT a meaningful quotient) that holds identically in debug and release; callers must still treat `b == 0` as a precondition violation, never as a value. - [fn inv](https://docs.logicaffeine.com/logicaffeine_base/gf256/fn.inv): Multiplicative inverse. `inv(a) = a^254` since the group has order 255; `inv(0) = 0` — `0` has no inverse, so this is a safe sentinel rather than the silent garbage a raw table lookup would return. - [fn invert](https://docs.logicaffeine.com/logicaffeine_base/gf256/fn.invert): Invert a `k×k` matrix over GF(2^8) by Gauss-Jordan elimination; `None` if singular. - [fn matmul](https://docs.logicaffeine.com/logicaffeine_base/gf256/fn.matmul): Multiply an `n×k` matrix by a `k×c` matrix over GF(2^8). - [fn matvec](https://docs.logicaffeine.com/logicaffeine_base/gf256/fn.matvec): Multiply an `m×n` matrix by an `n`-vector over GF(2^8), giving an `m`-vector. - [fn mul](https://docs.logicaffeine.com/logicaffeine_base/gf256/fn.mul): Field multiplication modulo `0x11d`. `0` absorbs. - [fn mul_add_region](https://docs.logicaffeine.com/logicaffeine_base/gf256/fn.mul_add_region): Region multiply-accumulate over GF(2^8): `dst[i] ^= c · src[i]` for every byte — the inner loop of Reed-Solomon encode/reconstruct. `src` and `dst` must be the same length. The body is a per-`c` table lookup XORed into the destination, a shape the compiler AUTO-VECTORIZES to SSE/AVX on native and to wasm `v128` under `simd128` — the SIMD speedup for browser FEC, in safe Rust with no hand-written intrinsics to silently miscompile (its result is pinned byte-exact to the scalar field by the tests). - [fn mul_table](https://docs.logicaffeine.com/logicaffeine_base/gf256/fn.mul_table): A 256-entry lookup table for multiplication by a fixed constant `c`: `table[b] = c · b` in GF(2^8). Precompute once per coefficient; a whole region then multiplies by one table lookup per byte — the SIMD-friendly hot path of Reed-Solomon coding. - [fn nullspace](https://docs.logicaffeine.com/logicaffeine_base/gf256/fn.nullspace): A basis of the null space `{x : A x = 0}` over GF(2^8). The basis has `n - rank(A)` vectors of length `n`; together they span every solution of the homogeneous system. - [fn pow](https://docs.logicaffeine.com/logicaffeine_base/gf256/fn.pow): `base^exp` in GF(2^8). `base^0 == 1` for every base (including `0`). - [fn rank](https://docs.logicaffeine.com/logicaffeine_base/gf256/fn.rank): Rank of an `m×n` matrix over GF(2^8). - [fn solve](https://docs.logicaffeine.com/logicaffeine_base/gf256/fn.solve): A particular solution of `A x = b` over GF(2^8), or `None` if the system is inconsistent. `a` is `m×n` (row per equation), `b` has length `m`; the returned `x` has length `n` with free variables set to zero. When the caller knows the system is square and full-rank (Oil-and-Vinegar signing after fixing the vinegar variables), the solution is unique. - [fn sub](https://docs.logicaffeine.com/logicaffeine_base/gf256/fn.sub): Field subtraction — identical to `add` in characteristic two. Named for call-site clarity where the algebra reads as a subtraction. ## logicaffeine_base::hash Cryptographic hash primitives — MD5 (RFC 1321) and SHA-1 (RFC 3174), rolled in pure Rust. - [fn md5](https://docs.logicaffeine.com/logicaffeine_base/hash/fn.md5): MD5 digest of `data` (RFC 1321) — 16 bytes. - [fn md5_x4](https://docs.logicaffeine.com/logicaffeine_base/hash/fn.md5_x4): MD5 of FOUR equal-length messages at once — 4-way SSE2 multi-buffer, the high-throughput path for hashing many same-size records (bulk name-based ids, dedup keys, content addresses). All four ABCD states advance in one `__m128i` (lane j = message j), so ~4× a scalar MD5 per message. The four inputs MUST share a length; returns the four 16-byte digests, byte-identical to `md5` per lane. - [fn md5_x8](https://docs.logicaffeine.com/logicaffeine_base/hash/fn.md5_x8): MD5 of EIGHT equal-length messages at once — AVX2 8-way multi-buffer, twice the width of `md5_x4`. All eight ABCD states advance in one `__m256i` (lane j = message j). Falls back to two `md5_x4` passes without AVX2. Byte-identical to `md5` per lane; the high-throughput path for hashing many same-size records (bulk name-based ids, dedup/content keys). - [fn sha1](https://docs.logicaffeine.com/logicaffeine_base/hash/fn.sha1): SHA-1 digest of `data` (RFC 3174) — 20 bytes. - [fn to_hex](https://docs.logicaffeine.com/logicaffeine_base/hash/fn.to_hex): Lowercase hex of a digest — handy for tests and debugging. ## logicaffeine_base::hybrid Hybrid flows: loops of infinitesimal steps whose state flows between jumps — a bouncing ball, a thermostat — run exactly, as the ideal hybrid system their steps follow to within an infinitesimal. - [struct Jump](https://docs.logicaffeine.com/logicaffeine_base/hybrid/struct.Jump): `If guard: block`. - [struct MPoly](https://docs.logicaffeine.com/logicaffeine_base/hybrid/struct.MPoly): A polynomial over the run’s slots with real algebraic coefficients: each monomial by its exponents, listed once, in order, none with a zero coefficient. - [struct Model](https://docs.logicaffeine.com/logicaffeine_base/hybrid/struct.Model): A loop’s flow and jumps over its slots: its body in order, and the flow of a whole step — each slot’s rate, and whether a step leaves it exactly unchanged. - [struct Scaling](https://docs.logicaffeine.com/logicaffeine_base/hybrid/struct.Scaling): A scaling certificate: from one round of the firings in `cycle` to the next, every slot in `slots` is multiplied by `s^w` (its weight `w`), and each time between firings by `s^q`. - [struct Term](https://docs.logicaffeine.com/logicaffeine_base/hybrid/struct.Term): A polynomial over the slots whose coefficients are the standard parts of the program’s, with whether they are the program’s coefficients exactly. - [struct UPoly](https://docs.logicaffeine.com/logicaffeine_base/hybrid/struct.UPoly): A polynomial in one variable with real algebraic coefficients, lowest power first, with no trailing zero: a coordinate of a flight in the time since it began, an atom along a flight, a value along a tail in `z`. - [enum Cell](https://docs.logicaffeine.com/logicaffeine_base/hybrid/enum.Cell): What a slot holds in the ideal run. - [enum Cond](https://docs.logicaffeine.com/logicaffeine_base/hybrid/enum.Cond): A condition of a guard or of a jump’s statements. - [enum Item](https://docs.logicaffeine.com/logicaffeine_base/hybrid/enum.Item): One part of a loop’s body, in its order: a run of flow statements — each slot’s rate, the coefficient of `dt` in its Euler step, and whether the run leaves it exactly unchanged — or the check of a jump. - [enum Rel](https://docs.logicaffeine.com/logicaffeine_base/hybrid/enum.Rel): `left − right` compared with zero. - [enum Stmt](https://docs.logicaffeine.com/logicaffeine_base/hybrid/enum.Stmt) - [enum Value](https://docs.logicaffeine.com/logicaffeine_base/hybrid/enum.Value): What a jump assigns: a polynomial over the slots, or a value no polynomial reads. - [const EVENT_BUDGET](https://docs.logicaffeine.com/logicaffeine_base/hybrid/constant.EVENT_BUDGET): The most firings a run follows one by one before the rest must be read off a scaling. Each firing’s values are exact numbers that grow as the firings go on, so the budget bounds the work as well as the count. - [const MAX_LIE_ORDER](https://docs.logicaffeine.com/logicaffeine_base/hybrid/constant.MAX_LIE_ORDER): The highest Lie derivative a field may need before its flow is taken not to be a polynomial in time. - [trait Ring](https://docs.logicaffeine.com/logicaffeine_base/hybrid/trait.Ring): What a polynomial over the slots evaluates in: algebraic numbers, polynomials in one variable, polynomials over the slots, values along a tail. - [fn check_scaling](https://docs.logicaffeine.com/logicaffeine_base/hybrid/fn.check_scaling): The certificate a tail rests on, checked on its own: the slots are closed under what feeds them, the field, the guards and the cycle’s statements setting them are homogeneous for the weights, `after` is the scaling’s image of `before`, and each flight of the round after is `s^q` times the same flight of the round before. A run whose state the scaling maps to its state a round later is then, round after round, the scaled copy of the round before. A scaling by one is the identity, which every model is homogeneous for: its certificate is that the state repeats. - [fn real_roots](https://docs.logicaffeine.com/logicaffeine_base/hybrid/fn.real_roots): The distinct real roots of `p`, ascending; none for a constant. - [fn run](https://docs.logicaffeine.com/logicaffeine_base/hybrid/fn.run): The values a loop of infinitesimal steps leaves after `span` of its time, starting from `start`: each infinitely close to what the loop leaves, and exactly it where the cell says so. - [fn scaled_slots](https://docs.logicaffeine.com/logicaffeine_base/hybrid/fn.scaled_slots): The slots a scaling of a cycle covers: every slot a guard reads, closed under what feeds them — the slots their rates read, and the slots a statement of the cycle setting one of them, or a condition it runs under, reads. - [type Step](https://docs.logicaffeine.com/logicaffeine_base/hybrid/type.Step): One firing of a cycle: which jump fires, and the branch each condition it meets takes. ## logicaffeine_base::hypernatural Infinite integers generated by the program’s generator `H` (`dt = 1/H`) — the trip counts of supertasks. - [struct Hypernatural](https://docs.logicaffeine.com/logicaffeine_base/hypernatural/struct.Hypernatural): An integer polynomial in the generator, by residue class. See the module documentation. - [enum FloorError](https://docs.logicaffeine.com/logicaffeine_base/hypernatural/enum.FloorError): Why the integer part of a hyperreal is not an infinite integer. ## logicaffeine_base::hyperreal Hyperreal numbers generated by the program’s infinitesimal `dt` — exact, ordered, decidable. - [struct Hyperreal](https://docs.logicaffeine.com/logicaffeine_base/hyperreal/struct.Hyperreal): A hyperreal number generated by the infinitesimal. See the module documentation. - [enum PowerError](https://docs.logicaffeine.com/logicaffeine_base/hyperreal/enum.PowerError): Why a power is refused. - [const MAX_POWER_DEGREE](https://docs.logicaffeine.com/logicaffeine_base/hyperreal/constant.MAX_POWER_DEGREE): The highest degree one power may reach, so a single operation’s work stays bounded. ## logicaffeine_base::intern String interning for O(1) equality comparison. - [struct Interner](https://docs.logicaffeine.com/logicaffeine_base/intern/struct.Interner): A string interner providing O(1) equality comparison via `Symbol` handles. - [struct Symbol](https://docs.logicaffeine.com/logicaffeine_base/intern/struct.Symbol): A lightweight handle to an interned string. - [trait SymbolEq](https://docs.logicaffeine.com/logicaffeine_base/intern/trait.SymbolEq): Convenience trait for comparing a `Symbol` to a string literal. ## logicaffeine_base::limit_value Values at the end of a supertask: what depends on the infinite generator’s residue, the limit rules that turn such a value into one number, and the provisional answer of an unfinished search. - [struct Converging](https://docs.logicaffeine.com/logicaffeine_base/limit_value/struct.Converging): The answer of a search: settled by a certificate, or provisional with its evidence. - [struct Depends](https://docs.logicaffeine.com/logicaffeine_base/limit_value/struct.Depends): A quantity on every residue class of the generator. See the module documentation. - [struct ResidueType](https://docs.logicaffeine.com/logicaffeine_base/limit_value/struct.ResidueType): The residues the infinite generator may take. See the module documentation. - [enum LimitRule](https://docs.logicaffeine.com/logicaffeine_base/limit_value/enum.LimitRule): How a quantity that depends on the generator becomes one value at the limit. - [enum ResidueError](https://docs.logicaffeine.com/logicaffeine_base/limit_value/enum.ResidueError): Why a residue system cannot be formed. - [const MAX_MODULUS](https://docs.logicaffeine.com/logicaffeine_base/limit_value/constant.MAX_MODULUS): The most residue classes one value may be split over: the wire’s collection bound, so every value a program holds can travel. ## logicaffeine_base::matrix_exp The exact matrix exponential `e^{t·M}` of a rational matrix. - [fn characteristic_polynomial](https://docs.logicaffeine.com/logicaffeine_base/matrix_exp/fn.characteristic_polynomial): `det(x·I − M)` by Faddeev–LeVerrier; `None` for a matrix that is not square. - [fn exp_matrix](https://docs.logicaffeine.com/logicaffeine_base/matrix_exp/fn.exp_matrix): `e^{t·M}`, every entry exact; `None` for a matrix that is not square. ## logicaffeine_base::money Money — an exact monetary amount in a specific currency (UNIVERSAL_TYPES Part V). - [mod currency](https://docs.logicaffeine.com/logicaffeine_base/money/currency/): The currency catalog — resolve an ISO-4217 code (case-insensitive) to its `Currency`. A growable data table, mirroring `crate::quantity::units::by_name`; the minor-unit scales follow ISO-4217. - [struct Currency](https://docs.logicaffeine.com/logicaffeine_base/money/struct.Currency): An ISO-4217 currency: its three-letter code and its minor-unit `scale` (the number of fractional digits — `USD`→2, `JPY`→0, `BHD`→3). The code is the identity. - [struct Money](https://docs.logicaffeine.com/logicaffeine_base/money/struct.Money): An exact monetary amount, quantised to its currency’s minor unit. - [struct RateTable](https://docs.logicaffeine.com/logicaffeine_base/money/struct.RateTable): A pluggable exchange-rate table — the substrate of the Universal Money Amount (money’s UTC). Each currency code maps to its rate versus a chosen reference currency: how many reference units one unit of the currency is worth, exact on the Rational tower (the reference itself is 1). The source is interchangeable — a literal table, a CRDT-synced table, an API fetch — they all produce this same value, so with rates in scope money of different currencies shares one coordinate and cross-currency math becomes meaningful (and exact). - [fn ambient_convert](https://docs.logicaffeine.com/logicaffeine_base/money/fn.ambient_convert): Convert `m` to `to` using the ambient rate table. `None` if no rates are in scope or a currency’s rate is missing — the caller surfaces a clean error rather than a wrong number. - [fn clear_ambient_rates](https://docs.logicaffeine.com/logicaffeine_base/money/fn.clear_ambient_rates): Drop the ambient rate table (back to “no rates in scope”). - [fn has_ambient_rates](https://docs.logicaffeine.com/logicaffeine_base/money/fn.has_ambient_rates): True if any rate context is in scope. - [fn set_ambient_rate](https://docs.logicaffeine.com/logicaffeine_base/money/fn.set_ambient_rate): Add or replace one rate in the ambient table (`1 = rate` reference units), creating the table if none is in scope yet. - [fn set_ambient_rates](https://docs.logicaffeine.com/logicaffeine_base/money/fn.set_ambient_rates): Install (replace) the ambient rate table. ## logicaffeine_base::money::currency The currency catalog — resolve an ISO-4217 code (case-insensitive) to its `Currency`. A growable data table, mirroring `crate::quantity::units::by_name`; the minor-unit scales follow ISO-4217. - [fn by_code](https://docs.logicaffeine.com/logicaffeine_base/money/currency/fn.by_code): Look up a currency by its ISO-4217 code (case-insensitive); `None` for an unknown code. ## logicaffeine_base::multi Values of several ordered infinitesimals: `dt`, `dx` declared much smaller than `dt`, and so on. - [struct MultiPowerError](https://docs.logicaffeine.com/logicaffeine_base/multi/struct.MultiPowerError): Why a power of a value of several infinitesimals is refused, with the infinitesimal and the root of it its degree is counted in. - [enum Multi](https://docs.logicaffeine.com/logicaffeine_base/multi/enum.Multi): A value of several ordered infinitesimals. See the module documentation. ## logicaffeine_base::nested Germs of several infinitesimals: a value of `dx`, declared much smaller than `dt`, known by its expansion in `dx` whose coefficients are values of `dt` and of the infinitesimals larger than it, not all of them exact — `exp(dt + dx) = Σ (e^dt/k!)·dx^k`, `ln(1 + dt + dx)`, the state a loop stepped by `dx` leaves when its rate is a value of `dt`. - [struct NestedGerm](https://docs.logicaffeine.com/logicaffeine_base/nested/struct.NestedGerm): A germ of several infinitesimals at its smallest. See the module documentation. ## logicaffeine_base::nested_flow Flows across infinitesimals: the state a loop stepped by one infinitesimal leaves when its affine update holds values of others. ## logicaffeine_base::number A number of the exact tower as base holds one itself: the coefficient of an expansion of a value of several infinitesimals whose coefficients are not all exact — `exp(dt + dx)`, whose coefficients in `dx` are the germ of `e^dt` — and the value the flows of such expansions start from. - [enum Number](https://docs.logicaffeine.com/logicaffeine_base/number/enum.Number): A number of the exact tower. See the module documentation. ## logicaffeine_base::numeric The numeric tower’s foundation: a hand-rolled arbitrary-precision integer. - [struct BigInt](https://docs.logicaffeine.com/logicaffeine_base/numeric/struct.BigInt): An exact, arbitrary-precision integer. - [struct Complex](https://docs.logicaffeine.com/logicaffeine_base/numeric/struct.Complex): An exact complex number `re + im·i`, each part a `Rational`. Because the parts are exact, `i·i == −1` and `(1+i)(1−i) == 2` hold with no floating error, and the Gaussian rationals are closed under `+ − × ÷` (every nonzero value has an exact inverse). The magnitude `√(re²+im²)` is irrational in general — request it as an `f64` view via `Complex::abs_f64` rather than forcing the exact value inexact. - [struct ComplexF](https://docs.logicaffeine.com/logicaffeine_base/numeric/struct.ComplexF): A floating-point complex number `re + im·i`, each part an `f64`. NOT ordered and NOT `Eq`/`Hash` (it carries `f64`s); equality is exact bit-for-value. - [struct Decimal](https://docs.logicaffeine.com/logicaffeine_base/numeric/struct.Decimal): An exact base-10 fixed-point number: an integer `coefficient` divided by a power of ten. The value is `coefficient · 10^(−scale)`, so `19.99` is `coefficient = 1999`, `scale = 2`. Money lives here — `0.1 + 0.2` is exactly `0.3`, never the `0.30000000000000004` of a binary float, and a long ledger of sums never drifts. - [struct Modular](https://docs.logicaffeine.com/logicaffeine_base/numeric/struct.Modular): An element of the ring ℤ/nℤ — an integer taken modulo a fixed `modulus`. This is the arbitrary-modulus generalisation of `crate::Word8`/…/`crate::Word64` (whose modulus is a power of two): arithmetic WRAPS into `[0, modulus)`, the cyclic group where overflow is the point, not a bug. The number-theory / crypto substrate — modular exponentiation and the extended-Euclid inverse live here, so RSA-style and finite-field code is exact. - [struct Rational](https://docs.logicaffeine.com/logicaffeine_base/numeric/struct.Rational): An exact rational number: a fraction kept in lowest terms with a strictly positive denominator. Built on `BigInt`, so it never rounds the way a JSON / `f64` “number” does — `1/3` stays exactly `1/3`, not `0.3333…`, and a numerator past 2^53 survives instead of collapsing onto a double. - [enum RoundingMode](https://docs.logicaffeine.com/logicaffeine_base/numeric/enum.RoundingMode): How a `Decimal` resolves the digits it must drop when rounding to a smaller scale. `HalfEven` (banker’s rounding) is the money/finance default: the unbiased tie-break that does not drift a long column of sums upward. - [const NUMERIC_HASH_P](https://docs.logicaffeine.com/logicaffeine_base/numeric/constant.NUMERIC_HASH_P): The Mersenne prime 2^61 − 1: the modulus of the UNIFIED numeric hash. Every numeric type hashes to its mathematical value mod P, so values that compare equal across types (`1 == 1.0 == 1/1`) hash equal — the hash/ equality coherence law that lets mixed-type map keys unify. - [fn cmp_bigint_f64_exact](https://docs.logicaffeine.com/logicaffeine_base/numeric/fn.cmp_bigint_f64_exact): Exact comparison of a BigInt against an f64. `None` iff `f` is NaN. - [fn cmp_i64_f64_exact](https://docs.logicaffeine.com/logicaffeine_base/numeric/fn.cmp_i64_f64_exact): Exact comparison of an i64 against an f64. `None` iff `f` is NaN. - [fn cmp_rational_f64_exact](https://docs.logicaffeine.com/logicaffeine_base/numeric/fn.cmp_rational_f64_exact): Exact comparison of a Rational against an f64. `None` iff `f` is NaN. - [fn float_max](https://docs.logicaffeine.com/logicaffeine_base/numeric/fn.float_max): The language’s `max` of two reals: a NaN gives way to the other operand, and of two equal values the one with the positive sign, so `max(0, -0.0)` is `0.0` (IEEE 754-2019 `maximumNumber`). - [fn float_min](https://docs.logicaffeine.com/logicaffeine_base/numeric/fn.float_min): The language’s `min` of two reals: a NaN gives way to the other operand, and of two equal values the one with the negative sign, so `min(0, -0.0)` is `-0.0` (IEEE 754-2019 `minimumNumber`). One answer on every tier and under every optimizer, where `f64::min` leaves the sign of two equal zeros open. - [fn numeric_hash_bigint](https://docs.logicaffeine.com/logicaffeine_base/numeric/fn.numeric_hash_bigint): The unified numeric hash of a BigInt. Limbs fold most-significant first: 2^64 ≡ 8 (mod 2^61 − 1). - [fn numeric_hash_f64](https://docs.logicaffeine.com/logicaffeine_base/numeric/fn.numeric_hash_f64): The unified numeric hash of an f64: `m · 2^e mod P` via modular exponentiation (2^61 ≡ 1, so the exponent reduces mod 61). NaN and the infinities take fixed sentinels outside the finite-value pattern. - [fn numeric_hash_i64](https://docs.logicaffeine.com/logicaffeine_base/numeric/fn.numeric_hash_i64): The unified numeric hash of an i64 (its value mod P, sign-adjusted). - [fn numeric_hash_rational](https://docs.logicaffeine.com/logicaffeine_base/numeric/fn.numeric_hash_rational): The unified numeric hash of a Rational: `num · den⁻¹ mod P` (Fermat inverse; P is prime, and a reduced denominator is never ≡ 0 mod P for representable values). - [fn rational_from_f64_exact](https://docs.logicaffeine.com/logicaffeine_base/numeric/fn.rational_from_f64_exact): The EXACT rational value of a finite f64. `None` for NaN/±inf. - [fn rational_to_f64_nearest](https://docs.logicaffeine.com/logicaffeine_base/numeric/fn.rational_to_f64_nearest): The f64 nearest to `r` (ties to even), rounded once from the exact value: the binary exponent comes from the bit lengths, the quotient is scaled to 53 significant bits (or onto the `2^-1074` grid below the normal range), and the remainder decides the rounding. Past the largest finite float it is the signed infinity. Unlike `Rational::to_f64`, which divides two rounded doubles, this never rounds twice. ## logicaffeine_base::ode Validated integration of a polynomial differential equation `x' = f(x)`. - [struct Field](https://docs.logicaffeine.com/logicaffeine_base/ode/struct.Field): A polynomial vector field: component `i` of `f(x)` is the sum of `components[i]`. - [struct Monomial](https://docs.logicaffeine.com/logicaffeine_base/ode/struct.Monomial): `c·∏ xᵢ^{eᵢ}`. - [enum FlowError](https://docs.logicaffeine.com/logicaffeine_base/ode/enum.FlowError): Why a walk stopped before its time. - [fn escape_time_bound](https://docs.logicaffeine.com/logicaffeine_base/ode/fn.escape_time_bound): For `x' = p(x)` with `p > 0` on `[x₀, ∞)` and `deg p ≥ 2`, a rational number at least the time the solution takes to leave every bound; `None` when `p` has a root there, grows too slowly to leave every bound in finite time, or no grid finer than `2^cap` pieces bounds it. - [fn flow](https://docs.logicaffeine.com/logicaffeine_base/ode/fn.flow): An enclosure of the solution at time `t ≥ 0` from every start in `start`, at working precision `q`; `cap` bounds how small a step may become. ## logicaffeine_base::ordered_field Polynomials over an ordered field with exact arithmetic, the coefficient rings of the hyperreals. - [struct PolyOver](https://docs.logicaffeine.com/logicaffeine_base/ordered_field/struct.PolyOver): A polynomial in one variable over `K`, little-endian, no trailing zero. - [trait OrderedField](https://docs.logicaffeine.com/logicaffeine_base/ordered_field/trait.OrderedField): A field with exact arithmetic and a decided order, read from the sign of an element. ## logicaffeine_base::ordinal Ordinals below ε₀ in Cantor normal form — the stage counter of transfinite execution. - [struct Ordinal](https://docs.logicaffeine.com/logicaffeine_base/ordinal/struct.Ordinal): An ordinal below ε₀. See the module documentation. ## logicaffeine_base::poly Exact univariate polynomials over ℚ — the algebra under the real algebraic numbers. - [struct Poly](https://docs.logicaffeine.com/logicaffeine_base/poly/struct.Poly): A polynomial over ℚ: `c[i]` is the coefficient of `xⁱ`. INVARIANT: no trailing zero. - [struct RootInterval](https://docs.logicaffeine.com/logicaffeine_base/poly/struct.RootInterval): One isolated real root. `lo == hi` is the root itself (a rational root the bisection landed on); otherwise the root is the only root in the open interval `(lo, hi)` and neither end is a root, so the squarefree part changes sign across it. ## logicaffeine_base::puiseux The real closure of the hyperreals: real algebraic Puiseux series in `dt`, exactly. - [struct PowerRefusal](https://docs.logicaffeine.com/logicaffeine_base/puiseux/struct.PowerRefusal): Why a power of a value of the real closure is refused: the hyperreal’s own refusal, its degree counted in the root `dt^(1/q)` the value is a rational function of. - [struct Puiseux](https://docs.logicaffeine.com/logicaffeine_base/puiseux/struct.Puiseux): A real algebraic Puiseux series in `dt`: a root of `poly` (squarefree, over `K_s`, `s^q = dt`), picked by its branch. See the module documentation. - [enum Closed](https://docs.logicaffeine.com/logicaffeine_base/puiseux/enum.Closed): A value of the real closure in its one form: a hyperreal when it is a rational function of `dt`, otherwise a Puiseux series that is no such function. ## logicaffeine_base::quantity Quantities: an exact magnitude carrying a physical `Dimension` and a unit. - [mod constants](https://docs.logicaffeine.com/logicaffeine_base/quantity/constants/): Physical constants as first-class `Quantity` values — each carries its dimension, so they compose with units under the same dimensional algebra (`E = m·c²` type-checks, and `c` can be asked for `in kilometres_per_hour`). The post-2019-SI defining constants are EXACT rationals (the SI fixes their numeric values); measured constants (G) use their CODATA value. - [mod units](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/): The unit catalog — every scale an EXACT rational to the SI base. Organized by dimension. (Irrational-scaled units like `parsec` (648000/π·AU) and `mach` are intentionally omitted until a float-backed quantity exists; everything here is lossless.) A later wave moves this to a growable data file; the math and the names are settled here first. - [struct Position](https://docs.logicaffeine.com/logicaffeine_base/quantity/struct.Position): A point in 3-D space, coordinates in metres (an inertial frame’s axes). Euclidean distance is transcendental (a square root), so positions are `f64` — the one place the time tower leaves the exact-rational world, because the geometry of spacetime demands it. - [struct Quantity](https://docs.logicaffeine.com/logicaffeine_base/quantity/struct.Quantity): An exact quantity: a magnitude in the SI base unit, tagged with its dimension. - [struct SpacetimeStamp](https://docs.logicaffeine.com/logicaffeine_base/quantity/struct.SpacetimeStamp): A space-aware timestamp — when (a SmoothUTC instant, nanoseconds) AND where (a position in space). This is the heart of the light-cone model: two events can only be causally ordered if their time separation is at least the light-travel time between their positions. Closer in time than that and they are spacelike-separated — genuinely concurrent, no signal could connect them, which is exactly where CRDTs (conflict-free, order-free merge) are the right tool. - [struct Unit](https://docs.logicaffeine.com/logicaffeine_base/quantity/struct.Unit): A unit of measurement: its dimension and how to map a value in this unit to the SI base. `si = value · scale + offset`. Linear units have `offset = 0`; affine units (°C, °F) do not. - [enum CausalRelation](https://docs.logicaffeine.com/logicaffeine_base/quantity/enum.CausalRelation): How two `SpacetimeStamp`s relate causally. `Before`: `self` is in the past light cone of the other (a signal from `self` could reach it). `After`: the reverse. `Concurrent`: spacelike — neither can have affected the other. - [fn light_travel_time](https://docs.logicaffeine.com/logicaffeine_base/quantity/fn.light_travel_time): The light-travel time across a distance — `distance / c`, exact. Returns a Time quantity, or `None` if `distance` is not a length (the dimensional guard). This is the core of “universal / space-travel time”: the delay before an event at distance `d` is observed elsewhere (Earth↔Sun ≈ 499 s, Earth↔Mars ≈ 3–22 min). The result rides the exact rational tower, so it never drifts. - [fn lorentz_factor](https://docs.logicaffeine.com/logicaffeine_base/quantity/fn.lorentz_factor): The special-relativistic Lorentz factor `γ = 1/√(1 − β²)` for a speed `β` as a fraction of `c`. `None` for `|β| ≥ 1` (or NaN) — nothing reaches or exceeds light speed. Inherently a float (relativity is transcendental), unlike the exact-rational quantity arithmetic. - [fn observed_arrival_nanos](https://docs.logicaffeine.com/logicaffeine_base/quantity/fn.observed_arrival_nanos): The instant (nanoseconds since the epoch) at which an event happening at `event_nanos` is observed by someone a distance away — `event + distance/c`. The relativistic light-delay the space-travel time model is built on. `None` if `distance` is not a length or the result overflows. - [fn proper_time_seconds](https://docs.logicaffeine.com/logicaffeine_base/quantity/fn.proper_time_seconds): The proper time (in seconds) a clock experiences over `coordinate_seconds` of coordinate time while moving at speed `β` (fraction of `c`): `coordinate / γ`. A moving clock ticks slow — this is the space-traveller’s “time attenuation”. `None` for `|β| ≥ 1`. - [fn time_dilation_factor](https://docs.logicaffeine.com/logicaffeine_base/quantity/fn.time_dilation_factor): The time-dilation factor `γ` for a velocity given as a speed `Quantity` (β derived as `v/c`). `None` if `velocity` is not a speed or is ≥ `c`. - [fn time_quantity_to_nanos](https://docs.logicaffeine.com/logicaffeine_base/quantity/fn.time_quantity_to_nanos): Convert a Time-dimensioned quantity to a whole number of nanoseconds (rounded to the nearest), the bridge from the exact `Quantity` world to the instant model. `None` if `q` is not a time, or the result does not fit `i64`. ## logicaffeine_base::quantity::constants Physical constants as first-class `Quantity` values — each carries its dimension, so they compose with units under the same dimensional algebra (`E = m·c²` type-checks, and `c` can be asked for `in kilometres_per_hour`). The post-2019-SI defining constants are EXACT rationals (the SI fixes their numeric values); measured constants (G) use their CODATA value. - [fn avogadro_constant](https://docs.logicaffeine.com/logicaffeine_base/quantity/constants/fn.avogadro_constant): Avogadro constant, `N_A` = 6.022 140 76 × 10²³ mol⁻¹ (exact). - [fn boltzmann_constant](https://docs.logicaffeine.com/logicaffeine_base/quantity/constants/fn.boltzmann_constant): Boltzmann constant, `k_B` = 1.380 649 × 10⁻²³ J/K (exact). - [fn elementary_charge](https://docs.logicaffeine.com/logicaffeine_base/quantity/constants/fn.elementary_charge): Elementary charge, `e` = 1.602 176 634 × 10⁻¹⁹ C (exact). - [fn gravitational_constant](https://docs.logicaffeine.com/logicaffeine_base/quantity/constants/fn.gravitational_constant): Newtonian gravitational constant, `G` = 6.674 30 × 10⁻¹¹ m³·kg⁻¹·s⁻² (CODATA measured value). - [fn molar_gas_constant](https://docs.logicaffeine.com/logicaffeine_base/quantity/constants/fn.molar_gas_constant): Molar gas constant, `R = N_A · k_B` = 8.314 462 618… J/(mol·K) (exact, a product of exacts). - [fn planck_constant](https://docs.logicaffeine.com/logicaffeine_base/quantity/constants/fn.planck_constant): Planck constant, `h` = 6.626 070 15 × 10⁻³⁴ J·s (exact). - [fn speed_of_light](https://docs.logicaffeine.com/logicaffeine_base/quantity/constants/fn.speed_of_light): Speed of light in vacuum, `c` = 299 792 458 m/s (exact). - [fn standard_atmosphere](https://docs.logicaffeine.com/logicaffeine_base/quantity/constants/fn.standard_atmosphere): Standard atmosphere, `atm` = 101 325 Pa (exact by definition). - [fn standard_gravity](https://docs.logicaffeine.com/logicaffeine_base/quantity/constants/fn.standard_gravity): Standard gravity, `g₀` = 9.806 65 m/s² (exact by definition). ## logicaffeine_base::quantity::units The unit catalog — every scale an EXACT rational to the SI base. Organized by dimension. (Irrational-scaled units like `parsec` (648000/π·AU) and `mach` are intentionally omitted until a float-backed quantity exists; everything here is lossless.) A later wave moves this to a growable data file; the math and the names are settled here first. - [fn acre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.acre) - [fn ampere](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.ampere) - [fn ampere_hour](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.ampere_hour) - [fn angstrom](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.angstrom) - [fn arcminute](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.arcminute) - [fn arcsecond](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.arcsecond) - [fn are](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.are) - [fn astronomical_unit](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.astronomical_unit) - [fn atmosphere](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.atmosphere) - [fn baker_dozen](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.baker_dozen) - [fn bar](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.bar) - [fn basis_point](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.basis_point) - [fn becquerel](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.becquerel) - [fn bit](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.bit) - [fn bit_per_second](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.bit_per_second) - [fn bushel](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.bushel) - [fn by_name](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.by_name): Look up a unit by an English name, plural, or symbol (case-insensitive) — the surface-syntax bridge so `quantity(2, "inch")` / `... in "feet"` resolve to a `Unit`. This is the growable catalog’s name index; unknown names return `None` (the front-end turns that into a clean error). Spelling variants and both singular/plural map to the same unit. - [fn byte](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.byte) - [fn byte_per_second](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.byte_per_second) - [fn cable](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.cable) - [fn calorie](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.calorie) - [fn candela](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.candela) - [fn carat](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.carat) - [fn celsius](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.celsius) - [fn centilitre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.centilitre) - [fn centimetre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.centimetre) - [fn centipoise](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.centipoise) - [fn centistokes](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.centistokes) - [fn century](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.century) - [fn chain](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.chain) - [fn coulomb](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.coulomb) - [fn cubic_centimetre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.cubic_centimetre) - [fn cubic_foot](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.cubic_foot) - [fn cubic_foot_per_minute](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.cubic_foot_per_minute) - [fn cubic_inch](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.cubic_inch) - [fn cubic_metre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.cubic_metre) - [fn cubic_metre_per_second](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.cubic_metre_per_second) - [fn curie](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.curie) - [fn dash](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.dash) - [fn day](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.day) - [fn decade](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.decade) - [fn decilitre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.decilitre) - [fn decimetre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.decimetre) - [fn degree](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.degree) - [fn dekametre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.dekametre) - [fn dozen](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.dozen) - [fn dram](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.dram) - [fn dry_gallon](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.dry_gallon) - [fn dry_pint](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.dry_pint) - [fn dry_quart](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.dry_quart) - [fn dyne](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.dyne) - [fn dyne_per_centimetre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.dyne_per_centimetre) - [fn each](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.each) - [fn earth_mass](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.earth_mass) - [fn earth_radius](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.earth_radius) - [fn electronvolt](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.electronvolt) - [fn erg](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.erg) - [fn fahrenheit](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.fahrenheit) - [fn farad](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.farad) - [fn fathom](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.fathom) - [fn femtometre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.femtometre) - [fn foot](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.foot) - [fn foot_candle](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.foot_candle) - [fn foot_per_second](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.foot_per_second) - [fn fortnight](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.fortnight) - [fn furlong](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.furlong) - [fn gallon_per_minute](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.gallon_per_minute) - [fn gauss](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.gauss) - [fn gibibyte](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.gibibyte) - [fn gigabit_per_second](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.gigabit_per_second) - [fn gigabyte](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.gigabyte) - [fn gigahertz](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.gigahertz) - [fn gigajoule](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.gigajoule) - [fn gigametre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.gigametre) - [fn gigawatt](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.gigawatt) - [fn gradian](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.gradian) - [fn grain](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.grain) - [fn gram](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.gram) - [fn gray](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.gray) - [fn great_gross](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.great_gross) - [fn gross](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.gross) - [fn hand](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.hand) - [fn hectare](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.hectare) - [fn hectometre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.hectometre) - [fn henry](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.henry) - [fn hertz](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.hertz) - [fn horsepower](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.horsepower) - [fn hour](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.hour) - [fn hundredweight](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.hundredweight) - [fn imperial_fluid_ounce](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.imperial_fluid_ounce) - [fn imperial_gallon](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.imperial_gallon) - [fn imperial_pint](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.imperial_pint) - [fn inch](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.inch) - [fn joule](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.joule) - [fn julian_year](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.julian_year) - [fn jupiter_mass](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.jupiter_mass) - [fn katal](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.katal) - [fn kelvin](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.kelvin) - [fn kibibyte](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.kibibyte) - [fn kilobit](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.kilobit) - [fn kilobit_per_second](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.kilobit_per_second) - [fn kilobyte](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.kilobyte) - [fn kilocalorie](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.kilocalorie) - [fn kilogram](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.kilogram) - [fn kilogram_force](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.kilogram_force) - [fn kilohertz](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.kilohertz) - [fn kilojoule](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.kilojoule) - [fn kilometre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.kilometre) - [fn kilometre_per_hour](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.kilometre_per_hour) - [fn kilonewton](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.kilonewton) - [fn kilopascal](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.kilopascal) - [fn kilovolt](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.kilovolt) - [fn kilowatt](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.kilowatt) - [fn kilowatt_hour](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.kilowatt_hour) - [fn km_per_litre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.km_per_litre) - [fn knot](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.knot) - [fn league](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.league) - [fn light_day](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.light_day) - [fn light_hour](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.light_hour) - [fn light_minute](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.light_minute) - [fn light_second](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.light_second) - [fn light_year](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.light_year) - [fn litre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.litre) - [fn litre_per_minute](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.litre_per_minute) - [fn litre_per_second](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.litre_per_second) - [fn long_ton](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.long_ton) - [fn lumen](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.lumen) - [fn lunar_distance](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.lunar_distance) - [fn lux](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.lux) - [fn maxwell](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.maxwell) - [fn mebibyte](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.mebibyte) - [fn megabit_per_second](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.megabit_per_second) - [fn megabyte](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.megabyte) - [fn megabyte_per_second](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.megabyte_per_second) - [fn megahertz](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.megahertz) - [fn megajoule](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.megajoule) - [fn megametre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.megametre) - [fn megawatt](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.megawatt) - [fn metre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.metre) - [fn metre_per_second](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.metre_per_second) - [fn microfarad](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.microfarad) - [fn microgram](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.microgram) - [fn microhenry](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.microhenry) - [fn micrometre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.micrometre) - [fn micromolar](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.micromolar) - [fn microsecond](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.microsecond) - [fn mile](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.mile) - [fn mile_per_gallon](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.mile_per_gallon) - [fn mile_per_hour](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.mile_per_hour) - [fn milliampere](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.milliampere) - [fn milliampere_hour](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.milliampere_hour) - [fn millibar](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.millibar) - [fn milligram](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.milligram) - [fn millihenry](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.millihenry) - [fn millilitre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.millilitre) - [fn millimetre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.millimetre) - [fn millimolar](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.millimolar) - [fn millisecond](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.millisecond) - [fn millisiemens](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.millisiemens) - [fn millitesla](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.millitesla) - [fn millivolt](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.millivolt) - [fn minute](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.minute) - [fn molal](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.molal) - [fn molar](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.molar) - [fn mole](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.mole) - [fn nanofarad](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.nanofarad) - [fn nanogram](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.nanogram) - [fn nanometre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.nanometre) - [fn nanosecond](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.nanosecond) - [fn nautical_league](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.nautical_league) - [fn nautical_mile](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.nautical_mile) - [fn newton](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.newton) - [fn newton_metre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.newton_metre) - [fn newton_per_metre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.newton_per_metre) - [fn nit](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.nit) - [fn ohm](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.ohm) - [fn oil_barrel](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.oil_barrel) - [fn ounce](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.ounce) - [fn pair](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.pair) - [fn pascal](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.pascal) - [fn pascal_second](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.pascal_second) - [fn peck](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.peck) - [fn percent](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.percent) - [fn permille](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.permille) - [fn petabyte](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.petabyte) - [fn phot](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.phot) - [fn pica](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.pica) - [fn picofarad](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.picofarad) - [fn picometre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.picometre) - [fn picosecond](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.picosecond) - [fn pinch](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.pinch) - [fn point](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.point) - [fn poise](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.poise) - [fn pound](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.pound) - [fn pound_foot](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.pound_foot) - [fn pound_force](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.pound_force) - [fn ppb](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.ppb) - [fn ppm](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.ppm) - [fn psi](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.psi) - [fn rad_unit](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.rad_unit) - [fn rankine](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.rankine) - [fn ream](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.ream) - [fn reaumur](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.reaumur) - [fn rem](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.rem) - [fn rod](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.rod) - [fn roentgen](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.roentgen) - [fn rpm](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.rpm) - [fn score](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.score) - [fn second](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.second) - [fn short_ton](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.short_ton) - [fn siemens](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.siemens) - [fn sievert](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.sievert) - [fn smidgen](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.smidgen) - [fn solar_mass](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.solar_mass) - [fn solar_radius](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.solar_radius) - [fn square_centimetre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.square_centimetre) - [fn square_foot](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.square_foot) - [fn square_inch](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.square_inch) - [fn square_kilometre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.square_kilometre) - [fn square_metre](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.square_metre) - [fn square_metre_per_second](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.square_metre_per_second) - [fn square_mile](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.square_mile) - [fn square_yard](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.square_yard) - [fn stick_of_butter](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.stick_of_butter) - [fn stokes](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.stokes) - [fn stone](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.stone) - [fn tablespoon](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.tablespoon) - [fn teaspoon](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.teaspoon) - [fn terabit](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.terabit) - [fn terabyte](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.terabyte) - [fn terajoule](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.terajoule) - [fn terawatt](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.terawatt) - [fn tesla](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.tesla) - [fn thou](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.thou) - [fn tonne](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.tonne) - [fn troy_ounce](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.troy_ounce) - [fn troy_pound](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.troy_pound) - [fn turn](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.turn) - [fn us_cup](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.us_cup) - [fn us_fluid_ounce](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.us_fluid_ounce) - [fn us_gallon](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.us_gallon) - [fn us_gill](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.us_gill) - [fn us_pint](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.us_pint) - [fn us_quart](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.us_quart) - [fn volt](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.volt) - [fn watt](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.watt) - [fn watt_hour](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.watt_hour) - [fn weber](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.weber) - [fn week](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.week) - [fn yard](https://docs.logicaffeine.com/logicaffeine_base/quantity/units/fn.yard) ## logicaffeine_base::sha_ops The four Intel SHA-1 (SHA-NI) operations, in SOFTWARE — the exact bit-for-bit semantics of `sha1rnds4` / `sha1msg1` / `sha1msg2` / `sha1nexte`. These are the spec the tree-walker runs so that SHA-1 written in LOGOS over these ops produces the identical result whether it is interpreted (software here) or AOT-compiled to the real hardware instruction (`core::arch::x86_64`). Same idea as the scalar-lane spec behind `Lanes8Word32` → AVX2. - [fn sha1msg1](https://docs.logicaffeine.com/logicaffeine_base/sha_ops/fn.sha1msg1): `sha1msg1(a, b)` — the first half of the message-schedule recurrence (the XOR mixing before the rotate). `dest = { W2^W0, W3^W1, W4^W2, W5^W3 }` per Intel, in lane order. - [fn sha1msg2](https://docs.logicaffeine.com/logicaffeine_base/sha_ops/fn.sha1msg2): `sha1msg2(a, b)` — completes the schedule: the final XOR with the previous words and the ROL-1, including the intra-vector dependency of W19 on W16. - [fn sha1nexte](https://docs.logicaffeine.com/logicaffeine_base/sha_ops/fn.sha1nexte): `sha1nexte(a, b)` — fold the next E (the previous block-round’s A, rotated) into the high dword of the next message group. `dest[127:96] = b[127:96] + (a[127:96] ROL 30)`; the low 96 bits pass `b`. - [fn sha1rnds4](https://docs.logicaffeine.com/logicaffeine_base/sha_ops/fn.sha1rnds4): `sha1rnds4(abcd, msg, func)` — four rounds of SHA-1. `abcd` is the working state (A in lane 3 … D in lane 0), `msg` the four message dwords with the round’s E already folded into its high dword (via `sha1nexte` / the initial add), and `func` ∈ 0..=3 selects the round function + constant (0 = Ch/K0, 1 = Parity/K1, 2 = Maj/K2, 3 = Parity/K3). Returns the new state. ## logicaffeine_base::si SI-dimensioned f64 newtypes — the characterized-descriptor surface types. - [struct Hertz](https://docs.logicaffeine.com/logicaffeine_base/si/struct.Hertz): Hertz — frequency (s⁻¹). - [struct Kelvin](https://docs.logicaffeine.com/logicaffeine_base/si/struct.Kelvin): Kelvin — thermodynamic temperature. - [struct Nanoseconds](https://docs.logicaffeine.com/logicaffeine_base/si/struct.Nanoseconds): Nanoseconds — time, payload in ns (the unit rides the NAME, not a hidden scale). - [struct PerKelvin](https://docs.logicaffeine.com/logicaffeine_base/si/struct.PerKelvin): Per-kelvin — temperature coefficients (tempco), K⁻¹. - [struct Seconds](https://docs.logicaffeine.com/logicaffeine_base/si/struct.Seconds): Seconds — time. - [struct Siemens](https://docs.logicaffeine.com/logicaffeine_base/si/struct.Siemens): Siemens — conductance (Ω⁻¹), the transconductor’s gm unit. - [struct Volts](https://docs.logicaffeine.com/logicaffeine_base/si/struct.Volts): Volts — electric potential. - [struct VoltsPerRootHz](https://docs.logicaffeine.com/logicaffeine_base/si/struct.VoltsPerRootHz): Volts per root hertz — noise spectral density, the rational-exponent payoff: `V·Hz^(−1/2)`. - [struct Watts](https://docs.logicaffeine.com/logicaffeine_base/si/struct.Watts): Watts — power, the thermal solver’s injection unit. ## logicaffeine_base::span Source location tracking for error reporting. - [struct Span](https://docs.logicaffeine.com/logicaffeine_base/span/struct.Span): A byte-offset range in source text. ## logicaffeine_base::supertask The run-time half of the supertask engine: the exact operations the statements it writes call, generic over a value model (`ValueAlgebra`) so the interpreter and a compiled program run one implementation. - [fn affine_power](https://docs.logicaffeine.com/logicaffeine_base/supertask/fn.affine_power): `Aᴺ·x`. See the module documentation. - [fn check_annihilator](https://docs.logicaffeine.com/logicaffeine_base/supertask/fn.check_annihilator): The certificate the closed form rests on, checked by multiplying it out: `A^z·(A^p − I)^m = 0`. - [fn cycle_at](https://docs.logicaffeine.com/logicaffeine_base/supertask/fn.cycle_at): The state at step `n` of a run recorded as `states` (the state before each step) up to the step whose state, `repeated`, had been seen before: the run is eventually periodic from the first occurrence of `repeated`. - [fn first_exit](https://docs.logicaffeine.com/logicaffeine_base/supertask/fn.first_exit): How many passes `While :` makes when each pass adds `step` to its counter, from `t0`: the first natural `k` at which the guard fails at `t0 + k·step`. The guard compares terms linear in the counter (the formula `Guard::read` takes), so its truth can change only where one of them crosses zero and otherwise repeats with the period of its remainders; its first failure lies at a crossing or within one period after one, and is found by evaluating the guard there alone. Where those points depend on the residue of the generator — `⌊1/(2·dt)⌋` — each class is read on its own scale and the count is the infinite integer the classes’ answers make. - [fn hybrid_flow](https://docs.logicaffeine.com/logicaffeine_base/supertask/fn.hybrid_flow): `N` steps of a loop whose body is polynomial Euler steps and jumps, as `model` encodes them: `[body, jumps]`, the body its parts in order — `["flow", field]` a run of flow statements as one polynomial update per slot, as for `polynomial_flow`, `["check", k]` the check of jump `k` — and each jump `[guard, block]`. A finite `N` runs the steps themselves. An infinite one, `N = T/dt + δ` on each residue class, ends on the values of the ideal hybrid system the loop follows for time `T` (see `crate::hybrid`): a value the flow moves is a germ known by its standard part, a value the loop holds exactly is that value. - [fn polynomial_flow](https://docs.logicaffeine.com/logicaffeine_base/supertask/fn.polynomial_flow): `N` passes of `x ← x + dt·f(x) + O(dt²)`, `f` polynomial with rational coefficients. A finite `N` runs the update itself. An infinite one, `N = T/dt + δ` on each residue class, ends infinitely close to the solution of `x' = f(x)` from the start’s standard part at time `T`, a germ known by its standard part; a scalar solution certified to leave every bound before `T` leaves an unlimited germ. - [fn search_candidates](https://docs.logicaffeine.com/logicaffeine_base/supertask/fn.search_candidates): The naturals a search over every natural must examine, in increasing order; empty when the predicate’s coefficients or periods are not ones this reading decides. See the module documentation. - [fn state_size](https://docs.logicaffeine.com/logicaffeine_base/supertask/fn.state_size): The bits a state occupies — a number by its magnitude, text by its length, a list or tuple by its items, an exact value by its canonical encoding — the measure the cycle search stops a growing state by. - [fn trip_count](https://docs.logicaffeine.com/logicaffeine_base/supertask/fn.trip_count): How many times `While t bound:` runs when each step adds `step` to `t`, starting from `t0`: `⌈(bound − t0)/step⌉` for a strict bound, `⌊…⌋ + 1` for an inclusive one, `0` when the guard is false at the start. `−1` — not counted, so the loop runs as written — when the clock is not a number, or when a standard step walks away from its bound; a refusal when an infinitesimal step does, since that loop could never end. - [type Matrix](https://docs.logicaffeine.com/logicaffeine_base/supertask/type.Matrix): A square matrix of values, row by row. ## logicaffeine_base::temporal Exact calendar primitives — the bedrock of the time tower. - [struct CivilDateTime](https://docs.logicaffeine.com/logicaffeine_base/temporal/struct.CivilDateTime): A civil (wall-clock) date-time, calendar + time-of-day, with no zone — the human-readable decomposition of a SmoothUTC instant (nanoseconds since the Unix epoch, leap-second-free). - [struct DstRule](https://docs.logicaffeine.com/logicaffeine_base/temporal/struct.DstRule): A POSIX-style DST transition rule: the `week`-th `weekday` of `month`, at `time_seconds` local. `week` is `1..=5` (5 = the last occurrence); `weekday` is `0 = Sunday … 6 = Saturday`. This is the `Mm.w.d` form a TZ string uses (e.g. `M3.2.0` = the 2nd Sunday of March), and it generates one transition per year — enough to express any zone with a regular DST schedule. - [struct EstimateInterval](https://docs.logicaffeine.com/logicaffeine_base/temporal/struct.EstimateInterval): A bound on a remote node’s current time: it lies somewhere in `[lower_nanos, upper_nanos]`. The width is the irreducible uncertainty — across a light-delay you can never pin a remote clock tighter than the physics allows. The `intersect` of two valid bounds is a lattice meet (it never widens), which is what makes a `SyncClock` conflict-free. - [struct Hlc](https://docs.logicaffeine.com/logicaffeine_base/temporal/struct.Hlc): A Hybrid Logical Clock timestamp: a physical instant (nanoseconds) plus a logical counter that breaks ties and preserves causality when the physical clock stalls, jumps backward, or two events share a nanosecond. The total order is lexicographic `(physical_nanos, logical)` — so the derived `Ord` is the HLC order. This is the causally-consistent timestamp the `SyncClock` CRDT keys on: it stays monotonic and orders happens-before correctly even across machines whose wall clocks disagree (the bounded-skew / interplanetary case the campaign targets). - [struct SyncClock](https://docs.logicaffeine.com/logicaffeine_base/temporal/struct.SyncClock): A light-cone-aware CRDT clock: a Hybrid Logical Clock (causal order) plus per-node knowledge intervals (light-cone-bounded estimates of each peer’s current time). Its `merge` is a join over a lattice — `max` on the HLC, interval intersection per node — so replicas separated by bounded (even interplanetary) delay converge conflict-free, regardless of message order. This realises “spacelike separation = CRDT concurrency”: events with no shared light cone need no total order, only this commutative/associative/idempotent merge. - [struct ZoneSpec](https://docs.logicaffeine.com/logicaffeine_base/temporal/struct.ZoneSpec): A named time zone: its standard UTC offset, and an optional DST schedule `(dst_offset, spring rule, fall rule)`. A zone with `dst = None` is a fixed offset (UTC, IST, JST). DST transitions are generated per year from the rules, so a `ZoneSpec` is tiny — no transition table. - [struct ZoneTransition](https://docs.logicaffeine.com/logicaffeine_base/temporal/struct.ZoneTransition): A UTC-offset transition: from `at_unix_seconds` (a UTC instant) onward, the zone’s local time is `UTC + offset_seconds`. A timezone is a list of these, sorted ascending — the shape every IANA zone reduces to. DST is just two alternating offsets with transitions twice a year. - [enum Fold](https://docs.logicaffeine.com/logicaffeine_base/temporal/enum.Fold): How to resolve a local civil time that maps ambiguously to UTC: in a DST fold (the hour repeated when clocks fall back, so a local time occurs twice) or a gap (the hour skipped when clocks spring forward, so a local time never occurs). `Earlier` picks the earlier instant, `Later` the later one. - [const NANOS_PER_DAY](https://docs.logicaffeine.com/logicaffeine_base/temporal/constant.NANOS_PER_DAY): Nanoseconds in one civil day. - [const NANOS_PER_SECOND](https://docs.logicaffeine.com/logicaffeine_base/temporal/constant.NANOS_PER_SECOND): Nanoseconds in one SI second. - [const SECONDS_PER_DAY](https://docs.logicaffeine.com/logicaffeine_base/temporal/constant.SECONDS_PER_DAY): Seconds in one civil day (SmoothUTC: no leap seconds, so every day is exactly 86 400 s). - [const TT_MINUS_TAI_NANOS](https://docs.logicaffeine.com/logicaffeine_base/temporal/constant.TT_MINUS_TAI_NANOS): The fixed `TT − TAI` offset: Terrestrial Time runs 32.184 s ahead of atomic time, exactly. - [const UNIX_EPOCH_JDN](https://docs.logicaffeine.com/logicaffeine_base/temporal/constant.UNIX_EPOCH_JDN): The Julian Day Number of the Unix epoch (1970-01-01, Gregorian). - [fn add_business_days](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.add_business_days): Advance a day number by `n` business days (skipping weekends): `n > 0` moves forward, `n < 0` backward. Landing rule is “next business day in the direction of travel”, so `add_business_days(friday, 1)` is the following Monday and `add_business_days(monday, -1)` is the preceding Friday. - [fn add_span](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.add_span): Add a calendar span (`months` then `days`) to a civil date-time — the civil (wall-clock) operation, distinct from adding a physical `Duration`. Months are applied first with end-of-month clamping (`Jan 31 + 1 month = Feb 28/29`), then whole `days` roll over exactly through the day number. The time-of-day is preserved. (`Span` arithmetic on a zoned value is where it diverges from a physical duration across a DST boundary; in UTC the two agree.) - [fn business_days_between](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.business_days_between): The count of business days (Mon–Fri) in the half-open interval between two day numbers. Signed by direction (`b < a` yields a negative count); `[a, b)` so adjacent days differ by 1. - [fn civil_from_days](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.civil_from_days): The inverse of `days_from_civil`: the Gregorian `(year, month, day)` of a day number. - [fn civil_from_unix_nanos](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.civil_from_unix_nanos): Decompose a SmoothUTC instant (nanoseconds since 1970-01-01T00:00:00) into its civil date-time. Floor division makes pre-epoch instants correct (e.g. `-1 ns` is `1969-12-31T23:59:59.999999999`). - [fn date_add_span](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.date_add_span): Add a calendar span (`months`, then `days`) to a date held as days since 1970-01-01 — the civil `Date + Span` every tier computes: months clamp at the end of the month and respect leap years (`Jan 31 + 1 month = Feb 28/29`), then whole days roll over. Month and day arithmetic wraps at `i32`, as `Int` span arithmetic does everywhere. `Date - Span` is this with both parts negated. - [fn day_of_year](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.day_of_year): The 1-based day of the Gregorian year (`1..=366`). - [fn days_from_civil](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.days_from_civil): Days since 1970-01-01 for a Gregorian civil date. Howard Hinnant’s algorithm — exact for any year, `month` in `1..=12`, `day` in `1..=last_day_of_month`. - [fn days_from_iso_week](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.days_from_iso_week): The inverse of `iso_week_from_days`: the day number of an ISO-8601 week date `(iso_year, week, iso_weekday)` (week `1..=53`, weekday `1..=7` Monday … Sunday). - [fn days_from_julian](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.days_from_julian): Days since 1970-01-01 for a Julian-calendar date. - [fn dst_transitions_for_year](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.dst_transitions_for_year): The two UTC transitions for `year` of a zone with a regular DST schedule: spring-forward (`std_offset → dst_offset`) at `start`, fall-back (`dst_offset → std_offset`) at `end`. Each rule’s `time_seconds` is wall-clock local in the offset in effect just before the transition. - [fn format_duration](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.format_duration): Format a physical duration (nanoseconds) as a compact human string — `1h30m`, `500ms`, `1.5s`, `2d`, `-45m`, `0s`. Largest unit first; zero components omitted; sub-second fractions trimmed. The inverse of `parse_duration`. (This is a physical elapsed time, distinct from a calendar `Span`: it has no months — those aren’t a fixed number of nanoseconds.) - [fn format_rfc3339](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.format_rfc3339): Format a SmoothUTC instant as an RFC 3339 / ISO 8601 UTC timestamp (`Z` zone), e.g. `1970-01-01T00:00:00Z` or `2024-03-10T07:30:00.123456789Z`. Sub-second precision appears only when nonzero, with trailing zeros trimmed. - [fn format_time_of_day](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.format_time_of_day): Format a time-of-day (nanoseconds from midnight) as `HH:MM:SS`, with a trailing sub-second fraction only when nonzero (trailing zeros trimmed) — e.g. `07:30:45`, `16:00:00`, `07:30:45.5`. The clock face is lossless to the nanosecond; the input is normalised modulo a day so a negative or overflowing value still maps onto `[00:00:00, 24:00:00)`. - [fn format_zoned](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.format_zoned): Format a UTC instant as the local wall-clock time in a named zone, with its offset — `2024-07-01T08:00:00-04:00` (the timezone-aware “relative read” of an instant). `None` if the zone is unknown. The space-aware/zoned generalisation of `format_rfc3339`. - [fn from_local](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.from_local): The UTC instant of a local civil date-time in a zone. A local time normally maps to exactly one instant; in a DST fold it maps to two (resolved by `fold`); in a DST gap it maps to none (the boundary instants are returned, `fold` choosing which). This is the offset-dependent inverse of `to_local`, solved by testing each candidate offset for self-consistency. - [fn is_gregorian_leap](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.is_gregorian_leap): True if `year` is a leap year in the proleptic Gregorian calendar (every 4th year, except centuries, except every 400th). - [fn is_julian_leap](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.is_julian_leap): True if `year` is a leap year in the proleptic Julian calendar (every 4th year, no century exception). - [fn is_weekend](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.is_weekend): True if a day number falls on a weekend (Saturday or Sunday). - [fn iso_week_from_days](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.iso_week_from_days): The ISO-8601 week date of a day number: `(iso_year, week, iso_weekday)`, with `week` in `1..=53` and `iso_weekday` in `1..=7` (Monday … Sunday). The ISO year can differ from the civil year near January 1 / December 31 (e.g. 2021-01-01 is ISO 2020-W53-5). - [fn iso_weekday_from_days](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.iso_weekday_from_days): The ISO-8601 weekday of a day number: `1 = Monday … 7 = Sunday`. - [fn jdn_from_julian](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.jdn_from_julian): The Julian Day Number of a Julian-calendar date (proleptic, `month` in `1..=12`). - [fn julian_from_days](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.julian_from_days): The inverse: the Julian-calendar `(year, month, day)` of a day number. - [fn julian_from_jdn](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.julian_from_jdn): The inverse of `jdn_from_julian`: the Julian-calendar `(year, month, day)` of a JDN. - [fn knowable_horizon](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.knowable_horizon): The freshest remote time you can possibly know: an event happening at a node `light_delay_nanos` away cannot be observed before `now − light_delay`. This is the light-cone horizon — the reason a distributed clock’s knowledge is principled-uncertain rather than sloppy. - [fn last_day_of_month](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.last_day_of_month): The last day (28–31) of a Gregorian month. - [fn local_instant_nanos](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.local_instant_nanos): The local-as-UTC instant of a UTC instant in a named zone: the nanoseconds that, read back with the plain UTC calendar functions, yield the zone’s local wall-clock components. This is the lowering target for zoned component reads (`the hour of m in "Asia/Tokyo"`): a local clock face encoded as an instant, so every UTC extractor composes onto it unchanged. `None` if the zone is unknown. (Not a real instant — it is the wall clock; do not re-format it with a `Z`.) - [fn months_between](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.months_between): The number of complete calendar months from instant `a` to instant `b` (signed; negative when `b` precedes `a`). A month is complete only when `b` reaches at least `a + k months` under the same end-of-month-clamping, time-of-day-preserving rule as `add_span` — so `Jan 15 → Mar 14` is 1 month (not 2), `Jan 31 → Feb 28` (non-leap) is a full month, and one hour short of a month is 0. - [fn nth_weekday_of_month](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.nth_weekday_of_month): The day-of-month of the `week`-th `weekday` of `(year, month)` — e.g. the 2nd Sunday of March, or (with `week = 5`) the last Sunday of October. `week` is `1..=5`, `weekday` `0 = Sun … 6 = Sat`. - [fn offset_at](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.offset_at): The UTC offset (seconds) a zone has at `instant_ns`. `transitions` must be sorted ascending by `at_unix_seconds`; `base_offset` applies before the first transition. - [fn parse_duration](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.parse_duration): Parse a physical duration string into nanoseconds — `1h30m`, `90m`, `1.5s`, `500ms`, `2d`, `-1h`, `1d2h3m4s`. Units: `d h m s ms us`/`µs` `ns`. `None` on malformed input or i64 overflow. - [fn parse_rfc3339](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.parse_rfc3339): Parse an RFC 3339 / ISO 8601 timestamp into a SmoothUTC instant (nanoseconds since epoch). Accepts a `Z` zone or a numeric `±HH:MM` offset (normalized to UTC); `None` on malformed input. - [fn tai_minus_utc](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.tai_minus_utc): `TAI − UTC` (whole seconds) in effect at a SmoothUTC/Unix instant — the count of leap seconds (plus the 1972 base of 10) inserted on/before it. Constant between leap seconds; `10` before 1972. - [fn tai_nanos_from_unix_nanos](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.tai_nanos_from_unix_nanos): Convert a SmoothUTC/Unix instant in nanoseconds to TAI nanoseconds (leap-second exact). - [fn tai_to_unix_seconds](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.tai_to_unix_seconds): The inverse: TAI seconds back to a SmoothUTC/Unix instant. The offset is monotone in UTC, so a first guess (`tai − offset(tai)`) corrected against `offset(guess)` converges in one step. - [fn to_local](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.to_local): The local civil date-time of a UTC instant in a zone (apply the offset in effect). - [fn tt_nanos_from_unix_nanos](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.tt_nanos_from_unix_nanos): Convert a SmoothUTC/Unix instant in nanoseconds to Terrestrial Time (TT) nanoseconds: `TT = TAI + 32.184 s` — the continuous astronomical scale ephemerides are tabulated against. - [fn unix_nanos_from_civil](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.unix_nanos_from_civil): The inverse: the SmoothUTC instant (nanoseconds since the epoch) of a civil date-time. - [fn unix_nanos_from_tt_nanos](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.unix_nanos_from_tt_nanos): The inverse: TT nanoseconds back to a SmoothUTC/Unix instant in nanoseconds. - [fn unix_to_tai_seconds](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.unix_to_tai_seconds): Convert a SmoothUTC/Unix instant (seconds) to TAI (atomic time) seconds: `TAI = UTC + (TAI−UTC)`. - [fn weekday_from_days](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.weekday_from_days): The weekday of a day number: `0 = Sunday … 6 = Saturday`. (1970-01-01 was a Thursday = 4.) - [fn years_between](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.years_between): The number of complete calendar years from `a` to `b` (signed) — complete 12-month periods, so `2020-06-01 → 2024-03-01` is 3 (the fourth year, ending 2024-06-01, has not arrived). - [fn zone_by_name](https://docs.logicaffeine.com/logicaffeine_base/temporal/fn.zone_by_name): Look up a `ZoneSpec` by IANA name (e.g. `"America/New_York"`, `"UTC"`, `"Australia/Sydney"`). `None` for an unknown zone. A growable registry seeded with common zones (POSIX-rule based); the full IANA set ingests later. ## logicaffeine_base::tower The exact real types in a program’s value model: real algebraic numbers, computable reals, the program’s infinitesimal and the hyperreals it generates, infinite integers, ordinals, and the values a supertask leaves. - [struct Branch](https://docs.logicaffeine.com/logicaffeine_base/tower/struct.Branch): One branch of a residue-dependent value, compared by value. - [struct DependsValue](https://docs.logicaffeine.com/logicaffeine_base/tower/struct.DependsValue): A value that depends on the residue of `⌈1/dt⌉`. - [struct HyperValue](https://docs.logicaffeine.com/logicaffeine_base/tower/struct.HyperValue): A hyperreal value with the infinitesimal it is written in. - [struct NaturalValue](https://docs.logicaffeine.com/logicaffeine_base/tower/struct.NaturalValue): An infinite integer with the infinitesimal whose reciprocal generates it. - [struct Scale](https://docs.logicaffeine.com/logicaffeine_base/tower/struct.Scale): An infinitesimal of the program: the name it was declared under, what is known about the residues of its reciprocal, the infinite natural `⌈1/dt⌉`, and where it stands among the others. - [enum ExactRef](https://docs.logicaffeine.com/logicaffeine_base/tower/enum.ExactRef): A value of a value model seen as one of the types this module governs. - [enum HyperForm](https://docs.logicaffeine.com/logicaffeine_base/tower/enum.HyperForm): A hyperreal’s representations: an exact rational function of `dt`; a real algebraic Puiseux series that is none, a root of one (`crate::puiseux`); the germ a flow leaves, known by its series in `dt`; or a value of several ordered infinitesimals (`Multi`). A Puiseux series compares and hashes by its value, a germ by its canonical encoding. - [enum Op](https://docs.logicaffeine.com/logicaffeine_base/tower/enum.Op): The arithmetic operators the exact types take. - [enum RealFn](https://docs.logicaffeine.com/logicaffeine_base/tower/enum.RealFn): A function of the reals the exact types take: the square root, the exponential, the natural logarithm. - [enum Rel](https://docs.logicaffeine.com/logicaffeine_base/tower/enum.Rel): The relational operators the exact types answer. - [enum Rounding](https://docs.logicaffeine.com/logicaffeine_base/tower/enum.Rounding): How an integer part rounds: down, up, or to the nearest integer with ties away from zero (the tower’s `round`). - [enum Shape](https://docs.logicaffeine.com/logicaffeine_base/tower/enum.Shape): A value’s structure, as far as the supertask runtime reads it: the scalar kinds it treats apart, and the items of a list or a tuple. - [trait TowerValue](https://docs.logicaffeine.com/logicaffeine_base/tower/trait.TowerValue): A value model that holds the exact types: how to see a value as one of them or as a standard number, and how to build one. The interpreter’s runtime value and a compiled program’s value each implement it; every operation in this module is generic over it. - [trait ValueAlgebra](https://docs.logicaffeine.com/logicaffeine_base/tower/trait.ValueAlgebra): A value model’s whole arithmetic and its lists: what the supertask runtime computes with. Each operation is the language’s own on that model, exact types and standard numbers alike. - [fn apply_limit](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.apply_limit): Resolve a residue-dependent value under a limit rule; a value that does not depend on the residue is its own limit under every rule. A value that depends on the residues of several generators resolves each branch’s finer dependence first: the residues of different generators are independent, so the rule over every pair of classes is the rule over the coarser generator’s classes of the rule over the finer one’s. - [fn arith](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.arith): Apply `op` when either operand is an exact type; `None` when neither is (the tower handles it), and for `+` with a `Text` operand, which joins the other value as it prints by the value model’s own rule for every value. `recurse` is the value model’s full arithmetic, used to lift an operation over residue branches and through provisional values. - [fn carry_evidence](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.carry_evidence): `v` carrying the evidence a provisional or settled answer `c` carries. An answer never holds another: when `v` carries evidence of its own, the two join into one (`Converging::joined`). - [fn depends_from_parts](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.depends_from_parts): A residue-dependent value rebuilt from its scale, modulus and per-class values. - [fn display](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.display): How an exact value prints; `None` for any other value. - [fn euler](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.euler): e, exactly. - [fn exact_bytes](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.exact_bytes): An algebraic number (`0`), computable real (`1`) or ordinal (`2`) as its canonical bytes; `None` for any other value, and for a real built from a function a program defines, which stays with the program. - [fn exact_power](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.exact_power): `base ** exponent` for an exponent that is an exact number — what `**` and `pow` are when their exponent is one: a fraction `p/q` takes the real `q`-th root and raises it to `p` (`2 ** (1/2)` is `√2`, `dt ** (1/2)` is `√dt`, an even root of a negative number refused), and any other exponent is the language’s own `**`, a float on either side the float power. A residue-dependent or provisional operand is followed branch by branch. - [fn from_algebraic](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.from_algebraic): The canonical value of an algebraic number: a rational is an `Int`/`BigInt`/`Rational`. - [fn from_closed](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.from_closed): The canonical value of a value of the real closure: a rational function of `dt` is that hyperreal, in its own smallest form. - [fn from_depends](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.from_depends): The canonical value of a residue-dependent value: a branch that itself depends on the residue is read on its own class, a single branch is that value, and a dependence whose every branch is an integer polynomial in `1/dt` on its class is that infinite integer. - [fn from_exact_bytes](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.from_exact_bytes): The value `exact_bytes` wrote; `None` for a forged or non-canonical encoding. - [fn from_exact_real](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.from_exact_real): The canonical value of a computable real: an algebraic one is an algebraic number. - [fn from_germ](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.from_germ): The canonical value of a germ: one built as a rational function of `dt` is that hyperreal. - [fn from_hyper](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.from_hyper): The canonical value of a hyperreal: a standard value is its standard part, and a polynomial in `1/dt` that is an integer for every admitted `⌈1/dt⌉` is that infinite integer. - [fn from_multi](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.from_multi): The canonical value of a value of several infinitesimals: a standard number is that number, and a value of one infinitesimal is that infinitesimal’s own. - [fn from_natural](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.from_natural): The canonical value of an infinite integer: a standard one is an `Int`/`BigInt`, and one whose branches are standard but differ is a residue-dependent integer. - [fn from_ordinal](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.from_ordinal): A finite ordinal is a natural number. - [fn from_scaled_bytes](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.from_scaled_bytes): The value `scaled_bytes` wrote; `None` for a forged or non-canonical encoding. - [fn generator_of](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.generator_of): The infinite natural `⌈1/dt⌉` generated by an infinitesimal value. - [fn germ_of](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.germ_of): A number as a germ: a standard number as a constant, a hyperreal by its series or as the germ it is, an infinite integer that does not depend on the residue by its series; `None` otherwise. - [fn integer_part](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.integer_part): The integer part of an exact value under `mode`; `None` when `v` is not one (the tower handles it). `recurse` is the builtin itself, for the standard values inside a dependence or a provisional answer. - [fn is_exact_value](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.is_exact_value): True for a value of one of the types this module governs. - [fn is_infinitesimal](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.is_infinitesimal): `x ≈ 0`: zero or an infinitesimal. - [fn is_infinitesimal_relative](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.is_infinitesimal_relative): Zero, or smaller than every positive value of `at` and of the infinitesimals larger than it. - [fn is_limited](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.is_limited): Bounded by a standard number. - [fn is_limited_relative](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.is_limited_relative): Bounded by a value of `at` and of the infinitesimals larger than it. - [fn limit_rule](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.limit_rule): A limit rule by its English name. - [fn map_depends](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.map_depends): `f` on every branch of a residue-dependent value, or the first error a branch raises. - [fn new_infinitesimal](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.new_infinitesimal): The program’s infinitesimal: `Let be an infinitesimal …`, its reciprocal’s residues modulo `modulus` limited to `allowed` (the parser has already intersected the stated facts), or the contradiction refused when nothing is allowed. - [fn new_ordered_infinitesimal](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.new_ordered_infinitesimal): `Let be an infinitesimal much smaller than [and much larger than ] …`: an infinitesimal below `larger` and above `smaller`, each an infinitesimal itself or nothing, with its reciprocal’s residues as `new_infinitesimal` reads them. Refused when a bound is no infinitesimal, when the two bounds are not already ordered, and when the name is one an infinitesimal it would be ordered with already has. - [fn not](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.not): `not` lifted over residue branches and through provisional values; `None` for any other value. - [fn omega](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.omega): ω, the first infinite ordinal. - [fn pi](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.pi): π, exactly. - [fn provisional](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.provisional): A provisional answer: the current guess after `steps` cases with `revisions` changes. A guess that is already an answer joins this evidence to its own. - [fn real_fn](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.real_fn): `f` of `v`, exactly. A standard number goes in as the rational it denotes (a float as its dyadic rational), an algebraic number or a computable real as itself, and the answer is held in its smallest exact form: `sqrt(4)` is `2`, `sqrt(2)` is `√2`, `exp(0)` is `1`, `ln(e)` is `1`. The square root of a hyperreal or an infinite integer is its root in the real closure (`crate::puiseux`): `sqrt(dt)` is `√dt`. Every other function of a value of the infinitesimal is the germ of it (`Germ`): `exp(dt)` is `1 + dt + O(dt^2)`, `ln(1 + dt)` is `dt - (1/2)·dt^2 + O(dt^3)`, and the root of a germ is a germ. What is no germ is refused by name: the exponential of an infinite value, beyond every power of `dt`, and the logarithm of a positive infinitesimal or an infinite value, which carries `ln(dt)`. A residue-dependent value is mapped branch by branch and a provisional one keeps its evidence; a function of an ordinal has no exact form. - [fn relation](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.relation): Apply `rel` when either operand is an exact type; `None` when neither is. The answer is a `Bool`, or a residue-dependent `Bool` when it depends on `⌈1/dt⌉`; a comparison no theorem decides within the budget is a loud error. - [fn scale_from_parts](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.scale_from_parts): The scale `scale_parts` wrote. - [fn scale_parts](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.scale_parts): The infinitesimal’s name and its declaration’s bytes (`Scale::to_bytes`): its reciprocal’s residue facts, and where it stands among the others. - [fn scaled_bytes](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.scaled_bytes): A hyperreal (`0`), infinite integer (`1`), germ (`2`), root of a hyperreal (`3`), exact value of several infinitesimals (`4`), germ of several (`5`) or infinite integer of several (`6`) as its scale and canonical bytes — the scale of a value of several its smallest infinitesimal, the bytes naming every one it involves; `None` for any other value, and for a germ holding a real built from a function a program defines. - [fn standard_part](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.standard_part): The standard part: a hyperreal’s standard value, branch by branch for a residue-dependent value; a standard value is its own. An infinite value has none. - [fn standard_part_relative](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.standard_part_relative): The standard part relative to the infinitesimal `at`: what `v` is infinitely close to among the values of `at` and the infinitesimals larger than it, every smaller infinitesimal read at zero — the inner limit with `at` held fixed. `the standard part of dt + dx relative to dt` is `dt`. - [fn structurally_equal](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.structurally_equal): Structural equality for collections and hashing: exact forms by value, a general computable real by the formula that built it; `None` when neither value is an exact type. - [fn transmissible](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.transmissible): Whether a value of the exact types can travel as data — to a task, through a channel, over the wire: every value but one holding a real built from a function a program defines, in itself, in a germ, in a branch of a residue-dependent value or as a provisional answer. A value model’s own lists are its own to walk. - [fn undecided_branch](https://docs.logicaffeine.com/logicaffeine_base/tower/fn.undecided_branch): Why a value cannot decide a branch — a residue-dependent answer, or a provisional one no proof settled — or `None` for any other value. Every tier refuses such a branch with this sentence. ## logicaffeine_base::union_find Union-Find (disjoint set) with path compression and union by rank. - [struct UnionFind](https://docs.logicaffeine.com/logicaffeine_base/union_find/struct.UnionFind): Union-Find over `usize` element ids. ## logicaffeine_base::uuid UUID — a 128-bit universally-unique identifier (RFC 9562, superseding RFC 4122). - [struct Uuid](https://docs.logicaffeine.com/logicaffeine_base/uuid/struct.Uuid): A 128-bit UUID, stored big-endian (RFC 9562 byte order). - [enum Variant](https://docs.logicaffeine.com/logicaffeine_base/uuid/enum.Variant): The RFC-defined variant of a UUID — which layout the variant/version bits follow. - [fn encode_canonical](https://docs.logicaffeine.com/logicaffeine_base/uuid/fn.encode_canonical): Write a UUID’s canonical 36-byte text into a caller buffer (no allocation) — the alloc-free hot path for `Display` and for BULK formatting (fill one big buffer, zero per-id allocations). Uses an SSSE3 `pshufb` nibble→hex encode when available, else the byte-pair table. - [fn encode_many](https://docs.logicaffeine.com/logicaffeine_base/uuid/fn.encode_many): Format many UUIDs into ONE contiguous buffer (each 36 bytes, `\n`-free), zero per-id allocation — the bulk path a database column / log stream wants. Returns the packed `36·n`-byte buffer. ## logicaffeine_base::word Fixed-width wrapping integers — the ring ℤ/2ᵏℤ. - [struct Lanes4Word32](https://docs.logicaffeine.com/logicaffeine_base/word/struct.Lanes4Word32): Four lanes of `Word32` = one 128-bit register (`__m128i`) — the SHA-1 state/message carrier. Unlike the arithmetic lane types, its vocabulary is the four Intel SHA operations (`sha1rnds4`/`sha1msg1`/ `sha1msg2`/`sha1nexte`), so SHA-1 WRITTEN in Logos over these compiles to the `sha1rnds4` hardware sequence (AOT) and runs the byte-identical software spec `crate::sha_ops` on the interpreter. Lane `i` is bits `[32i+31 : 32i]` — index 0 low, index 3 high — matching `_mm_loadu_si128`. - [struct Lanes4Word64](https://docs.logicaffeine.com/logicaffeine_base/word/struct.Lanes4Word64): Four lanes of `Word64` (one 256-bit SIMD register) — the Poly1305 accumulator lane vector. Carries `[u64; 4]`; ops have an AVX2 fast path proven byte-identical to the scalar lanes. - [struct Lanes8Word32](https://docs.logicaffeine.com/logicaffeine_base/word/struct.Lanes8Word32): Eight lanes of `Word32` (one 256-bit SIMD register). Operations are lane-wise over the ℤ/2³² ring. - [struct Lanes16Word8](https://docs.logicaffeine.com/logicaffeine_base/word/struct.Lanes16Word8): Sixteen `Word8` lanes = one 128-bit register (`__m128i`) — the BYTE-SHUFFLE carrier for SIMD text codecs (hex encode/decode). Its vocabulary is `shuffle` (`pshufb`, a 16-entry byte LUT), byte AND, per-byte shift, and the two byte interleaves — so a hex codec WRITTEN in Logos over it compiles to the `pshufb` sequence (AOT, when SSSE3 is statically enabled) and runs the byte-identical scalar spec on the interpreter. Lane `i` is byte `i` (index 0 low), matching `_mm_loadu_si128`. - [struct Lanes16Word16](https://docs.logicaffeine.com/logicaffeine_base/word/struct.Lanes16Word16): Sixteen lanes of `Word16` (one 256-bit SIMD register) — the NTT coefficient lane vector. Carries `[u16; 16]`; the multiply-high is the SIGNED `_mm256_mulhi_epi16` (the Montgomery butterfly’s `mulhi`). Ops have an AVX2 fast path proven byte-identical to the scalar lanes. - [struct Word8](https://docs.logicaffeine.com/logicaffeine_base/word/struct.Word8): A 8-bit wrapping integer: the ring ℤ/2^8ℤ, where every operation is total and wraps modulo 2^8. - [struct Word16](https://docs.logicaffeine.com/logicaffeine_base/word/struct.Word16): A 16-bit wrapping integer: the ring ℤ/2^16ℤ, where every operation is total and wraps modulo 2^16. - [struct Word32](https://docs.logicaffeine.com/logicaffeine_base/word/struct.Word32): A 32-bit wrapping integer: the ring ℤ/2^32ℤ, where every operation is total and wraps modulo 2^32. - [struct Word64](https://docs.logicaffeine.com/logicaffeine_base/word/struct.Word64): A 64-bit wrapping integer: the ring ℤ/2^64ℤ, where every operation is total and wraps modulo 2^64. - [enum LanesVal](https://docs.logicaffeine.com/logicaffeine_base/word/enum.LanesVal): A SIMD lane vector of any supported lane config — the single runtime carrier the interpreter/VM match on, mirroring `WordVal`. Binary ops require the same config; a mismatch returns `None`. - [enum WordVal](https://docs.logicaffeine.com/logicaffeine_base/word/enum.WordVal): A fixed-width wrapping integer of any supported width — the single runtime carrier for `Word8`/`Word16`/`Word32`/`Word64` across the interpreter, VM, and wire, so the rest of the system matches on one `Word` value rather than a type per width. Each width is its own ring: a `Word16` wraps at 2¹⁶ exactly as the compiled tier’s `Word16` newtype does. Binary ops require matching widths; a width mismatch is a type error the caller reports (the ops return `None`).