Skip to content
  1. Docs
  2. enzUI framework
  3. Developers

Developer tools

iced's devtools and Comet, the environment variables that switch on enzUI diagnostics, and accessibility inspection.

None of these tools is on in a normal build. Each is switched on by an environment variable or a feature of your own crate.

iced's devtools and Comet

iced's devtools add F12 to an application. It opens Comet, iced's companion debugger for frame timings, message rates and the update and view costs behind them. The first time, the devtools offer to install Comet with cargo install.

app_setup::run starts the event loop itself, so attach the devtools between its two halves, behind a feature of your app:

toml
[features]
devtools = ["iced/debug", "dep:iced_devtools"]

[dependencies]
iced_devtools = { version = "0.15.0-dev", optional = true }
rust
use enzui_widgets::app_setup::{self, AppServices};

fn main() -> iced::Result {
    let program = app_setup::with_services(
        iced::application(App::new, App::update, App::view),
        AppServices::default(),
    );
    #[cfg(feature = "devtools")]
    let program = iced_devtools::attach(program);
    app_setup::run_program(program)
}

Run with cargo run --features devtools, then press F12. The message type must implement Debug. Keep the feature out of release builds: iced/debug also turns on iced's timing instrumentation and the Comet connection.

Everyday switches

VariableWhat it does
RUST_LOGWhich diagnostics the default logger prints; see Logging
ENZUI_DIAGNOSTICS=1Paint accessibility findings (elided text, and controls wrapped in hit-target or contrast probes), layout-spill and overlap findings over the window, and log one audit report under enzui::trace::diagnostics
ENZUI_FRAME_COST=1Log shell layout durations and frame intervals under enzui::trace::frame_cost
ENZUI_TEXT_DIRECTION=rtlLay the app out right to left, whatever the locale
ENZUI_TEXT_SCALE=1.5Deliver a text scale as the platform would; see Theme file
ENZUI_PROBE_LIGHT=1, ENZUI_PROBE_DARK=1Force the light or dark mode of the user's theme, for captures
ENZUI_MOTION_SCALE=4Multiply every animation's duration, to watch motion slowly
ENZUI_SSD=1Let the desktop draw shell windows' titlebars where it decorates windows (KDE, sway)
ICED_BACKEND=tiny-skiaRender in software instead of on the GPU (wgpu)
ICED_PRESENT_MODE=fifoThe GPU present mode: vsync, no_vsync, immediate, fifo, fifo_relaxed or mailbox
ICED_OVERLAY_POPUPS=0Draw menus, lists, tooltips and popovers inside the window on Wayland too
LANGUAGE=en_XAThe pseudo-locale, to find untranslated or clipped text; see Localization

Ruling things out

VariableWhat it does
ENZUI_DISABLE_LAYOUT_MEMO=1Turn off layout reuse, when something lays out wrong
ENZUI_CACHED_SUBTREE_BYPASS=1Turn off cached subtrees, when something does not update
ENZUI_CACHED_SUBTREE_NESTING_CHECK=0Skip the nested cached-subtree check
ENZUI_DISABLE_RESPONSIVE_ISLANDRoute docked shell motion through a full relayout, to compare with ENZUI_FRAME_COST
ICED_DISABLE_ANIMATION_LANE=1Animate on the UI thread instead of the render lane
ICED_DISABLE_LANE_DAMAGE=1Paint every render-lane frame in full instead of only where it changed
ICED_DISABLE_UI_DAMAGE=1Paint every UI-thread frame in full instead of only where it changed
ICED_DEBUG_DEVICE_LOSS_AFTER_MS=<ms>Lose the graphics device that long after it is created, to watch the window recover

Frame tracing

VariableWhat it does
ENZUI_RENDER_PASS_TRACE=1Print each presented frame's render passes and command buffers
ICED_PRESENTATION_TRACE=<file>Append one JSON record per frame the compositor presented and per UI frame
ICED_SPAN_TRACE=<file>Append stage start_us duration_us for every update, view, layout, draw, replay and present
ICED_LANE_TRACE=<file>Append one JSON record per frame the render lane presented, and per lane stop
ICED_FRAME_DUMP=<dir>Write every frame handed to the surface as raw pixels; the readback stalls the GPU, so take timings from a separate run
ICED_REPLAY_VERIFY=1 or =<dir>Also draw every replayed frame in full and report each that differs (writing both renderings to the directory)
ICED_LANE_DAMAGE_CHECK=<file>Repaint render-lane frames in full and record how many pixels differ from the partial paint, and where
ICED_UI_DAMAGE_CHECK=<file>The same for UI-thread frames

For input-to-frame latency with percentiles, see Performance observer.

Accessibility inspection

ENZUI_DIAGNOSTICS=1 is the quickest look: silent elision, undersized targets and low contrast are outlined on screen. Warnings under enzui::a11y (on by default) name controls that share an id or have no name. For the tree itself, any AT-SPI inspector (Accerciser, or Orca's flat review) shows what a screen reader reads; Testing asserts on the same tree.