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("the number of variables of the composition polynomial does not match the number of composed polynomials")]
8	CompositionMismatch,
9	#[error("expected the polynomial to have {expected} variables")]
10	IncorrectNumberOfVariables { expected: usize },
11	#[error("attempted to project more variables {values_len} than inner polynomial has {n_vars}")]
12	InvalidProjection { values_len: usize, n_vars: usize },
13	#[error("invalid polynomial index in committed batch")]
14	InvalidPolynomialIndex,
15	#[error("polynomial error")]
16	Polynomial(#[from] crate::polynomial::Error),
17	#[error(
18		"n_vars ({n_vars}) must be at least as big as the requested log_degree ({log_degree})"
19	)]
20	NotEnoughVarsForPacking { n_vars: usize, log_degree: usize },
21	#[error("no oracle exists in this MultilinearOracleSet with id {0}")]
22	InvalidOracleId(OracleId),
23	#[error("tower_level ({tower_level}) exceeds maximum")]
24	TowerLevelTooHigh { tower_level: usize },
25	#[error("constraint set is empty")]
26	EmptyConstraintSet,
27	#[error("expected constraint set to contain only constraints with n_vars={expected}, but found n_vars={got}")]
28	ConstraintSetNvarsMismatch { got: usize, expected: usize },
29}