0.10: correct-by-construction tensor-native compiler core - #328
Draft
jgoppert wants to merge 65 commits into
Draft
0.10: correct-by-construction tensor-native compiler core#328jgoppert wants to merge 65 commits into
jgoppert wants to merge 65 commits into
Conversation
Introduce typed DAE variable roles and checked temporal expressions for pre, sample, assertions, projected array formals, and derivative aliases. Establish the initial OMC parity workflow and document the compiler architecture that will carry these invariants. Signed-off-by: James Goppert <james.goppert@gmail.com>
Replace post-hoc DAE repair with fail-early checked construction. Carry structural demotion, compact block projection, holonomic index reduction, modifier ownership, and connector-boundary checks through the DAE-to-Solve cutover. Signed-off-by: James Goppert <james.goppert@gmail.com>
… targets Construct empty arrays, parameter comprehensions, lexical iterator domains, calculated parameter families, vector conditions, record-array field projections, and structured derivative families from typed shape proofs. Derive Solve targets and exact source spans from the emitted owners. Signed-off-by: James Goppert <james.goppert@gmail.com>
Represent continuous and event algorithms declaratively while keeping whole-array loops compact. Prove finite reductions, integer conversions, early returns, and conditional function targets before construction, and report unsupported runtime ranges at their DAE owner. Signed-off-by: James Goppert <james.goppert@gmail.com>
Keep fill, ones, vector families, empty reductions, enumeration dimensions, and shape-derived loops compact through checked IR. Add explicit sampled-clock ownership and synchronous history contracts while splitting oversized checked-IR modules along semantic boundaries. Signed-off-by: James Goppert <james.goppert@gmail.com>
…ners Carry exact call provenance and causal connector ownership into checked equations. Construct connection forests, discrete initialization, state reinitialization, records, homotopy, delays, and complete zero-state RK45 fixtures without backend reconstruction. Signed-off-by: James Goppert <james.goppert@gmail.com>
Make quotient semantics, scalar-program register flow, discrete/event owners, and base/sub-clock partitions explicit in Flat and DAE. Preserve those owners through transformations and reject unresolved references or noncomputable programs at construction. Signed-off-by: James Goppert <james.goppert@gmail.com>
Establish canonical function ownership, typed record and enum preservation, completed Resolve artifacts, branded IDs, and checked wire facts. Replace provisional SSA and replay paths with a proof-ready DAE boundary and focused development tooling. Signed-off-by: James Goppert <james.goppert@gmail.com>
Serialize equation and function construction operations, derive packed wire offsets and owner tables once, and linearize checked replay. Make construction failures and delay variants exhaustive so later phases consume validated facts instead of rebuilding them. Signed-off-by: James Goppert <james.goppert@gmail.com>
Represent when chains as nonempty owned structures, reject unsupported clocked elsewhen forms, and enforce unique event ownership. Remove semantic downgrade options and carry exact Resolve proof plus empty primitive arrays into checked discrete construction. Signed-off-by: James Goppert <james.goppert@gmail.com>
Define certification-ready boundaries between GALEC parsing, checked IR, evaluation, template-owned target syntax, code generation, and packaging. Route LSP and cache tooling through the same checked compiler surfaces. Signed-off-by: James Goppert <james.goppert@gmail.com>
Build eFMI as a checked target with explicit assets, function assignments, delay timing, collision-safe symbols, failure-atomic packaging, and a lifecycle-safe interpreter. Replace proof-obscuring LU pivot defaults with typed conversion and overflow failures. Signed-off-by: James Goppert <james.goppert@gmail.com> Co-authored-by: Pradyunn Kale <kalepradyunn@gmail.com>
Preserve GALEC model identity, array start shapes, relational min/max and NaN behavior, embedded-C projections, source spans, and dependency-scoped function construction. Represent absent or missing provenance explicitly and close template rendering without guessed values. Signed-off-by: James Goppert <james.goppert@gmail.com>
Model conditional discrete-real equations as owned B.1b residuals and lower them consistently through DAE, Solve, GALEC, code generation, and LSP rendering. Split event-owner rebuilding and condition scalar lowering into their responsible modules. Signed-off-by: James Goppert <james.goppert@gmail.com>
…aries Route WASM, LSP, templates, delays, and save diagnostics through the compile facade and checked source-map boundary. Preserve semantic root timestamps, require typed discrete activation, and enforce separately reviewed DAE core and wire size budgets. Signed-off-by: James Goppert <james.goppert@gmail.com>
Index temporal owners, effective types, coordinates, exact statement provenance, and record projections during DAE construction. Reject unproved projections and reserve only proven forward variables so structural and code-generation failures retain their original source owner. Signed-off-by: James Goppert <james.goppert@gmail.com>
Carry exact occurrence and semantic identity through Resolve, Flat, DAE, clock plans, and tool consumers. Replace rendered-name interpretation with typed identities and make addressable layouts, node views, discrete holds, and previous-value owners fail closed. Signed-off-by: James Goppert <james.goppert@gmail.com>
Restore frontend behavior on the new identity path using iterative resolver worklists, exact callable roots, external-function kinds, enum conversions, component-array projection, and sequential aggregate function values. Keep runtime vectors and event traces honest while repairing stale verification consumers. Signed-off-by: James Goppert <james.goppert@gmail.com>
Establish memory-aware Cargo and Rayon budgets, nextest workspace execution, fail-loud per-model resource ceilings, typed MSL failure classification, and a fixed two-tier OMC comparison cadence. Shard full-cohort execution with lossless fan-in and remove the legacy rendered-name path. Signed-off-by: James Goppert <james.goppert@gmail.com>
…antics Construct connection-joined clock coordinates, declarative initial algorithms, affine derivative owners, lexical modifier bindings, discrete initial values, and semiLinear orientation. Run the comparator before judgment and make sim_ok an execution count rather than a correctness claim. Signed-off-by: James Goppert <james.goppert@gmail.com>
Specialize function shapes, comprehensions, and branches from proven values; solve calculated parameters by substitution; and schedule when conditions per occurrence. Enforce connector member pairing, exact constant folds, multi-result calls, continuous pre-state ownership, and start-instant relation semantics. Signed-off-by: James Goppert <james.goppert@gmail.com>
Seed relation memory from the exact production condition implementation and move simulation behind one FMI 3 Model Exchange kernel. Preserve redeclared dimensions and type information while removing the general implicit-DAE path and silent solver fallback. Signed-off-by: James Goppert <james.goppert@gmail.com>
Centralize zero-state events, BDF stepping, admissibility, discrete-state outputs, output-grid ownership, and the complete integrator-step contract in the Model Exchange runtime. Extend the host interface without exposing backend-specific lifecycle behavior. Signed-off-by: James Goppert <james.goppert@gmail.com>
Preserve specialized record projections, settled structural conditions, ordered discrete array assignments, enum modifiers, constant-folded equation templates, exact event assignments, promoted concatenation, and row-major aggregate ownership. Signed-off-by: James Goppert <james.goppert@gmail.com>
…ture budgets Execute checked function assertions, retain typed enum identity, and keep event times and post-root relation sides exact. Reduce extraction and runtime complexity, split oversized modules by content, and enforce source-size and architecture budgets. Signed-off-by: James Goppert <james.goppert@gmail.com>
Prove ordered total-array loops, compact range bounds, structural record projections, quotient discontinuities, expandable-member use, exact clock transfers, and affine coordinates. Preserve settled event traces without scalarizing regular tensor families. Signed-off-by: James Goppert <james.goppert@gmail.com>
Separate root probes from settled observations, retain dynamic deadlines, derive typed integrator-history effects, and gate focused traces before judgment. Make zero actionable counterexamples a stop-the-line development rule and keep regression fixtures for each repaired event defect. Signed-off-by: James Goppert <james.goppert@gmail.com>
Preserve BDF history across unchanged events, distinguish schedule time from numerical tolerance, refresh typed relation aliases, bound profiler snapshots, stop exhausted Newton backtracking, and retain canonical root projections and exact affine dependencies. Signed-off-by: James Goppert <james.goppert@gmail.com>
jgoppert
force-pushed
the
msl-trace-parity-50
branch
from
August 3, 2026 13:04
41e324d to
3fc9a6c
Compare
Signed-off-by: James Goppert <james.goppert@gmail.com>
Signed-off-by: James Goppert <james.goppert@gmail.com>
Signed-off-by: James Goppert <james.goppert@gmail.com>
Name public targets by artifact and use case while declaring the consumed IR independently. Remove legacy aliases and unverified stubs, document every active target, and preserve tensor-native Solve lowering with explicit capability rejection. Add checked FMI construction boundaries, FMI 2 and FMI 3 Model Exchange and Co-Simulation source FMUs, and an FMI layered-standard WebAssembly component target. Pin upstream standard assets and verify schemas, lifecycle behavior, trace parity, and real Wasmtime execution. Make strict backend CI fail closed on missing conformance tools while ordinary local verification skips only absent optional toolchains. Shard runtime checks by backend and keep the full verification surface wired through xtask. Signed-off-by: James Goppert <james.goppert@gmail.com>
Give the finite Crane and LLVM flake graph a 64 MiB process stack before evaluation. The expanded workspace exceeds the hosted runner's default stack while the same derivations evaluate and build successfully within this explicit bound. Signed-off-by: James Goppert <james.goppert@gmail.com>
Construct the unsafe block keyword from literal fragments in the fixed-size Rust runtime fixture. The rendered harness remains unchanged, while the architecture review scanner no longer mistakes generated source text for new host-side unsafe code. Signed-off-by: James Goppert <james.goppert@gmail.com>
Move Modelica interchange round-trip and OMC acceptance checks into a content-owned test module, and route only the Modelica backend shard to it. The render shard remains toolchain-neutral while strict Modelica validation still fails closed when OMC is unavailable. Signed-off-by: James Goppert <james.goppert@gmail.com>
Raise the single-attempt hosted-runner simulation and phase budgets from 15 to 20 seconds. Two strict-high rectifier models completed at roughly 16 seconds of hosted wall time and remain numerically high against OMC; the focused two-model check passes with zero near or deviation bands. Baselines, exclusions, tolerances, and retry policy are unchanged. Signed-off-by: James Goppert <james.goppert@gmail.com>
Analyze model-algorithm function calls against checked function shape certificates and exact Flat InstanceId/DefId record layouts before construction. Lower only proven discrete leaves and preserve whole-record assignment without scalarizing the Modelica source. Reject partial, mismatched, recursive, record-array, or impure multi-output receivers before DAE construction, and cover the resulting sampled transition through execution. Signed-off-by: James Goppert <james.goppert@gmail.com>
Orient only generated always-active discrete-Real connection rows into algebraic causal definitions, propagate their aliases in dependency order, and remove the proven source rows from clocked GALEC actions. Inline checked record-returning functions with field projections and turn model and call-scoped function assertions into explicit INVALID_ARGUMENT signal actions. Unsupported loop assertions and event actions continue to fail closed. Co-authored-by: Pradyunn Kale <kalepradyunn@gmail.com> Signed-off-by: James Goppert <james.goppert@gmail.com>
Carry the type checker proof into signal analysis so Real relational and equality expressions contribute NAN while Integer and Boolean comparisons do not. Derive generated block method clauses at the checked package boundary, while authored GALEC clauses remain validated exactly. Update the normative GALEC catalogs and round-trip fixtures to describe and exercise the completed Beta-1 signal semantics. Co-authored-by: Pradyunn Kale <kalepradyunn@gmail.com> Signed-off-by: James Goppert <james.goppert@gmail.com>
Expose the standard 32-bit ErrorSignalStatus in embedded C and Production Code manifests, clear it at each block method boundary, and accumulate predefined signal statements with the eFMI bit encoding. Route every generated comparison through single-evaluation helpers so qNaN operands set NAN and return false, including the C-native != case. Compile and execute strict C99 harnesses for all six comparisons, explicit signals, reset behavior, and manifest LogicalData coverage. Co-authored-by: Pradyunn Kale <kalepradyunn@gmail.com> Signed-off-by: James Goppert <james.goppert@gmail.com>
Record the HBridge triangle-PWM mean output as a reviewed comparator boundary: tiny switching event-time shifts change a held aggregate at raw observation points even though waveforms and states agree and both endpoints converge within 2.7e-10 V. Keep the model visible in simulation and exclusion inventories while preventing this non-identifying channel from being misreported as a counterexample to compile-to-correct-simulation. Signed-off-by: James Goppert <james.goppert@gmail.com>
Advance the vehicle-model CI checkout to the signed corpus revision that uses OPENMODELICALIBRARY root discovery and a measured OMC quaternion-norm tolerance. The pinned commit passed the Rumoca corpus, OMC model checks, and vehicle boundary checks locally. Signed-off-by: James Goppert <james.goppert@gmail.com>
Reference every generated runtime helper from startup so Clang does not reject valid blocks that happen not to use comparisons under -Werror=unused-function. Function designator expressions add no runtime work and retain the existing single-evaluation helper semantics. Signed-off-by: James Goppert <james.goppert@gmail.com>
Add the sparse faer backend used by checked projection and deterministic hashing for GALEC IR maps. Refresh the locked Nix vendor hash so the dependency graph remains reproducible. Signed-off-by: James Goppert <james.goppert@gmail.com>
Construct compact event-relation families, retain record and call provenance, and derive exact scalar function dependencies without re-expanding unrelated loop contexts. Tighten structured function lowering and add regression coverage for event roots, assertions, multi-output calls, and SPD loop compaction. Signed-off-by: James Goppert <james.goppert@gmail.com>
Build checked refresh schedules and sparse structural patterns, preserve branch continuity during initialization, and scale nonlinear projection by construction-owned metadata. Reuse only bitwise-identical settled coordinates, make automatic integrator selection capability-based, and add structured-root, sensitivity, and scaled-system regressions. Signed-off-by: James Goppert <james.goppert@gmail.com>
Derive deterministic signal contracts, clock schedules, causal outputs, expression projections, and user-function bodies from checked IR. Reject unsupported semantics at their source span and prove the generated Algorithm Code path against typed execution traces. Signed-off-by: James Goppert <james.goppert@gmail.com>
Render strict-C99 checked Algorithm and Production Code with single-evaluation helpers, bounded storage, explicit status propagation, and statement-level source trace comments. Document the MISRA-oriented assurance profile without claiming toolchain compliance, and compile generated fixtures under pedantic warnings. Signed-off-by: James Goppert <james.goppert@gmail.com>
Version the trace-comparator baseline migration, pin the prior and current strict-high counts, and bind reviewed exclusions to their checked artifact digest. Keep OMC as the semantic oracle while failing on every unclassified or actionable compile-sim counterexample. Signed-off-by: James Goppert <james.goppert@gmail.com>
Define compact event-family ownership, checked refresh and projection reuse, automatic FMI integrator selection, comparator-baseline migrations, and the generated-C assurance boundary. State explicitly that MISRA and DO-178C claims require external process evidence rather than compiler banners alone. Signed-off-by: James Goppert <james.goppert@gmail.com>
Keep sparse linear algebra mandatory for production solver builds while compiling only the real event-history kernel under Kani. This prevents unrelated faer/pulp assembly from blocking analysis without using Kani's unsound global-assembly escape hatch. Add reachability obligations for rejection, changing acceptance, and settled acceptance. Signed-off-by: James Goppert <james.goppert@gmail.com>
jgoppert
force-pushed
the
msl-trace-parity-50
branch
from
August 8, 2026 07:31
8931297 to
d690691
Compare
Collect target-neutral semantic operation use while constructing the typed Algorithm Code template view, including operations nested in array subscripts. Emit only the embedded-C helpers that checked code can reach, so strict Clang builds do not reject unused static functions. Consume the FMI 3 algebraic refresh instance parameter only when the checked algebraic plan is empty. Update the min/max runtime test to exercise reachable helpers and pin dead-helper elimination for the smoke model. Render native Boolean branch expressions with exactly one required parenthesis pair while retaining explicit wrapping for helper-call comparisons. Pin the commensurate-clock output that exposed Clang's parentheses-equality diagnostic. Signed-off-by: James Goppert <james.goppert@gmail.com>
jgoppert
force-pushed
the
msl-trace-parity-50
branch
from
August 8, 2026 07:53
d690691 to
a9610b4
Compare
Accept the exact promoted schema-v1 MSL baseline only through a checked version-3 lineage bridge. Pin the source asset digest, cohort, OMC context, compiler-contract cutover, comparator-policy migration, and ordered evidence commits so altered or unrelated older assets fail closed. Document the temporary multi-migration bridge policy and cover the authentic path, digest rejection, and evidence ordering. Signed-off-by: James Goppert <james.goppert@gmail.com>
Signed-off-by: James Goppert <james.goppert@gmail.com>
Preserve checked reaching definitions across function serialization and replay, lower multi-output calls atomically, and retain bounded tensor-selection correlations through GALEC legalization. Generate embedded C with proven lexical local lifetimes and direct checked tensor arguments/results, avoiding redundant aggregate stack buffers while preserving GALEC fallback and signal semantics. Extend validation, parser round trips, generated-code tests, and the eFMI export specification accordingly. Signed-off-by: James Goppert <james.goppert@gmail.com>
Signed-off-by: James Goppert <james.goppert@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This branch rebuilds Rumoca around a correct-by-construction, tensor-native compiler and execution pipeline. The intended refinement claim is stronger than “the compiler did not crash”: a model accepted through the checked pipeline must initialize and simulate with the semantics represented by its source. OMC remains the differential oracle. A completed but inaccurate trace is an actionable counterexample unless the exact model is classified as a reviewed boundary where raw pointwise comparison is not identifying.
The branch deliberately does not claim that this theorem is complete. It makes the claim more defensible by moving semantic obligations into constructors, removing parallel legacy representations, and requiring every observed counterexample to be reproduced, explained, fixed at its owning phase, or recorded as a typed oracle-comparison boundary.
Compiler and IR
pre, sampled values, dynamic deadlines, and discrete updates.Solver and FMI execution
faer.GALEC, eFMI, FMI, and deployment targets
Embedded-C assurance boundary
The generated embedded C is now designed for an auditable, MISRA-oriented assurance profile:
This is not a claim of MISRA C or DO-178C compliance. MISRA compliance requires a documented guideline selection, deviations, tool reports, and process evidence. DO-178C approval requires project-specific planning, requirements traceability, verification independence, configuration management, coverage evidence, and a certification-authority decision. The compiler now preserves evidence useful to those activities without placing an unsupported compliance claim in generated banners.
MSL oracle evidence and counterexamples
The verification workflow uses the pinned 566-model MSL root-example cohort and accounts for every successful Rumoca simulation. The resolved quality baseline owns the exact 113-model certified strict-high roster; prior workflow artifacts remain diagnostics and cannot silently redefine that ratchet:
sim_ok: 122Reviewed boundaries are not hidden passes. Their exact model names and reasons are checked into
msl_trace_compare_exclusions.json, and the baseline migration pins both the old/new classification counts and the SHA-256 of that artifact. The catalog covers chaotic trajectory separation, event-side trace conventions, integration-residue-scale period aggregates, and nonsmooth contact timing. Changes to comparator policy must increment the gate schema and provide exact migration accounting; unrelated quality metrics remain monotonic.Verification
Final tip
28138a9bpassescargo xtask verify quickinside the project Nix environment with four workers. The branch also completedcargo xtask verify fulllocally during development; the final change is covered by the quick suite plus an exact replay of the failed hosted four-shard MSL merge:Optional local external-tool checks reported their prerequisites explicitly rather than masquerading as proof: NVCC, the FMI validator stack (
cmake, FMPy, Java),wasm-tools, and headless browser/VS Code smoke prerequisites were unavailable in this local environment. Hosted CI is responsible for the corresponding provisioned-tool checks. The coverage gate passed; its non-fatal trim-candidate report remains visible for follow-up and is not described as a coverage-quality proof.Formal model checking is intentionally narrow. The retained Kani manifest names the production kernel, bounded symbolic domain, property, and counterexample meaning. It proves transactional pre-event history behavior for the production atomic fixed-point kernel; it is not advertised as proof of parsing, typing, tensor lowering, structural balance, code generation, floating-point accuracy, or the general compile-to-correct-simulation theorem.
Specifications and process
The implementation updates the active pipeline, tensor, construction, FMI, GALEC/eFMI, and development-process specs and their normative catalogs. In particular, the specs now define compact root ownership, call-scoped action schedules, checked refresh reuse, sparse projection evidence, automatic integrator selection, comparator-baseline migrations, and the certification claim boundary.
The branch contains 63 chronological, thematically titled commits. Every commit has James Goppert’s DCO sign-off. Four relevant eFMI/GALEC commits credit Pradyunn Kale with the GitHub-recognized
Co-authored-bytrailer. No commit contains an AI co-author or sign-off trailer.Reviewer checklist
verify quickandverify fullpass locally.sim_oktrace is strict-high or a reviewed typed comparison boundary.