Rumoca: Modelica as a Universal Algebraic Frontend via a Rust-Native Compiler
Source: arXiv:2606.14998 · Published 2026-06-12 · By Micah K. Condie, Abigaile Woodbury, Thomas Meschede, Joel A. E. Andersson, James M. Goppert
TL;DR
This paper tackles the challenge of integrating the widely used Modelica language for cyber-physical system modeling with modern downstream workflows like optimization, differentiable simulation, and scientific machine learning that use tools such as CasADi, JAX, and Julia. Existing Modelica toolchains do not target these environments directly, causing duplicated modeling effort or loss of semantic fidelity. Rumoca is introduced as a Rust-native Modelica compiler designed as a universal algebraic frontend that compiles Modelica models to multiple algebraic backends and features a native Rust simulation runtime with exact automatic differentiation and software-in-the-loop execution. The system fully parses and lowers Modelica through multiple typed intermediate representations exposing key compiler phases, enabling template-driven code generation to CasADi, SymPy, FMI, JAX, Julia, ONNX, JavaScript, and embedded C. Quantitative evaluation on the 566-model Modelica Standard Library benchmark demonstrates 99% parsing success, 73% DAE construction, and 28% full simulation success with approximately two-thirds simulation trace agreement against the OpenModelica reference. Rumoca also achieves a 3-5x speedup in compilation time versus OpenModelica but is slower in numerical integration for large systems. The full toolchain ships as VS Code and Python extensions and runs in-browser via WebAssembly, supporting zero-install interactive usage and deployable embedded control case studies.
Key findings
- Rumoca parses 100% and flattens 99% of the 566 root Modelica Standard Library example models.
- DAE construction succeeds on 73% of tested models, with losses concentrated in connection-heavy or switched-electronics libraries.
- Solver lowering and initialization rates drop to 60% and 41% respectively, with only 28% of models simulating to completion.
- Among models that simulate, 67% exhibit high or near-agreement tracerual fidelity with OpenModelica outputs (102 out of 151 models).
- Rumoca’s compilation phase is 2.6x to 5.2x faster than OpenModelica’s across multiple model size bins, with a 4.18x throughput speedup overall.
- Rumoca’s native Rust interpreted numerical integration runtime is faster than OpenModelica on small models (up to 6.7x), but slower on large systems, achieving 0.22x throughput overall versus OpenModelica's native compiled C solver.
- Rumoca supports multi-phase compiler IRs: Parsed, Flattened, DAE, and Solver IRs, enabling explicit validation and inspection at each stage.
- Rumoca runs natively in VS Code and the browser as a WebAssembly module, enabling zero-install playgrounds and self-contained HTML simulators.
Methodology — deep read
The threat model assumes standard user scenarios without active adversaries, focusing on faithful and efficient Modelica compilation and simulation across diverse downstream tools rather than system security. The dataset consists of the 566 root example models from the Modelica Standard Library (MSL) version 4.1.0, covering a broad cross-section of Modelica packages and sublibraries. The code was benchmarked against version 1.26.7 of OpenModelica (OMC), a reference open-source compiler.
Rumoca's architecture is modular, composed of explicit compiler phases each producing typed intermediate representations (IRs). The phases are Parsed IR (initial parse preserving object-oriented structure), Flattened IR (object hierarchy removed, connects resolved), DAE IR (hybrid differential-algebraic equation form with variable and equation tagging), and Solver IR (lowered to register-based opcode stream with forward-mode automatic differentiation). These IRs facilitate separation of compiler logic and backends.
Code generation is template-driven using Jinja2, emitting syntaxes for backends including CasADi (MX/SX modes), SymPy, FMI 2.0/3.0 (dual-mode FMUs), JavaScript, JAX, Julia/ModelingToolkit, ONNX, and embedded C (experimental). Re-emission templates in Base Modelica format and DAE IR as Modelica provide traceability and inspection.
Simulation occurs in a native Rust runtime consuming the Solver IR, supporting explicit RK45 and Diffsol solvers (BDF/ESDIRK for stiff problems). Initialization-condition planning precedes integration. Exact Jacobians/mass matrices come from analytic forward-mode AD on the DAE IR. Solvers can be JIT-compiled with Cranelift for native or WebAssembly deployment. Batch and real-time step-locked software-in-the-loop (SIL) modes are supported with serialization via FlatBuffers.
Evaluation is conducted by running the full Rumoca pipeline on all 566 root MSL examples, measuring reachability to phases (Flatten, DAE, Solver IR, Initialization, Simulation). Simulated trajectories are compared to OpenModelica outputs for normalized trace agreement. Timing benchmarks separate compilation (up to Solver IR) and simulation phases, measured on a 16-core AMD Ryzen 9 machine with warm persistent caches to approximate steady state.
Results are reported at per-package granularity and aggregate measures of pass rates, simulation agreement, and timing speedups. Throughput and median times per model size bucket are analyzed to clarify scalability tradeoffs.
The codebase is Rust-native, shipped as multiple crates with CI parity gates against MSL. Integration targets include CLI, VS Code extension, Python and NPM packages, and WebAssembly for browser. The open-source status and availability of code and weights are not explicitly stated in the truncated source but VS Code marketplace and public documentation suggest accessibility.
Technical innovations
- Explicit multi-IR compiler architecture passing Modelica models through Parsed, Flattened, DAE, and Solver IRs, each with strong typing and clear phase boundaries.
- Template-driven, backend-agnostic code generation framework powered by Jinja2 enabling diverse algebraic backends from a single Modelica source.
- Native Rust simulation runtime implementing exact forward-mode automatic differentiation Jacobians on the DAE IR for analytic sensitivities.
- WebAssembly-native, zero-install deployment of the full compiler and runtime enabling in-browser simulation, interactive playgrounds, and self-contained HTML simulators.
- Software-in-the-loop capable real-time simulation with FlatBuffers serialized I/O for live operator input and 3D visualization integration using Three.js.
Datasets
- Modelica Standard Library (MSL) 4.1.0 — 566 root example models — public open-source reference
Baselines vs proposed
- OpenModelica (OMC) compilation time: Median compile time per model 2.6x to 5.2x slower vs Rumoca
- OMC simulation time: Simulation throughput 4.5x higher on large models (Rumoca throughput 0.22x overall)
- Rumoca parsing success: 100% vs OMC baseline parsing (assumed 100%)
- Rumoca DAE construction success: 73% on MSL vs OMC (no direct % reported but assumed near-complete)
- Rumoca simulation success: 28% model simulation completion vs OMC (higher but not quantified precisely)
- Simulation accuracy: 67% of Rumoca simulated models matched OMC outputs within high or near agreement thresholds
Figures from the paper
Figures are reproduced from the source paper for academic discussion. Original copyright: the paper authors. See arXiv:2606.14998.

