Skip to content

Commit

Permalink
Make dynamic_params a span
Browse files Browse the repository at this point in the history
  • Loading branch information
fmkra committed Nov 16, 2024
1 parent 68a91f5 commit 94dffb2
Show file tree
Hide file tree
Showing 9 changed files with 29,629 additions and 29,457 deletions.
326 changes: 166 additions & 160 deletions src/air/layouts/dynamic.cairo

Large diffs are not rendered by default.

38,520 changes: 19,261 additions & 19,259 deletions src/air/layouts/dynamic/autogenerated/composition.cairo

Large diffs are not rendered by default.

19,206 changes: 9,561 additions & 9,645 deletions src/air/layouts/dynamic/autogenerated/oods.cairo

Large diffs are not rendered by default.

693 changes: 351 additions & 342 deletions src/air/layouts/dynamic/constants.cairo

Large diffs are not rendered by default.

239 changes: 239 additions & 0 deletions src/air/layouts/dynamic/contracts.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
use integrity::air::layouts::dynamic::{
global_values::GlobalValues,
constants::DynamicParams,
};

#[starknet::interface]
trait ILayoutCompositionContract<ContractState> {
fn eval_composition_polynomial_inner(
self: @ContractState,
mask_values: Span<felt252>,
constraint_coefficients: Span<felt252>,
point: felt252,
trace_generator: felt252,
global_values: GlobalValues
) -> felt252;
}

#[starknet::interface]
trait ILayoutOodsContract<ContractState> {
fn eval_oods_polynomial_inner(
self: @ContractState,
column_values: Span<felt252>,
oods_values: Span<felt252>,
constraint_coefficients: Span<felt252>,
point: felt252,
oods_point: felt252,
trace_generator: felt252,
dynamic_params: DynamicParams,
) -> felt252;
}

// #[starknet::contract]
// mod LayoutCompositionContract {
// use super::{
// ILayoutCompositionContract, ILayoutCompositionContractDispatcher,
// ILayoutCompositionContractDispatcherTrait
// };
// use integrity::air::layouts::dynamic::{global_values::GlobalValues,};
// use starknet::ContractAddress;

// use integrity::air::layouts::dynamic::autogenerated::eval_composition_polynomial_inner;

// #[storage]
// struct Storage {
// // contract_1: ContractAddress,
// // contract_2: ContractAddress,
// // contract_3: ContractAddress,
// }

// #[constructor]
// fn constructor(
// ref self: ContractState,
// // contract_1: ContractAddress,
// // contract_2: ContractAddress,
// // contract_3: ContractAddress
// ) {
// // self.contract_1.write(contract_1);
// // self.contract_2.write(contract_2);
// // self.contract_3.write(contract_3);
// }

// #[abi(embed_v0)]
// impl LayoutCompositionContract of ILayoutCompositionContract<ContractState> {
// fn eval_composition_polynomial_inner(
// self: @ContractState,
// mask_values: Span<felt252>,
// mut constraint_coefficients: Span<felt252>,
// point: felt252,
// trace_generator: felt252,
// global_values: GlobalValues
// ) -> felt252 {
// eval_composition_polynomial_inner(
// mask_values,
// constraint_coefficients,
// point,
// trace_generator,
// global_values
// )
// // let mut total_sum = 0;

// // total_sum +=
// // ILayoutCompositionContractDispatcher { contract_address: self.contract_1.read(), }
// // .eval_composition_polynomial_inner(
// // mask_values,
// // (*constraint_coefficients.multi_pop_front::<219>().unwrap()).unbox().span(),
// // point,
// // trace_generator,
// // global_values,
// // );

// // total_sum +=
// // ILayoutCompositionContractDispatcher { contract_address: self.contract_2.read(), }
// // .eval_composition_polynomial_inner(
// // mask_values,
// // (*constraint_coefficients.multi_pop_front::<69>().unwrap()).unbox().span(),
// // point,
// // trace_generator,
// // global_values,
// // );

