11//! VM execution runner
22
33use crate :: core:: {
4- DIMENSION , F , ONE_VEC_PTR , POSEIDON_16_NULL_HASH_PTR , POSEIDON_24_NULL_HASH_PTR ,
5- PUBLIC_INPUT_START , VECTOR_LEN , ZERO_VEC_PTR ,
4+ DIMENSION , F , NONRESERVED_PROGRAM_INPUT_START , ONE_VEC_PTR , POSEIDON_16_NULL_HASH_PTR ,
5+ POSEIDON_24_NULL_HASH_PTR , VECTOR_LEN , ZERO_VEC_PTR ,
66} ;
77use crate :: diagnostics:: { ExecutionResult , RunnerError } ;
88use crate :: execution:: { ExecutionHistory , Memory } ;
@@ -23,9 +23,11 @@ const STACK_TRACE_INSTRUCTIONS: usize = 5000;
2323/// Build public memory with standard initialization
2424pub fn build_public_memory ( public_input : & [ F ] ) -> Vec < F > {
2525 // padded to a power of two
26- let public_memory_len = ( PUBLIC_INPUT_START + public_input. len ( ) ) . next_power_of_two ( ) ;
26+ let public_memory_len =
27+ ( NONRESERVED_PROGRAM_INPUT_START + public_input. len ( ) ) . next_power_of_two ( ) ;
2728 let mut public_memory = F :: zero_vec ( public_memory_len) ;
28- public_memory[ PUBLIC_INPUT_START ..] [ ..public_input. len ( ) ] . copy_from_slice ( public_input) ;
29+ public_memory[ NONRESERVED_PROGRAM_INPUT_START ..] [ ..public_input. len ( ) ]
30+ . copy_from_slice ( public_input) ;
2931
3032 // "zero" vector
3133 let zero_start = ZERO_VEC_PTR * VECTOR_LEN ;
@@ -157,7 +159,8 @@ fn execute_bytecode_helper(
157159 // set public memory
158160 let mut memory = Memory :: new ( build_public_memory ( public_input) ) ;
159161
160- let public_memory_size = ( PUBLIC_INPUT_START + public_input. len ( ) ) . next_power_of_two ( ) ;
162+ let public_memory_size =
163+ ( NONRESERVED_PROGRAM_INPUT_START + public_input. len ( ) ) . next_power_of_two ( ) ;
161164 let mut fp = public_memory_size;
162165
163166 for ( i, value) in private_input. iter ( ) . enumerate ( ) {
@@ -320,7 +323,8 @@ fn execute_bytecode_helper(
320323 summary. push_str ( & format ! ( "MEMORY: {}\n " , pretty_integer( memory. 0 . len( ) ) ) ) ;
321324 summary. push ( '\n' ) ;
322325
323- let runtime_memory_size = memory. 0 . len ( ) - ( PUBLIC_INPUT_START + public_input. len ( ) ) ;
326+ let runtime_memory_size =
327+ memory. 0 . len ( ) - ( NONRESERVED_PROGRAM_INPUT_START + public_input. len ( ) ) ;
324328 summary. push_str ( & format ! (
325329 "Bytecode size: {}\n " ,
326330 pretty_integer( bytecode. instructions. len( ) )
@@ -342,7 +346,7 @@ fn execute_bytecode_helper(
342346 let used_memory_cells = memory
343347 . 0
344348 . iter ( )
345- . skip ( PUBLIC_INPUT_START + public_input. len ( ) )
349+ . skip ( NONRESERVED_PROGRAM_INPUT_START + public_input. len ( ) )
346350 . filter ( |& & x| x. is_some ( ) )
347351 . count ( ) ;
348352 summary. push_str ( & format ! (
0 commit comments