Errors and troubleshooting
check_inference() returns an operation-specific immutable plan or Error.
Inspect code, field and message; never continue with an invalid request.
execute() returns Status: no error on success, otherwise a structured error.
| Stage | What to check |
|---|---|
| Construct shape | More than six dimensions throws std::length_error; a scalar is Shape{}. |
| Prepare | Operation ID, arity, dtypes, explicit input/output shapes, layouts and typed parameters. |
| Allocate | Use checked required bytes and alignment, including padding and strides. |
| Bind/execute | Real accessible capacities, null pointers, overlap, alignment and relevant FP state. |
| Interpret outputs | Valid logical extents, BoxDecode count/prefix and recipe-specific auxiliary outputs. |
Preparation and context creation may allocate and throw. A raw address and byte count cannot prove ownership, mapping or lifetime; the caller must supply valid storage. Metadata checks are not a substitute for Runtime mapping/coherency and synchronization.
The shared unary buffer checks report insufficient capacity before a null pointer or misalignment. Power-of-two alignment uses a bit-mask check; other nonzero alignments use an equivalent remainder check. Empty buffers require no address.
Reprepare after changing shapes, layouts or parameters. A reusable plan does not make shared writable output buffers safe. BoxDecode needs a separate available context for each in-flight call. See calling kernels.
Do not confuse invalid metadata with data-dependent behavior. NaNs, nonfinite scores and rejected detection geometry follow the selected operation's numerical rules; they are not all preparation errors.