// // total_sum +=
// // ILayoutCompositionContractDispatcher { contract_address: self.contract_3.read(), }
// // .eval_composition_polynomial_inner(
// // mask_values,
// // (*constraint_coefficients.multi_pop_front::<59>().unwrap()).unbox().span(),
// // point,
// // trace_generator,
// // global_values,
// // );

// // assert(constraint_coefficients.len() == 0, 'constraint_coeffs too long');
// // total_sum
// }
// }
// }

// #[starknet::contract]
// mod LayoutCompositionPart1Contract {
// use super::ILayoutCompositionContract;
// use integrity::air::layouts::dynamic::{
// global_values::GlobalValues, autogenerated::eval_composition_polynomial_inner_part1,
// };
// use starknet::ContractAddress;


// #[storage]
// struct Storage {}

// #[abi(embed_v0)]
// impl LayoutCompositionPart1Contract of ILayoutCompositionContract<ContractState> {
// fn eval_composition_polynomial_inner(
// self: @ContractState,
// mask_values: Span<felt252>,
// constraint_coefficients: Span<felt252>,
// point: felt252,
// trace_generator: felt252,
// global_values: GlobalValues
// ) -> felt252 {
// eval_composition_polynomial_inner_part1(
// mask_values, constraint_coefficients, point, trace_generator, global_values,
// )
// }
// }
// }

// #[starknet::contract]
// mod LayoutCompositionPart2Contract {
// use super::ILayoutCompositionContract;
// use integrity::air::layouts::dynamic::{
// global_values::GlobalValues, autogenerated::eval_composition_polynomial_inner_part2,
// };
// use starknet::ContractAddress;


// #[storage]
// struct Storage {}

// #[abi(embed_v0)]
// impl LayoutCompositionPart2Contract of ILayoutCompositionContract<ContractState> {
// fn eval_composition_polynomial_inner(
// self: @ContractState,
// mask_values: Span<felt252>,
// constraint_coefficients: Span<felt252>,
// point: felt252,
// trace_generator: felt252,
// global_values: GlobalValues
// ) -> felt252 {
// eval_composition_polynomial_inner_part2(
// mask_values, constraint_coefficients, point, trace_generator, global_values,
// )
// }
// }
// }

// #[starknet::contract]
// mod LayoutCompositionPart3Contract {
// use super::ILayoutCompositionContract;
// use integrity::air::layouts::dynamic::{
// global_values::GlobalValues, autogenerated::eval_composition_polynomial_inner_part3,
// };
// use starknet::ContractAddress;


// #[storage]
// struct Storage {}

// #[abi(embed_v0)]
// impl LayoutCompositionPart3Contract of ILayoutCompositionContract<ContractState> {
// fn eval_composition_polynomial_inner(
// self: @ContractState,
// mask_values: Span<felt252>,
// constraint_coefficients: Span<felt252>,
// point: felt252,
// trace_generator: felt252,
// global_values: GlobalValues
// ) -> felt252 {
// eval_composition_polynomial_inner_part3(
// mask_values, constraint_coefficients, point, trace_generator, global_values,
// )
// }
// }
// }

#[starknet::contract]
mod LayoutOodsContract {
use super::{ILayoutOodsContract};
use integrity::air::layouts::dynamic::{
global_values::GlobalValues, autogenerated::eval_oods_polynomial_inner,
constants::DynamicParams,
};
use starknet::ContractAddress;

#[storage]
struct Storage {}

#[abi(embed_v0)]
impl LayoutOodsContract of ILayoutOodsContract<ContractState> {
fn eval_oods_polynomial_inner(
self: @ContractState,
column_values: Span<felt252>,
oods_values: Span<felt252>,
constraint_coefficients: Span<felt252>,
point: felt252,
oods_point: felt252,
trace_generator: felt252,
dynamic_params: DynamicParams,
) -> felt252 {
eval_oods_polynomial_inner(
column_values,
oods_values,
constraint_coefficients,
point,
oods_point,
trace_generator,
dynamic_params,
)
}
}
}
Loading

0 comments on commit 94dffb2

Please sign in to comment.