Skip to content

Commit

Permalink
Update wide fibonacci to 256 columns (#575)
Browse files Browse the repository at this point in the history
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/starkware-libs/stwo/575)
<!-- Reviewable:end -->
  • Loading branch information
shaharsamocha7 authored Apr 15, 2024
2 parents f90d64d + 3030189 commit c8552c4
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 792 deletions.
14 changes: 3 additions & 11 deletions src/examples/wide_fibonacci/avx.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use itertools::Itertools;
use num_traits::{One, Zero};

use super::structs::WideFibComponent;
use super::component::{WideFibAir, WideFibComponent};
use crate::core::air::accumulation::{DomainEvaluationAccumulator, PointEvaluationAccumulator};
use crate::core::air::mask::fixed_mask_points;
use crate::core::air::{Air, Component, ComponentTrace};
use crate::core::backend::avx512::qm31::PackedSecureField;
use crate::core::backend::avx512::{AVX512Backend, BaseFieldVec, PackedBaseField, VECS_LOG_SIZE};
use crate::core::backend::{CPUBackend, Col, Column, ColumnOps};
use crate::core::backend::{Col, Column, ColumnOps};
use crate::core::circle::CirclePoint;
use crate::core::constraints::coset_vanishing;
use crate::core::fields::m31::BaseField;
Expand All @@ -19,19 +19,11 @@ use crate::core::ColumnVec;

const N_COLS: usize = 1 << 8;

pub struct WideFibAir {
component: WideFibComponent,
}
impl Air<AVX512Backend> for WideFibAir {
fn components(&self) -> Vec<&dyn Component<AVX512Backend>> {
vec![&self.component]
}
}
impl Air<CPUBackend> for WideFibAir {
fn components(&self) -> Vec<&dyn Component<CPUBackend>> {
vec![&self.component]
}
}

pub fn gen_trace(
log_size: usize,
Expand Down Expand Up @@ -162,7 +154,7 @@ mod tests {
use crate::core::fields::IntoSlice;
use crate::core::prover::{prove, verify};
use crate::examples::wide_fibonacci::avx::{gen_trace, WideFibAir};
use crate::examples::wide_fibonacci::structs::WideFibComponent;
use crate::examples::wide_fibonacci::component::WideFibComponent;

#[test]
fn test_avx_wide_fib_prove() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
use crate::core::air::{Air, Component};
use crate::core::backend::CPUBackend;
use crate::core::fields::m31::BaseField;

/// Component that computes fibonacci numbers over 64 columns.
pub struct WideFibComponent {
pub log_size: u32,
}

pub struct WideFibAir {
pub component: WideFibComponent,
}

impl Air<CPUBackend> for WideFibAir {
fn components(&self) -> Vec<&dyn Component<CPUBackend>> {
vec![&self.component]
}
}

// Input for the fibonacci claim.
#[derive(Debug, Clone, Copy)]
pub struct Input {
Expand Down
Loading

0 comments on commit c8552c4

Please sign in to comment.