Isabelle as Systems Platform: Managing Automated and Quasi-interactive Builds

Fabian Huch · 2024

Read Isabelle as Systems Platform: Managing Automated and Quasi-interactive Builds by Fabian Huch (2024) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2412-13083.txt.

Introduction

Fabian Huch, writing alone in 2024, presented a new build manager for the Isabelle theorem prover platform. Interactive provers are complex systems that need strong tooling to run well. Isabelle has a proven Scala-based systems environment, yet much of its project infrastructure leaned on outside tools.

For continuous integration the project used a Jenkins server, which handled user-submitted builds poorly and suffered weak reliability and speed. The new manager replaces that system and is written fully inside Isabelle's own environment. Huch shows how its modules supported every part of the manager. The work presents the prover platform as a systems platform in its own right, able to run its own build farm.

Catalog record

CREATORFabian Huch
YEAR2024
COLLECTIONPAPERS
FORMATTXT
FILE SIZE16 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2412-13083

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Isabelle as Systems Platform: Managing Automated and Quasi-interactive Builds Fabian Huch Abstract Interactive theorem provers are complex systems that require sophisticated platform efforts – and hence systems programming environments – to manage effectively. The Isabelle platform exemplifies this with its Isabelle/Scala systems programming environment, which has proven to be very successful. In contrast, much of the project infrastructure has relied on external tooling in the past, despite shortcomings. For continuous integration, the previous system employed a Jenkins server, which did not adequately support user-submitted Isabelle builds and faced issues with reliability and performance. In this work, we present our design and implementation of a new Isabelle build manager that replaces the old continuous integration system, fully implemented within Isabelle/Scala. We illustrate how our implementation utilizes different modules of the environment, which supported all aspects of the build manager well. 1 Introduction Interactive theorem provers are no longer simple inference engines, but rather involved systems aimed to support all facets of mathematics. This has led to the highly sophisticated prover platforms we have today. To build the Isabelle platform, Isabelle/Scala has emerged as a capable environment for systems programming after being introduced from 2008 1 1 1 in Isabelle/606850a6fc1a to 2010 [ 3 ] . At the time of writing, it consists of 331 modules with \approx 63\,000 lines of code that take up 3.3\text{\,}\mathrm{MiB} ( 656\text{\,}\mathrm{KiB} compressed). By providing access to external tools and the operating system uniformly across platforms, it serves as operating system abstraction, supporting Isabelle-specific technology, databases, many file formats, communication channels, and much more. This approach has been very successful, resulting in high-quality software: Users are presented with a prover system that simply works out of the box on all platforms. Moreover, the Archive of Formal Proofs – considered the most important outcome of Isabelle prover technology – is currently the largest uniform body of formalized material in existence with \approx 271\,000 user-specified theorems in 4.368\,700\text{\,}\mathrm{\text{million}} lines of code 2 2 2 https://www.isa-afp.org/statistics . This surpasses both the Lean Mathlib ( \approx 151\,800 theorems in 1.562\,109\text{\,}\mathrm{\text{million}} lines of code 3 3 3 https://leanprover-community.github.io/mathlib_stats.html ) and the Mizar Mathematical Library ( \approx 67\,000 theorems in 3.179\,541\text{\,}\mathrm{\text{million}} lines of code 4 4 4 Source code: http://mizar.org/system/index.html#download ), which was considered the largest body of formalizations in 2009 [ 4 ] . In contrast, much of the infrastructure of the Isabelle project – predating the mature Isabelle/Scala of today – has been built with external tooling. In particular, for continuous integration (CI), a customized Jenkins server instance was used which would re-run all Isabelle sessions as regression test whenever changes in the underlying repositories occurred. Moreover, to test changes before publishing them, users could force-push their commits to a testboard repository, which would trigger a test run. Since its introduction in early 2016, the system had performed \approx 21\,400 builds in total. However, with this many builds (and likely due to software defects), the Jenkins instance had become quite slow in answering requests, to the point of being unusable. The system was also prone to leaking memory as well as file handles, and to spuriously fail starting builds. Moreover, every job ran on exactly one host drawn from a pre-defined set; with the advent of cluster-based builds in Isabelle 2024 [ 2 ] , managing jobs that run on multiple hosts became necessary. Finally, force-pushing a changeset is not an adequate model for the quasi-interactive Isabelle builds that power users need: One cannot specify Isabelle build options, the selection of sessions to build, or other parameters. Also, only changes to one single repository can be tested at a time – when working with multiple components that need to be adapted and tested simultaneously (such as Isabelle with the AFP), this is insufficient. For those reasons, replacing the Jenkins as build manager became necessary. We decided against utilizing a different existing CI system for several reasons: • Integrating Isabelle properly would require lots of additional work, especially since most systems are not designed to handle user-submitted tasks and allocate host resources dynamically. • Most of the CI happens inside Isabelle anyway: For instance, when AFP entries fail, the maintainers of the entry need to be notified by mail. • General-purpose CI systems tend to be quite complex since they need to cater to all use cases. Maintaining such a system (especially for high compute loads) requires too much effort, as our experience with the Jenkins server had shown. Instead, we decided implement the system ourselves within Isabelle/Scala, exploring whether the platform is mature enough for such a undertaking. In this work, we describe the Isabelle build manager we developed, and discuss the systems programming aspects. 2 System Description We implemented the build manager as a single Isabelle/Scala module. The server is launched via Isabelle/Scala command-line tool ( isabelle build_manager ) and consists of multiple sub-processes, which run as separate Isabelle threads within the JVM. Similar to the implementation in the build cluster [ 2 ] , the state is shared between these (and external) processes via a PostgreSQL database, using isabelle.SQL . Hence, the sub-processes can run independently, each performing their own task: 1. Poller : Listens for repository updates on the Isabelle repository and all extra component s known to the build manager (such as the AFP). When a new changeset for a component appears, it queues a task for every CI job that requires this component. 2. Timer : Queues tasks for CI jobs that should trigger on specific times (e.g., nightly at midnight) rather than on every commit. 3. Runner : Checks the queue for tasks whose host selection is currently feasible. If such are present, it starts a job for the one with highest priority. The runner also checks if jobs timed out or were cancelled, interrupting running build processes if needed. Processes that don’t finish in time after interruption will be terminated forcefully. The runner also finalizes any finished job, producing a result . 4. Web Server : Provides statically rendered HTML pages of its current state when requested (using isabelle.HTML and isabelle.Web_App ); interactive elements are rendered via HTML 5 forms. The state only contains meta-information about build results (since there might be tens of thousands of results); the build log is read from file when a specific build is accessed. Opened log files are cached until no longer requested for a certain time period. 2.1 Running a Build Processes Tasks contain a build config that describes either a user-submitted build (incorporating most parameters of the regular Isabelle build), or a CI job from the pre-existing isabelle.Build_CI module. In either case, running the actual build process consists of four steps: 1. The runner uses isabelle.Sync and isabelle.Mercurial to create a self-contained copy of Isabelle and the required components in the desired revisions, which are given by the task description. The revision either refers to the underlying repository of the component, or to an already synced file copy (that might contain changes). For CI builds, we also store a summary of the commit history and changes since the previous build. 2. Creating the actual build process: This requires initializing the remote isabelle.Other_Isabelle environment for the build via isabelle.SSH , using isabelle.Rsync to transfer the prepared

Read the complete text