RunMat
GitHub

Configuration Reference

RunMat utilizes a hierarchical configuration system that manages project-level metadata, source organization, and runtime execution parameters. The configuration is primarily driven by a manifest file (runmat.toml or runmat.json) and can be overridden by environment variables and CLI arguments.

For a user-facing guide to project layout, source roots, dependencies, and named entrypoints, see Projects. This page is the reference for manifest and runtime settings.

Configuration Resolution Order

RunMat resolves configuration settings using a specific precedence. Lower-numbered levels are overridden by higher-numbered levels:

  1. Built-in Defaults
  2. Project Manifest: Settings found in runmat.toml or runmat.json. The system automatically discovers this file by walking up the directory tree from the source file being executed
  3. Environment Variables: Variables such as RUNMAT_CONFIG or RUNMAT_JIT_THRESHOLD
  4. CLI Arguments: Explicit flags passed to the runmat binary (e.g., --no-jit or --gc-preset)

Example Project Manifest (runmat.toml)

[package]
name = "my-project"
version = "0.1.0"
runmat-version = ">=0.4.0"

[dependencies]
utils = { path = "../utils", version = "0.1.0" }

[entrypoints.hello]
path = "hello.m"

[runtime.language]
compat = "runmat"

You can then execute the project's hello entrypoint with:

runmat run hello

Project Reference

Project sections describe package identity, source layout, dependencies, and named entrypoints.

[package]

KeyTypeDefaultNotes
namestringrequiredPackage identifier.
versionstringunsetPackage version metadata.
runmat-versionstringunsetMinimum RunMat version gate. Accepts >=x.y.z or x.y.z.

[sources]

KeyTypeDefaultNotes
rootsstring[]requiredSource root directories, relative to the config file directory.

[dependencies]

Each dependency is keyed by alias.

[dependencies]
utils = { path = "../utils", version = "0.1.0" }
FieldTypeDefaultNotes
pathstringunsetLocal dependency path. Required for local composition today.
versionstringunsetVersion metadata for dependency declaration.

[entrypoints.<name>]

Define named targets that can be executed from CLI.

[entrypoints.main]
module = "app.main"
function = "main"
[entrypoints.batch]
path = "scripts/run_batch.m"
FieldTypeDefaultNotes
pathstringunsetFile target (.m extension inferred if omitted).
modulestringunsetModule path under source roots.
functionstringunsetFunction name for module target.

Exactly one target mode is required: path or module + function.

Entrypoint CLI examples:

runmat run main
runmat benchmark main --iterations 25 --jit

Runtime Reference

All runtime settings are under [runtime]. Runtime settings control the behavior of the RunMat runtime.

[runtime]

KeyTypeDefaultNotes
callstack_limitinteger200Max retained call stack frames for diagnostics.
error_namespacestring""Error ID namespace. Empty value is normalized at startup by language compatibility mode (set to RunMat in compat = "runmat" mode).
verbosebooleanfalseEnables verbose execution output.
snapshot_pathstringunsetOptional snapshot file to preload.

[runtime.language]

KeyTypeDefaultAllowed valuesNotes
compatstring"runmat"runmat, matlab, strictLanguage compatibility mode.

See MATLAB Language Compatability for more details on runtime language compatibility modes.

[runtime.jit]

KeyTypeDefaultNotes
enabledbooleantrueEnables JIT compilation.
thresholdinteger10Executions before JIT tiering triggers.
optimization_levelstring"speed"none, size, speed, aggressive.

[runtime.gc]

KeyTypeDefaultNotes
presetstringunsetlow-latency, high-throughput, low-memory, debug.
young_size_mbintegerunsetYoung generation size override (MB).
threadsintegerunsetGC worker thread override.
collect_statsbooleanfalseEnables GC statistics collection.

[runtime.accelerate]

KeyTypeDefaultNotes
enabledbooleantrueEnables acceleration subsystem.
providerstring"wgpu"auto, wgpu, inprocess.
allow_inprocess_fallbackbooleantrueFalls back to in-process provider if hardware provider fails.
wgpu_power_preferencestring"auto"auto, high-performance, low-power.
wgpu_force_fallback_adapterbooleanfalseForces WGPU fallback adapter selection.

