Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nicer benchmarks 2 #23

Merged
merged 3 commits into from
Jun 29, 2024
Merged
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
15 changes: 9 additions & 6 deletions .github/workflows/build-and-profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,17 @@ jobs:
- name: 'Build Minuska'
run: nix build -L '.#minuska' --out-link ./result-minuska

- name: 'Build Coq examples'
run: nix build -L '.#examples-coq'
- name: 'Run standalone benchmarks'
run: nix develop -L '.#bench-standalone' --command ./bench-standalone/test.sh

- name: 'Run standalone examples'
run: nix develop -L '.#examples-standalone' --command ./examples-standalone/test.sh
- name: 'Run hybrid benchmarks'
run: nix develop -L '.#bench-hybrid' --command ./bench-hybrid/test.sh

- name: 'Run hybrid examples'
run: nix develop -L '.#examples-hybrid' --command ./examples-hybrid/test.sh
- name: 'Run Coq benchmarks'
run: nix develop -L '.#bench-coq' --command ./bench-coq/build-and-profile.sh

- name: 'Build old Coq examples'
run: nix build -L '.#old-examples-coq'

- name: 'Build Docker image'
run: nix build -L '.#minuska-docker' --out-link ./result-minuska-docker
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions bench-hybrid/tc-ast/tc10.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(@builtin-int 10)
1 change: 1 addition & 0 deletions bench-hybrid/tc-ast/tc100.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(@builtin-int 100)
1 change: 1 addition & 0 deletions bench-hybrid/tc-ast/tc20.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(@builtin-int 20)
1 change: 1 addition & 0 deletions bench-hybrid/tc-ast/tc50.ast
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(@builtin-int 50)
18 changes: 18 additions & 0 deletions bench-hybrid/test-tc/testTC10.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
From Minuska Require
interp_loop
.
From Test Require
twocounters
tc10
.

Import String.
Import Ascii.

Time Compute (let steps := 10000 in
@interp_loop.interp_loop
default_everything.DSM
twocounters.lang_interpreter
steps
tc10.given_groundterm
).
18 changes: 18 additions & 0 deletions bench-hybrid/test-tc/testTC100.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
From Minuska Require
interp_loop
.
From Test Require
twocounters
tc100
.

Import String.
Import Ascii.

Time Compute (let steps := 10000 in
@interp_loop.interp_loop
default_everything.DSM
twocounters.lang_interpreter
steps
tc100.given_groundterm
).
18 changes: 18 additions & 0 deletions bench-hybrid/test-tc/testTC20.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
From Minuska Require
interp_loop
.
From Test Require
twocounters
tc20
.

Import String.
Import Ascii.

Time Compute (let steps := 10000 in
@interp_loop.interp_loop
default_everything.DSM
twocounters.lang_interpreter
steps
tc20.given_groundterm
).
18 changes: 18 additions & 0 deletions bench-hybrid/test-tc/testTC50.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
From Minuska Require
interp_loop
.
From Test Require
twocounters
tc50
.

Import String.
Import Ascii.

Time Compute (let steps := 10000 in
@interp_loop.interp_loop
default_everything.DSM
twocounters.lang_interpreter
steps
tc50.given_groundterm
).
24 changes: 20 additions & 4 deletions examples-hybrid/test.sh → bench-hybrid/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ pushd "$SCRIPT_DIR" > /dev/null

TIME=$(which time)

LOGFILEOUT="./log-stdout.txt"
LOGFILEERR="./log-stderr.txt"
if [[ -n "$VERBOSE" ]]; then
LOGFILEOUT=/dev/stdout
LOGFILEERR=/dev/stderr
fi


