Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/verify-session-lifecycle/coverage.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
"src/host/hostMain.ts#runHost>handlers.destroy": "ccff44951e711dac",
"skill:model/SessionLifecycle.tla": "cd8639012467f13e",
"skill:scripts/facts.mjs": "3ef7fa152ec0af36",
"skill:scripts/check.sh": "cad764a01b6eee50"
"skill:scripts/check.sh": "17f2ce5bd1b1b090"
},
"callSites": {
"writeManifest": [
Expand Down
11 changes: 11 additions & 0 deletions .agents/skills/verify-session-lifecycle/scripts/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,16 @@ fi
# with at least 1 TLC worker. A run that expects a violation keeps 1 worker,
# which finds the shortest trace.
CPUS=$(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
# getconf counts every online CPU, also in a container whose cgroup v2 quota
# allows fewer. cpu.max reads "max <period>" without a quota, else
# "<quota> <period>" in microseconds.
if read -r quota period 2>/dev/null </sys/fs/cgroup/cpu.max &&
[[ $quota =~ ^[1-9][0-9]*$ && $period =~ ^[1-9][0-9]*$ ]]; then
quota_cpus=$(((quota + period - 1) / period))
if [ "$quota_cpus" -lt "$CPUS" ]; then
CPUS=$quota_cpus
fi
fi
passes=0
for name in $RUNS; do
if [ "$(cut -f1 "$OUT/$name/expect.txt")" = pass ]; then
Expand All @@ -376,6 +386,7 @@ PASS_WORKERS=1
if [ "$concurrent" -gt 0 ] && [ "$CPUS" -gt "$concurrent" ]; then
PASS_WORKERS=$((CPUS / concurrent))
fi
echo "CPUs: $CPUS. TLC workers of a run that expects pass: $PASS_WORKERS."

run_tlc() {
local dir rc=0 workers=1
Expand Down
Loading