pub fn run_generation(iterations: u64) {
    env_logger::init();

    let mut verified_programs: u64 = 0;
    let mut executed_programs: u64 = 0;
    for i in 0..iterations {
        let module =
            ModuleBuilder::new(1, Some(Box::new(generate_bytecode))).materialize_unverified();
        debug!("Running on verifier...");
        let verified_module = match run_verifier(module.clone()) {
            Ok(verified_module) => {
                // We cannot execute more than u64::max_value() iterations.
                verify!(verified_programs < u64::max_value());
                verified_programs += 1;
                Some(verified_module)
            }
            Err(e) => {
                error!("{}", e);
                if EXECUTE_UNVERIFIED_MODULE {
                    Some(VerifiedModule::bypass_verifier_DANGEROUS_FOR_TESTING_ONLY(
                        module.clone(),
                    ))
                } else {
                    None
                }
            }
        };
        if let Some(verified_module) = verified_module {
            if RUN_ON_VM {
                debug!("Running on VM...");
                match run_vm(verified_module) {
                    Ok(_) => {
                        // We cannot execute more than u64::max_value() iterations.
                        verify!(executed_programs < u64::max_value());
                        executed_programs += 1
                    }
                    Err(e) => error!("{}", e),
                }
            }
        };
        if iterations > 10 && i % (iterations / 10) == 0 {
            info!("Iteration: {} / {}", i, iterations);
        }
    }

    info!(
        "Total programs: {}, Percent valid: {:.2}, Percent executed {:.2}",
        iterations,
        (verified_programs as f64) / (iterations as f64) * 100.0,
        (executed_programs as f64) / (iterations as f64) * 100.0,
    );
}
/// Run generate_bytecode for 'iterations' iterations and test each generated module
/// on the bytecode verifier.
Run generate_bytecode for 'iterations' iterations and test each generated module
on the bytecode verifier.
Run generate_bytecode for ' iterations ' iterations and test each generated module on the bytecode verifier .
pub fn run_generation(iterations: u64) {
    env_logger::init();
    let mut verified_programs: u64 = 0;
    let mut executed_programs: u64 = 0;
    for i in 0..iterations {
        let module =
            ModuleBuilder::new(1, Some(Box::new(generate_bytecode))).materialize_unverified();
        debug!("Running on verifier...");
        let verified_module = match run_verifier(module.clone()) {
            Ok(verified_module) => {
                // We cannot execute more than u64::max_value() iterations.
                verify!(verified_programs < u64::max_value());
                verified_programs += 1;
                Some(verified_module)
            }
            Err(e) => {
                error!("{}", e);
                if EXECUTE_UNVERIFIED_MODULE {
                    Some(VerifiedModule::bypass_verifier_DANGEROUS_FOR_TESTING_ONLY(
                        module.clone(),
                    ))
                } else {
                    None
                }
            }
        };
        if let Some(verified_module) = verified_module {
            if RUN_ON_VM {
                debug!("Running on VM...");
                match run_vm(verified_module) {
                    Ok(_) => {
                        // We cannot execute more than u64::max_value() iterations.
                        verify!(executed_programs < u64::max_value());
                        executed_programs += 1
                    }
                    Err(e) => error!("{}", e),
                }
            }
        };
        if iterations > 10 && i % (iterations / 10) == 0 {
            info!("Iteration: {} / {}", i, iterations);
        }
    }
    info!(
        "Total programs: {}, Percent valid: {:.2}, Percent executed {:.2}",
        iterations,
        (verified_programs as f64) / (iterations as f64) * 100.0,
        (executed_programs as f64) / (iterations as f64) * 100.0,
    );
}
pub fn run_generation ( iterations : u64 ) { env_logger :: init ( ) ; let mut verified_programs : u64 = 0 ; let mut executed_programs : u64 = 0 ; for i in 0 .. iterations { let module = ModuleBuilder :: new ( 1 , Some ( Box :: new ( generate_bytecode ) ) ) . materialize_unverified ( ) ; debug ! ( " " ) ; let verified_module = match run_verifier ( module . clone ( ) ) { Ok ( verified_module ) => { // We cannot execute more than u64::max_value() iterations. verify ! ( verified_programs u64 max_value ( ) ) ; verified_programs += 1 ; Some ( verified_module ) } Err ( e ) => { error ! ( " " e ) ; if EXECUTE_UNVERIFIED_MODULE { Some ( VerifiedModule :: bypass_verifier_DANGEROUS_FOR_TESTING_ONLY ( module . clone ( ) , ) ) } else { None } } } ; if let Some ( verified_module ) = verified_module { if RUN_ON_VM { debug ! ( " " ) ; match run_vm ( verified_module ) { Ok ( _ ) => { // We cannot execute more than u64::max_value() iterations. verify ! ( executed_programs u64 max_value ( ) ) ; executed_programs += 1 } Err ( e ) => error ! ( " " e ) , } } } ; if iterations > 10 && i % ( iterations / 10 ) == 0 { info ! ( " " i iterations ) ; } } info ! ( " " iterations ( verified_programs as f64 ) ( iterations as f64 ) 100.0 ( executed_programs as f64 ) ( iterations as f64 ) 100.0 ) ; }
Run generate_bytecode for 'iterations' iterations and test each generated module
on the bytecode verifier.
Run generate_bytecode for ' iterations ' iterations and test each generated module on the bytecode verifier .
iterations
u64