Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b811f98
test: add regression corpus runner for the Rust runtime cutover
hbgit Oct 15, 2026
58e4f4b
test: derive C runtime property fields from stdout and pass map2check…
hbgit Oct 15, 2026
33b41e8
test: normalise corpus runner tags across C and Rust paths and cover …
hbgit Oct 15, 2026
b3c10cb
test: add C runtime baseline for the Rust runtime cutover
hbgit Oct 16, 2026
d32c614
build: build and install the Rust runtime instead of the C bitcode li…
hbgit Oct 16, 2026
54c49d4
build: stop building the C runtime unit tests
hbgit Oct 16, 2026
393b6a2
feat(pass): add the runtime hook table of map2check-library and its t…
hbgit Oct 16, 2026
2f39843
feat(pass): emit map2check_save_basic_block_log from TrackBasicBlockPass
hbgit Oct 16, 2026
233df8c
feat(pass): emit map2check_is_valid_assert from AssertPass
hbgit Oct 16, 2026
1c7bd53
feat(pass): emit map2check_reach_target from TargetPass
hbgit Oct 16, 2026
a5dbf40
feat(pass): emit __VERIFIER_assume from LoopPredAssumePass
hbgit Oct 16, 2026
c6fdcf9
feat(pass): emit map2check_set_mode before map2check_init in Map2Chec…
hbgit Oct 16, 2026
5c984ec
build(frontend): compile the analysed program to bitcode with -fexcep…
hbgit Oct 16, 2026
29ec102
test(frontend): pin the frontend mode to AnalysisMode mapping
hbgit Oct 16, 2026
1ff67fe
build(frontend): compile the Clam route's program with -fexceptions too
hbgit Oct 16, 2026
c1f4d56
feat(pass): emit the signed binop checkers of map2check-library from …
hbgit Oct 16, 2026
59907e7
feat(pass): log nondet values through map2check_save_nondet_log_<t> f…
hbgit Oct 16, 2026
fcfd4e1
fix(pass): drop nounwind from __VERIFIER_assume in LoopPredAssumePass
hbgit Oct 16, 2026
113734d
feat(pass): emit the memory API of map2check-library from MemoryTrack…
hbgit Oct 16, 2026
072afa6
fix(pass): keep a body for the program's own __VERIFIER_assume
hbgit Oct 16, 2026
06eb370
test(pass): link every instrumented input against libmap2check.a
hbgit Oct 16, 2026
9968a51
fix(pass): free the program's own load of the pointer variable
hbgit Oct 16, 2026
4c3578d
feat(pass): resolve program definitions of library exports before ins…
hbgit Oct 16, 2026
b96b06a
feat: link map2check-library instead of the C bitcode runtime
hbgit Oct 16, 2026
0ab2fbc
test: restore MAP2CHECK_PATH after the KLEE runtime lookup test
hbgit Oct 16, 2026
7cc8ac7
test: add differential gate comparing C and Rust runtime baselines
hbgit Oct 16, 2026
8cf38ce
test: let the corpus runner append EXTRA_FLAGS to the map2check flags
hbgit Oct 16, 2026
20e0572
test: record an OOM kill in the container's cgroup as verdict OOM
hbgit Oct 16, 2026
815e1b5
test: record the first differential gate run of the Rust runtime
hbgit Oct 17, 2026
4f937db
test: approve gate deltas and raise the RSS limit to 1.36 (D4)
hbgit Oct 17, 2026
33e3b00
test: record the criterion 9 profiles of the 18 rows above 1.5 wall
hbgit Oct 17, 2026
c57fef5
test: re-run the Rust symex gate with the slimmed KLEE runtime
hbgit Oct 17, 2026
9f04073
test: cite SD-20 and SD-21 in the accepted deltas
hbgit Oct 17, 2026
db52895
build: link libmap2check_runtime.a from the lib/ of the release archive
hbgit Oct 17, 2026
8e8a023
ci: build and test against the released Rust runtime
hbgit Oct 17, 2026
7f348f7
ci: commit the KLEE bitcode script and suppress a fixture finding
hbgit Oct 17, 2026
0fa359a
test(testcomp): loop_reads.c is COVERED under the Rust runtime
hbgit Oct 17, 2026
d2820f8
fix(invariants): run Clam on bitcode input too
hbgit Oct 17, 2026
c57a4e8
build(docker): pin and verify rustup-init instead of piping sh.rustup.rs
hbgit Oct 17, 2026
58c2b08
fix: correct the loop_reads.c claim and two review minors
hbgit Oct 17, 2026
490a676
docs: document the Rust runtime build variables and the cutover in th…
hbgit Oct 17, 2026
f7f15e3
build: refuse the core libmap2check.a when the runtime build is missing
hbgit Oct 17, 2026
f00d33e
test: record gate 2 for the merge (Rust side on the v1.1.0-rc1 runtime)
hbgit Oct 17, 2026
1f91659
build: check the runtime archive on the MAP2CHECK_RUST_SRC route too
hbgit Oct 17, 2026
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
1 change: 1 addition & 0 deletions .cppcheck-suppressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ unusedFunction:modules/backend/pass/*
unusedFunction:modules/backend/library/*
uninitMemberVar
missingReturn:modules/frontend/counter_example/*
memleakOnRealloc:tests/unit/pass/inputs/memtrack.c
160 changes: 138 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
# Unit tests use -DSKIP_KLEE=ON -DSKIP_AFL_PLUS_PLUS=ON,
# so the full Dockerfile.dev dependencies are not needed.
#
# Runtime: map2check-library (Rust), the pinned release fetched by
# scripts/runtime/fetch-map2check-library.sh into /opt/map2check-library
# (-DMAP2CHECK_RUST_LIB_DIR). The C runtime (modules/backend/library) is out
# of the build and is no longer compiled or analysed here.
#
# Phase 1.5 — OpenSSF Best Practices Badge (Analysis section)
############################################################
name: CI
Expand Down Expand Up @@ -54,13 +59,17 @@ jobs:
sudo tar xzf /tmp/wabt.tar.gz -C /opt
sudo ln -sf /opt/wabt-1.0.41/bin/wasm2c /usr/local/bin/wasm2c

- name: Fetch map2check-library (Rust runtime)
run: sudo bash scripts/runtime/fetch-map2check-library.sh /opt/map2check-library

- name: Configure CMake
run: |
mkdir -p build && cd build
cmake .. -G Ninja \
-DLLVM_DIR=/usr/lib/llvm-16/lib/cmake/llvm \
-DSKIP_AFL_PLUS_PLUS=ON \
-DSKIP_KLEE=ON \
-DMAP2CHECK_RUST_LIB_DIR=/opt/map2check-library/lib \
-DENABLE_TEST=ON
env:
CC: /usr/bin/clang-16
Expand Down Expand Up @@ -99,13 +108,17 @@ jobs:
sudo tar xzf /tmp/wabt.tar.gz -C /opt
sudo ln -sf /opt/wabt-1.0.41/bin/wasm2c /usr/local/bin/wasm2c

- name: Fetch map2check-library (Rust runtime)
run: sudo bash scripts/runtime/fetch-map2check-library.sh /opt/map2check-library

- name: Generate compile_commands.json
run: |
mkdir -p build && cd build
cmake .. -G Ninja \
-DLLVM_DIR=/usr/lib/llvm-16/lib/cmake/llvm \
-DSKIP_AFL_PLUS_PLUS=ON \
-DSKIP_KLEE=ON \
-DMAP2CHECK_RUST_LIB_DIR=/opt/map2check-library/lib \
-DENABLE_TEST=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
env:
Expand All @@ -129,23 +142,6 @@ jobs:
modules/frontend/ \
tests/unit/

- name: Run cppcheck (C backend)
# Blocking since the backend was cleared of all findings
# (migration-schedule item 2.0.12 / OpenSSF static_analysis_fixed)
run: |
cppcheck \
--enable=warning,portability \
--suppress=missingIncludeSystem \
--suppress=unknownMacro \
--suppress=unusedFunction \
--suppressions-list=.cppcheck-suppressions.txt \
--inline-suppr \
--error-exitcode=1 \
--std=c11 \
--language=c \
-I modules/ \
modules/backend/library/

- name: Build (for clang-tidy)
run: cd build && ninja
env:
Expand Down Expand Up @@ -186,13 +182,17 @@ jobs:
sudo tar xzf /tmp/wabt.tar.gz -C /opt
sudo ln -sf /opt/wabt-1.0.41/bin/wasm2c /usr/local/bin/wasm2c

- name: Fetch map2check-library (Rust runtime)
run: sudo bash scripts/runtime/fetch-map2check-library.sh /opt/map2check-library

- name: Configure CMake with Sanitizers
run: |
mkdir -p build && cd build
cmake .. -G Ninja \
-DLLVM_DIR=/usr/lib/llvm-16/lib/cmake/llvm \
-DSKIP_AFL_PLUS_PLUS=ON \
-DSKIP_KLEE=ON \
-DMAP2CHECK_RUST_LIB_DIR=/opt/map2check-library/lib \
-DENABLE_TEST=ON \
-DMAP2CHECK_ENABLE_SANITIZERS=ON
env:
Expand All @@ -214,6 +214,50 @@ jobs:
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
run: cd build && ctest --output-on-failure

# ===========================================================
# Job: KLEE runtime bitcode of map2check-library
# ===========================================================
# The release archive does not ship the symex (KLEE) runtime; it is built
# from the same pinned tag with rustc 1.72.1 (LLVM 16) and handed to the
# Docker jobs below as -DMAP2CHECK_RUST_KLEE_BC. Cached on the script,
# which holds the pin.
klee-runtime:
name: KLEE Runtime Bitcode
runs-on: ubuntu-22.04
timeout-minutes: 30

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Cache the bitcode
id: cache
uses: actions/cache@v4
with:
path: m2c-klee/map2check-klee.bc
key: map2check-klee-bc-${{ hashFiles('scripts/runtime/map2check-klee-bc.sh') }}

- name: Install LLVM 16 tools + rustc 1.72.1
if: steps.cache.outputs.cache-hit != 'true'
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" | sudo tee /etc/apt/sources.list.d/llvm-16.list
sudo apt-get update
sudo apt-get install -y llvm-16
rustup toolchain install 1.72.1 --profile minimal

- name: Build map2check-klee.bc
if: steps.cache.outputs.cache-hit != 'true'
run: bash scripts/runtime/map2check-klee-bc.sh m2c-klee/map2check-klee.bc

- name: Upload the bitcode
uses: actions/upload-artifact@v4
with:
name: map2check-klee-bc
path: m2c-klee/map2check-klee.bc
if-no-files-found: error
retention-days: 7

# ===========================================================
# Job 4: WASM End-to-End Tests (Docker)
# ===========================================================
Expand All @@ -225,7 +269,7 @@ jobs:
name: WASM E2E Tests (Docker)
runs-on: ubuntu-22.04
timeout-minutes: 45
needs: [build-and-test]
needs: [build-and-test, klee-runtime]

steps:
- name: Checkout
Expand All @@ -241,11 +285,26 @@ jobs:
- name: Pull map2check-dev image
run: docker pull ghcr.io/hbgit/map2check-dev:latest

- name: Fetch map2check-library (Rust runtime)
run: sudo bash scripts/runtime/fetch-map2check-library.sh /opt/map2check-library

- name: Download KLEE runtime bitcode
uses: actions/download-artifact@v4
with:
name: map2check-klee-bc
path: ${{ runner.temp }}/m2c-klee

- name: Stage KLEE runtime bitcode
run: |
sudo install -D -m 644 "${{ runner.temp }}/m2c-klee/map2check-klee.bc" \
/opt/map2check-library/klee/map2check-klee.bc

- name: Build + install Map2Check in container
run: |
docker run --rm \
-u root \
-v "${{ github.workspace }}:/workspace" \
-v /opt/map2check-library:/opt/map2check-library:ro \
-w /workspace \
-e CC=/usr/bin/clang-16 \
-e CXX=/usr/bin/clang++-16 \
Expand All @@ -266,6 +325,8 @@ jobs:
mkdir -p build_e2e && cd build_e2e
cmake .. -G Ninja \
-DLLVM_DIR=/usr/lib/llvm-16/lib/cmake/llvm \
-DMAP2CHECK_RUST_LIB_DIR=/opt/map2check-library/lib \
-DMAP2CHECK_RUST_KLEE_BC=/opt/map2check-library/klee/map2check-klee.bc \
-DENABLE_TEST=ON \
-DMAP2CHECK_DYNAMIC_LINK=ON \
-DCMAKE_INSTALL_PREFIX=/workspace/install_e2e
Expand Down Expand Up @@ -310,7 +371,7 @@ jobs:
name: CASTLE Regression
runs-on: ubuntu-22.04
timeout-minutes: 20
needs: [build-and-test]
needs: [build-and-test, klee-runtime]

steps:
- name: Checkout
Expand All @@ -326,11 +387,26 @@ jobs:
- name: Pull map2check-dev image
run: docker pull ghcr.io/hbgit/map2check-dev:latest

- name: Fetch map2check-library (Rust runtime)
run: sudo bash scripts/runtime/fetch-map2check-library.sh /opt/map2check-library

- name: Download KLEE runtime bitcode
uses: actions/download-artifact@v4
with:
name: map2check-klee-bc
path: ${{ runner.temp }}/m2c-klee

- name: Stage KLEE runtime bitcode
run: |
sudo install -D -m 644 "${{ runner.temp }}/m2c-klee/map2check-klee.bc" \
/opt/map2check-library/klee/map2check-klee.bc

- name: Build + install Map2Check in container
run: |
docker run --rm \
-u root \
-v "${{ github.workspace }}:/workspace" \
-v /opt/map2check-library:/opt/map2check-library:ro \
-w /workspace \
-e CC=/usr/bin/clang-16 \
-e CXX=/usr/bin/clang++-16 \
Expand All @@ -339,6 +415,8 @@ jobs:
mkdir -p build_castle_ci && cd build_castle_ci
cmake .. -G Ninja \
-DLLVM_DIR=/usr/lib/llvm-16/lib/cmake/llvm \
-DMAP2CHECK_RUST_LIB_DIR=/opt/map2check-library/lib \
-DMAP2CHECK_RUST_KLEE_BC=/opt/map2check-library/klee/map2check-klee.bc \
-DENABLE_TEST=ON \
-DMAP2CHECK_DYNAMIC_LINK=ON \
-DCMAKE_INSTALL_PREFIX=/workspace/install_castle_ci
Expand Down Expand Up @@ -387,7 +465,7 @@ jobs:
name: Invariants (Clam)
runs-on: ubuntu-22.04
timeout-minutes: 25
needs: [build-and-test]
needs: [build-and-test, klee-runtime]

steps:
- name: Checkout
Expand All @@ -403,11 +481,26 @@ jobs:
- name: Pull map2check-dev image
run: docker pull ghcr.io/hbgit/map2check-dev:latest

- name: Fetch map2check-library (Rust runtime)
run: sudo bash scripts/runtime/fetch-map2check-library.sh /opt/map2check-library

- name: Download KLEE runtime bitcode
uses: actions/download-artifact@v4
with:
name: map2check-klee-bc
path: ${{ runner.temp }}/m2c-klee

- name: Stage KLEE runtime bitcode
run: |
sudo install -D -m 644 "${{ runner.temp }}/m2c-klee/map2check-klee.bc" \
/opt/map2check-library/klee/map2check-klee.bc

- name: Build with -DENABLE_CLAM=ON
run: |
docker run --rm \
-u root \
-v "${{ github.workspace }}:/workspace" \
-v /opt/map2check-library:/opt/map2check-library:ro \
-w /workspace \
-e CC=/usr/bin/clang-16 \
-e CXX=/usr/bin/clang++-16 \
Expand All @@ -416,6 +509,8 @@ jobs:
mkdir -p build_clam_ci && cd build_clam_ci
cmake .. -G Ninja \
-DLLVM_DIR=/usr/lib/llvm-16/lib/cmake/llvm \
-DMAP2CHECK_RUST_LIB_DIR=/opt/map2check-library/lib \
-DMAP2CHECK_RUST_KLEE_BC=/opt/map2check-library/klee/map2check-klee.bc \
-DENABLE_CLAM=ON \
-DMAP2CHECK_DYNAMIC_LINK=ON \
-DCMAKE_INSTALL_PREFIX=/workspace/install_clam_ci
Expand Down Expand Up @@ -452,7 +547,7 @@ jobs:
name: Test-Comp Validation (TestCov)
runs-on: ubuntu-22.04
timeout-minutes: 25
needs: [build-and-test]
needs: [build-and-test, klee-runtime]

steps:
- name: Checkout
Expand All @@ -468,11 +563,26 @@ jobs:
- name: Pull map2check-dev image
run: docker pull ghcr.io/hbgit/map2check-dev:latest

- name: Fetch map2check-library (Rust runtime)
run: sudo bash scripts/runtime/fetch-map2check-library.sh /opt/map2check-library

- name: Download KLEE runtime bitcode
uses: actions/download-artifact@v4
with:
name: map2check-klee-bc
path: ${{ runner.temp }}/m2c-klee

- name: Stage KLEE runtime bitcode
run: |
sudo install -D -m 644 "${{ runner.temp }}/m2c-klee/map2check-klee.bc" \
/opt/map2check-library/klee/map2check-klee.bc

- name: Build + install Map2Check in container
run: |
docker run --rm \
-u root \
-v "${{ github.workspace }}:/workspace" \
-v /opt/map2check-library:/opt/map2check-library:ro \
-w /workspace \
-e CC=/usr/bin/clang-16 \
-e CXX=/usr/bin/clang++-16 \
Expand All @@ -481,6 +591,8 @@ jobs:
mkdir -p build_testcov_ci && cd build_testcov_ci
cmake .. -G Ninja \
-DLLVM_DIR=/usr/lib/llvm-16/lib/cmake/llvm \
-DMAP2CHECK_RUST_LIB_DIR=/opt/map2check-library/lib \
-DMAP2CHECK_RUST_KLEE_BC=/opt/map2check-library/klee/map2check-klee.bc \
-DMAP2CHECK_DYNAMIC_LINK=ON \
-DCMAKE_INSTALL_PREFIX=/workspace/install_testcov_ci
ninja
Expand Down Expand Up @@ -525,7 +637,7 @@ jobs:
valgrind-memcheck:
name: Valgrind Memcheck (ctest)
runs-on: ubuntu-22.04
timeout-minutes: 30
timeout-minutes: 45

steps:
- name: Checkout
Expand All @@ -547,13 +659,17 @@ jobs:
sudo tar xzf /tmp/wabt.tar.gz -C /opt
sudo ln -sf /opt/wabt-1.0.41/bin/wasm2c /usr/local/bin/wasm2c

- name: Fetch map2check-library (Rust runtime)
run: sudo bash scripts/runtime/fetch-map2check-library.sh /opt/map2check-library

- name: Configure CMake (Debug, sem sanitizers)
run: |
mkdir -p build && cd build
cmake .. -G Ninja \
-DLLVM_DIR=/usr/lib/llvm-16/lib/cmake/llvm \
-DSKIP_AFL_PLUS_PLUS=ON \
-DSKIP_KLEE=ON \
-DMAP2CHECK_RUST_LIB_DIR=/opt/map2check-library/lib \
-DENABLE_TEST=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-gdwarf-4" \
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ The format loosely follows [Keep a Changelog](https://keepachangelog.com/en/1.0.

### Changed

- Runtime replaced by map2check-library (Rust). The C runtime of
`modules/backend/library` is no longer built or installed; Map2Check links
map2check-library 1.1.0-rc1 or later (`libmap2check.a`, plus
`map2check-klee.bc` for symex), selected with `MAP2CHECK_RUST_LIB_DIR`,
`MAP2CHECK_RUST_SRC` and `MAP2CHECK_RUST_KLEE_BC` (see the README build
section). The verdict differences from the C runtime are listed in
`tests/cutover/deltas-aceitos.tsv`.
- Replaced LibFuzzer with AFL++ 4.40c (persistent, PCGUARD) as the fuzzing engine.
- tacasv2a: `--slice` no longer crashes KLEE and its test suites stay valid
on the original program. The slicer runs with `-cutoff-diverging=false`
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ endif()

include_directories(${PROJECT_SOURCE_DIR})

# Before the tests: they link the runtime library this module resolves
# (MAP2CHECK_RUST_RUNTIME_LIB).
include(cmake/Map2CheckRustRuntime.cmake)

if(ENABLE_TEST)
# include(CTest) em vez de enable_testing(): gera DartConfiguration.tcl,
# necessário para `ctest -T memcheck` (job Valgrind no CI).
Expand Down
Loading
Loading