Skip to content

About

A repository of projects used for regression testing and continuous integration

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

67 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OlympusMons

A repository of projects used for regression testing and continuous integration of F*.

The invariant

hashes.txt records a commit of F* and of each project:

FStar:<commit>
everparse:<commit>
...

one project:commit per line (# starts a comment). Every project builds at its recorded commit, against the F (with its Pulse and KaRaMeL) at the recorded F commit.** The projects' own pins of F*, KaRaMeL or Pulse (submodules, nightly releases, hashes files, ...) are ignored.

project repository what is built
FStar FStarLang/FStar stage 3 and a binary package; its CI target make ci
everparse project-everest/everparse the targets of its Linux CI (ci.yml, cbor.yml)
pal FStarLang/pal make and make test, as in its CI
kuiper FStarLang/kuiper make verify only: its extraction needs its own patched F* and KaRaMeL
pulse-verified-gc FStarLang/pulse-verified-gc the steps of its CI (verify.yml)
AlgoStar FStarLang/AlgoStar make -C autoclrs, as in its CI
hacl-pulse FStarLang/hacl-pulse make (lint, verify, extract, compile, stack, test), as in its CI (ci.yml)
atlas FStarLang/atlas the targets of its CI (ci.yml) but the interop tests, which need system services (tftpd, lrzsz); against the everparse and hacl-pulse trees above

The exact commands are in scripts/build/.

Some projects are built against others: atlas against the trees that the everparse and hacl-pulse builds leave (QuackyDucky, LowParse, and hacl-pulse's extracted C, checked files and Hacl.cui), instead of the pins in its setup.sh. Such a project is built only after its dependencies, and only if they built at their recorded commits. The dependencies are in deps_of in scripts/lib.sh, and again in the Makefile and nightly.yml.

When a project is not on its default branch's commit, it is on its olympus branch, which has the changes needed to build with the recorded F*: a few commits on top of the project's default branch, which the nightly rebases whenever the default branch moves (it never merges). pal and hacl-pulse are different: they pin an F* nightly themselves, and their changes go upstream, as a pull request from their olympus branch, which also bumps that pin to the nightly that OlympusMons builds with. Each commit on an olympus branch says whether it is a minimal change (Olympus-Change: minimal) or works around a significant regression in F* (Olympus-Change: fstar-regression-workaround). A pull request whose commits are all minimal goes on the project's merge queue by itself; any other waits for a review. These changes never admit proofs or weaken specifications.

There is one Z3: the official release of the version that the recorded F* uses by default (its --z3version, e.g. 5.3.0), downloaded by F*'s own .scripts/get_fstar_z3.sh and installed in _work/z3 as z3 and z3-<version> (see scripts/install-z3.sh). _work/z3 comes first in the PATH of every build. The projects that pin a Z3 version (EverParse's EVERPARSE_Z3_VERSION, Kuiper's and pulse-verified-gc's Z3_VERSION) are given this version instead. Any other Z3 (z3-4.13.3, ...) is shadowed in _work/z3 by a stub that fails, so that a leftover pin of another Z3 makes the build fail rather than silently use another Z3.

Building

Prerequisites: opam, a C toolchain (with 32-bit support, for EverParse's tests), GCC 15 as gcc-15/g++-15 (for F*'s Cherry tests), clang/LLVM 20 and clang-format 20 (for pal), Rust (for pal and EverParse), and .NET 10 (for F*'s tests); the nightly also needs the GitHub CLI gh. On Ubuntu 26.04, sudo scripts/install-system-deps.sh installs all of them but Rust, which is best installed with rustup.

One-time setup, an opam switch (olympus) with the OCaml packages that F* and the projects need, and the Z3 that F* uses:

scripts/setup.sh

Then:

make -k -j$(nproc)    # check out and build F* and all projects
make status           # summarize the results
make everparse        # check out and build F*, then one project

Everything happens in _work/: the clones are in _work/src/<project>, Z3 is installed in _work/z3 (again whenever F* is built), F* in _work/fstar, and the log of each build is in _work/logs/<project>.log. (In CI, _work is ~/olympus-work, outside the workspace, so that the jobs of a run share it; set OLYMPUS_WORK to move it.)

Each build is given a time limit (timeout_of in scripts/lib.sh, overridden by OLYMPUS_TIMEOUT). A build that exceeds it is killed, and what it was doing — the process tree, the load and the free disk — is written to _work/logs/<project>.diagnostics.log just before it is, so that a hang can be diagnosed afterwards. Nothing ever waits for input: git is told not to prompt, so a repository that cannot be read fails at once instead of blocking the build.

make checks out the recorded commits first, and refuses to do so over changes to the tracked files of a tree. To build the trees in _work/src as they are (for instance, while fixing a project), use make NOCHECKOUT=1 <project>; FORCE=1 discards those changes instead. Builds are incremental; CLEAN=1 restores each tree to exactly the recorded commit -- discarding changes to tracked files as well as every untracked and ignored file, F*'s submodules included -- and rebuilds the F* package, for a build from scratch (do this before committing a new hashes.txt). As it rebuilds F*, do not use it while other builds are running.

Note that some of these projects regenerate committed files as they build (pulse-verified-gc extracts into generational/snapshot/), and so leave their tree with modified tracked files. That is why CLEAN=1, and CI, put the trees back.

Updating

To move F* (or a project) forward: change its commit in hashes.txt, run make -k -j$(nproc) CLEAN=1, and fix any project that fails on (a new commit of) its olympus branch. Only commit the new hashes.txt when everything builds. The nightly does this every night, with Copilot to fix what breaks.

Continuous integration

.github/workflows/build.yml builds everything from scratch on every pull request (except from forks) and on demand (gh workflow run Build). It is a graph of jobs:

                      /  FStar-ci   \
                     |   everparse   |
  Set up  ->  F*  -> |   pal         |  ->  atlas  ->  Summary
                     |   kuiper      |
                      \  ...        /
  • Set up checks that the runner can read every repository in hashes.txt (seconds, and before anything expensive), creates the opam switch and fetches Z3, and checks out every project. A repository it cannot read is reported straight away, but only F* stops the run: the rest are still worth building, and the job of the unreadable one fails on its own.
  • F* builds F* and installs it as the package that the rest use. It has the machine to itself, so it is given every core.
  • One job per target, all depending on F* and running concurrently; then one per target that depends on other projects (atlas).
  • Summary collects the results and fails if any target did not succeed.

Each target therefore has its own line in the run's graph, its own log (the log-<target> artifact, and the tail of it in that job's summary), and its own time limit (timeout_of in scripts/lib.sh). A build that exceeds its limit is killed, but not before its log records the state of the machine and the process tree underneath it, so that the run says which command hung rather than only that something did. While a build runs it reports what it is doing every couple of minutes, so a slow job can be told from a stuck one as it happens.

workflow_dispatch takes two inputs: targets, to build only some of them (gh workflow run Build -f targets=hacl-pulse; a target's dependencies are built with it), and clean, which can be turned off to reuse the trees of the previous run when retrying one project.

The jobs of a run share one build tree (~/olympus-work on the runner), so a run has the machine to itself; GitHub queues a new run behind the running one, and keeps only the newest commit queued.

The runners

A full build takes about 130 CPU-hours and a few hours even on a big machine, far beyond GitHub's hosted runners for private repositories, so the workflow runs on self-hosted runners labelled olympus. Keep this repository private: on a public repository, anyone could run code on those runners with a pull request.

A runner only ever runs one job at a time, so the number of runners registered on the build machine is what decides how many of the per-project jobs run at once. Register one per project (there are seven jobs after F*); with a single runner they queue up and the build takes as long as all of them put together.

To set up the machine, with Ubuntu 26.04 and 100 GB of free disk:

  1. Create a user for the runners, and run sudo scripts/install-system-deps.sh (from a clone of this repository).

  2. As that user, install Rust with rustup.

  3. As that user, with gh logged in as an administrator of this repository:

    scripts/ci/add-runners.sh 8        # register 8 runners, as services
    scripts/ci/add-runners.sh --list   # what is registered, and running
    

    This registers the runners with the olympus label and installs each as a service, so they come back after a reboot. It is safe to re-run: runners that are already configured are left alone (and restarted if they are down). --remove unregisters the ones it created.

  4. Nothing else: the projects are all public, so the builds clone them without credentials, and the gh API calls use the workflow's own GITHUB_TOKEN. The Set up job checks in seconds that the runners can read every repository; a project they cannot read fails at once, rather than hanging until its job runs out of time.

The opam switch is created (in the runner user's ~/.opam) by the first build. By default each per-project job uses a quarter of the machine's cores and the F* job uses all of them; the repository variable OLYMPUS_JOBS overrides this with a fixed number of parallel jobs for every job.

The nightly

.github/workflows/nightly.yml keeps OlympusMons current with F*, unattended. Every night (08:00 UTC, or on demand: gh workflow run Nightly) it:

  1. Advances F* to the latest F* nightly (the newest release of FStarLang/FStar-nightly, whose tags are F* commits; only ever forward), and every other project to the tip of its default branch, with the commits of its olympus branch, if it has one, rebased on top of it (locally; nothing is pushed yet). Merge commits are flattened, and commits that upstream has taken drop out, so the olympus branch stays a few commits on top of upstream. For pal and hacl-pulse, the branch is only carried forward while its pull request is open, and a commit on top bumps their F* nightly pin (replacing the previous night's). A project whose olympus branch does not rebase cleanly is not built: Copilot does the rebase (below). Nothing is written to hashes.txt yet. If nothing is newer, it stops.
  2. Builds F*, and then each target in a job of its own (nightly-project.yml), from scratch, in parallel, with a log per target. A target that depends on other projects (atlas) waits for their jobs, and is built against them as they finished: repaired, if they needed it. It uses a tree (~/olympus-nightly-work) and an opam switch (olympus-nightly) of its own, so a Build can run beside it.
  3. Repairs, in the same job, a project that failed (or did not rebase), straight away and without waiting for the others: it runs the Copilot CLI (autopilot, Claude Opus 5.5) once, in the tree of the failed build, with the failing log, the F* that changed, and the rules: no admit, assume, magic, --lax; no deleted or skipped lemmas or tests; no CI or pin changes; no changes to other projects (a dependency's tree included). For a project whose olympus branch did not rebase cleanly, the job starts the rebase and the agent first resolves its conflicts (and must end with a linear history on top of upstream, without conflict markers). There is no budget and no retry: the agent builds the project as often as it needs to, until the build passes or it gives up. The job then checks that its last build did pass and that the change has none of the shortcuts above, and commits the change locally, saying (as Copilot classified it) whether it is minimal, with Copilot's explanation of what broke and how it fixed it as the commit message (which the job summary and the pull request show too). Nothing is pushed yet. F*'s own CI (FStar-ci) is not repaired: a failure there is for a person. Since repairs start without waiting for it, a broken F* can cost the agents some work that is thrown away.
  4. Verifies, still in the same job: the repaired project is built again from scratch, at the commit of its repair. What is recorded is a clean build of the commit, not of the tree Copilot left. The job passes only if the project builds, first time or after its repair; the projects that depend on it start only then.
  5. Pushes, still in the same job, as soon as the project builds, and whether or not the others do: it moves the project's olympus branch to what was built (the rebased branch, with its repair if it needed one; the branch is created only when there is something on it). For pal and hacl-pulse it opens (or updates) the pull request from it, and puts it on the merge queue if every commit in it is minimal and Copilot did not have to resolve rebase conflicts. Nothing reaches a repository unless it has been built from scratch.
  6. Publishes. Only if every job passed (and pushed), it commits the new hashes.txt to main, with F*'s nightly noted on its line. That push is made with a token, so it starts a Build of it, as a final confirmation. Otherwise it fails, says why in its summary, and changes nothing: hashes.txt always names commits that all build together.

Setting it up

Pushing is done as a GitHub App owned by FStarLang, so that no one's personal token has to be renewed, and any owner of the organization can change what it may do:

  • The app has the repository permissions "Contents: read and write" and "Pull requests: read and write" (and "Workflows: read and write", should a repair ever need to change a project's workflows).
  • It is installed on FStarLang (this repository, pal, kuiper, pulse-verified-gc, AlgoStar, hacl-pulse and atlas) and on project-everest (everparse). pal and hacl-pulse also need "Allow auto-merge" on, in their settings, so that a pull request can be queued before its checks have passed.
  • Its (numeric) app ID is OLYMPUS_APP_ID in nightly.yml and nightly-project.yml, and a private key of it is the repository secret OLYMPUS_APP_PRIVATE_KEY (Settings, Secrets and variables, Actions).

Each job that pushes makes an installation token per organization just before it pushes (they last an hour), as OLYMPUS_PUSH_TOKEN_FSTARLANG and OLYMPUS_PUSH_TOKEN_PROJECT_EVEREST; which one pushes to which repository is decided by its owner, in push_token_var_of in scripts/lib.sh. A project in a new organization needs the app installed there, a line in push_token_var_of, and a token step in both workflows.

Repairs also need the repository secret COPILOT_GITHUB_TOKEN: a fine-grained personal access token with the "Copilot Requests" permission, of an account with Copilot (a GitHub App cannot use Copilot).

The Set up job checks, in seconds, that the push tokens can be made and that each can push to every repository it is for, and fails before anything expensive if not. Without COPILOT_GITHUB_TOKEN the nightly still runs but only reports, and does not publish a result that has failures. The runners need Node.js only for repairs, whose jobs install it and the Copilot CLI themselves.

workflow_dispatch takes: fix (off to only report), publish (off for a dry run, which changes nothing), force (build even if nothing is newer), fstar_rev (an F* nightly such as nightly-2026-10-28, or a branch or a commit, instead of the latest nightly; pal and hacl-pulse are only bumped to a nightly) and model.

What the credentials can do

Copilot runs with --yolo on the runner, and the builds run arbitrary makefiles, so the tokens are kept apart: the repair step has only the Copilot token, and scripts/nightly/fix.sh hands Copilot nothing but that (no GitHub login, no git configuration). The push tokens are given only to the step that pushes a project, after it has been built from scratch, and to the Publish job; and only the commands that push (and open pull requests) see them. Copilot never commits or pushes; the workflow does that, after checking the result. Every step has the workflow's GITHUB_TOKEN, which can only read this repository, for its gh API calls; the build itself does not (base_env unsets it).

Things to know

  • A rebase rewrites the olympus branch, so the nightly force-pushes it, but with a lease: only if the branch is still where the nightly found it. So that the commits recorded in older hashes.txt stay fetchable, every commit the branch is moved to is tagged after the F* nightly it was built with, olympus/nightly-2026-10-28 (.2, .3, ... if a second run of the same nightly pushes another), and the one it is moved away from, if it is not already tagged, olympus/before-nightly-2026-10-28. If a branch moved while the nightly ran, that project is not pushed, and nothing is recorded (its fix is kept as a patch in its log-fix-<project> artifact).
  • So push to an olympus branch only between nightlies, and rebase rather than merge: the nightly carries the branch's commits forward.
  • A repair is made on the machine that built the project, in its tree, so its commit exists only there until its job pushes it.
  • Copilot has no cost cap here. The only limit is 12 hours for one agent, to guard against a hung session.
  • A target's job is long: its build, up to 12 hours of Copilot, and a build from scratch (matrix.sh --minutes).
  • FStar has no olympus branch; everparse and atlas have none until the first time one of them needs a fix, and pal and hacl-pulse have one whenever they have a pull request from the nightly (once it is merged or closed, the next nightly starts from their default branch again).
  • Fixes for a change in F* that is still to come can be prepared on a branch of the project named olympus<something> (such as olympus_phase2_core): when the change lands and the project needs a repair, Copilot is pointed at those branches, and takes their changes if they fix the build.
  • Only the projects are fixed, never F*.

About

A repository of projects used for regression testing and continuous integration

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages