RunMat
  • Pricing
RunMat
GitHub
GitHub
Sign inTry in browser
DesktopRuntimePhysicsCADAdministrationAgent

Get RunMat updates

New releases, guides and examples.

Product+
  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download
Math+
  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting
Physics+
  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA
Industries+
  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance
Learn+
  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students
Compare+
  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons
Company+
  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms

Product

  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download

Math

  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting

Physics

  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA

Industries

  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance

Learn

  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students

Compare

  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons

Company

  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms
GitHubXLinkedIn

© Dystr, Inc. · RunMat v0.7.2, Nov 26, 2026 ·

RunMat® is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

/
    • Authoring Builtins
    • Native Extension ABI
    • Development
    • Build System
    • Supported Architectures
    • Testing Strategy
    • Benchmarking
    • Telemetry
Docs>Runtime>Runtime Development

Testing Strategy

RunMat tests are organized by ownership boundary. Parser and lowering crates test language structure, VM tests exercise bytecode and interpreter behavior, runtime tests cover builtins and providers, integration tests cover cross-crate execution behavior, and WASM tests cover browser and JavaScript-hosted behavior.

Baseline Checks

Run the workspace tests through the package groups:

cargo fmt -- --check
python3 scripts/development/run-workspace-test-group.py --check
RUST_TEST_THREADS=1 python3 scripts/development/run-workspace-test-group.py language
RUST_TEST_THREADS=1 python3 scripts/development/run-workspace-test-group.py runtime
RUST_TEST_THREADS=1 python3 scripts/development/run-workspace-test-group.py geometry-analysis
RUST_TEST_THREADS=1 python3 scripts/development/run-workspace-test-group.py tooling-distributed

The groups assign each workspace package once, exercise the supported Clarabel feature profiles, and run harness-free benchmark smoke tests with bounded arguments. Long scientific cohorts use the separate receipt policy in qualification/scientific/policy.json. Add --include-extended to execute those cohorts directly.

CI serializes tests with RUST_TEST_THREADS=1 because several suites touch global runtime state: filesystem providers, GPU providers, registries, process environment, and plotting/runtime hooks. The group runner sets RUST_MIN_STACK=67108864 to match the native CLI command and Tokio-worker stack reserve. Unoptimized native continuations can exceed libtest's default 2-MiB thread stack. The operating system commits pages as they are used; the reserve does not allocate a second workspace. Use the same environment variable when invoking affected native tests directly.

Run compiler and lint checks with the same supported package feature profiles. A workspace-wide --all-features command enables mutually exclusive external BLAS and language bindings in the vendored Clarabel solver.

Crate-Level Tests

Use crate tests when a change is localized. For example:

Change areaUseful commands
Lexer/parser syntaxcargo test -p runmat-lexer, cargo test -p runmat-parser
HIR/MIR loweringcargo test -p runmat-hir, cargo test -p runmat-mir
VM bytecode/interpretercargo test -p runmat-vm, cargo test -p runmat-vm --test indexing
Runtime builtinscargo test -p runmat-runtime
CLI behaviorcargo test -p runmat
Config loadingcargo test -p runmat-config
Builtin registrycargo test -p runmat-builtins
Macro expansioncargo test -p runmat-macros

VM tests use shared helpers that parse MATLAB source, lower through HIR and MIR, compile bytecode, and interpret the result. Those helpers also run tests on a larger stack for deep compile or interpreter cases.

Runtime tests include helper utilities for provider setup, GPU provider locking, filesystem wrappers, and gather operations. Prefer those helpers over open-coded global setup in new tests.

Runtime Integration Tests

Cross-crate runtime behavior lives in crates/runmat-runtime-integration-tests. This crate is intentionally separate from unit tests because it exercises dispatch, GPU handle behavior, dtype behavior, provider wiring, and residency assumptions across multiple crates.

cargo test -p runmat-runtime-integration-tests

Run this suite when a change affects builtin dispatch, GPU values, provider registration, dtype conversion, or execution behavior that crosses crate boundaries.

GPU Tests

The acceleration crate has focused tests for fusion, provider initialization, residency, reductions, matmul paths, precision boundaries, telemetry, and backend behavior.

cargo test -p runmat-accelerate
cargo test -p runmat-accelerate --features wgpu
cargo test -p runmat-accelerate --features wgpu --test provider_init

Runtime GPU tests use either the deterministic in-process provider or WGPU behind the wgpu feature:

cargo test -p runmat-runtime --features wgpu
cargo test -p runmat-runtime-integration-tests --test bench_residency_smoke

Use the in-process provider for semantic tests that should not depend on a physical GPU. Use WGPU tests when validating backend initialization, residency, shader dispatch, or device behavior.

Production WGSL generators also have GPU-free Rust tests. These parse the emitted source with the Naga version paired with WGPU, validate its declared capabilities, and check that removing a required capability rejects the shader:

cargo test -p runmat-accelerate --lib --no-default-features --features wgpu validation_tests
cargo test -p runmat-accelerate --lib --no-default-features --features wgpu atan2_selected_tests
cargo test -p runmat-accelerate --lib --no-default-features --features wgpu selected_native_power_reduction_uses_the_ordinary_helper_for_edge_controls

Add generator cases beside their owning shader or provider module, using the shared validation helper rather than copying shader source into a test. Cover precision, operation, operand layout and specialization variants that alter emitted code. Parsing and validation do not establish device support, numerical accuracy, residency or performance; those require separate execution tests on the relevant backend and precision.

