From d420b6491f7ea79af519097c8fde6b30cb4d8cd1 Mon Sep 17 00:00:00 2001 From: Nathan Braswell Date: Mon, 25 Apr 2022 09:19:14 -0400 Subject: [PATCH] Fix regression - was using the wrong error when blocking recursion and treating as real error instead of stop recursion fallback --- fib_tests.sh | 2 +- partial_eval.scm | 4 ++-- table.md | 18 ++++++++++-------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/fib_tests.sh b/fib_tests.sh index db04f45..0845f6a 100755 --- a/fib_tests.sh +++ b/fib_tests.sh @@ -46,11 +46,11 @@ popd hyperfine --warmup 2 --export-markdown table.md \ 'echo '$NUMBER' | wasmtime ./fib_compiled.wasm' 'echo '$NUMBER' | wasmtime ./fib_compiled_let.wasm' \ + 'echo '$NUMBER' | wasmtime ./builtin_fib.wasm' 'echo '$NUMBER' | wasmtime ./fib_compiled_manual.wasm' \ "scheme --script ./fib.scm $NUMBER" "scheme --script ./fib_let.scm $NUMBER" \ "python3 ./fib.py $NUMBER" "python3 ./fib_let.py $NUMBER" \ 'echo '$NUMBER' | wasmtime ./rust_fib/target/wasm32-wasi/debug/rust_let.wasm' 'echo '$NUMBER' | wasmtime ./rust_fib/target/wasm32-wasi/release/rust_let.wasm' \ - #'echo '$NUMBER' | wasmtime ./builtin_fib.wasm' 'echo '$NUMBER' | wasmtime ./fib_compiled_manual.wasm' \ #'echo '$NUMBER' | wasmtime ./rust_fib/target/wasm32-wasi/debug/rust_let.wasm' 'echo '$NUMBER' | wasmtime ./rust_fib/target/wasm32-wasi/release/rust_let.wasm' \ #'echo '$NUMBER' | ./rust_fib/target/debug/rust_let' 'echo '$NUMBER' | ./rust_fib/target/release/rust_let' \ #'echo '$NUMBER' | wasmtime ./fib_interpreted.wasm' 'echo '$NUMBER' | wasmtime ./fib_interpreted_let.wasm' \ diff --git a/partial_eval.scm b/partial_eval.scm index f7a48c1..464b674 100644 --- a/partial_eval.scm +++ b/partial_eval.scm @@ -4572,7 +4572,7 @@ (ctx (array datasi funcs memo env pectx inline_locals)) - ) (array (mif e x pex) e ctx))))) + ) (array (mif e x pex) err ctx))))) ((datasi funcs memo env pectx inline_locals) ctx) (memo (put memo (.hash c) 'RECURSE_FAIL)) (ctx (array datasi funcs memo env pectx inline_locals)) @@ -4741,7 +4741,7 @@ ((param_codes first_params_err ctx) (compile_params false ctx params)) ((func_val func_code func_err ctx) (compile-inner ctx func_value false inside_veval s_env_access_code inline_level)) ((unval_param_codes err ctx) (compile_params true ctx params)) - ((bad_unval_params_msg_val _ _ ctx) (compile-inner ctx (marked_val (str "error was with unval-evaling parameters of " (str_strip c))) true inside_veval s_env_access_code inline_level)) + ((bad_unval_params_msg_val _ _ ctx) (compile-inner ctx (marked_val (str "error was with unval-evaling parameters of " (true_str_strip c) " " err)) true inside_veval s_env_access_code inline_level)) (wrap_param_code (lambda (code) (concat (local.get '$tmp) ; saving ito restore it code diff --git a/table.md b/table.md index b8ac255..2895152 100644 --- a/table.md +++ b/table.md @@ -1,10 +1,12 @@ | Command | Mean [ms] | Min [ms] | Max [ms] | Relative | |:---|---:|---:|---:|---:| -| `echo 30 \| wasmtime ./fib_compiled.wasm` | 106.4 ± 4.2 | 102.8 | 122.5 | 5.68 ± 0.28 | -| `echo 30 \| wasmtime ./fib_compiled_let.wasm` | 138.8 ± 4.2 | 136.1 | 155.8 | 7.42 ± 0.31 | -| `scheme --script ./fib.scm 30` | 53.9 ± 0.8 | 52.8 | 56.1 | 2.88 ± 0.10 | -| `scheme --script ./fib_let.scm 30` | 54.1 ± 0.8 | 53.1 | 57.3 | 2.89 ± 0.10 | -| `python3 ./fib.py 30` | 286.5 ± 2.9 | 281.0 | 289.8 | 15.31 ± 0.48 | -| `python3 ./fib_let.py 30` | 300.9 ± 2.0 | 297.8 | 303.9 | 16.08 ± 0.49 | -| `echo 30 \| wasmtime ./rust_fib/target/wasm32-wasi/debug/rust_let.wasm` | 29.6 ± 0.7 | 28.7 | 33.2 | 1.58 ± 0.06 | -| `echo 30 \| wasmtime ./rust_fib/target/wasm32-wasi/release/rust_let.wasm` | 18.7 ± 0.6 | 17.7 | 21.1 | 1.00 | +| `echo 30 \| wasmtime ./fib_compiled.wasm` | 106.3 ± 1.7 | 103.8 | 111.8 | 8.18 ± 0.35 | +| `echo 30 \| wasmtime ./fib_compiled_let.wasm` | 142.1 ± 1.5 | 140.0 | 144.9 | 10.93 ± 0.45 | +| `echo 30 \| wasmtime ./builtin_fib.wasm` | 13.0 ± 0.5 | 11.7 | 14.7 | 1.00 | +| `echo 30 \| wasmtime ./fib_compiled_manual.wasm` | 305.9 ± 3.2 | 301.8 | 311.7 | 23.53 ± 0.98 | +| `scheme --script ./fib.scm 30` | 53.9 ± 0.6 | 53.0 | 56.0 | 4.15 ± 0.17 | +| `scheme --script ./fib_let.scm 30` | 54.0 ± 0.6 | 53.1 | 55.6 | 4.15 ± 0.17 | +| `python3 ./fib.py 30` | 287.6 ± 2.7 | 283.8 | 293.1 | 22.12 ± 0.91 | +| `python3 ./fib_let.py 30` | 303.8 ± 2.9 | 300.5 | 308.0 | 23.37 ± 0.97 | +| `echo 30 \| wasmtime ./rust_fib/target/wasm32-wasi/debug/rust_let.wasm` | 29.7 ± 0.6 | 28.5 | 32.3 | 2.29 ± 0.10 | +| `echo 30 \| wasmtime ./rust_fib/target/wasm32-wasi/release/rust_let.wasm` | 18.6 ± 0.4 | 17.8 | 19.8 | 1.43 ± 0.06 |