Skip to content

Commit 348ca67

Browse files
committed
CI: filter on max proof time in manifests
Signed-off-by: Andrew Helwer <ahelwer@pm.me>
1 parent 32a32c7 commit 348ca67

43 files changed

Lines changed: 298 additions & 295 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/scripts/generate_manifest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def generate_new_manifest(examples_root, spec_path, spec_name, parser, queries):
9393
}
9494
for cfg_path in sorted(get_cfg_files(examples_root, tla_path))
9595
]
96-
} | ({'proof' : {'runtime': 'unknown'}} if 'proof' in module_features else {})
96+
} | ({'proof' : {'maxRuntimeMinutes': 1}} if 'proof' in module_features else {})
9797
for tla_path, module_features in get_tla_file_features(examples_root, spec_path, parser, queries)
9898
]
9999
}
@@ -133,7 +133,7 @@ def find_corresponding_model(old_model, new_module):
133133
return models[0] if any(models) else None
134134

135135
def integrate_model_info(old_model, new_model):
136-
fields = ['runtime', 'mode', 'result', 'distinctStates', 'totalStates', 'stateDepth']
136+
fields = ['runtime', 'mode', 'result', 'distinctStates', 'totalStates', 'stateDepth', 'workers']
137137
for field in fields:
138138
if field in old_model:
139139
new_model[field] = old_model[field]

.github/workflows/CI.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ jobs:
3838
with:
3939
distribution: adopt
4040
java-version: 17
41+
- name: Install timeout command
42+
if: matrix.os == 'macos-latest'
43+
run: brew install coreutils
4144
- name: Download TLA⁺ dependencies (Windows)
4245
if: matrix.os == 'windows-latest'
4346
run: $SCRIPT_DIR/windows-setup.sh $SCRIPT_DIR $DEPS_DIR false
@@ -146,13 +149,12 @@ jobs:
146149
| map(select(has("proof")))
147150
# Failing on Linux
148151
| map(select(.path != "specifications/LoopInvariance/SumSequence.tla"))
149-
# Take too long to check in the CI
150-
| map(select(.path != "specifications/byzpaxos/BPConProof.tla"))
151-
| map(select(.path != "specifications/tcp/tcp_proof.tla"))
152-
| map(.path + "\u0000")
152+
# Skip long-running proofs in CI
153+
| map(select(.proof.maxRuntimeMinutes <= 5))
154+
| map((.proof.maxRuntimeMinutes | tostring) + "\u0000" + .path + "\u0000")
153155
| join("")' \
154-
| xargs --verbose --null --no-run-if-empty -I {TLA_FILE} \
155-
time "$DEPS_DIR/tlapm/bin/tlapm" "{TLA_FILE}" -I "$DEPS_DIR/community" --stretch 5
156+
| xargs --verbose --null --no-run-if-empty -n 2 \
157+
sh -c 'time timeout --signal=KILL "${1}m" "$DEPS_DIR/tlapm/bin/tlapm" "$2" -I "$DEPS_DIR/community" --stretch 5' --
156158
- name: Smoke-test manifest generation script
157159
run: |
158160
python $SCRIPT_DIR/generate_manifest.py \

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Steps:
4545
- Spec authors: a list of people who authored the spec
4646
- Spec tags:
4747
- `"beginner"` if your spec is appropriate for TLA⁺ newcomers
48-
- Module proof runtime: if module contains formal proofs, record the approximate time necessary to check the proofs with TLAPM on an ordinary workstation; add `"proof" : { "runtime" : "HH:MM:SS" }` to the module fields at the same level as `models`
48+
- Module proof runtime: if module contains formal proofs, record the estimated maximum time necessary to check the proofs with TLAPM on an underpowered workstation such as a CI runner machine; add `"proof" : { "maxRuntimeMinutes" : N }` to the module fields at the same level as `models`. If you have a relatively powerful machine this might up to twice the amount of time it takes locally. If your proof completes in only a couple seconds, put 1 for this value.
4949
- If less than one minute, proof will be checked in its entirety by the CI
5050
- Model runtime: approximate model runtime on an ordinary workstation, in `"HH:MM:SS"` format
5151
- If less than 30 seconds, will be run in its entirety by the CI; otherwise will only be smoke-tested for 5 seconds

manifest-schema.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,10 @@
2929
},
3030
"proof": {
3131
"type": "object",
32-
"required": ["runtime"],
32+
"required": ["maxRuntimeMinutes"],
3333
"additionalProperties": false,
3434
"properties": {
35-
"runtime": {
36-
"type": "string",
37-
"pattern": "^(([0-9][0-9]:[0-9][0-9]:[0-9][0-9])|unknown)$"
38-
}
35+
"maxRuntimeMinutes": {"type": "integer"}
3936
}
4037
},
4138
"models": {

specifications/Bakery-Boulangerie/manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
],
1414
"models": [],
1515
"proof": {
16-
"runtime": "00:00:20"
16+
"maxRuntimeMinutes": 2
1717
}
1818
},
1919
{
@@ -23,7 +23,7 @@
2323
],
2424
"models": [],
2525
"proof": {
26-
"runtime": "00:00:30"
26+
"maxRuntimeMinutes": 3
2727
}
2828
},
2929
{
@@ -54,4 +54,4 @@
5454
]
5555
}
5656
]
57-
}
57+
}

specifications/CigaretteSmokers/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"features": [],
4040
"models": [],
4141
"proof": {
42-
"runtime": "unknown"
42+
"maxRuntimeMinutes": 1
4343
}
4444
}
4545
]

specifications/CoffeeCan/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"features": [],
5757
"models": [],
5858
"proof": {
59-
"runtime": "unknown"
59+
"maxRuntimeMinutes": 1
6060
}
6161
}
6262
]

specifications/DieHard/manifest.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@
3636
}
3737
]
3838
},
39+
{
40+
"path": "specifications/DieHard/DieHard_proof.tla",
41+
"features": [],
42+
"models": [],
43+
"proof": {
44+
"maxRuntimeMinutes": 1
45+
}
46+
},
3947
{
4048
"path": "specifications/DieHard/DieHarder.tla",
4149
"features": [],
@@ -70,14 +78,6 @@
7078
"workers": 1
7179
}
7280
]
73-
},
74-
{
75-
"path": "specifications/DieHard/DieHard_proof.tla",
76-
"features": [],
77-
"models": [],
78-
"proof": {
79-
"runtime": "unknown"
80-
}
8181
}
8282
]
8383
}

specifications/Disruptor/manifest.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
}
2020
]
2121
},
22-
{
23-
"path": "specifications/Disruptor/APRingBuffer.tla",
24-
"features": [],
25-
"models": []
26-
},
2722
{
2823
"path": "specifications/Disruptor/APDisruptor_SPMC.tla",
2924
"features": [],
@@ -36,6 +31,11 @@
3631
}
3732
]
3833
},
34+
{
35+
"path": "specifications/Disruptor/APRingBuffer.tla",
36+
"features": [],
37+
"models": []
38+
},
3939
{
4040
"path": "specifications/Disruptor/Disruptor_MPMC.tla",
4141
"features": [],

specifications/FiniteMonotonic/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"features": [],
5151
"models": [],
5252
"proof": {
53-
"runtime": "00:00:01"
53+
"maxRuntimeMinutes": 1
5454
}
5555
},
5656
{

0 commit comments

Comments
 (0)