Plotting has a GPU-free source census covering its compute precision variants, workgroup specializations, and vertex shaders through the same source materializer used by production pipelines:

cargo test -p runmat-plot --no-default-features --lib plotting_shader_sources_parse_and_validate_for_every_declared_variant

Run the surface packer's device geometry check explicitly on a machine with a GPU:

RUNMAT_PLOT_FORCE_GPU_TESTS=1 cargo test -p runmat-plot --no-default-features --lib gpu_surface_layout_matches_non_square_cpu_surface_contract

This command requires an adapter and device; their absence fails the test. Do not also set RUNMAT_PLOT_SKIP_GPU_TESTS. A normal library run without the force flag does not establish surface GPU execution coverage.

WASM Tests

WASM CI builds the runtime for wasm32-unknown-unknown, then runs the headless browser script:

rustup target add wasm32-unknown-unknown
scripts/regenerate-wasm-registry.sh
cargo build -p runmat-wasm --target wasm32-unknown-unknown --features occt-wasm-host
scripts/test-wasm-headless.sh

scripts/test-wasm-headless.sh regenerates the WASM registry with the atomic production plot-web,occt-wasm-host flow, checks runmat-core for wasm compatibility with the same OCCT host feature enabled, and runs browser-based WASM tests. To include runtime browser tests:

RUNMAT_WASM_INCLUDE_RUNTIME=1 scripts/test-wasm-headless.sh

Focused WASM regression suites are available through the runtime dispatcher:

scripts/runtime/test-wasm-regression-suite.sh symptom-closure
scripts/runtime/test-wasm-regression-suite.sh replay-smoke

Those wrappers run the appropriate wasm-pack test --node and wasm-pack test --chrome --headless targets under crates/runmat-wasm/tests. They also regenerate the WASM builtin registry before running tests, so focused regressions exercise the same builtin catalog as packaged browser builds.

The symptom-closure suite includes the shared signal compatibility harness in crates/runmat-runtime/tests/fixtures/signal_compatibility_harness.m. The same fixture is also run by the CLI integration test test_signal_compatibility_harness_cli, covering CSV import, MAT-file save/load, FFT magnitude/indexing, filter/conv, and signal window functions through both host and JavaScript filesystem providers.

FEA Script Tests

The geometry/analysis CI group excludes the pipeline::transient::rod_qualification scientific family, which contains long continuum-refinement and multi-block cold-history fixtures. These tests retain their numerical assertions and are available as a separate qualification lane:

RUST_MIN_STACK=67108864 cargo test --locked -p runmat-analysis-fea --lib -- \
  --test-threads=1 pipeline::transient::rod_qualification::

Allow a dedicated machine and an extended time budget for that lane. An ordinary CI pass does not establish these refinement envelopes. To include the lane in the complete geometry/analysis group, use python3 scripts/development/run-workspace-test-group.py geometry-analysis --include-extended. Direct cargo test retains its usual selection; ignored diagnostics and benchmarks remain opt-in.

FEA governance, calibration, reporting, and artifact scripts use stdlib unittest tests:

scripts/test-fea-scripts.sh

Macro UI Tests

runmat-macros uses compile-fail fixtures for macro diagnostics.

cargo test -p runmat-macros --test compile

The fixtures live under crates/runmat-macros/tests/ui. Each failing Rust input has a matching .stderr expectation. Update those expectations only when the diagnostic change is intentional.

C MEX Repository Cohorts

The runmat-mex suite includes source fixtures maintained in this repository and an opt-in gate for pinned external projects. The external checkouts are not downloaded during ordinary Cargo tests. Supply local checkouts at the exact revisions below, then run the ignored cohort tests explicitly.

ProjectRevisionLicense fileExecuted gateways
FieldTrip2e14f7291090b19568827799096daec7dfb99de8COPYINGsrc/det2x2.c, src/getpid.c
RUNMAT_MEX_FIELDTRIP_CHECKOUT=/path/to/fieldtrip \
cargo test -p runmat-mex --test repository_cohorts -- --ignored

Each test verifies the checkout's Git revision and license file before compiling. It then loads and executes the gateway through runmat-mex and checks its returned value. This gate is intended for supported-platform qualification and for changes to the SDK, compiler plan, loader, value conversion, or gateway lifecycle.

Generated C-to-Fortran gateways are tracked separately because a successful link requires their native Fortran libraries. The pinned source audits use fmm2d revision 550dae5b77b1e006c8ffae37fc832f8c2b536871 and fmm3dbie revision ec79660cf39ef048741a26e2b31960fccefa4e27; full build and execution belongs to the advanced Fortran MEX qualification gate.

Choosing What To Run

ChangeStart withExpand to
Parser or syntaxTouched parser test filecargo test -p runmat-parser
Lowering or bytecodeTouched HIR/MIR/VM testcargo test -p runmat-vm
Builtin implementationcargo test -p runmat-runtimeRuntime integration tests
GPU or fusioncargo test -p runmat-accelerate --features wgpuRuntime GPU integration tests
CLI commandcargo test -p runmat-cliFull workspace tests
WASM or TypeScript APIscripts/test-wasm-headless.shWASM regression suite and npm test in bindings/ts
Macro changescargo test -p runmat-macros --test compileFull macro crate tests

Before merging a broad runtime change, run the full baseline or let CI confirm it on the target runners.

On this page
  • Baseline Checks
  • Crate-Level Tests
  • Runtime Integration Tests
  • GPU Tests
  • WASM Tests
  • FEA Script Tests
  • Macro UI Tests
  • C MEX Repository Cohorts
  • Choosing What To Run