Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: Dockerfile for bv-evaluation scripts #898

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
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
6 changes: 6 additions & 0 deletions bv-evaluation/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
results/
raw-data/
plots/
for-paper/raw-data/
Dockerfile
Makefile
55 changes: 55 additions & 0 deletions bv-evaluation/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Main Lean image
FROM ubuntu:24.04
WORKDIR /code

# Install dependencies
RUN apt-get update -y \
&& DEBIAN_FRONTEND="noninteractive" apt-get install --yes \
tzdata \
pip \
python3-venv \
build-essential \
cmake \
git \
ninja-build \
gdb curl wget \
# dependencies for experiment scripts
python3-matplotlib python3-pandas python3-num2words \
# bitwuzla dependencies
meson libgmp-dev libcadical-dev libsymfpu-dev pkg-config

# Install Lean
RUN curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf > /code/elan.sh \
&& sh /code/elan.sh -y # elan
ENV PATH /root/.elan/bin:$PATH
ENV LIBRARY_PATH /root/.elan/lib:$LIBRARY_PATH

# Install Bitwuzla
RUN git clone https://github.com/bitwuzla/bitwuzla
WORKDIR /code/bitwuzla
RUN ./configure.py && cd build && ninja install

# Install plotting script dependencies

WORKDIR /code/lean-mlir/bv-evaluation/
COPY bv-evaluation/requirements.txt ./
RUN bash -c "\
python3 -m venv venv \
&& source venv/bin/activate \
&& python3 -m pip install -r requirements.txt "

# First, get cached dependencies
WORKDIR /code/lean-mlir
COPY lean-toolchain lakefile.toml lake-manifest.json ./
RUN lake exe cache get!

# Then, copy & build lean-mlir
COPY . .

RUN lake build

# Set the evaluation script directory as working dir
WORKDIR /code/lean-mlir/bv-evaluation

USER root

17 changes: 17 additions & 0 deletions bv-evaluation/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

DOCKER=podman
DOCKER_IMAGE_TAG=opencompl/lean-mlir-bv-evaluate

docker-image:
${DOCKER} build -f Dockerfile ../ -t "${DOCKER_IMAGE_TAG}"

.PHONY:

*.py: .PHONY
./run-script.sh python3 $@

clean:
docker rmi ${DOCKER_IMAGE_TAG}

all:
./run-script.sh ./run-tests.sh
2 changes: 1 addition & 1 deletion bv-evaluation/collect-data-alive.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import re

paper_directory = 'for-paper/'
paper_directory = ''
benchmark_dir = "../SSA/Projects/InstCombine/"
res_dir = "results/AliveSymbolic/"
raw_data_dir = paper_directory + 'raw-data/AliveSymbolic/'
Expand Down
2 changes: 1 addition & 1 deletion bv-evaluation/collect-data-hdel-symbolic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import re

paper_directory = 'for-paper/'
paper_directory = ''
benchmark_dir = "../SSA/Projects/InstCombine/HackersDelight/"
res_dir = "results/HackersDelightSymbolic/"
raw_data_dir = paper_directory + 'raw-data/HackersDelightSymbolic/'
Expand Down
2 changes: 1 addition & 1 deletion bv-evaluation/collect-data-hdel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pandas as pd
import os

paper_directory = 'for-paper/'
paper_directory = ''
benchmark_dir = "../SSA/Projects/InstCombine/HackersDelight/"
res_dir = "results/HackersDelight/"
raw_data_dir = paper_directory + 'raw-data/HackersDelight/'
Expand Down
2 changes: 1 addition & 1 deletion bv-evaluation/collect-data-llvm-symbolic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import re

paper_directory = 'for-paper/'
paper_directory = ''
benchmark_dir = "../SSA/Projects/InstCombine/tests/proofs/"
res_dir = "results/InstCombineSymbolic/"
raw_data_dir = paper_directory + 'raw-data/InstCombineSymbolic/'
Expand Down
2 changes: 1 addition & 1 deletion bv-evaluation/collect-data-llvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pandas as pd
import os

paper_directory = 'for-paper/'
paper_directory = ''
benchmark_dir = "../SSA/Projects/InstCombine/tests/proofs/"
res_dir = "results/InstCombine/"
raw_data_dir = paper_directory + "raw-data/InstCombine/"
Expand Down
22 changes: 22 additions & 0 deletions bv-evaluation/plots/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.PHONY: lint


all :
python3 plot.py all

lint:
ruff format *.py
ruff check *.py

instcombine :
python3 plot.py instcombine

hackersdelight :
python3 plot.py hackersdelight

smtlib :
python3 plot.py smtlib


clean:
rm *.pdf
Binary file removed bv-evaluation/plots/bitwuzla_ch2_1DeMorgan.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed bv-evaluation/plots/llvm-ceg-cumul.pdf
Binary file not shown.
Binary file removed bv-evaluation/plots/llvm-cumul.pdf
Binary file not shown.
Loading
Loading