binius_core/oracle/
error.rs

1// Copyright 2024-2025 Irreducible Inc.
2
3use crate::oracle::OracleId;
4
5#[derive(Debug, thiserror::Error)]
6pub enum Error {
7	#[error(
8		"the number of variables of the composition polynomial does not match the number of composed polynomials"
9	)]
10	CompositionMismatch,
11	#[error("expected the start index to be at most {expected}")]
12	InvalidStartIndex { expected: usize },
13	#[error("expected the nonzero index to be at most {expected}")]
14	InvalidNonzeroIndex { expected: usize },
15	#[error("expected the polynomial to have {expected} variables")]
16	IncorrectNumberOfVariables { expected: usize },
17	#[error("attempted to project more variables {values_len} than inner polynomial has {n_vars}")]
18	InvalidProjection { values_len: usize, n_vars: usize },
19	#[error("invalid polynomial index in committed batch")]
20	InvalidPolynomialIndex,
21	#[error("polynomial error")]
22	Polynomial(#[from] crate::polynomial::Error),
23	#[error("n_vars ({n_vars}) must be at least as big as the requested log_degree ({log_degree})")]
24	NotEnoughVarsForPacking { n_vars: usize, log_degree: usize },
25	#[error("no oracle exists in this MultilinearOracleSet with id {0}")]
26	InvalidOracleId(OracleId),
27	#[error("tower_level ({tower_level}) exceeds maximum")]
28	TowerLevelTooHigh { tower_level: usize },
29	#[error("constraint set is empty")]
30	EmptyConstraintSet,
31	#[error(
32		"expected constraint set to contain only constraints with n_vars={expected}, but found n_vars={got}"
33	)]
34	ConstraintSetNvarsMismatch { got: usize, expected: usize },
35}