@@ -9,7 +9,7 @@ use openvm_circuit_primitives_derive::AlignedBorrow;
9
9
use openvm_stark_backend:: {
10
10
config:: { StarkGenericConfig , Val } ,
11
11
interaction:: { InteractionBuilder , PermutationCheckBus } ,
12
- p3_air:: { Air , BaseAir } ,
12
+ p3_air:: { Air , AirBuilder , BaseAir } ,
13
13
p3_field:: { FieldAlgebra , PrimeField32 } ,
14
14
p3_matrix:: { dense:: RowMajorMatrix , Matrix } ,
15
15
p3_maybe_rayon:: prelude:: * ,
@@ -79,6 +79,13 @@ impl<const CHUNK: usize, AB: InteractionBuilder> Air<AB> for PersistentBoundaryA
79
79
local. expand_direction * local. expand_direction * local. expand_direction ,
80
80
) ;
81
81
82
+ // Constrain that an "initial" row has timestamp zero.
83
+ // Since `direction` is constrained to be in {-1, 0, 1}, we can select `direction == 1`
84
+ // with the constraint below.
85
+ builder
86
+ . when ( local. expand_direction * ( local. expand_direction + AB :: F :: ONE ) )
87
+ . assert_zero ( local. timestamp ) ;
88
+
82
89
let mut expand_fields = vec ! [
83
90
// direction = 1 => is_final = 0
84
91
// direction = -1 => is_final = 1
0 commit comments