epfl-lara/stainless
50.7
Adequate · 6 November 2026
98.1k
lines of production code
Scala
with C
4
measurements over time
What this system is
Features
Add BoundedQuantifiers and Internal proof modules to Stainless library
The Stainless proof library now includes two new modules: BoundedQuantifiers and Internal. BoundedQuantifiers provides utilities for reasoning over bounded integer ranges, including functions for bounded universal and existential quantification (intForall, intExists), elimination rules (elimForall, elimExists), and logical equivalences between negated quantifiers. Internal introduces helper classes for relational and equational reasoning, allowing users to chain proofs and relations using operators like ^^, ==\|, and \|.
frontends/library/stainless/proof · high confidence
Add Coq benchmark suite for Stainless verification
The Coq benchmark frontend now includes a new set of Stainless verification examples (ported from Leon) covering arithmetic, lists, tuples, and pre/post-conditions, providing additional test cases for the Coq code generation pipeline.
frontends/benchmarks/coq · high confidence
Add SAT precondition benchmark cases
Added a new set of Scala benchmark files in the \frontends/benchmarks/sat-precondition\ directory, split into \valid\ and \invalid\ subdirectories. These benchmarks exercise the Stainless verification engine with preconditions that are either satisfiable (valid) or unsatisfiable (invalid), including cases involving basic BigInt constraints and Stainless collection specifications like \forall\ and \contains\.
frontends/benchmarks/sat-precondition · high confidence
Add Stainless utility libraries for random number generation and time tracking
The Stainless library now includes new utility modules for \Random\ and \Timepoint\. The \Random\ object provides methods to generate random booleans, integers, and big integers, integrating with the verification state via a seed mechanism. The \Timepoint\ object allows users to capture the current time and calculate elapsed milliseconds, with underlying implementations mapped to C's \clock()\ function for code generation.
frontends/library/stainless/util · high confidence
Add StdIn and StdOut library components for I/O operations
The Stainless library now includes \StdIn\ and \StdOut\ objects to handle standard input and output. \StdIn\ provides methods like \readInt\, \readBigInt\, and \readBoolean\ to read data from the console, with \readInt\ implemented via a custom parser that mimics C's \scanf("%d")\ behavior for verification purposes. \StdOut\ offers \print\ and \println\ methods for various types (including unsigned integers, strings, bytes, and characters), with specific C code generation directives (\@cCode.function\) ensuring correct formatting (e.g., using \PRIu8\, \PRIi32\) when compiling to C. These components are marked with \@library\ and \@extern\ annotations to facilitate their translation and use in verified programs.
frontends/library/stainless/io · high confidence
Add algebraic structure definitions and proofs to the Stainless library
The \frontends/algebra\ package now includes a comprehensive set of algebraic type classes and their associated verification laws, including \Semigroup\, \Monoid\, \Group\, \AbelianGroup\, \Ring\, \Eq\, \PartialOrder\, \TotalOrder\, and various semilattices. These definitions provide formal specifications for mathematical structures, complete with law annotations (e.g., associativity, commutativity, identity) to support program verification. The update also introduces concrete implementations for common types like \BigInt\ and \Nat\, as well as utility operations such as \foldMap\ for lists and formal proofs demonstrating the equivalence of \foldLeft\ and \foldRight\ operations under monoidal structures.
frontends/algebra · high confidence
Add configuration file support and a new check-files utility
Users can now specify or disable a configuration file (e.g., \stainless.conf\) via the \--config-file\ option, with the tool automatically searching for it in the current directory and parent directories. Additionally, a new \check-files-util\ tool has been added to run verification on specified files or folders, supporting options to ignore specific files and control parallelism, and writing verification results to \.check\ files for integration testing.
repository · high confidence
Add floating-point math library with verified trigonometric functions
The \stainless.math\ package now includes verified implementations of standard floating-point math functions, including \sin\, \cos\, \tan\, \asin\, and \acos\. These functions are backed by the \FdLibm\ object, which provides low-level bit manipulation and kernel algorithms for IEEE 754 double-precision arithmetic. The library also exposes constants for float and double representation details (such as precision, exponent ranges, and bit masks) via \FloatConsts\ and \DoubleConsts\, enabling users to reason about floating-point behavior in their specifications.
frontends/library/stainless/math · high confidence
Add new equivalence benchmarks for regression verification
The equivalence benchmark suite in \frontends/benchmarks/equivalence\ has been expanded with several new test cases to support regression verification. New benchmarks include \addHorn\ (based on the Automating Regression Verification paper), \fizzbuzz\, \adjlist\, \arrayContent\, \arrayHeap\, \arrayIncreasing\, \binSum\ (testing normalization with return type changes), \boardgame\ (testing adjacency bonuses and city settlement validity with multiple candidate implementations), \cloudSculpting\ (testing auxiliary function matching with argument permutation), \dup\ (testing normalization of negative inputs), \factorial\, \fibonacci\, \finiteStreams\, and \foolproof\ (testing function name collision avoidance). Each benchmark consists of a Scala source file defining model and candidate functions, along with a \test\_conf.json\ specifying the expected equivalence outcomes.
frontends/benchmarks/equivalence · high confidence
Added Sphinx Read the Docs theme assets and translations
The documentation build now includes the \sphinx\_rtd\_theme\ package (version 2.0.0) within the project's Sphinx theme directory. This adds the necessary Python setup module, HTML templates (layout, breadcrumbs, footer), and localized message catalogs for multiple languages (Danish, German, English, Spanish, Estonian, Persian, French, Croatian, Hungarian, Italian), ensuring the generated documentation renders with the standard Read the Docs styling and supports internationalization.
core/src/sphinx/themes · high confidence
Added Stainless verification library for collections
New files have been added to the Stainless verification library to provide formal specifications, operations, and lemmas for collection types. This includes a new \CMap\ implementation, conversion utilities between invariant and covariant list representations, and extensive lemma libraries (\ListMapLemmas\, \ListSpecs\, \covcollection.ListSpecs\) proving properties for \List\ and \ListMap\ operations such as indexing, appending, reversing, and map updates.
frontends/library/stainless/collection · high confidence
Added benchmark examples for Stainless full-imperative mode
Added three new Scala benchmark files to the \frontends/benchmarks/full-imperative/valid\ directory to test Stainless verification under the full-imperative flag. \NoAnyHeapRef.scala\ verifies that code works without explicitly mentioning \AnyHeapRef\. \ObjectId.scala\ tests the equivalence of \refEq\ and \objectId\ for \AnyHeapRef\ instances. \TreeImmutSum.scala\ provides a complex example of an immutable tree structure with heap references, including methods for computing sums and validating structure, though it is noted to verify slowly except for the \revealValid\ method.
frontends/benchmarks/full-imperative · high confidence
Added termination benchmark suite for Stainless/Scala
The termination benchmark suite in \frontends/benchmarks/termination/valid\ has been populated with a new set of Scala source files (e.g., Ackermann, Fibonacci, McCarthy91, Viterbi) to exercise the tool's termination analysis. These benchmarks cover various recursive patterns, including higher-order functions, mutual recursion, and explicit measure annotations, providing a broader validation surface for the Stainless frontend's verification capabilities.
frontends/benchmarks/termination/valid · high confidence
Added termination-looping benchmarks for Stainless
Added a suite of new Scala benchmark files in the termination/looping directory (including Inconsistency, Numeric, OddEven, UniversalEquality, WrongFibonacci, and several issue-specific cases like i1271 and i1332) to test the Stainless verifier's handling of non-terminating or looping recursive functions, including mutual recursion, opaque/inlineOnce annotations, and array manipulation patterns.
frontends/benchmarks/termination/looping · high confidence
Expanded imperative benchmark suite with new language feature support
The \frontends/benchmarks/imperative/valid\ directory has been populated with a comprehensive set of new Scala benchmark files that validate the verification of imperative features. These additions cover array operations (including creation, mutation, and nested arrays), control flow with \return\ statements (including early returns in loops and nested functions), state snapshots via the \snapshot\ keyword, and cell swapping. The suite also includes tests for local variable scoping, nested function state mutation, and expression evaluation order, ensuring the frontend correctly handles these imperative constructs.
frontends/benchmarks/imperative/valid · high confidence
Experimental test case generation from counter-examples
Stainless now includes experimental components that automatically generate test cases (Scala or C) based on counter-examples reported during verification. This feature is triggered via the \--batched\ mode and allows users to specify an output file path using \--testgen-file\ (defaulting to \TestCases.scala\) and, for C generation, include headers via \--genc-testgen-includes\.
core/src/main/scala/stainless · high confidence
Initial Snap packaging for Stainless
This change introduces the Snap packaging infrastructure for the Stainless program verifier, enabling installation via the Snap Store. It adds the \snap/snapcraft.yaml\ manifest which configures the build environment (using Java 17, SMT solvers z3 and cvc5, and Scala 3) and defines the \stainless\ application command. Additionally, it includes local wrapper scripts (\snap/local/stainless\ and \snap/local/stainless-cli\) that set up the runtime environment and launch the Stainless JARs.
snap · high confidence
Initial release of SLC verification library with boolean, set, and tactic support
Adds the \slc-lib\ Coq library, providing foundational support for verification tasks. This includes \Booleans.v\ and \PropBool.v\ for reasoning about boolean expressions and propositions (including \propInBool\ conversion and \ifthenelse\ tactics), \Sets.v\ for set operations (union, intersection, difference, subset) with associated rewriting hints, \Ints.v\ for integer comparison lemmas, and \Tactics.v\ which aggregates these into a unified \t\_base\ proof automation strategy.
slc-lib · high confidence
Initial release of the sbt-stainless plugin
Introduces the sbt-stainless plugin, enabling users to integrate Stainless verification into their SBT projects. The plugin adds settings to enable/disable verification, specify extra dependencies and resolvers, and automatically fetches and includes Stainless library sources for analysis. It also includes scripted tests to verify basic verification, ghost code handling, and actor-based concurrency models.
sbt-plugin · high confidence
Initial repository structure and configuration for Stainless
This change establishes the foundational repository structure for the Stainless verification framework. It introduces the Apache 2.0 license, a Contributor License Agreement (CLA), and a contributing guide. The project is configured to use the Inox solver library as a Git submodule and specifies a default configuration file (stainless.conf.default) with Z3 and cvc5 as the default solvers. Additionally, it provides a Dockerfile for containerized builds, a CI shell script for automated testing and benchmarking, and updated documentation in the README.
(repo-wide) · high confidence
Introduce Dotty (Scala 3) extraction frontend
Users can now verify Scala 3 code using the new Dotty frontend. This change adds the \StainlessPlugin\ configuration, a main entry point that bundles the Scala 3 compiler, and core extraction components including AST extractors, a fragment checker for ghost annotation propagation, a ghost access rewriter, and symbol mapping utilities. This enables Stainless to parse and extract verification models from Scala 3 source code.
frontends/dotty/src/main · high confidence
Introduce InoxEncoder and SolverFactory to integrate Inox solver backend
The Stainless verification engine now integrates the Inox solver backend by adding a new \InoxEncoder\ component and a \SolverFactory\ for solver instantiation. The encoder translates Stainless AST nodes (such as arrays, match expressions, and postconditions) into Inox's internal representation, while the factory manages solver selection and applies the encoder as a transformation step. This change enables Stainless to offload verification conditions to the Inox solver infrastructure.
core/src/main/scala/stainless/solvers · high confidence
Introduce Stainless annotation library for verification and code generation
This change adds the \stainless.annotation\ package, providing a comprehensive set of annotations for users to control verification behavior and C code generation. The \annotations.scala\ file introduces verification directives such as \@invariant\, \@pure\, \@extern\, \@dropVCs\, and \@traceInduct\, allowing users to specify invariants, purity, and verification tactics. The \cCode.scala\ object adds specific annotations for the GenC code generator, including \@cCode.function\ for custom C implementations, \@cCode.global\ for global state management, and \@cCode.typedef\ for type mappings. Additionally, \isabelle.scala\ provides annotations for integrating with the Isabelle proof assistant. These annotations are internal (\@ignore\) and do not appear in the final compiled code, serving purely as metadata for the Stainless toolchain.
frontends/library/stainless/annotation · high confidence
Introduce Stainless codegen runtime library
The Stainless codegen runtime library has been added to the core project, providing the standard library of data types and operations required by the code generation evaluator. This includes implementations for algebraic data types (ADT), tuples, and monitors, as well as collections such as Bag, Set, Map, and BigArray. The library also introduces support for arbitrary-precision arithmetic via BigInt and Rational, bitwise operations via BitVector, and utility functions for floating-point, string, and generic value handling.
core/src/main/scala/stainless/codegen/runtime · high confidence
New CI, packaging, and launcher scripts for Stainless
The bin directory now includes a suite of new scripts to streamline development and distribution. For testing, external-tests.sh and bolts-tests.sh automate running the external test suites (including a new --lite mode for faster CI checks), while stainless-actors-tests.sh handles actor verification. For distribution, package-standalone.sh builds and packages standalone artifacts with Z3 and CVC5 for Linux, macOS, and Windows, and docker-release.sh automates Docker image creation and publishing. Additionally, launcher templates (launcher.tmpl.sh, launcher-noscalaz3.tmpl.sh, etc.) and the stainless-cli script provide updated ways to run Stainless, with the CLI now using scala-cli.
bin · high confidence
New CompilationUnit implementation for code generation
The code generation subsystem introduces a new CompilationUnit class that handles the translation of Stainless programs into JVM bytecode. This component manages the mapping of Stainless types and values to JVM-compatible objects, including support for integer literals (Int8-64), floating-point numbers, booleans, strings, big integers, rationals, tuples, ADTs, sets, bags, and maps. It also implements runtime evaluation of expressions via reflection, allowing for the execution of compiled lambdas and handling of dependent types through a context-aware encoding system.
core/src/main/scala/stainless/codegen · high confidence
New Coq-based verification backend and strict arithmetic checks
The verification component now includes a new Coq translation pipeline (CoqEncoder, CoqVerificationChecker) that exports verification conditions to Coq for proof, alongside an AssertionInjector that inserts runtime checks for array bounds, casts, and integer overflow. When strict arithmetic is enabled, the injector verifies that signed and unsigned addition, subtraction, multiplication, and negation do not overflow, and it supports opting out of these checks via the @wrapping annotation.
core/src/main/scala/stainless/verification · high confidence
New Stainless library components for verification contracts, quantifiers, and collections
The stainless.lang library now includes new objects and types to support formal verification: Ensures provides first-class function postconditions (ensures, ensuresOf) for arities up to 4; Quantifiers exposes forall/exists predicates, witness picking, and Bijection/Injection case classes; Set gains map, flatMap, filter, withFilter, toList, and toScala operations with ghost-enforced postconditions; StaticChecks offers ghost-aware ensuring, require, and assert helpers; Real provides a wrapper for BigDecimal arithmetic; and package.scala adds ghost, snapshot, choose, decreases, and partialEval primitives. These additions enable users to write richer verification contracts and use higher-order reasoning constructs in Stainless programs.
frontends/library/stainless/lang · high confidence
New code generation-based evaluator for parameterless functions
Stainless now offers a code generation evaluator as an alternative to the traditional recursive evaluator for checking parameterless functions. This new component compiles function bodies into JVM bytecode using the cafebabe library, allowing for faster evaluation of large or complex expressions by leveraging the JVM's execution capabilities. The system includes function splitting to manage code size and slot limits, and integrates with the existing analysis pipeline to report results. Users can enable this mode via the --codegen flag, providing a potentially more robust and performant verification path for specific workloads.
core/src/main/scala/stainless/evaluators · high confidence
New equivalence checking component for verifying function pairs
Stainless now includes a dedicated equivalence checking component that analyzes pairs of functions to determine if they are equivalent, unequivalent, unsafe, or have unknown safety/equivalence status. This feature introduces new command-line options such as --comparefuns to select specific function pairs, --equivchk-output to specify the JSON report location, and --equivchk-init-weights to customize verification weights. The component integrates into the verification pipeline, extracting and transforming code to generate detailed reports on the relationship between specified functions, including handling of termination measures and counter-examples.
core/src/main/scala/stainless/equivchk · high confidence
New extraction pipeline phases for function inlining and specialization
The extraction pipeline now includes new phases in the \stainless.extraction.inlining\ package to handle function inlining and specialization. \FunctionInlining\ processes \@inline\ and \@inlineOnce\ annotations, inlining function bodies while managing preconditions, postconditions, and synthetic methods. \CallSiteInline\ handles the \stainless.lang.inline\ construct to drop verification conditions for inlined calls. \ChooseEncoder\ transforms \Choose\ expressions into explicit functions with satisfiability assertions. \FunctionSpecialization\ supports the \@template\ and \specialize\ constructs for generating specialized function variants. \UnfoldOpaque\ processes the \unfold\ keyword to add equality assumptions for opaque function calls. These changes modify how Stainless extracts and verifies code involving inlining, specialization, and opaque types.
core/src/main/scala/stainless/extraction/inlining · high confidence
Refactored frontend architecture with new dependency resolution and call graph visualization
The Stainless frontend has been restructured to support a more modular and robust compilation pipeline. A new \DependencyResolver\ component allows users to fetch and use extra source dependencies via the \--extra-deps\ and \--extra-resolvers\ options, enabling verification against external libraries. The frontend now includes a \CallGraphPrinter\ to generate DOT files for visualizing code dependencies, accessible via the \--debug=call-graph\ option. Additionally, the \@keep\ annotation and \--keep\ option have been introduced to prevent the filtering out of specific library symbols during compilation, ensuring that necessary external code is preserved in the verification context.
core/src/main/scala/stainless/frontend · high confidence
Support for @induct annotation and indexed recursive types
The termination extraction phase now supports the @induct annotation, allowing users to specify parameters for automatic induction-based termination proofs on ADTs, integers, and bitvectors. When @induct is applied, the system automatically generates the corresponding decreases clause and transformation logic, ignoring any manually specified decreases clauses for those parameters. Additionally, a new SizedADTExtraction phase handles indexed recursive types (via the indexedAt construct), enabling verification of data structures with size-indexed invariants.
core/src/main/scala/stainless/extraction/termination · high confidence
Support for local (inner) classes in extraction
The extraction phase now handles local classes defined within methods. This change introduces a dependency graph that tracks relationships between functions and local class definitions, including their inherited laws. It adds type operations to correctly compute least upper bounds and greatest lower bounds for local class types, ensuring proper type checking when mixing local and global classes. Additionally, a ghost traverser is implemented to correctly propagate ghostness flags through local class constructors, method invocations, and selectors, while a freshener ensures local variables and class identifiers are uniquely renamed to avoid conflicts during extraction.
core/src/main/scala/stainless/extraction/innerclasses · high confidence
Removals
Removal of SumAndMax verification example
The SumAndMax.scala file, which contained Leon verification examples for list operations such as max, sum, and size, has been removed from the valid directory. This eliminates the specific property proofs and data structures defined in that file from the project's verification suite.
valid · high confidence
Architecture
New OO extraction pipeline with ADT specialization and caching
The object-oriented extraction phase has been restructured into a new pipeline located in core/src/main/scala/stainless/extraction/oo. This introduces an AdtSpecialization phase that transforms eligible classes into Algebraic Data Types (ADTs), including support for case objects, instance-of patterns, and type members. The extraction now relies on a robust DependencyGraph to track relationships between functions, classes, and sorts, and uses ExtractionCaches with precise keys (including descendant dependencies) to optimize repeated extractions. Supporting components include ClassSymbols for symbol management, SymbolOps for pattern matching logic, and TransformerWithType for type-aware transformations.
core/src/main/scala/stainless/extraction/oo · high confidence
Refactor AST into modular Stainless-specific traits
The AST module in core/src/main/scala/stainless/ast has been restructured into a set of new, specialized traits (Constructors, Deconstructors, Graphs, Printers, SymbolIdentifier, SymbolOps, TreeOps, TypeOps, Types) that extend the corresponding base traits from the Inox library. This change introduces Stainless-specific implementations for pattern deconstruction, call and dependency graph collection, pretty-printing (including support for the &&& operator and infix printing), and type unification, while also defining a new SymbolIdentifier class to track symbol provenance.
core/src/main/scala/stainless/ast · high confidence
Refactored method extraction into a modular phase-based pipeline
The method extraction logic in the Stainless compiler has been restructured from a monolithic implementation into a series of distinct, composable extraction phases. This change introduces new components including DependencyGraph for precise call and override analysis, SuperCalls for resolving super-method invocations, Sealing for handling non-sealed abstract classes, MutabilityAnalyzer for tracking mutable state, and specialized transformers for FieldAccessors, Laws, MergeInvariants, SuperInvariants, ValueClasses, and GhostTraverser. For users, this refactoring provides a more robust and maintainable foundation for verifying Scala code, ensuring that complex features like inheritance, mutability, and proof laws are handled through dedicated, well-defined transformation steps rather than ad-hoc logic.
core/src/main/scala/stainless/extraction/methods · high confidence
Refactored termination checking into a modular processor pipeline
The termination checking logic has been restructured from a monolithic implementation into a modular pipeline of specialized processors. The diff introduces distinct components for handling different termination strategies: \ChainProcessor\ for size-change termination, \DecreasesProcessor\ for explicit \decreases\ clauses, \LoopProcessor\ for detecting non-terminating loops, \RecursionProcessor\ for simple self-recursion, and \RelationProcessor\ for analyzing recursive call relations. Supporting infrastructure includes \DatatypeChecker\ for validating datatype positivity, \SizeFunctions\ for computing structural sizes (including bitvector handling), and \OrderingRelation\ traits defining how measures are compared. This change improves the maintainability and extensibility of the termination analysis by separating concerns into focused, testable units within the \stainless.termination\ package.
core/src/main/scala/stainless/termination · high confidence
Behavioural changes
3 commits (1 fix) modifying frontends/benchmarks/unsigned
A change to existing behaviour in frontends/benchmarks/unsigned — 3 commits (1 fix), 4 files: “Verify the GenC benchmarks with --strict-arithmetic and run them with UBSan (\#1825)”; “Replace BitVectors with unsigned opaque types UByte, UShort, UInt, ULong”; “Fix the compiler warnings of the library and of negative literals in benchmarks” (refs \#1825).
frontends/benchmarks/unsigned · medium confidence · unverified
4 commits (0 fixes) modifying frontends/benchmarks/genc/invalid
A change to existing behaviour in frontends/benchmarks/genc/invalid — 4 commits, 7 files: “Reject the function types that GenC cannot print”; “Emit immutable values as const in GenC”; “Report cyclic constant definitions in GenC”; and 1 more.
frontends/benchmarks/genc/invalid · medium confidence · unverified
Added strict arithmetic benchmarks for overflow, narrowing, and floating-point conversions
The strictarithmetic benchmark suite now includes comprehensive test cases for strict arithmetic behavior, covering integer overflow/underflow, bit-vector narrowing, signed/unsigned conversions, and floating-point to integer casts. Valid examples demonstrate safe operations with range guards, while invalid examples verify that the frontend rejects unsafe conversions (e.g., BigInt to Int out of range) and overflow-prone operations. The suite also introduces support for the \wrapping\ block and \@wrapping\ annotation to opt-out of overflow checks, including specific tests for floating-point NaN handling and casting within wrapping contexts. Also in this area: 7 commits (1 fix) modifying frontends.
frontends/benchmarks/strictarithmetic/invalid, frontends/benchmarks/strictarithmetic/valid · medium confidence
Documentation build system moved to core/src/sphinx
The Sphinx documentation build infrastructure has been relocated into the core project under \core/src/sphinx\. This change introduces a dedicated \Makefile\ for generating HTML, PDF, and other documentation formats, along with a \conf.py\ configuration file that sets the project version to 0.9.1 and applies the \sphinx\_rtd\_theme\ for the HTML output. A \.gitignore\ file is also added to exclude the \\_build\ directory from version control.
core/src/sphinx · high confidence
Exception lifting transforms throw expressions into assertions
The extraction pipeline now includes an ExceptionLifting phase that converts throw expressions into assertions. Specifically, a \throw\ statement is transformed into an \assert(false)\ with a message indicating the code is unreachable, effectively removing runtime exception handling from the extracted imperative code while preserving verification properties.
core/src/main/scala/stainless/extraction/throwing · high confidence
GenC C code generation pipeline restructured and ported
The GenC component has been reorganized into a modular pipeline architecture, introducing new phases such as GhostElimination, StructInlining, and TailRecElimination to improve the quality of generated C code. A new C file output phase now correctly separates header and implementation files, while an analysis layer provides detailed reporting on extraction and compilation performance. These changes enhance the reliability and debuggability of the C code generation process for users.
core/src/main/scala/stainless/genc · high confidence
GenC IR refactoring and tail-recursion elimination
The GenC code generation pipeline now includes a new intermediate representation layer with dedicated transformation phases. A new Normaliser ensures correct execution order between Scala and C by flattening block expressions and handling short-circuiting logic. Tail-recursive functions are now optimized into labeled goto loops, eliminating the risk of stack overflow and removing redundant while-loops. Additionally, a StructInliner removes single-field structs to simplify the generated C code, and a ClassLifter properly handles class hierarchies for tagged unions.
core/src/main/scala/stainless/genc/ir · high confidence
GenC compiler pipeline restructured with new intermediate phases
The GenC code generation pipeline has been reorganized into a series of distinct intermediate phases to improve modularity and correctness. New phases include \ArraysLengthsExtraction\ to extract array lengths from class invariants, \ComputeFunCtxPhase\ to determine function contexts, \LiftingPhase\ to handle class types for tagged unions, \NormalisationPhase\ for expression simplification, \ReferencingPhase\ to manage variable references, \StructInliningPhase\ to optimize single-member structs, and \TailRecElimPhase\ to convert tail-recursive functions to loops. The \TrimSymbols\ phase has been updated to more accurately track dependencies for exported functions, and \IR2CPhase\ now handles the final translation to C with improved handling of fixed arrays and deterministic output ordering.
core/src/main/scala/stainless/genc/phases · high confidence
Imperative extraction phase introduces ghost checking, heap state tracking, and mutable map support
The imperative extraction pipeline now enforces strict ghost-flow rules, preventing non-ghost code from accessing or modifying ghost state and ensuring ghost variables are only assigned ghost expressions. It adds a user-facing Heap type with operations like \Heap.get\, \Heap.unchanged\, and \Heap.eval\ to reason about heap state, and introduces support for mutable maps (including \MutableMapType\, \MutableMapWithDefault\, \MutableMapApply\, \MutableMapUpdated\, and \MutableMapDuplicate\) which are cleaned up into standard map types during extraction. Additionally, the phase now supports array swap operations (\Swap\, \CellSwap\), allows \old(...)\ expressions only in postconditions, and improves mutability analysis for types and classes.
core/src/main/scala/stainless/extraction/imperative · high confidence
New extraction caching and pipeline infrastructure
The extraction subsystem now uses a new caching mechanism based on explicit dependency tracking and a structured pipeline. Cache keys are generated from the structural content of functions and sorts (including IDs, type arguments, parameters, return types, bodies, and flags) rather than object identity, ensuring that caches are correctly invalidated when underlying definitions change. The extraction process is now organized into a composable pipeline with support for summary data collection, allowing for better debugging and performance monitoring of the transformation steps.
core/src/main/scala/stainless/extraction · high confidence
New extraction pipeline phases for partial functions and tree sanitization
The extraction pipeline now includes a new \PartialFunctions\ phase that transforms \PartialFunction.apply\ calls into explicit class constructors with inferred preconditions, and a \TreeSanitizer\ trait that validates the extracted tree structure. The sanitizer enforces several rules: setters can only be overridden by other setters, ghostness must be preserved during method overriding, sealed abstract classes must have children, and specifications like \require\, \decreases\, and \ensuring\ must appear in valid positions within function bodies.
core/src/main/scala/stainless/extraction/xlang · high confidence
New extraction utility infrastructure for caching, debugging, and synthetic types
This change introduces several new utility components in the extraction pipeline: a thread-safe ConcurrentCache implementation to support safer concurrent caching; a PositionChecker trait and traverser that detects and reports missing source positions for functions, expressions, and types (accessible via the --debug=positions flag); a NamedPipeline wrapper that integrates debug output for AST trees and sizes (via --debug-objects and --debug-phases) and ensures well-formedness after each phase; and SyntheticSorts, which provides cache-friendly synthetic definitions for Option (including isEmpty and get) and ControlFlow (Return/Proceed) sorts and functions when the standard library definitions are not present.
core/src/main/scala/stainless/extraction/utils · high confidence
Refactored Stainless transformer infrastructure with new traverser and simplifier components
The transformer subsystem in core/src/main/scala/stainless/transformers has been restructured to improve code organization and pattern-matching handling. A new GhostTraverser trait was introduced to correctly propagate ghost context during AST traversal, ensuring that ghost flags on variables, annotations, and function invocations are respected. The core Transformer and Traverser traits were updated to explicitly handle MatchExpr and Passes nodes, as well as pattern deconstruction, allowing for more precise transformation of pattern-matching logic. Simplification capabilities were enhanced with the addition of LatticesSimplifier (wrapping OCBSL, OL, and Bland algorithms with thread-local state), SimplifierWithSolver (integrating timeout-bound solver calls for path condition reasoning), and SimplifierWithPC (handling path-condition-aware simplification of asserts, requires, and match expressions). The PartialEvaluator was refactored to include productivity checks and unfolding step limits, while TransformerWithPC was updated to correctly manage path conditions through requires, ensures, and match cases. These changes collectively provide a more robust and modular foundation for program transformations, particularly for pattern matching and purity analysis.
core/src/main/scala/stainless/transformers · high confidence
Refactored inner function extraction with new data structures and traversal logic
The inner function extraction module has been restructured to improve how local functions are handled during verification. A new \LocalFunDef\ case class and a unified \FunAbstraction\ trait now provide a consistent interface for both outer and inner function definitions, simplifying transformations that treat them similarly. The \FunctionClosure\ phase has been updated to better manage captured variables and path conditions, ensuring that free variables are correctly ordered and substituted when hoisting inner functions. Additionally, a new \GhostTraverser\ trait has been introduced to properly handle ghost code within local function definitions, ensuring that ghost flags are respected during traversal. These changes collectively enhance the robustness and clarity of the inner function extraction pipeline.
core/src/main/scala/stainless/extraction/innerfuns · high confidence
Refactored verification utilities and added new utility components
The Stainless verification engine now includes a suite of new utility components in the utils package to support advanced verification features and improved internal organization. A new CheckFilter component enables precise function filtering for verification, supporting wildcard patterns in the --functions option to target specific code paths. Cache management has been restructured with a new Caches module that introduces a --cache-dir option (defaulting to .stainless-cache/) and supports both hash-based and binary cache formats. Serialization capabilities have been significantly expanded via new StainlessSerializer and XLangSerializer classes, adding support for a wide range of AST nodes including refinement patterns, imperative constructs (blocks, while loops, mutable maps), inner classes, and various flags. Counter-example handling is improved with a new CtexRemapping utility that remaps counter-examples back to their originating functions. Additional utilities include a FileWatcher for manual file watching in watch mode, a DependenciesFinder for computing symbol dependencies, and a LibraryFilter for managing library flag propagation in class hierarchies.
core/src/main/scala/stainless/utils · high confidence
Test coverage
2 commits adding/updating tests in frontends/dotty/src/test; Add Dotty-specific benchmark suite for Scala 3 features; Added actor verification tests for ghost elimination; Added benchmark configurations and test cases for ADT failure and refinement pattern matching; Added benchmark files for refinement type validation; Added benchmark fixtures for filtering while loops and inner functions; Added example demonstrating ADT invariant enforcement in Scala 3; Added invalid benchmark suite for imperative Scala features; Added invalid refinement benchmark cases; Added termination benchmarks for false-invalid and unchecked-invalid cases; Added tests for the CodeGenEvaluator; Added verification benchmarks for invalid specifications and edge cases; Expanded extraction benchmark suite for Stainless; Expanded invalid extraction benchmarks for Stainless; Expanded refinement type validation benchmarks; GenC benchmark suite expanded with new test cases and golden-file verification; New Scala 3 integration test infrastructure for the Dotty frontend.
Dependencies
Upgrade to Scala 3.10.1 and update build dependencies
The Stainless compiler and library are now built against Scala 3.10.1-RC1 (nightly build from 2026-09-03). The build configuration also updates several dependencies, including circe to version 0.14.1, scala-parallel-collections to 1.0.3, and scalatest to 3.2.9, while configuring exclusion rules to prevent conflicts with upstream Scala 3 libraries in the assembled JARs.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 51 → 51 (-0.4)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 48 → 50 (+1.3)
- Architecture 93 → 91 (-1.3)
- Maturity 52 → 51 (-0.7)
- Readiness 55 → 54 (-1.0)
- Security 68 → 56 (-11.7)
- Accessibility 47 → 47 (+0.0)
- Performance 100 → 100 (+0.0)
Resolved (128)
- Concentrated knowledge decay
- Documentation: no installation or build instructions (README.md)
- Duplicated block (5–6 lines × 2) (frontends/dotty/src/main/scala/stainless/frontends/dotc/CodeExtraction.scala)
- Duplicated block (9 lines × 2) (core/src/main/scala/stainless/extraction/imperative/GhostChecker.scala)
- FileTooLong: math/BitVectors.scala (frontends/library/stainless/math/BitVectors.scala)
- High IaC: WD-DOCKER-0013 (Dockerfile)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Members sharing a duplicated core (12 members, 50+ identical tokens) (core/src/main/scala/stainless/ast/Deconstructors.scala)
- Most significant orphaned file (core/src/main/scala/stainless/equivchk/EquivalenceChecker.scala)
- Most significant orphaned file (core/src/main/scala/stainless/extraction/imperative/EffectElaboration.scala)
- Most significant orphaned file (frontends/library/stainless/math/BitVectors.scala)
- Off-boarding risk: anonymized user #1
- Off-boarding risk: anonymized user #2
- …and 108 more
New (23)
- CPrinter.pp (cyclomatic 34) (core/src/main/scala/stainless/genc/CPrinter.scala)
- CustomPrinter.ppBody (cyclomatic 17) (core/src/main/scala/stainless/testgen/ScalaTestGen.scala)
- Dependency hygiene PARTLY measured — sbt declarations read, dependency currency not (Maven Central unreachable)
- Further orphaned files (smaller)
- High: security finding (details withheld)
- Hotspot: core/src/main/scala/stainless/genc/CPrinter.scala (core/src/main/scala/stainless/genc/CPrinter.scala)
- Hotspot: core/src/main/scala/stainless/genc/phases/IR2CPhase.scala (core/src/main/scala/stainless/genc/phases/IR2CPhase.scala)
- Hotspot: core/src/main/scala/stainless/genc/phases/Scala2IRPhase.scala (core/src/main/scala/stainless/genc/phases/Scala2IRPhase.scala)
- Hotspot: core/src/main/scala/stainless/verification/AssertionInjector.scala (core/src/main/scala/stainless/verification/AssertionInjector.scala)
- IR2CImpl.checkGlobalInit (cognitive 17) (core/src/main/scala/stainless/genc/phases/IR2CPhase.scala)
- IR2CImpl.checkGlobalInit (cyclomatic 19) (core/src/main/scala/stainless/genc/phases/IR2CPhase.scala)
- Members sharing a duplicated core (12 members, 50+ identical tokens) (core/src/main/scala/stainless/ast/Deconstructors.scala)
- Off-boarding risk: anonymized user #3
- Off-boarding risk: anonymized user #1
- Off-boarding risk: anonymized user #2
- Orphaned knowledge (core/src/main/scala/stainless/equivchk/EquivalenceChecker.scala)
- Orphaned knowledge (core/src/main/scala/stainless/equivchk/EquivalenceCheckingComponent.scala)
- Orphaned knowledge (core/src/main/scala/stainless/extraction/imperative/EffectElaboration.scala)
- Orphaned knowledge (core/src/main/scala/stainless/extraction/imperative/ReturnElimination.scala)
- Orphaned knowledge (core/src/main/scala/stainless/extraction/innerclasses/InnerClasses.scala)
- …and 3 more
Changes since last survey
- 86 commits — 80 feature/other, 6 fixes
By area
- frontends/benchmarks — 34 commits
- core/src — 16 commits
- (root) — 12 commits
- .github/workflows — 11 commits
- frontends/dotty — 7 commits
- sbt-plugin/src — 3 commits
- frontends/library — 2 commits
- bin/package-standalone.sh — 1 commit
Notable commits
- fix: Fix --debug=sizes for GenC programs
- fix: Fix bigIntToBV literal extraction for unsigned bitvectors
- fix: Fix the compiler warnings of core and of the dotty frontend
- fix: Fix the compiler warnings of the library and of negative literals in benchmarks
- fix: Fix the unsigned value of negative bytes in ImageProcessing.at
- fix: Fix the warnings of the sbt plugin tests
- change: Accept every registered phase name in --debug-phases
- change: Accept field selections as match scrutinees in GenC
- change: Accept programs rejected by Stainless in GenC invalid tests
- change: Add GenC benchmark for BigInt literals converted to bitvectors
- change: Add an update mode for the expected files of the integration tests (#1837)
- change: Add four end-to-end GenC benchmarks with golden C and output checks
- change: Apply the VC filter inside regions that drop VCs
- change: Build the Docker image from the dotty standalone release on Java 17
- change: Bump Inox to the SMT-LIB floating point min and max
- change: Bump cafebabe to drop its feature warnings
- change: CI: cancel superseded pull request runs (#1839)
- change: Check multiplication overflow on twice the bit width
- change: Check the VCs of the integration tests in parallel in the CI
- change: Check the bodies of anonymous classes in the fragment checker
- …and 66 more
Architecture
- Unchanged — 0 containers · 3 contexts · 2 edges
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
epfl-lara/stainless was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 585c45e6b5bd46b7b52d89a91f904479f444e8e5 — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-60d1b390edf0.