Debugging a WebAssembly application has unique constraints compared to native development. Traditional debugger features like breakpoints and step-through execution are not supported inside a Wasm module, so most diagnosis relies on logging, comparison testing, and tooling purpose-built for Graphite’s architecture. This page covers the practical techniques that work best for tracking down bugs in the Graphite editor.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/GraphiteEditor/Graphite/llms.txt
Use this file to discover all available pages before exploring further.
Comparing Deployed Builds
The fastest first step when investigating a bug is to determine whether it exists onmaster or only in your local branch. Graphite maintains two live deployments:
- dev.graphite.art — always deploys the latest commit on
master - editor.graphite.art — the latest stable public release
master or something introduced in your changes. Use Help > About Graphite… inside either build to read the exact Git commit hash of that deployment.
All deployed builds — including dev, stable, and per-commit build links — are compiled with release optimizations enabled. This means some bugs that only manifest in debug builds (such as panics from bounds checks or
debug_assert! failures) will be visible when running locally but will not appear in any deployed version.Build Links per Commit
Every commit on themaster branch gets its own hosted build through Graphite’s CI infrastructure. To access a build for a specific commit:
- Open the GitHub commits list
- Find the commit you want to test
- Click the comment icon on the right side of that commit row
Bisect Tool
When you need to find exactly which commit introduced a regression, use the built-in bisect tool:master: you specify a starting date or commit hash, then for each candidate commit it provides a link to that commit’s hosted build. After testing the build you mark the issue as present or absent, and the tool narrows the range and repeats until the culprit commit is identified — typically in around 7–10 steps for a range of a few hundred commits.
The bisect tool supports two search modes:
- Find when a regression started — start from a known-good commit and search forward
- Find when a feature was added or fixed — start from a known-bad commit and search for when it started working
Logging
Breakpoints are not supported inside WebAssembly, so print-based debugging is the primary technique for tracing runtime behavior. Open the browser developer tools (F12) and check the Console tab for output. Use these Rust macros in your code:| Macro | Usage | Committed? |
|---|---|---|
log::debug!("value: {x}") | Temporary debugging output | ❌ Remove before review |
log::error!("Unexpected state: {msg}") | User-facing errors arising from a bug | ✅ Keep |
log::warn!("Possible issue: {msg}") | Non-critical problems that likely indicate a bug | ✅ Keep |
log::trace!("Processing node {id}") | Verbose internal activity logs, hidden by default | ✅ Keep |
Message System Logs
To observe the stream of messages flowing through the editor’s dispatch system, go to Help > Debug: Print Messages in the editor menu. There are two levels:- Only Names — prints the message type name for every dispatched message; low overhead and useful for confirming which code paths are being reached
- Full Contents — prints the complete data payload of every message; more verbose but invaluable when investigating data correctness issues
log::debug!() printouts: enable message logging to see the flow, then add targeted debug prints inside the handler where something goes wrong.
Node and Document IDs
In debug builds, you can inspect the internal IDs of nodes, layers, and documents directly in the UI:- Node/layer IDs — hover over a layer name in the Layers panel, or over any node or layer in the node graph, to see a tooltip showing its
NodeId - Document IDs — hover over a document’s tab to see a tooltip with its document ID
Performance Profiling
Having the browser developer tools open noticeably degrades performance in both debug and release builds. Close the developer tools panel when you are not actively using it — especially before recording performance profiles. For performance investigations:- Use the Performance tab in your browser’s developer tools to record and analyze profiles
- Use debug builds for profiling; release builds inline and optimize away functions, which can make profiles misleading
- The Firefox Profiler has some features not available in Chromium’s DevTools (such as better source map support and flame graph tooling) and is worth using for deep performance work