diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 5dbc500b..776bdee6 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -71,11 +71,6 @@ jobs: python -m pip install maturin rustup target add x86_64-unknown-linux-musl - # we need this for brun and opc - - name: install clvm_tools - run: | - cargo install clvm_tools_rs - - name: Build env: CC: gcc diff --git a/benches/run-program.rs b/benches/run-program.rs index ef1cb729..94b9da97 100644 --- a/benches/run-program.rs +++ b/benches/run-program.rs @@ -224,14 +224,13 @@ fn run_program_benchmark(c: &mut Criterion) { ] { a.restore_checkpoint(&test_case_checkpoint); - println!("benchmark/{test}.hex"); - let prg = read_to_string(format!("benchmark/{test}.hex")) - .expect("failed to load benchmark program"); - let prg = hex::decode(prg.trim()).expect("invalid hex in benchmark program"); - let prg = node_from_bytes(&mut a, &prg[..]).expect("failed to parse benchmark program"); - let env = make_env(&mut a); - let iter_checkpoint = a.checkpoint(); group.bench_function(*test, |b| { + let prg = read_to_string(format!("benchmark/{test}.hex")) + .expect("failed to load benchmark program"); + let prg = hex::decode(prg.trim()).expect("invalid hex in benchmark program"); + let prg = node_from_bytes(&mut a, &prg[..]).expect("failed to parse benchmark program"); + let env = make_env(&mut a); + let iter_checkpoint = a.checkpoint(); b.iter(|| { a.restore_checkpoint(&iter_checkpoint); let start = Instant::now(); diff --git a/tests/run-programs.py b/tests/run-programs.py index dd85b3fc..aebb0b13 100755 --- a/tests/run-programs.py +++ b/tests/run-programs.py @@ -7,6 +7,7 @@ import platform from colorama import init, Fore, Style from run import run_clvm +from os.path import isfile init() ret = 0 @@ -14,22 +15,27 @@ for fn in glob.glob('programs/large-atom-*.hex.invalid'): try: + print(fn) run_clvm(fn) ret = 1 - print("FAILED: expected parse failure") + print(Fore.RED + "FAILED: expected parse failure" + Style.RESET_ALL) except Exception as e: - print("expected failure: %s" % e) + print(Fore.GREEN + f"OK: expected: {e}" + Style.RESET_ALL) for fn in glob.glob('programs/*.clvm'): hexname = fn[:-4] + 'hex' + if isfile(hexname): + continue with open(hexname, 'w+') as out: proc = subprocess.Popen(['opc', fn], stdout=out) proc.wait() for fn in glob.glob('programs/*.env'): hexenv = fn + 'hex' + if isfile(hexenv): + continue with open(hexenv, 'w+') as out: proc = subprocess.Popen(['opc', fn], stdout=out) proc.wait() @@ -38,7 +44,6 @@ hexenv = hexname[:-3] + 'envhex' -# command = ['brun', '-m', '11000000000', '-c', '--backend=rust', '--quiet', '--time', '--hex', hexname, hexenv] command = ['./run.py', hexname, hexenv] # prepend the size command, to measure RSS