v0.14 Rust migration decision ledger

August 27, 2026 · View on GitHub

Status: active implementation ledger for Lacuna 0.14.0.

This page records the operational outcome of every foundation and candidate in the Rust migration register. The register explains architecture and candidate contracts; this ledger answers what was measured, what shipped, and why. A release tag is blocked while any row remains PROPOSED, MEASURED, or ADMITTED.

Evidence contract

Every measured row links to a lacuna.native-migration-benchmark version 1 artifact produced from the exact source commit. The artifact records effective dimensions, reference and candidate latencies, incremental process RSS, copy/workspace bytes, thread configuration, equivalence checksums, and the admission decision. Generated inputs use fixed seeds and are created outside the timed region. Native admission requires correctness plus one of:

  • at least 1.5 times end-to-end throughput over the optimized reference;
  • at least 30% lower incremental peak RSS with no more than 10% latency regression;
  • bounded-memory completion of a declared workload the reference cannot complete under the same budget.

The result must reproduce in nightly CI before a native path becomes SHIPPED_NATIVE. The non-publishing release preflight repeats the same evidence for the exact release SHA and remains a tag gate; it does not create or change candidate decisions. A negative result is terminal for v0.14 unless a changed design or new representative evidence is reviewed.

Foundation decisions

IDStateEvidence commit/runEffective shapeReference/candidate resultDecision and reopening evidence
F-01 typed array boundarySHIPPED_NATIVEe54b757 CIone Linux cp311-abi3 wheel on Python 3.11–3.14; Linux x86_64/aarch64, macOS arm64, and Windows x86_64 target wheelsTyped NumPy bulk-copy boundary, grouped IC, and PBO passed same-wheel and target-wheel parity; MSRV, dependency, license, and RustSec gates passedRelease-ready. Reopen only if the stable-ABI or target-wheel matrix stops passing.
F-02a exact c14n-v1 streamingOPTIMIZED_NON_NATIVEc7fd033 array, c7fd033 frame100,000 × 4 float64 array and Polars frame12.83×/38.1% RSS and 1.58×/27.3% RSS; exact digestsPython streaming resolves the material allocation and latency problem. Reopen native work only with a different design and pinned-Linux evidence.
F-02b new identityBLOCKEDADR-017not applicableDeferredReopen only through a new canonicalization ADR and migration.
F-03a compact internal carriersOPTIMIZED_NON_NATIVE957cc16, 010b873, 97db28e, d3f85dfcost components, resample values/indices/offsets, and CPCV design spikecontiguous carriers remain behind cost and scalar-bootstrap APIs; memory-heavy joint resampling and CPCV carriers were removed after full-call measurementReopen CPCV carriers only with a changed projection design or a separately approved public-carrier contract.
F-03b public carriersBLOCKEDADR-017not applicableDeferredReopen through public API/schema migration.
F-04 execution budgetOPTIMIZED_NON_NATIVE2f5f180bounded bootstrap batches; native threads=1fixed/output and temporary allocation checks occur before allocationParallel native work remains blocked; extend the private resolver only as candidate callers migrate.
F-05 benchmark evidenceOPTIMIZED_NON_NATIVEe54b757 nightly, e54b757 CIisolated smoke/small/medium cases; seven timed repetitions after two warm-upssidecar v1 records process RSS, traced memory, copy/workspace/projection bytes, effective dimensions, thread configuration, exact checksums, full evidence comparison, and mechanical admissionThe Python/CI harness is release-ready. Exact-SHA preflight must reproduce it before tagging.

Candidate decisions

