Skip to content

cargo-hax-v0.4.0

Choose a tag to compare

@github-actions github-actions released this 07 Sep 13:00
· 342 commits to main since this release
f8fe693

Changes to the Rust engine:

  • Fix diagnostic reporting

Changes to the OCaml engine:

  • Don't fail when an item carries a hax attribute pointing to an item that
    another backend cfg-ed out. Backend-specific item quotes such as
    #[hax_lib::legacy_lean::before(..)] used to abort extraction to any other
    backend with Could not find item with UID ... (#2026)
  • Drop rustc's internal <cfg_trace>/<cfg_attr_trace> marker attributes, which
    made the engine print Rust code that could not be parsed back (#2026)

Changes to the frontend:

  • Fix all observable issues in the new rust version of the THIR importer
  • Add access to representation information of other types than just enums

Changes to cargo-hax:

  • Manage aeneas and charon versions with cargo hax tools, pinned via a committed hax.toml,
    installed from pre-built binaries verified against a shipped manifest
  • cargo hax into lean generates a complete, buildable Lean package by default (#2142)
  • Publish a pre-built cargo-hax binary per supported platform with every release, so that
    cargo binstall cargo-hax installs it without building
  • Make cargo install cargo-hax build on any recent toolchain, so that the lean backend can be
    installed on its own and pinned per project with cargo-run-bin; the JSON schema exporter the
    OCaml engine's build consumes moved behind the new legacy-engine feature
  • Add proof scenarios: named extraction configurations committed as [scenario.<name>] tables in
    hax.toml, run with the new cargo hax extract [NAME]... subcommand into per-scenario
    proofs/<scenario>/<backend>/ directories
  • Add support for specifications written with anodized:
    #[spec(requires: ..)], #[spec(ensures: ..)] and #[spec(maintains: ..)] now extract as
    pre- and postconditions, on every backend
  • Validate driver reports on cargo's stderr: only haxmeta files of workspace crates under the
    run's target directory are accepted, and a lost or partial report set fails the run instead
    of silently producing an incomplete extraction
  • Exit with a failing status whenever an error was reported
  • Make traits from core with default methods visible to charon so that impls of these traits have the right defaulted implementations (#2172)

Changes to the hax-lib crate:

  • Add hax_lib::ensures_ref, an ensures whose closure takes the result by reference,
    for postconditions over a type that is not Copy
  • Remove dependency to proc_macro_error2 (unmaintained) (#2039)
  • Keep the generics of a struct in scope in the refinement functions generated by
    #[hax_lib::attributes], fixing refinements on fields that mention a const generic (#899)
  • Allow specifications on the methods of an impl block whose signature mentions an associated
    type of Self. The cases that remain unsupported (trait declarations, and associated types the
    block does not define) now fail with an explicit error instead of invalid code (#2089)
  • Support quote annotations (before, after, options) on inherent impl blocks and on their
    items (#1698)
  • Support requires, and ensures written behind a cfg_attr in
    an impl block or a trait annotated with #[hax_lib::attributes], keeping
    the cfg_attr predicate (#1496)
  • Restore the documentation of the proc-macros, which was missing on docs.rs and in builds without
    --cfg hax (#1759)
  • Fix the docs.rs build of hax-lib: its docs.rs metadata table was misspelled, and --cfg hax
    has to reach rustc too so that the cfg(hax) dependencies resolve (#2087)

Changes to core models:

Changes to the F* backend and library:

  • Fix some regressions in the F* proof lib (particularly the vec_deque models)
  • Specify the F* overflowing_add/overflowing_sub primitives, which were left uninterpreted.
    The checked_* integer models route through them, so they could not be used in a proof (#2127)
  • Specify abs_i8/16/32/64/128/isize (previously wholly uninterpreted) with the documented
    wrap-to-MIN result refinement, unblocking proofs about i*::abs and the AVX2
    _mm256_abs_epi32 models (#2107)
  • Fix the overflow condition of the F* mul_overflow primitive, which compared against maxint
    twice. overflowing_mul/checked_mul reported overflow for every product except exactly maxint

Changes to the Lean backend and library:

  • Add Lean/Aeneas as a new backend (#2075, #2071, #2050, #2051). The previous Lean backend is
    now called legacy-lean in the CLI (#2064).
  • Lean library for the new Lean/Aeneas backend (#2080, #2146, #2130)
  • Legacy Lean: Hoist methods to allow (mutual) recursion between methods and associated items of
    the same impl (163)
  • Model Iterator's provided methods, so map/filter/fold/collect/rev and the other
    adapters resolve when a downstream crate is extracted to Lean. Adds DoubleEndedIterator,
    ExactSizeIterator and the Rev, FilterMap, TakeWhile, SkipWhile, MapWhile, Inspect
    and Fuse adapters, makes collect into Vec and Result computable, and gives
    zip/chain std's IntoIterator bound so a collection can be passed directly (#2200)

Miscellaneous:

  • Update the required OCaml version to 5.4.1 (#2137)
  • New testing framework for the engine(s)
  • Four examples for the new Aeneas/Lean backend (#2058, #2059, #2070, #2061)
  • Fix missing tools in the Nix dev shells (#2131)
  • Check examples through just check-examples instead of a Nix flake check (#2131)
  • Document the supported platforms: Linux (x86_64 and aarch64) and macOS (aarch64). Windows
    and macOS on Intel are not supported and are no longer built in CI