Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -57,6 +57,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 @@ -76,6 +80,7 @@
, wasm-spec-src
, grace-src
, ocaml-recovery-parser-src
, binaryen-patched
}: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import ./nix/pkgs.nix {
Expand Down Expand Up @@ -111,7 +116,8 @@
export CLANG="${pkgs.clang_19}/bin/clang"
'';

rts = import ./nix/rts.nix { inherit pkgs llvmEnv; };
wasmOpt = binaryen-patched.packages.${system}.default;
rts = import ./nix/rts.nix { inherit pkgs llvmEnv wasmOpt; };

commonBuildInputs = pkgs: with pkgs; [ dune_3 obelisk perl removeReferencesTo ] ++ (with ocamlPackages; [
ocaml
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 @@ -95,6 +95,11 @@ pkgs.stdenv.mkDerivation {

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 --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
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_504_499; size = +25_528}
debug.print: {cycles = 2_504_383; size = +25_528}
ingress Completed: Reply: 0x4449444c0000
debug.print: {cycles = 54_912_188; size = +830_464}
debug.print: {cycles = 54_912_044; 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_115_011; heap_bytes = +33_888}
debug.print: {cycles = 1_114_823; 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_153_792_735)
debug.print: (50_070, +86_221_288, 1_256_407_315)
debug.print: (50_227, +75_320_504, 1_151_398_207)
debug.print: (50_070, +86_221_288, 1_253_408_059)
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_324_057_357)
debug.print: (49_806, +86_432_120, 1_295_845_087)
debug.print: (49_965, +88_051_888, 1_321_855_449)
debug.print: (49_806, +86_432_120, 1_293_744_743)
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 ""
instill $ID not-compile/not-compile.mo ""
Loading