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 / dtype —
rlx_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§
- Backend
Summary - Per-backend rollup: fusion coverage (always) + execution legality (when the backend is compiled in).
- Check
Options - What to check and against which backends.
- Check
Report - 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
Devicewhose op claim answers legality for a fusion target. - backend_
name - Stable lowercase name for a backend target.
- check_
graph - Run every enabled check against
graphand 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. Runscheck_graphand reports findings to stderr. - parse_
backend - Parse a backend name (with common aliases) into a
FusionTarget.