eBPF-based security platform
ci: cap a proof's memory at what a runner has
Daniel Borkmann2f412bd3b9fc
diff --git a/.agents/skills/proofs/SKILL.md b/.agents/skills/proofs/SKILL.mdindex 9fdafeb9..5a579caf 100644--- a/.agents/skills/proofs/SKILL.md+++ b/.agents/skills/proofs/SKILL.md@@ -36,7 +36,7 @@ each harness includes, and all of them after a change to `proof.h` orgigabytes is one to reshape, not to wait for.CI splits `proofs.list` into eight shards and runs each proof alone-under the 14 GB and 60 minutes `.github/scripts/proofs.sh` caps it at;+under the 6 GB and 60 minutes `.github/scripts/proofs.sh` caps it at;a proof added there has to fit both. It leaves out the proofs`testing/proofs/cbmc/ci-skip.list` names, each with why, which no runchecks unless a developer starts it: run one by hand after a change todiff --git a/.github/scripts/proofs.sh b/.github/scripts/proofs.shindex 7de24e1e..e6ccd142 100755--- a/.github/scripts/proofs.sh+++ b/.github/scripts/proofs.sh@@ -21,9 +21,11 @@ CBMC_SHA256=bdfce55b828a45e19d685f7569e3569657ce80faa20c79a99f1791b5d5b852bcELAN_VERSION=4.2.4ELAN_SHA256=42b94d4244e8353142c456ec0e4ca6528fd898a6c604d4059f494e706e431f63-# A runner has 16 GB, and the slowest proof CI runs takes 15 minutes on-# a fast host: a proof past either cap is one to reshape.-PROOF_MEMORY_KB=14000000+# A runner has two CPUs and about 7 GB. A proof gets 6 GB, so that one+# past it fails as out of memory rather than taking the runner down with+# it, and the slowest proof CI runs takes 15 minutes on a fast host: a+# proof past either cap is one to reshape.+PROOF_MEMORY_KB=6000000PROOF_MINUTES=60cd "$(git rev-parse --show-toplevel)"diff --git a/.github/workflows/proofs.yml b/.github/workflows/proofs.ymlindex e8acca36..039b7e9e 100644--- a/.github/workflows/proofs.yml+++ b/.github/workflows/proofs.yml@@ -23,7 +23,7 @@ concurrency:jobs:# Shard <k> of <n> runs every <n>th proof of proofs.list from the# <k>th, but those ci-skip.list names, one at a time: the runner's- # 16 GB is for one proof, not four. proofs.sh caps each proof's memory+ # 7 GB is for one proof, not two. proofs.sh caps each proof's memory# and time well within the job's. CBMC reads the headers of the C# library and of the libraries the harnesses include through the# runner's gcc, so the job runs on the Ubuntu release the proofs arediff --git a/AGENTS.md b/AGENTS.mdindex 551b2dc9..d4845b1e 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -353,10 +353,11 @@ one usually still compiles and passes tests.for every input. They take hours of CPU, so CI runs them after a pushto main, in the `Proofs` workflow, never on a pull request, and leavesout the CBMC proofs `testing/proofs/cbmc/ci-skip.list` names, which- take hours each. A change to code a proof covers, or to an algorithm- a model follows, runs those proofs by name before it is sent, all of- them after a change to `proof.h` or `run.sh`, and a new parser gets a- proof where CBMC can carry one; the `proofs` skill says how.+ need more time or memory than CI gives a proof. A change to code a+ proof covers, or to an algorithm a model follows, runs those proofs+ by name before it is sent, all of them after a change to `proof.h` or+ `run.sh`, and a new parser gets a proof where CBMC can carry one; the+ `proofs` skill says how.- CI runs `.github/scripts/build-commits.sh`, `check-style.sh`,`check-dco.sh`, `check-coccinelle.sh`, `check-sparse.sh`,`check-spdx.sh`, `check-unused.sh`, `scan-build.sh` and thediff --git a/Documentation/contribute/testing/proof-coverage.rst b/Documentation/contribute/testing/proof-coverage.rstindex 0d157da3..29b0511c 100644--- a/Documentation/contribute/testing/proof-coverage.rst+++ b/Documentation/contribute/testing/proof-coverage.rst@@ -13,8 +13,9 @@ Lean 4 proofs under :src:`testing/proofs/lean4/`, what each one proves andfor which inputs, the source files no proof reads and the parsers noproof covers yet. :doc:`proofs` explains how to run and write them. CIruns every proof after a push to main but the CBMC proofs-:src:`testing/proofs/cbmc/ci-skip.list` names, which take hours each:-only a run a developer starts checks those.+:src:`testing/proofs/cbmc/ci-skip.list` names, which need more time or+memory than CI gives a proof: only a run a developer starts checks+those.CBMC proofs-----------diff --git a/Documentation/contribute/testing/proofs.rst b/Documentation/contribute/testing/proofs.rstindex 72d20e44..56b434d3 100644--- a/Documentation/contribute/testing/proofs.rst+++ b/Documentation/contribute/testing/proofs.rst@@ -103,7 +103,7 @@ a change is the only one it gets before it lands. Its ``Lean4`` job runs``make proofs-lean4`` with the toolchain ``lean-toolchain`` names. Its``CBMC`` job runs in eight shards: shard ``<k>`` takes every eighth proofof :src:`testing/proofs/cbmc/proofs.list` from the ``<k>``-th and runs-each alone, under a cap of 14 GB and 60 minutes, so a proof you add has+each alone, under a cap of 6 GB and 60 minutes, so a proof you add hasto fit both on a runner. CI pins CBMC 5.95.1 and elan in:src:`.github/scripts/proofs.sh`, and installs the headers of libcurl,OpenSSL and zlib that the harnesses include with itsdiff --git a/testing/proofs/cbmc/ci-skip.list b/testing/proofs/cbmc/ci-skip.listindex 6f7be4e0..6cb4331b 100644--- a/testing/proofs/cbmc/ci-skip.list+++ b/testing/proofs/cbmc/ci-skip.list@@ -1,5 +1,5 @@# The proofs of proofs.list the Proofs workflow leaves out, each with-# why: CI gives a proof the 14 GB and 60 minutes .github/scripts/proofs.sh+# why: CI gives a proof the 6 GB and 60 minutes .github/scripts/proofs.sh# caps it at, and these need more on a 16-core host. Run each by hand# after a change to what it reads, make proofs-cbmc PROOFS=<proof> under# the memory cap of the proofs skill, and take it off once it fits.@@ -8,3 +8,8 @@ bpm-tree-sync-application no result after 7 hours, past 15 GBbpm-tree-sync-pending no result after 7 hours, past 15 GBbpm-tree-sync-walk no result after 7 hours, past 15 GBbpm-tree-recovery-model 76 to 97 minutes, once no result in 2 hours+upatch-prog-uprobes 12 GB at its peak+bpm-tree-state-match 11 GB at its peak, for labels read from /etc+bpm-tree-state-pending 10 GB at its peak+config-evidence-collect 7 GB at its peak+tpm-public 7 GB at its peak