Skip to content

Proof coverage: 45/70 functions matched — two gaps to close #2

@astefano

Description

@astefano

Summary

The Z3 proof certificate pipeline successfully generates proofs for 45 out of 70 verified functions in pmemlog. There are two separate gaps in the pipeline that account for the missing 25 functions.

The numbers

Stage Count Source
Verus total functions 109 Verus compiler output
Verus verified 72 Verus compiler output
results.json entries 48 probe-verus verify (atomized)
Matched to .smt2 45 proofs.py name mapping
.smt2 files produced 93 Verus -V spinoff-all

Gap 1: Verus 72 verified → results.json 48 entries

probe-verus only includes functions that go through its atomize pipeline (call graph analysis via verus-analyzer). Functions that aren't reachable in the call graph or that verus-analyzer can't resolve get filtered out. Known categories of missed functions:

  • Trait default method implementations
  • Certain macro-generated functions
  • Closures and anonymous functions
  • Functions not reachable from the analysis entry points

Impact: 24 verified functions are not in results.json at all, so they can't appear in the proof bundle.

Fix: Improve probe-verus coverage — either by enhancing verus-analyzer symbol resolution or by falling back to Verus's own function list when atomize misses functions.

Gap 2: results.json 48 → matched to .smt2 45

3 functions in results.json couldn't be mapped to any .smt2 file. The mapping logic in proofs.py normalises both:

  • The probe-verus key (e.g., probe:pmemlog/0.1.0/logimpl_v/...#untrusted_append())
  • The Verus internal name from the .smt2 Function-Def comment (e.g., lib::logimpl_v::UntrustedLogImpl::untrusted_append)

Matching fails when:

  • Function names get mangled differently (generics, closures, impl blocks)
  • The module path parsed from the probe key doesn't align with the Verus namespace
  • A function has multiple .smt2 files (spinoff variants) and module context isn't enough to disambiguate

Impact: 3 functions have entries in proofs.json but with z3_formula: null and z3_proof: null.

Fix: Improve build_function_mapping() in proofs.py:

  • Add Levenshtein/fuzzy matching as a fallback
  • Use the full Verus qualified name (not just the leaf) for matching
  • Have Verus emit a canonical function ID in .smt2 comments (upstream)

Important note

All 93 .smt2 files are still produced and available. The proof evidence exists — we just can't automatically associate 25 of the functions with their corresponding .smt2 files yet. This is a mapping/coverage issue, not a data loss issue.

Labels

  • enhancement
  • proof-pipeline

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions