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.

/
    • Session Engine
    • Execution Requests
    • Workspace State
    • Variable Inspection
    • Workspace Replay
    • Interaction & Streams
    • Host Integration
    • Execution
    • Async Execution
    • Errors & Diagnostics
    • Parallel Execution
    • Remote Execution
Docs>Runtime>Sessions and Execution

Interaction & Streams

The session installs per-execution runtime guards so host-visible output is captured as structured data instead of leaking through global process state.

Captured Channels

ChannelSourceOutcome field
stdout/stderr/clear screenRuntime console bufferstreams
MATLAB warningsRuntime warning storediagnostics and warnings in host payloads
display valuesSession display policydisplay_events and flow
plotsPlotting hooksfigures_touched
input/key eventsAsync interaction handlerstdin_events
profilingRuntime/provider telemetryprofiling
fusion metadataOptional session settingfusion_plan

Each execution resets the thread-local console buffer, warning store, recent-figure tracker, provider telemetry, current source context, and interrupt hook before running user bytecode.

Async Input

Hosts can install an async input handler with install_async_input_handler. The runtime calls this handler when input or keypress-style interactions need host data. Without a host handler, native execution falls back to default terminal input helpers.

The session also installs an expression-evaluation hook for numeric input() parsing. It compiles and runs the typed expression through the same parser, HIR, bytecode, and interpreter path used by normal execution. On native hosts, that nested evaluation runs on a dedicated thread with a larger stack to avoid stack pressure from re-entering the interpreter.

Cancellation

Cancellation is cooperative. cancel_execution flips an AtomicBool shared with the runtime interrupt hook. The VM polls that flag between interpreter steps and returns an execution-cancelled runtime error when it observes cancellation.

Long native, JIT, or provider operations can only stop at their polling or return boundaries. Hosts should treat cancellation as a request, not as preemptive thread termination.

Diagnostics

Runtime errors are normalized into the configured error namespace, then populated with call-stack information from the session SourcePool when VM call frames are available. The public ExecutionOutcome carries diagnostics as structured records with code, severity, message, and optional span.

Warnings are also surfaced as diagnostics with warning severity. A request can therefore finish successfully while still returning diagnostic entries.

Reentrancy

ActiveExecutionGuard prevents two simultaneous executions on the same RunMatSession. This protects shared fields such as workspace_values, variable_array, input hooks, and source context. Hosts that need concurrency should use multiple sessions.

On this page
  • Captured Channels
  • Async Input
  • Cancellation
  • Diagnostics
  • Reentrancy