Skip to content

Commit

Permalink
drop CI dependency on clvm_tools_rs. It's only used by run-programs.p…
Browse files Browse the repository at this point in the history
…y to compile .clvm -> .hex. But the hex files are already checked in.
  • Loading branch information
arvidn committed Dec 19, 2023
1 parent 0cfbd41 commit 174b9e4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 6 additions & 7 deletions benches/run-program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
11 changes: 8 additions & 3 deletions tests/run-programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,35 @@
import platform
from colorama import init, Fore, Style
from run import run_clvm
from os.path import isfile

init()
ret = 0

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()
Expand All @@ -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
Expand Down

0 comments on commit 174b9e4

Please sign in to comment.