[runtime.accelerate.auto_offload]

KeyTypeDefaultNotes
enabledbooleantrueEnables auto-offload planner.
calibratebooleantrueEnables calibration mode for planner profile generation.
profile_pathstringunsetOptional profile cache path.
log_levelstring"trace"off, info, trace.

[runtime.plotting]

KeyTypeDefaultNotes
modestring"auto"auto, gui, headless.
force_headlessbooleanfalseForces non-interactive rendering behavior.
backendstring"auto"auto, wgpu, static, web.
scatter_target_pointsintegerunsetOptional scatter decimation target.
surface_vertex_budgetintegerunsetOptional surface vertex LOD budget.

[runtime.plotting.gui]

KeyTypeDefaultNotes
widthinteger1200Default GUI window width.
heightinteger800Default GUI window height.
vsyncbooleantrueEnables VSync.
maximizedbooleanfalseStarts window maximized.

[runtime.plotting.export]

KeyTypeDefaultNotes
formatstring"png"png, svg, pdf, html.
dpiinteger300Raster export DPI.
output_dirstringunsetDefault export output directory.

[runtime.telemetry]

KeyTypeDefaultNotes
enabledbooleantrueEnables telemetry client.
show_payloadsbooleanfalseEchoes serialized payloads to stdout.
http_endpointstringunsetOptional HTTP override. When unset, runtime uses built-in collector endpoint.
udp_endpointstring"udp.telemetry.runmat.com:7846"UDP collector endpoint.
queue_sizeinteger256Async telemetry queue size (minimum bounded internally).
sync_modebooleanfalseSends telemetry synchronously on caller thread.
drain_modestring"all"none, all.
drain_timeout_msinteger50Max drain wait on shutdown (capped internally).
require_ingestion_keybooleantrueDisables telemetry if key is required but unavailable.

[runtime.logging]

KeyTypeDefaultNotes
levelstring"warn"error, warn, info, debug, trace.
debugbooleanfalseForces debug logging path.
filestringunsetReserved log file path option (runtime currently logs to process logger).

Environment Variables

Config Selection

  • RUNMAT_CONFIG: absolute or relative path to runmat.toml / runmat.json

Service/Auth

  • RUNMAT_API_KEY
  • RUNMAT_SERVER_URL
  • RUNMAT_ORG_ID
  • RUNMAT_PROJECT_ID

Telemetry

  • RUNMAT_TELEMETRY_KEY (ingestion key override)

Full Reference Example

[package]
name = "image-pipeline"
version = "0.1.0"
runmat-version = ">=0.4.0"

[sources]
roots = ["src", "lib"]

[dependencies]
utils = { path = "../utils", version = "0.1.0" }

[entrypoints.main]
module = "app.main"
function = "main"

[entrypoints.batch]
path = "scripts/run_batch.m"

[runtime]
callstack_limit = 200
error_namespace = "RunMat"
verbose = false

[runtime.language]
compat = "runmat"

[runtime.jit]
enabled = true
threshold = 10
optimization_level = "speed"

[runtime.gc]
preset = "low-latency"
young_size_mb = 128
threads = 8
collect_stats = false

[runtime.accelerate]
enabled = true
provider = "wgpu"
allow_inprocess_fallback = true
wgpu_power_preference = "auto"
wgpu_force_fallback_adapter = false

[runtime.accelerate.auto_offload]
enabled = true
calibrate = true
profile_path = ".runmat/auto_offload.json"
log_level = "trace"

[runtime.plotting]
mode = "auto"
force_headless = false
backend = "auto"
scatter_target_points = 250000
surface_vertex_budget = 400000

[runtime.plotting.gui]
width = 1200
height = 800
vsync = true
maximized = false

[runtime.plotting.export]
format = "png"
dpi = 300
output_dir = "artifacts/figures"

[runtime.telemetry]
enabled = true
show_payloads = false
udp_endpoint = "udp.telemetry.runmat.com:7846"
queue_size = 256
sync_mode = false
drain_mode = "all"
drain_timeout_ms = 50
require_ingestion_key = true

[runtime.logging]
level = "warn"
debug = false