IDStatePublic operationEvidence commit/runEffective shapeBaseline / optimized / nativeCorrectnessDecision and reopening evidence
R-01SHIPPED_NATIVEgrouped rank ICe54b757 artifact, nightly run1,625,750 rows, 1,000 groups cycling through 3/250/1,250/5,000 rows, 3 horizonslocal v0.13/reference/native: 282.50/282.50/41.14 ms; authoritative optimized NumPy/native: 11.935/2.076 s (5.749×)exact structure, checksum, and all 2,989 compared numeric values; analytical, skewed-group, tie, signed-zero, null, boundary, and differential tests passRelease-ready single-threaded typed-array kernel. The exact-SHA preflight remains a tag gate. Reopen a negative decision only with changed representative evidence.
R-02OPTIMIZED_NON_NATIVEcost stress1a35b3e baseline, 957cc16 reference100,000 rows, 9 scenarios, 200 periodsrepeated row/scenario tuple construction replaced by one component and period aggregation; local timing is non-authoritativeexact equivalence checksum plus literal row-rescan, unknown-row, reconciliation, and monotonicity testsThe complete non-fingerprint portion is only an 8.64% upper bound on public latency, below native materiality. Reopen with a changed full-call profile on the pinned runner.
R-03OPTIMIZED_NON_NATIVEcapacity curve37a0da5 baseline, 957cc16 reference100,000 rows, 3 scenarios, 10 capital points, 200 periodsexact s, s^(3/2) and period sufficient-statistic evaluation replaces 30 trade rescansexact equivalence checksum plus literal trade-rescan, constraint, unknown-liquidity, and zero-quantity testsThe complete non-fingerprint portion is only an 8.01% upper bound on public latency. Reopen with a changed algorithm or pinned profile.
R-04OPTIMIZED_NON_NATIVEbreak-even cost37a0da5 baseline, 957cc16 reference100,000 rows, 33 screen points, 200 periodsnet P&L/return are O(1) per point; Sharpe/CAGR retain O(periods)structural output is exact; literal rescans agree within 1e-12 and the near-zero trace difference is about 4e-11The complete non-fingerprint portion is an 8.77% upper bound on public latency. Native work is not material.
R-05OPTIMIZED_NON_NATIVEpurged/CPCV assemblyd3f85df rejected native spike100,000 rows, 6 groups, 15 combinations, 1.5 million role evaluations420.52 ms v0.13 baseline / 184.60 ms optimized / 159.42 ms native (1.158× versus optimized)exact equivalence checksum; analytical, half-open interval, embargo, source-order, path-incidence, boundary, and property tests passed before removalThe optimized NumPy path is 2.28× faster than baseline. Native missed the 1.5× full-call gate because unchanged Fold and evidence projection dominate; the kernel, binding, and dispatch were removed. Reopen only with a changed projection design or new representative evidence.
R-06NOT_MIGRATINGshared resampling reduction957cc16 baseline, 97db28e bounded reference204 rows, 12 columns, 1,000 resamples120.15 ms / 125.02 ms bounded reference; experimental vectorization was 121.10 ms with about 23 MiB more RSSfinal checksum is exact; RNG/substream and batch-size invariance plus independent White/Hansen fixtures passIndex generation owns 96.4% of the measured path; the eligible reducer owns 3.6%. No native RNG is allowed, so the Rust reducer fails materiality. Reopen only with a new reducer scope or profile evidence.
R-07OPTIMIZED_NON_NATIVEpermutation reduction1bdb0a8 baseline, 3b492eb reference204 rows, 2,000 unrestricted Pearson permutations83.83 ms / 31.14 ms optimized / no native spike (2.69×)exact equivalence checksum, exact RNG identities, and literal corrcoef agreement within 1e-15Centered norms and the paired vector are invariant, so one NumPy dot product replaces repeated corrcoef construction. The optimized public call is below 50 ms; reopen native work only with a newly material workload.
R-08SHIPPED_NATIVEPBO/CSCVc031c82 baseline, 7bbdf55 reference, e54b757 nightly artifact, nightly run1,008 rows, 12 strategies, 14 partitions, 3,432 combinations730.09 ms v0.13 / 178.23 ms optimized / 48.89 ms local native; authoritative optimized/native: 405.55/85.71 ms (4.732×)structure is exact; all 17,163 finite values are within 1e-12 (max absolute error 1.67e-16, max relative error 9.15e-15); exact sidecar checksums remain recorded separately; Rust/core boundary, mean/Sharpe, tie, layout, and status tests passRelease-ready at the 512-combination crossover. Python retains policy, RNG-free combination enumeration, and result construction. Exact-SHA preflight remains a tag gate.
R-09OPTIMIZED_NON_NATIVEbucket assignmenta538500 baseline, 1c2817b reference100,000 rows, 200 groups, 5 buckets, 0.14% nulls142.19 ms / 61.87 ms optimized / no native spike (2.30×)exact equivalence checksum plus literal group-oracle coverage across bucket kinds, ties, direction, exclusions, and group supportOne Polars plan removed Python group materialization and cut traced Python peak memory 17.6%. Reopen only if pinned evidence isolates a material residual outside Polars.
R-10OPTIMIZED_NON_NATIVEmembership turnoverbaseline, reference100,000 rows, 200 periods, 500 instruments, 5 buckets, 3 lags77.84 ms / 42.10 ms optimized / no native spike (1.85x)exact equivalence checksum, legacy lag-one fixtures, and churn-heavy literal-set differential coverageEndpoint self-joins eliminated Python sets and cut traced Python peak memory 83.8%; the optimized public call is below 50 ms. Reopen only with a newly material shape.
R-11OPTIMIZED_NON_NATIVEprior-only regime quantilesbaseline, reference100,000 rows, 252-observation window, 63 minimum history, 1.03% nonfinite5.28 s / 1.74 s optimized / no native spike (3.04x)exact equivalence checksum plus bit-identical NumPy-linear, prior-only, null/NaN, chunk, and permutation coveragePolars order statistics remove the quadratic Python loop. The complete optimized Polars phase is about 1.7% of the instrumented public call, below native materiality. Reopen only if threshold work becomes material after a changed carrier or workload.
R-12OPTIMIZED_NON_NATIVEevent windowsbaseline, reference100,000 price rows, 5,000 events, 80,000 requested path rows, 500 instruments182.93 ms / 61.94 ms optimized / no native spike (2.95x)exact equivalence checksum plus irregular-calendar, null/exhausted-anchor, censoring, chunk, ordering, and overlap coveragePolars as-of/range joins cut incremental RSS 85.1%. The eligible residual joins and aggregation are under 10% of instrumented public latency, below native materiality. Reopen with a newly material residual profile.
R-13OPTIMIZED_NON_NATIVEevent responsebaseline, reference20,000 events, 40 clusters, 4 offsets, 1,000 resamples746.68 ms / 18.60 ms optimized / no native spike (40.1x)exact equivalence checksum, unchanged Python RNG identities, literal path-concatenation agreement, unequal-cluster weighting, and batch-size invarianceCluster sufficient statistics cut incremental RSS 98.3% and move the public call below 50 ms. R-06 leaves no material Rust reducer. Reopen only with a newly material shape.
R-14OPTIMIZED_NON_NATIVEportfolio projectionbaseline, reference100,000 rows, 200 cohorts, 10 neutral groups, rank-weighted long/short legs880.93 ms / 37.64 ms optimized / no native spike (23.4x)exact equivalence checksum plus literal equal/rank/absolute score oracles, reconciliation, one-sided groups, zero fallback, and permutation invariancePolars window allocation cut incremental RSS 91.5% and moved the public call below 50 ms. No residual constrained kernel remains.
R-15OPTIMIZED_NON_NATIVEuniverse transitionsbaseline, reference80,000 rows, 4 universes, 800 snapshots, 125 instruments per universe, 20% rotating exclusions579.37 ms / 400.23 ms optimized / no native spike (1.45x)exact equivalence checksum plus literal multi-universe sets, zero/partial retention, chunk/order, duplicate, and c14n-v1 identity coverageSnapshot self-joins cut RSS, but all optimized Polars work is only 5.6% of the instrumented call; exact streaming c14n-v1 owns over 92%. Native set operations fail materiality.
R-16OPTIMIZED_NON_NATIVEc14n-v1 fingerprintc7fd033 array, c7fd033 frame100,000 × 4 float64 array and Polars framearray: 1.163 s / 90.61 ms; frame: 2.619 s / 1.659 s; no native spikeexact c14n-v1 checksums, frozen corpus, property and chunk-layout parityStreaming Python passed the admission thresholds, so Rust is not justified. Reopen only for a changed encoder design backed by new benchmark evidence.

Release closure

All v0.14 rows are terminal. Before tagging 0.14.0, the non-publishing preflight must reproduce the native evidence for the exact release SHA and emit its checksummed manifest. Release notes list SHIPPED_NATIVE, OPTIMIZED_NON_NATIVE, NOT_MIGRATING, and BLOCKED outcomes separately; they do not describe an unmeasured candidate as a delivered performance improvement.