binius_core/polynomial/
error.rs1use std::ops::Range;
4
5use binius_field::Error as FieldError;
6
7#[derive(Debug, thiserror::Error)]
8pub enum Error {
9 #[error("the query must have size {expected}")]
10 IncorrectQuerySize { expected: usize },
11 #[error("all polynomials in mixed composition should have {expected} vars")]
12 IncorrectArityInMixedComposition { expected: usize },
13 #[error("array of inner composition evaluations is of incorrect length")]
14 IncorrectInnerEvalsLength,
15 #[error("the polynomial is expected to have {expected} variables, and instead has {actual}")]
16 IncorrectNumberOfVariables { expected: usize, actual: usize },
17 #[error("block size must between 1 and {n_vars} (inclusive)")]
18 InvalidBlockSize { n_vars: usize },
19 #[error("shift offset must be between 1 and {max_shift_offset} inclusive, got {shift_offset}")]
20 InvalidShiftOffset {
21 max_shift_offset: usize,
22 shift_offset: usize,
23 },
24 #[error("invalid tower height: {actual}. tower height must be 0, 3, 4, 5, 6, or 7")]
25 InvalidTowerHeight { actual: usize },
26 #[error("indices provided to IndexComposition constructor do not match number of variables")]
27 IndexCompositionIndicesOutOfBounds,
28 #[error("mixed polynomial was not provided")]
29 MixedMultilinearNotFound,
30 #[error("MultilinearComposite constructed with incorrect arguments: {0}")]
31 MultilinearCompositeValidation(String),
32 #[error("argument {arg} must be in the range {range:?}")]
33 ArgumentRangeError { arg: String, range: Range<usize> },
34 #[error("{0}")]
35 FieldError(#[from] FieldError),
36 #[error("not enough field elements to fill a single packed field element ({length} / {packed_width})")]
37 PackedFieldNotFilled { length: usize, packed_width: usize },
38 #[error("one of the defining inputs to the ring switching eq-indicator function has length {actual}, rather than {expected}")]
39 RingSwitchWrongLength { expected: usize, actual: usize },
40 #[error("{0}")]
41 MathError(#[from] binius_math::Error),
42 #[error("{0}")]
43 HalError(#[from] binius_hal::Error),
44}