Skip to content
58 changes: 57 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
url = "github:serokell/ocaml-recovery-parser";
flake = false;
};
binaryen-patched = {
url = "github:ggreif/binaryen/gabor/lsb-if-ctz-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs =
Expand All @@ -66,6 +70,7 @@
, motoko-matchers-src
, grace-src
, ocaml-recovery-parser-src
, binaryen-patched
}: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import ./nix/pkgs.nix {
Expand Down Expand Up @@ -99,7 +104,8 @@
export CLANG="${pkgs.clang_21}/bin/clang"
'';

rts-set = import ./nix/rts.nix { inherit pkgs llvmEnv; };
wasmOpt = binaryen-patched.packages.${system}.default;
rts-set = import ./nix/rts.nix { inherit pkgs llvmEnv wasmOpt; };
# `.#rts-checked` always runs the host-side `cargo test` suite.
# `.#rts` is the same on Linux (Hydra-cached, fast) but skips the
# check phase on darwin where the cargo test suite has no cache and
Expand Down
7 changes: 6 additions & 1 deletion nix/rts.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, llvmEnv }:
{ pkgs, llvmEnv, wasmOpt ? null }:
let
# Build Rust package cargo-vendor-tools
cargoVendorTools = pkgs.rustPlatform.buildRustPackage rec {
Expand Down Expand Up @@ -85,6 +85,11 @@ let

installPhase = ''
mkdir -p $out/rts
${pkgs.lib.optionalString (wasmOpt != null) ''
for f in mo-rts-non-incremental.wasm mo-rts-incremental.wasm mo-rts-eop.wasm; do
${wasmOpt}/bin/wasm-opt -Os --optimize-instructions "$f" -o "$f"
done
''}
cp mo-rts-non-incremental.wasm $out/rts
cp mo-rts-non-incremental-debug.wasm $out/rts
cp mo-rts-incremental.wasm $out/rts
Expand Down
6 changes: 3 additions & 3 deletions test/bench/ok/alloc.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: (+671_088_640, 5_053_130_525)
debug.print: (+671_088_640, 5_053_109_933)
ingress Completed: Reply: 0x4449444c0000
debug.print: (+671_088_640, 5_049_945_650)
debug.print: (+671_088_640, 5_049_945_538)
ingress Completed: Reply: 0x4449444c0000
debug.print: (+671_088_640, 5_049_945_678)
debug.print: (+671_088_640, 5_049_945_564)
ingress Completed: Reply: 0x4449444c0000
ingress Completed: Reply: 0x4449444c0000
4 changes: 2 additions & 2 deletions test/bench/ok/bignum.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: {cycles = 2_464_057; size = +25_528}
debug.print: {cycles = 2_464_449; size = +25_528}
ingress Completed: Reply: 0x4449444c0000
debug.print: {cycles = 54_911_631; size = +830_464}
debug.print: {cycles = 54_798_530; size = +830_464}
ingress Completed: Reply: 0x4449444c0000
ingress Completed: Reply: 0x4449444c0000
2 changes: 1 addition & 1 deletion test/bench/ok/candid-subtype-cost.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: {cycles = 1_118_480; heap_bytes = +33_888}
debug.print: {cycles = 1_121_241; heap_bytes = +33_888}
ingress Completed: Reply: 0x4449444c0000
ingress Completed: Reply: 0x4449444c0000
4 changes: 2 additions & 2 deletions test/bench/ok/heap-32.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: (50_227, +75_320_504, 1_136_441_053)
debug.print: (50_070, +86_221_288, 1_235_835_970)
debug.print: (50_227, +75_320_504, 1_119_382_334)
debug.print: (50_070, +86_221_288, 1_216_946_094)
ingress Completed: Reply: 0x4449444c0000
ingress Completed: Reply: 0x4449444c0000
4 changes: 2 additions & 2 deletions test/bench/ok/heap-64.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: (49_965, +88_051_888, 1_306_891_884)
debug.print: (49_806, +86_432_120, 1_279_591_213)
debug.print: (49_965, +88_051_888, 1_290_762_387)
debug.print: (49_806, +86_432_120, 1_263_990_068)
ingress Completed: Reply: 0x4449444c0000
ingress Completed: Reply: 0x4449444c0000
6 changes: 3 additions & 3 deletions test/bench/ok/iter.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: (+104, 197_539)
debug.print: (+104, 197_537)
ingress Completed: Reply: 0x4449444c0000
debug.print: (+104, 197_539)
debug.print: (+104, 197_537)
ingress Completed: Reply: 0x4449444c0000
debug.print: (+104, 197_539)
debug.print: (+104, 197_537)
ingress Completed: Reply: 0x4449444c0000
ingress Completed: Reply: 0x4449444c0000
2 changes: 1 addition & 1 deletion test/bench/ok/nat16.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: (0, 52_429_611)
debug.print: (0, 52_429_609)
ingress Completed: Reply: 0x4449444c0000
ingress Completed: Reply: 0x4449444c0000
12 changes: 6 additions & 6 deletions test/bench/ok/palindrome.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: (true, +2_928, 21_902)
debug.print: (false, +2_928, 20_901)
debug.print: (false, +2_928, 21_876)
debug.print: (true, +2_184, 19_888)
debug.print: (false, +2_160, 18_325)
debug.print: (false, +2_160, 19_690)
debug.print: (true, +2_928, 21_867)
debug.print: (false, +2_928, 20_866)
debug.print: (false, +2_928, 21_841)
debug.print: (true, +2_184, 19_853)
debug.print: (false, +2_160, 18_290)
debug.print: (false, +2_160, 19_655)
ingress Completed: Reply: 0x4449444c0000
ingress Completed: Reply: 0x4449444c0000
2 changes: 1 addition & 1 deletion test/bench/ok/region-mem.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: {heap_diff = 0; instr_diff = 6_863_831_459}
debug.print: {heap_diff = 0; instr_diff = 6_838_665_633}
ingress Completed: Reply: 0x4449444c0000
ingress Completed: Reply: 0x4449444c0000
2 changes: 1 addition & 1 deletion test/bench/ok/region0-mem.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: {heap_diff = 0; instr_diff = 6_662_504_867}
debug.print: {heap_diff = 0; instr_diff = 6_637_339_041}
ingress Completed: Reply: 0x4449444c0000
ingress Completed: Reply: 0x4449444c0000
2 changes: 1 addition & 1 deletion test/bench/ok/stable-mem.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: {heap_diff = 0; instr_diff = 4_561_158_563}
debug.print: {heap_diff = 0; instr_diff = 4_561_158_561}
ingress Completed: Reply: 0x4449444c0000
ingress Completed: Reply: 0x4449444c0000
12 changes: 6 additions & 6 deletions test/bench/ok/typtbl.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
debug.print: {bias = 1_024; scalar = 16}
debug.print: {cycles = 175_473}
debug.print: {cycles = 175_741}
debug.print: {cycles = 354_173}
debug.print: {cycles = 532_605}
debug.print: {cycles = 711_037}
debug.print: {cycles = 262_475}
debug.print: {cycles = 184_541}
debug.print: {cycles = 184_808}
debug.print: {cycles = 372_712}
debug.print: {cycles = 560_616}
debug.print: {cycles = 748_520}
debug.print: {cycles = 275_132}
ingress Completed: Reply: 0x4449444c0000
6 changes: 3 additions & 3 deletions test/bench/ok/variant-switch.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: {heap_diff = 0; instr_diff = 137_580_319; total = 1_090_000}
debug.print: {heap_diff = 0; instr_diff = 137_580_317; total = 1_090_000}
ingress Completed: Reply: 0x4449444c0000
debug.print: {fib7_eval = 13; fib7_evalFT = 13; fib7_xform = 13; instr_eval = 24_493_446; instr_evalFT = 21_520_346; instr_transform = 1_187_846}
debug.print: {fib7_eval = 13; fib7_evalFT = 13; fib7_xform = 13; instr_eval = 24_373_344; instr_evalFT = 21_400_244; instr_transform = 1_187_844}
ingress Completed: Reply: 0x4449444c0000
debug.print: {acc1 = 20_000; acc2 = 20_000; instr_isWeekend = 10_000_319; instr_isWeekendOr = 11_040_319}
debug.print: {acc1 = 20_000; acc2 = 20_000; instr_isWeekend = 10_000_317; instr_isWeekendOr = 11_040_317}
ingress Completed: Reply: 0x4449444c0000
ingress Completed: Reply: 0x4449444c0000
2 changes: 1 addition & 1 deletion test/run-drun/not-compile.drun
Original file line number Diff line number Diff line change
@@ -1 +1 @@
install $ID not-compile/not-compile.mo ""
install $ID not-compile/not-compile.mo ""