Elide/ Architecture

Architecture ยท observability

Shared tools across languages.

Debug across languages in one session. Profile guest code, inspect the shared heap, and diagnose JIT behavior, regardless of language.

Walkthrough

One common substrate

Elide brings Truffle's shared debugger, profiler and coverage tools to guest execution7 16. Each language implements a common instrumentation contract; Elide supplies shared configuration and reporting4 6 15. Native Image monitors and native profilers extend this diagnostic architecture into the managed runtime and machine code9 12.

One suite of consistent tools

Node provides an inspector, CPU profiles and heap snapshots for JavaScript23 24. Similarly, Elide connects each language to one instrumentation API for debugging, profiling and coverage14 16 17 19 20.

Uniform instrumentation

Truffle languages expose source locations and standard tags for operations such as calls and statements14 15. Their implementations determine which operations and source details each tool can see. Graal can inline instrument dispatch with guest code22.

Instrument from MCP or the CLI

Elide makes debugging, profiling, coverage and Insight available through CLI options1. The CLI sends these settings through a Cap'n Proto invocation record to engine components that activate the tools3 4 5. MCP exposes Insight through the same engine instrument API32.

Chrome Debugger works across languages

Step through cross-language calls, inspect variables and read guest stacks in one Chrome Debugger session17. Elide's CDP debugger option connects this shared debugger to guest execution2 18 30.

Insight works across languages

Insight lets a privileged script observe execution across languages21. Callbacks can inspect and modify guest locals22. See example below31.

Elide adds JFR events and bridges to Rust

Elide unifies logs under one configuration. JFR events describe boot, guest execution, and HTTP, on top of defaults. Policy connects these diagnostics to the program's lifecycle33 34 35.

Trace problems from source to runtime

Native Image supplies JFR execution samples and runtime events, plus managed-heap dumps that VisualVM can inspect10 11. Heap dumps expose the runtime's representation of guest objects. Linux perf samples native execution stacks; debug symbols and jitdump metadata identify ahead-of-time and runtime-compiled methods12.

Build-time instrumentation

Native Image generates monitoring code during the build and compiles it into the executable9. Elide supports JFR, jvmstat and heap dumps, plus jcmd on Linux and macOS25. Frame pointers support native stack walking8.

kernel
perf
Host OS
Rust CLI
Rust ยท native
Substrate VM
Truffle
instruments
Engine ยท Native Image
JS
TS
Py
JVM
Languages
Application
JVM libraries SLF4J logsRust components native logsShared Rust logger ELIDE_LOG ยท both sidesElide lifecycle boot ยท guest ยท HTTPJFR recording Elide + VM eventsElide engine ยท shared instrument APIobserve.js Insight script insight.on("source", (source) => { console.log(`Observed source: ${source.name}`); });--insights attaches the script source events reach its callbacktarget.py program def twice(value): return value * 2 print("Result: " + str(twice(21)))stdout Observed source: target.py ยท Result: 42
Rust CLI ยท parse --debugger --profiler --coverage --insightsinvocation record Cap'n ProtoFFI
runFlags ยท Cap'n Proto
Engine entry @CEntryPointengine options no branch on languageMCP ยท InsightTruffle instruments inspector ยท DAP profilers ยท coverage Insight
Rust CLI ยท parse --debugger --profiler --coverage --insightsinvocation record Cap'n ProtoFFI
runFlags ยท Cap'n Proto
Engine entry @CEntryPointengine options no branch on languageMCP ยท InsightTruffle instruments inspector ยท DAP profilers ยท coverage Insight
  1. buildclosed world
  2. runactivate included tools
build choices frame pointers debug info jfr ยท jvmstat ยท heapdump
activation record at launch dump on OOM dump on signal VisualVM attach
profilerattaches to every node tagged call JavaScript Pythonrootfunction f(a)statementreturn g(a)callg(a)expressionarootdef f(a):statementreturn g(a)callg(a)expressiona
build-time monitoring
jfr ยท jvmstat ยท heapdump. Writes .jfr and .hprof.

Each instrument and its job

Choose a tool for its diagnostic scope. CPU sampling estimates where time goes; tracing counts executions19. Elide's bare --profiler selects tracing; --profiler=cpusampling selects sampling1 2.

Scroll to see all columns

InstrumentCPU samplesMemoryDebuggingCoverageEventsInspection
Chrome inspector--debugger17 18โ—
DAP--debugger=dap18โ—
CPU sampler--profiler=cpusampling19โ—
CPU tracer--profiler=cputracing19โ—
Memory tracer ยท experimental--profiler=memtracing19โ—
Coverage--coverage20โ—
Insight--insights=script21โ—
Flight recorder.jfr recording10โ—โ—
Heap dump.hprof configured trigger11โ—
jvmstatprocess discovery9 13โ—
Compilation trace-X polyglot.engine.TraceCompilation=true27 29โ—
Ideal Graph Visualizercompiler graph dumps26 27โ—
perf + jitdumpperf record12โ—
VisualVMattach, or open .jfr / .hprof13โ—โ—โ—

Managed-runtime inspection in VisualVM

VisualVM opens recordings and managed-heap dumps to reveal runtime activity and objects retaining memory. Live inspection requires the corresponding monitoring support. These screenshots show upstream examples13.

