Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
1acb208
3 de set. de 2026, 14:50
lopes-lv Sep 3, 2026
67f6a19
10 de set. de 2026, 16:13
lopes-lv Sep 10, 2026
346271f
test: expand FFI stress harness to cover 100% of exported symbols
lopes-lv Sep 15, 2026
a0f494d
15 de set. de 2026, 09:21
lopes-lv Sep 15, 2026
a951802
feat:implementação do M3
lopes-lv Oct 2, 2026
860368c
Fix Rust FFI review findings
Copilot Oct 6, 2026
6c4e6e2
Merge branch 'feature/rust' into feat/update_rust
hbgit Oct 13, 2026
38841ee
ci: fix cargo-audit installation for rust 1.82 and optimize Dockerfile
hbgit Oct 13, 2026
dfcce06
docs: add implementation plan for verifying and resolving PR 2
hbgit Oct 13, 2026
672a84c
Merge pull request #2 from hbgit/feat/update_rust
hbgit Oct 13, 2026
753b4bb
Merge branch 'feature/rust' into feat/M3_paridade
hbgit Oct 13, 2026
d86e5d5
docs: correct panic = "abort" premise dropped by the base
hbgit Oct 13, 2026
0f28571
Merge pull request #3 from hbgit/feat/M3_paridade
hbgit Oct 14, 2026
04e6439
docs: audit Rust plan implementation and track pending work
hbgit Oct 14, 2026
48c6ccf
ci: enforce 80% tarpaulin coverage gate outside ffi*.rs
hbgit Oct 14, 2026
5cabe2d
test: serialize global-state tests and cover state/error helpers
hbgit Oct 14, 2026
f0b1c8c
test: cover memory VCC checkers against the global memtrack state
hbgit Oct 14, 2026
395fbc6
test: cover LibFuzzer nondet generators and iteration entry point
hbgit Oct 14, 2026
bc04579
test: cover remaining overflow, caller, nondet, memtrack and output b…
hbgit Oct 14, 2026
b0e04ad
Merge pull request #30 from hbgit/feat/issue-25-coverage-gate
hbgit Oct 14, 2026
9649c44
ci: version branch protection for feature/rust and master (#26)
hbgit Oct 15, 2026
eecc3c9
docs: note master CI requirement and bypass in branch protection sect…
hbgit Oct 15, 2026
f30f67d
Merge pull request #31 from hbgit/ci/issue-26-branch-protection
hbgit Oct 15, 2026
eeff599
Minor changes
hbgit Oct 15, 2026
cf6b5ae
docs: add plan for issue #27 (remove C-era artifacts)
hbgit Oct 15, 2026
571ae1c
test: add guard against C-era artifacts in tracked files (#27)
hbgit Oct 15, 2026
b1d6abd
chore: remove C-era docs (Doxyfile, UML .xmi, class diagram) (#27)
hbgit Oct 15, 2026
e9386b5
fix: tighten C-era guard and remove run_libfuzzer_test.sh (#27)
hbgit Oct 15, 2026
7908879
Merge pull request #32 from hbgit/chore/issue-27-remove-c-era-docs
hbgit Oct 15, 2026
dabda13
build: expose crate version as MAP2CHECK_VERSION in generated header …
hbgit Oct 15, 2026
8890f02
build: bump crate version to 1.0.0-rc1 (#28)
hbgit Oct 15, 2026
91178f3
docs: add plan for issue #28 (version crate and header as 1.0.0-rc1)
hbgit Oct 15, 2026
86989e7
Merge pull request #33 from hbgit/build/issue-28-version-rc1
hbgit Oct 15, 2026
1167715
test: unit-test init and result-management FFI exports (#29)
hbgit Oct 15, 2026
09b4c3b
test: unit-test nondet and basic-block FFI exports (#29)
hbgit Oct 15, 2026
740b100
test: unit-test memory-tracking FFI exports (#29)
hbgit Oct 15, 2026
db05523
test: unit-test assert and overflow FFI exports (#29)
hbgit Oct 15, 2026
2910f9c
test: unit-test memory-safety check FFI exports (#29)
hbgit Oct 15, 2026
05b44c3
test: cover process-terminating verifier exports via child process (#29)
hbgit Oct 15, 2026
7e3cb98
test: fail when a header export has no Rust test (#29)
hbgit Oct 15, 2026
6e8279e
test: require real calls and cross-check source exports in FFI checkl…
hbgit Oct 15, 2026
09d86ac
docs: add plan for issue #29 (Rust unit tests per FFI export)
hbgit Oct 15, 2026
9600fc0
Merge pull request #34 from hbgit/test/issue-29-ffi-unit-tests
hbgit Oct 15, 2026
79beb93
docs: add plan for issue #5 (compatibility docs and release process)
hbgit Oct 15, 2026
53c5d75
test: share header declaration parser between integration tests (#5)
hbgit Oct 15, 2026
52f1c6b
docs: add symbol/signature compatibility matrix to api-deltas (#5)
hbgit Oct 15, 2026
e5cdbe4
docs: add C integration guide with serializer-checked JSON examples (#5)
hbgit Oct 15, 2026
2378dfa
docs: add CHANGELOG and require a section for the crate version (#5)
hbgit Oct 15, 2026
6bd4c74
docs: add reproducible semantic deltas against the legacy C code (#5)
hbgit Oct 15, 2026
c3b8a7c
build: package release archive with header, libraries and docs (#5)
hbgit Oct 15, 2026
e8dc375
test: pin macro-generated FFI signatures to their hand-written header…
hbgit Oct 15, 2026
acd4eb0
docs: record VLA size unit in SD-12 and fix release notes extraction …
hbgit Oct 15, 2026
b8fd022
docs: link suspected regressions to their issues (#5)
hbgit Oct 15, 2026
bb1c7b0
test: define __map2check_main__ stub in compat_docs for coverage buil…
hbgit Oct 15, 2026
3813dde
Merge pull request #35 from hbgit/docs/issue-5-compat-release
hbgit Oct 15, 2026
346e340
Merge branch 'feature/rust' into develop
hbgit Oct 15, 2026
983042c
ci: make develop the integration branch instead of feature/rust
hbgit Oct 15, 2026
c455a96
docs: add remote branch cleanup and develop-flow migration plan
hbgit Oct 15, 2026
4c1a8b4
Merge pull request #39 from hbgit/ci/develop-as-integration-branch
hbgit Oct 15, 2026
0b1dcbc
ci: rename release branch master to main in CI, protection script and…
hbgit Oct 15, 2026
6fee40d
Merge pull request #40 from hbgit/ci/rename-master-to-main
hbgit Oct 15, 2026
f3d337c
docs: add plan for the Map2Check C runtime cutover to the Rust library
hbgit Oct 15, 2026
28881cf
docs: retarget the cutover plan at Map2Check develop (AFL++ instead o…
hbgit Oct 15, 2026
b8ed2da
docs: map Map2Check pass ABI to the core Rust API and gate it with a …
hbgit Oct 15, 2026
2d13ac2
docs: fix nondet log contract in the cutover plan to match the core API
hbgit Oct 15, 2026
2a0a68f
docs: fix the cutover ABI mapping after review (unsigned binops, widt…
hbgit Oct 15, 2026
62c9b63
docs: record LLVM 16 linkage spike and propose runtime integration ro…
hbgit Oct 16, 2026
482af55
docs: qualify D1 evidence after review (provisional afl criterion, Cm…
hbgit Oct 16, 2026
3f7101f
docs: record maintainer approval of the runtime integration route (D1)
hbgit Oct 16, 2026
bd1d917
build: add unwinding runtime profile and klee feature
hbgit Oct 16, 2026
b024016
fix: reset analysis state on every init and fuzz iteration (#9)
hbgit Oct 16, 2026
4899d73
fix: guard every FFI export, document panic policy and test pre-init …
hbgit Oct 16, 2026
daa3f61
fix: keep the first violation when later checks pass (#36)
hbgit Oct 16, 2026
315e3e3
fix: report an untracked resolved free as invalid (#37)
hbgit Oct 16, 2026
b560946
fix: register a VLA as a static slot sized in elements (#38)
hbgit Oct 16, 2026
1ff0566
fix: validate addresses by the latest alloc/free event (#11)
hbgit Oct 16, 2026
91f82f4
fix: record the release when a resolved free passes (#11, #37)
hbgit Oct 16, 2026
f782db4
fix: honour memcleanup and null-is-valid options in memory checks (#10)
hbgit Oct 16, 2026
9a6dcd1
test: align the C harness with the kept memory options (#10)
hbgit Oct 16, 2026
3e75811
test: expect memtrack then memcleanup at exit in the C API test (#10)
hbgit Oct 16, 2026
a019f33
feat: select analysis mode at runtime and report target reachability
hbgit Oct 16, 2026
854c1e8
fix: validate the analysis mode and match develop's memcleanup verdict
hbgit Oct 16, 2026
95243dc
docs: link a witness-enabling constructor into witness binaries in th…
hbgit Oct 16, 2026
1ed268b
test: capture result files of the develop C runtime as golden files (…
hbgit Oct 16, 2026
e16cb5b
feat: write legacy property, log and witness files consumed by the Ma…
hbgit Oct 16, 2026
a62b464
fix: print no JSON with an analysis mode set and end an unreadable ru…
hbgit Oct 16, 2026
9d955b0
feat: check signed binops at the operation's width and report divisio…
hbgit Oct 16, 2026
6a2b915
feat: track posix_memalign through the void ** it wrote (#13)
hbgit Oct 16, 2026
52b9a25
feat: pass the pointer variable to the free exports so list_log.csv n…
hbgit Oct 16, 2026
0d5b1f6
docs: refresh the symbol matrix after the core binop, posix_memalign …
hbgit Oct 16, 2026
9156b09
feat: log every nondet type the pass emits as develop writes it (#6, …
hbgit Oct 16, 2026
f4e4908
feat: read fuzzer input like develop's AFL++ generator and reject inp…
hbgit Oct 16, 2026
6214215
docs: refresh the symbol matrix after the nondet exports
hbgit Oct 16, 2026
8b9da9f
docs: point the nondet comments at develop's actual source lines
hbgit Oct 16, 2026
8881adc
docs: record the D1 re-measurement; conditions 3 and 4 not met (Task …
hbgit Oct 16, 2026
c1b5be5
chore: commit the D1 re-measurement scripts and raw results (Task 2.5b)
hbgit Oct 16, 2026
6d21e7a
ci: run the harness at -O2 and require -fexceptions for the analysed …
hbgit Oct 16, 2026
670758e
docs: record the maintainer's D1 decision to mitigate in Rust
hbgit Oct 16, 2026
cb95649
fix: compile the shared sources with rustc 1.72 for the KLEE runtime
hbgit Oct 16, 2026
6ed460b
test: add the KLEE paths integration test (#20)
hbgit Oct 16, 2026
22c101c
feat: add KLEE nondet runtime (#20)
hbgit Oct 16, 2026
6d0d35f
ci: build the KLEE runtime bitcode with rustc 1.72.1
hbgit Oct 16, 2026
49eed87
docs: record the KLEE feasibility decision (go) and close D1 conditio…
hbgit Oct 16, 2026
2721a5f
fix: make __VERIFIER_error/__VERIFIER_assert no-ops with a mode set
hbgit Oct 16, 2026
12dbb6f
build: gate the KLEE runtime on intrinsics KLEE 3.1 executes
hbgit Oct 16, 2026
d39f581
docs: document the KLEE exports and the review fixes
hbgit Oct 16, 2026
e265bc2
feat: port the wasm2c runtime to Rust behind the wasm feature
hbgit Oct 16, 2026
e104814
test: require every core_symbol of the ABI mapping in the runtime sta…
hbgit Oct 16, 2026
3ad91d9
docs: document the wasm feature, the wasm exports and SD-19; check wa…
hbgit Oct 16, 2026
34c0a84
build: bump version to 1.1.0-rc1 and document the cutover changes
hbgit Oct 16, 2026
c8b3236
build: bump cbindgen to drop the unsound atty dependency
hbgit Oct 16, 2026
d664e56
build: include the wasm runtime in the KLEE bitcode
hbgit Oct 16, 2026
6b49b82
fix: write the legacy result files atomically through a temp file and…
hbgit Oct 16, 2026
c18ff11
build: drop the repo-wide coverage instrumentation from every build
hbgit Oct 16, 2026
74b6394
perf: check loads without building a hash set per call
hbgit Oct 16, 2026
8073d56
perf: borrow the function name in VccContext
hbgit Oct 16, 2026
843402d
fix: report a NULL malloc block as UNKNOWN before looking at its size
hbgit Oct 16, 2026
44585e8
test: check the huge-malloc abort by its ktest, not by the files othe…
hbgit Oct 16, 2026
e52e6db
docs: record D3 and D4 as approved and set the RSS limit to 1.36
hbgit Oct 17, 2026
6094f27
docs: add SD-20 and SD-21 for the gate's C-bug deltas and record D2 a…
hbgit Oct 17, 2026
ef166d1
perf: stub std's backtrace symbolizer out of the KLEE runtime
hbgit Oct 17, 2026
94a17ec
fix: stop the symbolizer walk only at the backtrace printer's entry
hbgit Oct 17, 2026
511fb6e
docs: record D2 as approved
hbgit Oct 17, 2026
3f4f40b
build: copy the files the tests read into the Docker test stage
hbgit Oct 17, 2026
3429f03
Merge pull request #41 from hbgit/cutover/runtime-rust
hbgit Oct 17, 2026
7c5164b
test: port Map2Check C runtime unit assertions to Rust
hbgit Oct 17, 2026
4e519ca
docs: say the address-status tests observe STATIC through the SD-06 f…
hbgit Oct 17, 2026
41039f6
docs: date 1.1.0-rc1 and list the changes merged after the version bump
hbgit Oct 17, 2026
1225939
Merge pull request #42 from hbgit/cutover/port-c-unit-asserts
hbgit Oct 17, 2026
15d8e9f
Merge pull request #43 from hbgit/release/1.1.0-rc1
hbgit Oct 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .cargo/config.toml

This file was deleted.

1 change: 0 additions & 1 deletion .claude/.headroom_wrap_marker.json

This file was deleted.

26 changes: 0 additions & 26 deletions .claude/.headroom_wrap_owners.json

This file was deleted.

192 changes: 183 additions & 9 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@ name: CI Map2Check Rust

on:
push:
branches: [ "master", "feature/rust" ]
branches: [ "main", "develop", "release/**" ]
pull_request:
branches: [ "master", "feature/rust" ]
branches: [ "main", "develop", "release/**" ]

jobs:
build_and_test:
runs-on: ubuntu-latest


steps:
- name: Baixar o código do repositório
uses: actions/checkout@v4

- name: Instalar Clang e runtime dos sanitizers
run: sudo apt-get update && sudo apt-get install -y clang

- name: Instalar o compilador Rust
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@1.82.0
with:
components: clippy, rustfmt

Expand All @@ -32,15 +33,188 @@ jobs:
- name: Rodar todos os testes
run: cargo test --all-features

# O espelho de wasm_rt_memory_t / wasm_rt_funcref_table_t (feature wasm)
# só é conferido contra o wasm-rt.h do wabt quando WASM_RT_INCLUDE existe.
- name: Conferir o layout de wasm-rt.h (wabt 1.0.41)
run: |
mkdir -p target/wabt-include
curl -fsSL https://raw.githubusercontent.com/WebAssembly/wabt/1.0.41/wasm2c/wasm-rt.h \
-o target/wabt-include/wasm-rt.h
WASM_RT_INCLUDE="$PWD/target/wabt-include" \
cargo test --features wasm --lib layout_matches_wasm_rt_h

- name: Testar script de proteção de branches
run: scripts/test-branch-protection.sh

- name: Testar guard de artefatos da era C
run: scripts/test-check-no-c-era-artifacts.sh

- name: Verificar ausência de artefatos da era C
run: scripts/check-no-c-era-artifacts.sh

- name: Instalar cargo-tarpaulin
uses: taiki-e/install-action@v2
with:
tool: cargo-tarpaulin@0.31.3

- name: Cobertura (cargo-tarpaulin, gate de 80% fora de ffi*.rs)
run: scripts/coverage.sh

- name: Publicar relatório de cobertura
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage/
if-no-files-found: error

# NOTE: a static lib built with this crate's [profile.release] (LTO +
# codegen-units = 1) linked into a clang -fsanitize=address,undefined
# binary has a known, pre-existing intermittent SIGSEGV (~20-25% of
# runs) unrelated to any actual memory-safety bug — confirmed by
# bisection: it reproduces even for the most trivial call sequence
# (map2check_init + get_current_property + map2check_success) and
# disappears entirely (0/40 failures) when the exact same binary is
# built WITHOUT sanitizers. This affects tests/ffi_harness.c too, not
# just the M3 additions below. Root cause is very likely a signal
# handler conflict between Rust's stack-overflow guard and ASan's own
# SIGSEGV handler; fixing it is out of scope here. The retry loop is a
# stopgap so this pre-existing flake doesn't make CI red on unrelated
# PRs — see the retry: a *new* memory-safety bug would fail every
# attempt, not just some.
- name: Compilar e executar harness FFI com ASan e UBSan
run: |
cargo build --release --all-features
clang -fsanitize=address,undefined -fno-omit-frame-pointer \
tests/ffi_harness.c target/release/libmap2check.a \
-ldl -lpthread -lm -o target/ffi_harness
ok=0
for i in 1 2 3 4 5; do
if target/ffi_harness; then ok=1; break; fi
done
[ "$ok" = 1 ]

# The harness rejects inputs with __VERIFIER_assume(0), which unwinds
# through the C frame of its __map2check_main__ (D1 condition 11).
# Optimised builds are where a missing unwind path would show: once
# with -fexceptions, the flag the pipeline must use, and once with
# clang's defaults.
- name: Compilar e executar harness FFI em -O2 (com e sem -fexceptions)
run: |
cargo build --release --all-features
for flags in "-fexceptions" ""; do
clang -O2 $flags -fsanitize=address,undefined -fno-omit-frame-pointer \
tests/ffi_harness.c target/release/libmap2check.a \
-ldl -lpthread -lm -o target/ffi_harness_o2
ok=0
for i in 1 2 3 4 5; do
if target/ffi_harness_o2; then ok=1; break; fi
done
[ "$ok" = 1 ] || { echo "ffi_harness -O2 $flags falhou"; exit 1; }
done

- name: Compilar e executar test/codeAPI_by_caller_test.c (API núcleo)
run: |
cargo build --release
clang -fsanitize=address,undefined -fno-omit-frame-pointer \
test/codeAPI_by_caller_test.c target/release/libmap2check.a \
-ldl -lpthread -lm -o target/codeAPI_test
ok=0
for i in 1 2 3 4 5; do
if target/codeAPI_test; then ok=1; break; fi
done
[ "$ok" = 1 ]

- name: Compilar e executar test/codefuzz_by_caller_test.c (feature libfuzzer)
run: |
cargo build --release --features libfuzzer
clang -fsanitize=address,undefined -fno-omit-frame-pointer \
test/codefuzz_by_caller_test.c target/release/libmap2check.a \
-ldl -lpthread -lm -o target/codefuzz_test
ok=0
for i in 1 2 3 4 5; do
if target/codefuzz_test; then ok=1; break; fi
done
[ "$ok" = 1 ]

- name: Compilar e executar test/codeklee_by_caller_test.c (smoke test, sem KLEE real)
run: |
cargo build --release
clang -fsanitize=address,undefined -fno-omit-frame-pointer \
test/codeklee_by_caller_test.c target/release/libmap2check.a \
-ldl -lpthread -lm -o target/codeklee_test
ok=0
for i in 1 2 3 4 5; do
if target/codeklee_test; then ok=1; break; fi
done
[ "$ok" = 1 ]

- name: Testar empacotamento de release (header, bibliotecas e docs)
run: scripts/test-package-release.sh

- name: Checar segurança de dependências (cargo-deny)
uses: EmbarkStudios/cargo-deny-action@v2
with:
manifest-path: ./Cargo.toml

- name: Auditoria de segurança (cargo-audit)
uses: rustsec/audit-check@v2
- name: Instalar cargo-audit
uses: taiki-e/install-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tool: cargo-audit

- name: Auditoria de segurança (cargo-audit)
run: cargo audit

- name: Build do Dockerfile
run: docker build .
run: docker build .
# Runtime do gerador `symex` (D1, rota A′; docs/klee-feasibility.md): as
# mesmas fontes compiladas por rustc 1.72.1 (LLVM 16) a partir de
# klee/Cargo.toml e do seu Cargo.lock v3, em bitcode que o llvm-link-16 e o
# KLEE 3.1 leem. O clippy em 1.82 do job acima não vê o que o 1.72 não
# compila (`LazyLock`, `unsafe extern`, API de std posterior a 1.72): este
# job é a guarda da condição 5. O KLEE em si não roda aqui (a imagem com o
# KLEE 3.1 é a do Map2Check); tests/klee_paths.sh roda no CI do Map2Check
# (Task 3.4) e localmente com Docker.
klee_runtime:
runs-on: ubuntu-24.04
steps:
- name: Baixar o código do repositório
uses: actions/checkout@v4

- name: Instalar as ferramentas do LLVM 16 (opt, llvm-dis, llvm-nm, llvm-as, lli)
run: sudo apt-get update && sudo apt-get install -y llvm-16

- name: Instalar o rustc 1.72.1 (LLVM 16) com clippy
run: rustup toolchain install 1.72.1 --profile minimal --component clippy

# O clippy em 1.82 do job acima não compila nondet/klee.rs (feature
# `klee` só existe em klee/Cargo.toml); este é o lint dele.
- name: Clippy do build KLEE (rustc 1.72.1, feature klee)
run: RUSTUP_TOOLCHAIN=1.72.1 cargo clippy --locked --manifest-path klee/Cargo.toml --features klee,wasm -- -D warnings

# O script roda os autotestes da troca de intrínsecos antes de usá-la:
# equivalência por lli-16 em tests/klee/lower-intrinsics.ll e recusa
# de tests/klee/unknown-intrinsic.ll; qualquer intrínseco que o KLEE
# 3.1 não execute faz o build falhar. Antes da troca, o simbolizador
# de backtrace do std vira stubs de abort (scripts/klee-stub-symbolizer.py,
# com autoteste em tests/klee/stub-symbolizer.ll), e a guarda final
# falha se algum corpo do simbolizador sobrar.
- name: Compilar o runtime KLEE em bitcode (klee/Cargo.toml, --locked)
run: scripts/build-klee-runtime.sh target/klee/map2check-klee.bc

- name: Verificar que o bitcode existe e é legível pelo llvm-dis-16
run: |
test -s target/klee/map2check-klee.bc
llvm-dis-16 target/klee/map2check-klee.bc -o /dev/null

- name: Checar dependências do lockfile KLEE (cargo-deny)
uses: EmbarkStudios/cargo-deny-action@v2
with:
manifest-path: ./klee/Cargo.toml

- name: Publicar o bitcode do runtime KLEE
uses: actions/upload-artifact@v4
with:
name: map2check-klee-bc
path: target/klee/map2check-klee.bc
if-no-files-found: error
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
build/*
release-library/*

# LLVM bitcode (gerados por llvm-link)
codeklee_by_caller_test.bc
fullprogram_2.bc
libmap2check_klee.bc
libmap2check_libfuzzer.bc
# LLVM bitcode artifacts
*.bc

# Rust / Cargo build artifacts
Expand All @@ -21,3 +17,6 @@ tarpaulin-report.html

# Header C gerado por cbindgen
map2check.h

# Arquivos de release (scripts/package-release.sh)
dist/
Loading
Loading