Fig 2: The Rumoca in-browser playground. The compiler

Fig 3: Modelica simulations can be exported into fully self-

Fig 4: Software-in-the-loop setup: Rumoca runtime as real-
Limitations
- Only 28% of tested Modelica Standard Library models simulate to completion using Rumoca, indicating limited coverage of complex event handling and stiff system scenarios.
- Simulation agreement with OpenModelica is incomplete; one third of the simulated models show diverging traces, raising questions about solver robustness or semantic gaps.
- Embedded C backend is experimental and not recommended for production use yet.
- Rumoca’s interpreted solver runtime scales poorly on large models, losing to OpenModelica’s compiled native solvers on big systems.
- AI-assisted compiler development accelerated implementation but root-cause diagnosis and semantic correctness still require substantial human oversight and manual intervention.
- Benchmarking did not include variance measures or repeated trials for timing; caching asymmetry between Rumoca and OpenModelica may have influenced speed comparisons.
Open questions / follow-ons
- How to improve driver support for stiff and event-heavy Modelica libraries to increase simulation coverage beyond 28%?
- Can the simulation runtime be enhanced with ahead-of-time or JIT compilation to close the performance gap on large models?
- Could deeper integration with symbolic frameworks further reduce semantic drifts causing simulator output divergences?
- What extensions to Modelica language itself would unlock more seamless support for differentiable programming and machine learning workflows using Rumoca?
Why it matters for bot defense
Bot-defense and CAPTCHA practitioners interested in modeling and simulation frameworks may find insights from Rumoca’s approach to bridging declarative domain-specific languages (Modelica) with modern machine learning and optimization ecosystems. While not directly related to CAPTCHA, Rumoca exemplifies how well-designed compiler pipelines and intermediate representations enable universal frontend interoperability, which can inspire architectures for bot detection models that require interoperability between symbolic rules, differentiable models, and real-time constraints. The template-driven, multi-backend code generation and native runtime system also highlight strategies for building extensible, performant analytics engines that could be adapted for bot behavioral analyses or challenge-response systems. Furthermore, Rumoca’s WebAssembly deployment and real-time simulation with external controller integration illustrate techniques for deploying complex decision-making models on constrained, browser-based, or edge environments often targeted by bots.
Cite
@article{arxiv2606_14998,
title={ Rumoca: Modelica as a Universal Algebraic Frontend via a Rust-Native Compiler },
author={ Micah K. Condie and Abigaile Woodbury and Thomas Meschede and Joel A. E. Andersson and James M. Goppert },
journal={arXiv preprint arXiv:2606.14998},
year={ 2026 },
url={https://arxiv.org/abs/2606.14998}
}