An upstream VisualVM example of browsing recorded runtime events.Screenshot: graalvm.org, VisualVM documentation13
A heap dump in VisualVM's heap viewer: instances, sizes and retained objects by class.Screenshot: graalvm.org, VisualVM documentation13
The dominator view shows which objects retain the most memory.Screenshot: graalvm.org, VisualVM documentation13
An upstream Native Image heap dump opened in VisualVM.Screenshot: graalvm.org, VisualVM documentation13

Compiler graphs in IGV

IGV exposes Truffle trees, guest call graphs and compiler phases, connecting source structure to optimization decisions26 27. Elide exposes compilation tracing through -X; compiler graph dumps are configured separately28 29. These screenshots show upstream examples26.

A JavaScript compilation graph, with Stack View identifying a deoptimization node.Screenshot: graalvm.org, Ideal Graph Visualizer documentation26
Source metadata connects a selected graph node to its source line.Screenshot: graalvm.org, Ideal Graph Visualizer documentation26
Extract or hide nodes to isolate one path through a large graph.Screenshot: graalvm.org, Ideal Graph Visualizer documentation26
The satellite view moves the viewport across a whole compilation unit.Screenshot: graalvm.org, Ideal Graph Visualizer documentation26

One Insight agent, two languages

Save these three files together. The agent observes source loading; the two targets each print a result31.

observe.js

insight.("source", (source) => {
  if (source.name === "target.js" || source.name === "target.py") {
    console.(`Observed source: ${source.name}`);
  }
});

target.js

function (value) {
  return value * 2;
}
console.(`Result: ${(21)}`);

target.py

def (value):
    return value * 2

("Result: " + ((21)))

Run each target with the same agent. Captured on macOS ARM64, 2026-09-05, with Elide 1.5.0+20260902.bac3ab38; both commands exited successfully with empty stderr31.

$ elide run --insights=observe.js target.js
Observed source: target.js
Result: 42

$ elide run --insights=observe.js target.py
Observed source: target.py
Result: 42

Sources

  1. Elide CLI instruments โ€” Debugger, profiler, coverage and Insight options; bare profiler selects execution tracing.
  2. Elide instrument modes โ€” CDP and DAP debugging; CPU sampling, execution tracing and memory tracing.
  3. Elide invocation protocol โ€” Passing instrument settings from the CLI to the engine.
  4. Elide instrument configuration โ€” Shared instrument activation across guest languages.
  5. Elide Insight integration โ€” Agent registration and supported script formats.
  6. Elide profiler and coverage reporting โ€” Shared activation and collection with tool-specific reports.
  7. Elide tooling dependencies โ€” Chrome inspector, DAP, coverage, Insight and profilers.
  8. Elide native profiling configuration โ€” Frame pointers for native stack walking.
  9. Native Image monitoring options โ€” Build-time support for runtime monitoring.
  10. Native Image Flight Recorder โ€” Execution samples, runtime events and custom events.
  11. Elide managed-heap dumps โ€” --heap-dump on exit and --heap-dump-on-oom; dumps cover the managed VM heap and open in VisualVM.
  12. Elide JIT profiling with perf โ€” --jitdump writes runtime-compilation metadata; perf record, perf inject and perf report resolve ahead-of-time and runtime-compiled guest code.
  13. VisualVM โ€” Process discovery, JFR recordings and managed-heap inspection. Gallery images come from this guide.
  14. Truffle standard tags โ€” Common execution tags for calls, statements and other language operations.
  15. Truffle instrumentable nodes โ€” Source locations, tags and execution wrappers.
  16. Truffle instrumentation โ€” Shared hooks for observing execution and injecting behavior.
  17. Chrome Debugger โ€” Guest-language debugging, including stepping across language boundaries.
  18. Elide debugging guide โ€” --debugger=dap and --debugger=cdp bind to loopback by default; DAP waits for a client before guest code runs.
  19. Truffle profiling โ€” CPU sampling, execution tracing and experimental guest-allocation tracing.
  20. Truffle coverage โ€” Code coverage and LCOV reports.
  21. GraalVM Insight โ€” Writing scripts that instrument execution across languages.
  22. Insight execution hooks โ€” Observing execution and accessing guest locals; agent scripts run with operator privileges.
  23. Node.js CLI โ€” JavaScript profiling, heap snapshots and inspector options.
  24. Node.js inspector โ€” Chrome DevTools Protocol integration.
  25. Elide live capture โ€” Linux and macOS builds include jcmd, JFR, jvmstat and heap dumps; JMX and native memory tracking stay disabled.
  26. Ideal Graph Visualizer โ€” Compiler graphs, source metadata and compilation phases. Gallery images come from this guide.
  27. Truffle compiler diagnostics โ€” Compilation traces, syntax trees, guest call graphs and compiler phases.
  28. Native Image compiler options โ€” Build-time and runtime compiler configuration.
  29. Elide engine options โ€” Passing compilation-tracing options through the CLI.
  30. Elide debugger integration โ€” CDP and DAP connections; debugger access includes host resources.
  31. Insight example โ€” One agent observing source loading in JavaScript and Python, with scripts and recorded output.
  32. Elide MCP instruments โ€” Activating Insight through the engine API from MCP.
  33. Elide JFR events โ€” Boot, guest execution and HTTP events with timing and outcomes.
  34. Elide diagnostic lifecycle โ€” Capture controls and finalization before engine teardown.
  35. Elide unified logging โ€” JVM library logs flow into the Rust logging backend under a shared configuration.