testInCoq() {
rm -rf coqfiles
Expand All @@ -23,19 +30,28 @@ testInCoq() {
minuska gt2coq ./imp-ast/count-5.imp coqfiles/count5.v
minuska gt2coq ./imp-ast/count-6.imp coqfiles/count6.v
minuska gt2coq ./imp-ast/count-7.imp coqfiles/count7.v
minuska def2coq ./languages/two-counters/two-counters.m coqfiles/twocounters.v
minuska gt2coq ./tc-ast/tc10.ast coqfiles/tc10.v
minuska gt2coq ./tc-ast/tc20.ast coqfiles/tc20.v
minuska gt2coq ./tc-ast/tc50.ast coqfiles/tc50.v
minuska gt2coq ./tc-ast/tc100.ast coqfiles/tc100.v




echo "Compiling *.v files"
pushd coqfiles > /dev/null
for vfile in *.v; do
echo "Compiling $vfile" > /dev/null
coqc -R . Test "$vfile" > /dev/null 2>/dev/null
echo "Compiling $vfile" > "$LOGFILEOUT"
coqc -R . Test "$vfile" > "$LOGFILEOUT" 2>"$LOGFILEERR"
done
popd > /dev/null
cp test-imp/testCount*.v ./coqfiles/
cp test-tc/testTC*.v ./coqfiles/
pushd coqfiles > /dev/null
for testvfile in testCount*.v; do
for testvfile in test*.v; do
echo "coqc $testvfile"
"$TIME" --output "$testvfile.time" --format "%e" coqc -R . Test "$testvfile" 2> /dev/null | grep 'Finished transaction'
"$TIME" --output "$testvfile.time" --format "%e" coqc -R . Test "$testvfile" 2> "$LOGFILEERR" | grep 'Finished transaction'
cat "$testvfile.time"
done
popd > /dev/null
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 20 additions & 20 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@
in {
packages.minuska = minuskaFun { coqPackages = pkgs.coqPackages_8_19; } ;

packages.examples-coq
packages.old-examples-coq
= pkgs.coqPackages_8_19.callPackage
( { coq, stdenv }:
stdenv.mkDerivation {
name = "examples-coq";
src = ./examples-coq;
name = "old-examples-coq";
src = ./old-examples-coq;

propagatedBuildInputs = [
self.outputs.packages.${system}.minuska
Expand All @@ -121,10 +121,10 @@
} ) { } ;


packages.examples-standalone
packages.bench-standalone
= pkgs.stdenv.mkDerivation {
name = "examples-standalone";
src = ./examples-standalone;
name = "bench-standalone";
src = ./bench-standalone;
nativeBuildInputs = [
self.outputs.packages.${system}.minuska
pkgs.time
Expand All @@ -142,28 +142,28 @@
#];
};

packages.examples-hybrid
packages.bench-hybrid
= pkgs.stdenv.mkDerivation {
name = "examples-hybrid";
src = ./examples-hybrid;
name = "bench-hybrid";
src = ./bench-hybrid;
nativeBuildInputs = [
self.outputs.packages.${system}.minuska
pkgs.time
] ++ [self.outputs.packages.${system}.minuska.coqPackages.coq]
++ self.outputs.packages.${system}.minuska.coqLibraries ;
};

packages.minuska-bench
packages.bench-coq
= pkgs.coqPackages_8_19.callPackage
( { coq, stdenv }:
stdenv.mkDerivation {
name = "minuska-bench";
src = ./minuska-bench;
name = "bench-coq";
src = ./bench-coq;

propagatedBuildInputs = [
pkgs.time
pkgs.python312
self.outputs.packages.${system}.examples-coq
self.outputs.packages.${system}.old-examples-coq
#self.outputs.packages.${system}.examples-coq.coqPackages.coq
];
enableParallelBuilding = true;
Expand Down Expand Up @@ -219,23 +219,23 @@
];
};

examples-standalone =
bench-standalone =
let
examples-standalone = self.outputs.packages.${system}.examples-standalone;
bench-standalone = self.outputs.packages.${system}.bench-standalone;
in
pkgs.mkShell {
inputsFrom = [examples-standalone];
inputsFrom = [bench-standalone];
packages = [];
};

minuska-bench =
bench-coq =
let
minuska-bench = self.outputs.packages.${system}.minuska-bench;
bench-coq = self.outputs.packages.${system}.bench-coq;
in
pkgs.mkShell {
inputsFrom = [minuska-bench];
inputsFrom = [bench-coq];
packages = [
minuska-bench.coqPackages.coq-lsp
bench-coq.coqPackages.coq-lsp
#benchexec
];
};
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading