vyre Error Codes

August 1, 2026 · View on GitHub

This document is the canonical registry of every stable error/warning code in vyre-core. Codes are append-only: renames are semver-major events handled as migrations in vyre-core::dialect::migration. Every new code must appear here with a description and a Fix: template before it ships.

Every message emitted through Diagnostic carries one of these codes. Tooling (LSP clients, CI annotators, editor extensions) keys rules off the code, not the prose; prose is free to drift across versions as long as the code stays stable.

Code families

FamilySeveritySource
E-*errorGeneral errors surfaced via Diagnostic
W-*warningDeprecations, soft-failed invariants
V###errorProgram-validation rules (validate_program)
B-*errorBackend dispatch / capability errors
C-*errorConformance verdict failures

Validation codes (V###)

Emitted by validate_program when an IR invariant fails. Fields in every message are prefixed Fix: per the frozen contract.

CodeInvariantFix template
V008Duplicate local binding (shadowing)Choose a unique local name, or pass ValidationOptions::with_shadowing(true) to allow nested shadowing.
V009Atomic on non-writable bufferDeclare the buffer with BufferAccess::ReadWrite.
V010Barrier reached by only part of a workgroup (divergent barrier)Move the barrier to uniform control flow.
V011Assignment to loop variableLoop variables are immutable, so rename instead.
V012Unsupported cast between two DataTypesUse a supported casts.md conversion or rewrite the expression before validation.
V013Bytes load/store on buffer without bytes_extraction = trueUse a typed buffer (U32/I32/F32/…), or declare the buffer with .with_bytes_extraction(true) when the op is a bytes-extraction op like decode.base64.
V014Atomic on buffer with non-u32 element typeAtomics only support U32 elements, so retype the buffer.
V015Loop bound expression has wrong type (expected u32)Ensure from and to are U32.
V016Unknown op id in Expr::CallUse a registered op id or add the op to core::ops::*.
V017Call depth exceeds DEFAULT_MAX_CALL_DEPTHReduce call nesting or eliminate mutually recursive operations.
V018Program nesting depth exceeds DEFAULT_MAX_NESTING_DEPTHFlatten nested If/Loop/Block structures or split the program before lowering.
V019Program has more than DEFAULT_MAX_NODE_COUNT nodesSplit the program into smaller kernels or run an optimization pass before lowering.
V020Call to non-inlinable opLower this op through its dedicated backend path or rewrite the caller with explicit IR.
V021Call argument count mismatches callee's ReadOnly/Uniform input countPass exactly one argument per input buffer in binding order.
V022Program or callee declares too many outputsMark at most one result buffer with BufferDecl::output(...).
V023Cast to Bytes is unsupported in WGSL loweringUse buffer load/store directly for byte data.
V025Atomic on workgroup buffer is outside the portable memory modelUse a storage ReadWrite buffer for atomics.
V027Atomic index has wrong type (expected u32)Cast the index to U32 before the atomic.
V028Fma operand has wrong type (expected f32)Cast the operand to F32 before Fma, or use the integer mul/add form explicitly.
V029Select branches have mismatched typesCast both branches to the same type before Select.
V030Opaque Expr extension fails invariant (empty extension_kind/debug_identity/missing result_type/validate_extension failure)Return a stable non-empty extension_kind, a human-readable debug_identity, and an explicit result_type, and pass validate_extension.
V031Opaque Node extension fails invariant (empty extension_kind/debug_identity/validate_extension failure)Return a stable non-empty extension_kind, a human-readable debug_identity, and pass validate_extension.
V032Duplicate sibling let binding in the same regionRename one binding, or move one declaration into an inner Block/Region/Loop if a new scope is intended.
V033Expression nesting exceeds DEFAULT_MAX_EXPR_DEPTHSplit the expression into intermediate let-bindings before lowering.
V034Backend does not support the requested cast targetChoose a target type the backend supports, or validate against a backend that advertises that cast support.
V035Narrowing cast may truncate high bitsUse a non-narrowing target, or prove the source value fits before casting.
V036Constant store index exceeds the declared buffer element countKeep constant store indices inside the declared element range.
V041Subgroup expressions used without backend subgroup supportValidate with ValidationOptions::with_backend(backend) where backend.supports_subgroup_ops() == true, or remove subgroup ops before lowering.
V042Program validation error 042See diagnostic output.
V043Program validation error 043See diagnostic output.
V044Program validation error 044See diagnostic output.
V045Program validation error 045See diagnostic output.
V046Distributed collective node validation failureValidate with backend collective support, use matching collective buffer element types, declare every referenced buffer, and keep collective buffers in device/global storage.
V047Bitwise subgroup reduction given an f32 operandUse an integer operand for And/Or/Xor, or use Add/Mul/Min/Max for a float reduction.
V051Buffer reference used where a value is expectedA buffer reference is legal only as a call argument. Pass it directly to a composite op, or read an element with Expr::Load.
V052Call passes a reference to an undeclared bufferDeclare the buffer in Program::buffers.
V053Value passed for a buffer<T> parameterPass Expr::buffer_ref(name) naming the buffer the op should read.
V054Referenced buffer's element type does not match the signaturePass a buffer whose element type matches buffer<T>, or change the op signature.
V055Synchronizing loop exit is unordered against the back edgePut an unconditional barrier after the early exit, as the final node in the loop body.

Codes V024, V026, V037-V040, V048-V050, and any codes >V055 are reserved slots. Allocate through this registry before emitting a new diagnostic.

General errors (E-*)

CodeDescriptionFix template
E-IR-001Decode of unknown Opaque extension id (wire format)Link the crate that registers the extension id, then re-decode.
E-IR-002Buffer zero-count with non-empty shape payloadReject the non-canonical Program bytes.
E-IR-003Diagnostic catalog carries a code not listed in docs/error-codes.mdAdd the code to the registry before shipping.

Warnings (W-*)

CodeDescriptionFix template
W-DEPREC-001Deprecated op id in useMigrate to the replacement op listed in the deprecation registry.

Backend codes (B-*)

CodeDescriptionFix template
B-CAP-001Backend does not support this op's capability classPick a backend that supports this op's capabilities, or use a different op.
B-CAP-002Backend factory refused to construct (no GPU adapter, missing driver)Fix the adapter issue per the error's Fix: prose, or skip this backend.
B-CAP-003Unsupported feature, for example a dispatch request on an emission-only targetUse a backend whose supports_dispatch returns true.

Backend ErrorCode stable ids

Variantcodedescription
DeviceOutOfMemory1001Backend device reported insufficient memory during allocation, staging, or dispatch.
UnsupportedFeature1002The selected backend lacks a feature required by the program or dispatch policy.
PoisonedLock1003A synchronization lock was poisoned after a panic while held.
KernelCompileFailed1004Kernel source compilation or validation failed for WGSL, SPIR-V, PTX, Metal IR, or another backend source format.
DispatchFailed1005Queue submission, command execution, readback, or dispatch completion failed.
InvalidProgram1006The submitted program violates backend constraints or the portable program contract.
Unknown1999Legacy or unclassified backend failure produced without a more specific machine-readable code.

Pipeline codes (P-*, vyre-runtime::PipelineError)

CodeVariantDescriptionFix template
P-URING-001IoUringSyscall { syscall, errno, fix }A raw io_uring_setup / mmap / io_uring_enter / io_uring_register syscall returned an errno.Per-variant fix: string names the remediation; typical causes are kernel too old, missing CAP_SYS_ADMIN for SQPOLL on <5.13, or exhausted max_map_count.
P-URING-002QueueFull { queue, fix }The submission or completion queue rejected a request because it is full, out of bounds, or a slot is still in flight.Drain completions with AsyncUringStream::poll or GpuStream::poll, then retry. For backpressure-triggered rejections on publish_slot, wait for the kernel to advance control[DONE_COUNT].
P-URING-003NotLinuxio_uring or futex_waitv was requested on a non-Linux host.Run on Linux 5.16+ or use Megakernel::dispatch without a GpuStream.
P-URING-004NvmePassthroughDisabledsubmit_nvme_passthrough was called without the uring-cmd-nvme feature.Add features = ["uring-cmd-nvme"] to vyre-runtime in your Cargo.toml; requires Linux 6.0+.
P-BACKEND-001Backend(msg)A backend error bubbled up from Megakernel::bootstrap or Megakernel::dispatch.Inspect the wrapped message; usually a validation error on the IR or an OOM during pipeline creation.

Conformance codes (C-*)

CodeDescriptionFix template
C-LAW-001Backend output disagreed with reference on witnessed inputFix the backend lowering or rewrite the op to honor the declared AlgebraicLaw.
C-DET-001Backend produced non-deterministic output across seedsRemove the non-deterministic code path; conform bans silent nondeterminism.

Adding a new code

  1. Pick the next unused integer in the appropriate family.
  2. Add a row to this document with the code, description, and Fix: template.
  3. Emit the code via Diagnostic with the matching code field.
  4. CI verifies every code emitted in source appears in this registry (see scripts/check_error_codes_cataloged.sh).

Policy

  • Append-only. Never reuse a retired code. Retiring a code leaves a row behind with a Retired: v<X.Y.Z> note.
  • Code is the stable key. Prose may drift.
  • Fix: is mandatory. Every variant carries actionable remediation.
  • No stringly-typed errors. Every error-path surfaces a structured code; the prose is a formatting detail.

Uncataloged Legacy / Auto-migrated Codes

CodeDescriptionFix template
E-CSRMigrated codeSee diagnostic output.
E-DATAFLOWMigrated codeSee diagnostic output.
E-DECODEMigrated codeSee diagnostic output.
E-DECODE-CONFIGMigrated codeSee diagnostic output.
E-DECOMPRESSMigrated codeSee diagnostic output.
E-DFAMigrated codeSee diagnostic output.
E-GPUMigrated codeSee diagnostic output.
E-INLINE-ARG-COUNTMigrated codeSee diagnostic output.
E-INLINE-CYCLEMigrated codeSee diagnostic output.
E-INLINE-NON-INLINABLEMigrated codeSee diagnostic output.
E-INLINE-NO-OUTPUTMigrated codeSee diagnostic output.
E-INLINE-OUTPUT-COUNTMigrated codeSee diagnostic output.
E-INLINE-UNKNOWN-OPMigrated codeSee diagnostic output.
E-INTERPMigrated codeSee diagnostic output.
E-LOWERINGMigrated codeSee diagnostic output.
E-PREFIXMigrated codeSee diagnostic output.
E-RULE-EVALMigrated codeSee diagnostic output.
E-SERIALIZATIONMigrated codeSee diagnostic output.
E-TESTMigrated codeSee diagnostic output.
E-TOML-PARSEMigrated codeSee diagnostic output.
E-UNKNOWNMigrated codeSee diagnostic output.
E-WIRE-UNKNOWN-DIALECTMigrated codeSee diagnostic output.
E-WIRE-UNKNOWN-OPMigrated codeSee diagnostic output.
E-WIRE-VALIDATIONMigrated codeSee diagnostic output.
E-WIRE-VERSIONMigrated codeSee diagnostic output.
E-XMigrated codeSee diagnostic output.
W-DEPRECATEDMigrated codeSee diagnostic output.
W-OP-DEPRECATEDMigrated codeSee diagnostic output.
W-TOML-BAD-OP-IDMigrated codeSee diagnostic output.
W-TOML-UNREADABLEMigrated codeSee diagnostic output.
E-TOML-BAD-CATEGORYMigrated codeSee diagnostic output.
E-TOML-BAD-OP-IDMigrated codeSee diagnostic output.
E-TOML-DIALECT-DIR-ENTRYMigrated codeSee diagnostic output.
E-TOML-DIALECT-DIR-MISSINGMigrated codeSee diagnostic output.
E-TOML-DIALECT-DIR-UNREADABLEMigrated codeSee diagnostic output.
E-TOML-DUPLICATE-OPMigrated codeSee diagnostic output.
E-TOML-EMPTY-DIALECTMigrated codeSee diagnostic output.
E-TOML-EMPTY-DIALECT-PATHMigrated codeSee diagnostic output.
E-TOML-EMPTY-VERSIONMigrated codeSee diagnostic output.
E-TOML-MANIFEST-REJECTEDMigrated codeSee diagnostic output.
E-TOML-UNREADABLEMigrated codeSee diagnostic output.