Skip to content

Commit 79342b9

Browse files
Cap harness parallelism on ubuntu partition runners
Both ubuntu-latest 'Verify std library (partition 1)' jobs died with 'The runner has received a shutdown signal' while verifying the ffi::c_str harnesses; the macos jobs passed. run-kani.sh passes -j (one thread per core) to kani, so the 4-core/16 GB ubuntu runners verify four harnesses concurrently. With the new Kani/CBMC pin the c_str harnesses have grown memory-hungry - measured individually with CI-equivalent flags (--no-assert-contracts, --object-bits 12): check_from_bytes_with_nul 9.6 GB check_to_str 5.4 GB check_as_ptr 3.1 GB check_bytes 3.1 GB check_count_bytes 1.7 GB Four such harnesses in flight exceed 16 GB, OOM-killing the runner. Introduce KANI_JOBS to let CI cap the number of parallel harnesses and set it to 2 for the ubuntu partition jobs. The heaviest known cluster (the four c_str harnesses above) then peaks at ~13.4 GB of concurrent solver memory (measured by sampling the process tree), which fits the runner with headroom to spare. macos jobs keep the full -j behavior. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
1 parent 5837927 commit 79342b9

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/kani.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ jobs:
3535
WORKER_INDEX: ${{ matrix.partition }}
3636
# Total number of workers running this step
3737
WORKER_TOTAL: 4
38+
# Cap parallel harness verification on ubuntu-latest: its 4-core/16 GB
39+
# runners get OOM-killed when 4 memory-hungry harnesses (up to ~10 GB
40+
# each, e.g. the ffi::c_str ones) run concurrently.
41+
KANI_JOBS: ${{ matrix.os == 'ubuntu-latest' && 2 || '' }}
3842

3943
steps:
4044
- name: Remove unnecessary software to free up disk space

scripts/run-kani.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,18 @@ run_verification_subset() {
213213

214214
echo "Running verification for harnesses:"
215215
printf '%s\n' "${harnesses[@]}"
216+
# Use KANI_JOBS to cap the number of parallel harnesses; some harnesses peak
217+
# at close to 10 GB of memory, so running one per core can exhaust the
218+
# memory of smaller CI runners (e.g., 4-core/16 GB ubuntu-latest).
219+
local jobs_arg="-j"
220+
if [[ -n "${KANI_JOBS:-}" ]]; then
221+
jobs_arg="--jobs=${KANI_JOBS}"
222+
fi
216223
"$kani_path" verify-std -Z unstable-options ./library \
217224
$unstable_args \
218225
--no-assert-contracts \
219226
$harness_args --exact \
220-
-j \
227+
$jobs_arg \
221228
--output-format=terse \
222229
"${command_args[@]}" \
223230
--cbmc-args --object-bits 12

0 commit comments

Comments
 (0)