Skip to main content

Module check

Module check 

Source
Expand description

Static graph checker — the analysis behind cargo rlx check and the #[rlx_model(check)] self-check hook.

rlx already computes everything a language server would surface, but only exposes it through env-gated eprintln! (RLX_DISPATCH_REPORT, RLX_FUSION_REPORT, RLX_LINT_NUMERICS) or compile-time panics. This module folds those same pure functions into one structured CheckReport.

Four axes, all but execution-legality fully device-free (no GPU, no driver):

  • shape / dtyperlx_ir::verify::verify_all (errors).
  • backend dispatch — per backend, ops that run native vs. portable common-IR (a perf note) vs. can’t be lowered (an error), resolved from the backend’s real op claim via the registry.
  • fusion — patterns that should have collapsed but didn’t (warnings).
  • numerics — constant subgraphs that provably fold to NaN/Inf (warnings).

Execution legality is only reported for backends compiled into the build. CPU is always available and portable; other backends are opt-in behind the consuming crate’s Cargo features (the claim is read driver-free — backend factories build unit structs and supported_ops() is a const).

Structs§

BackendSummary
Per-backend rollup: fusion coverage (always) + execution legality (when the backend is compiled in).
CheckOptions
What to check and against which backends.
CheckReport
The full result of check_graph.
Diagnostic
A single finding about the graph.
Legality
Execution-legality rollup against a backend’s real op claim.

Enums§

Severity
Diagnostic severity, ordered most-severe first for rendering.

Functions§

all_backends
Every fusion target rlx models a static op claim for.
backend_device
The execution Device whose op claim answers legality for a fusion target.
backend_name
Stable lowercase name for a backend target.
check_graph
Run every enabled check against graph and collect the findings.
default_backends
A representative cross-vendor default set (CPU + the three big GPU families).
model_self_check
Self-check hook injected by #[rlx_model(check)] right after the model’s graph is traced. Runs check_graph and reports findings to stderr.
parse_backend
Parse a backend name (with common aliases) into a FusionTarget.