Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
88b9211
shared-pool: pin v1.1.0 (57b3f02, PR #4 merge) with an identity check
gabehamilton Nov 14, 2026
d9aa728
shared-pool: freeze the v1.1.0 catalogue (118 ids); v1.0.0 rows stale
gabehamilton Nov 14, 2026
1a1f060
shared-pool: README and the v1.1.0 trace contract
gabehamilton Nov 14, 2026
156a942
shared-pool: TLA-EXEC, the v1.1.0 executor protocol in TLA+
gabehamilton Nov 14, 2026
f0a8b82
shared-pool: TLA-EXEC review fixes (in-flight refusals, quotient cros…
gabehamilton Nov 14, 2026
10912fb
shared-pool: run the unmutated Executor.tla in CI before its mutants
gabehamilton Nov 14, 2026
959d3c8
shared-pool: v1.1.0 conformance generator (s/7, init_error, window, t…
gabehamilton Nov 14, 2026
8b841c1
shared-pool: conformance/coverage.py, the corpus classes from the terms
gabehamilton Nov 14, 2026
ae29340
shared-pool: conformance review fixes (v1.0.0 corpus cite, trace 208 …
gabehamilton Nov 14, 2026
6e729ed
shared-pool: Kani layer adapted to v1.1.0 (plain mode green)
gabehamilton Nov 14, 2026
3bfaa4b
shared-pool: Prolog static layer at v1.1.0 (requirements, C-1..C-6, e…
gabehamilton Nov 14, 2026
69cca54
shared-pool: Kani mutants for v1.1.0 (re-based, N1-N14) and the memcm…
gabehamilton Nov 14, 2026
9207199
shared-pool: near-tests and wasm surface for v1.1.0 (W8)
gabehamilton Nov 14, 2026
2288776
shared-pool: Prolog C-2 compares the Full and version-cap conditions …
gabehamilton Nov 14, 2026
4cc1c00
shared-pool: Lean layer for v1.1.0 (INV-RES, LIVE-ALL, window, cap)
gabehamilton Nov 14, 2026
40e03e2
shared-pool: Lean RESULTS.md for v1.1.0
gabehamilton Nov 14, 2026
4761faa
shared-pool: near-tests mutant record for v1.1.0, s13 killed by a cra…
gabehamilton Nov 14, 2026
538c97a
shared-pool: TLA+ core model for v1.1.0 (SharedPool.tla frozen)
gabehamilton Nov 14, 2026
1931204
shared-pool: Lean LEAN-GUARD row states the code and guard/5 comparis…
gabehamilton Nov 14, 2026
91c18bf
shared-pool: Prolog model and MC-1 at v1.1.0 (pool/8, seven universes…
gabehamilton Nov 14, 2026
51d4ca2
shared-pool: Prolog RESULTS.md, C-2 reads the committed v1.1.0 GuardO…
gabehamilton Nov 14, 2026
79c9162
shared-pool: Prolog RESULTS.md records one uninterrupted full run (re…
gabehamilton Nov 14, 2026
158579e
shared-pool: near-tests SH-8 and LIVE-2 rows mark the traces half pen…
gabehamilton Nov 14, 2026
db957d4
shared-pool: tla.rs v1.1.0 transcription, REF back in plain mode, mut…
gabehamilton Nov 14, 2026
c51cbf4
shared-pool: near-tests wasm surface re-run 2026-11-14 (review fixes)
gabehamilton Nov 14, 2026
da244cd
shared-pool: TLA+ v1.1.0 results, named killers, F-2b witnesses, WinL…
gabehamilton Nov 14, 2026
59de813
shared-pool: TLA+ RESULTS.md records the final run (5 min 8 s default…
gabehamilton Nov 14, 2026
cfcfbfa
shared-pool: MC_Liveness header names MC_Liveness_Win2 (WIN-LIVE at M…
gabehamilton Nov 14, 2026
8303e07
shared-pool: sandbox layer for v1.1.0, one build, RT-WINDOW, RT-D1, R…
gabehamilton Nov 14, 2026
dbe335d
shared-pool: sandbox RESULTS.md states what the 512-job fill checks o…
gabehamilton Nov 14, 2026
2862fb3
shared-pool: RES-1 asserts the 10 Tgas margin for the 30 Tgas row (re…
gabehamilton Nov 14, 2026
a7781c7
shared-pool: v1.1.0 conformance corpus and the six trace replayers in…
gabehamilton Nov 14, 2026
207809d
shared-pool: record the layer runs at the integration commit a7781c7 …
gabehamilton Nov 14, 2026
6b120fd
shared-pool: Lean replay without Guard, REF on WF states in plain h_w…
gabehamilton Nov 14, 2026
5cf571e
shared-pool: Lean RESULTS.md records run.sh mutants at 6b120fd (W10 r…
gabehamilton Nov 14, 2026
1fd106f
shared-pool: run-local.py --all, a measurement of every Kani harness …
gabehamilton Nov 14, 2026
0d801de
Merge gabehamilton/shared-pool-controls-local-checkout (651852b) into…
gabehamilton Nov 14, 2026
2d33d33
shared-pool: run-local.py --all runs a 35 GB job alone and kills each…
gabehamilton Nov 14, 2026
24d1630
shared-pool: README and CI comments for the v1.1.0 layer results (W13…
gabehamilton Nov 14, 2026
4ff2c30
shared-pool: strategy.md for v1.1.0 from the layer results (W13, Kani…
gabehamilton Nov 14, 2026
fc91ef2
shared-pool: status.toml for v1.1.0 from the layer results, with [fin…
gabehamilton Nov 14, 2026
39b073d
shared-pool: W13 part 1 review fixes (anchors, Kani qualifiers, tag w…
gabehamilton Nov 14, 2026
8cc7e99
shared-pool: status-lint checks status.toml against strategy.md secti…
gabehamilton Nov 14, 2026
a4e3179
shared-pool: status-lint review fixes (cell markup and negation, cata…
gabehamilton Nov 14, 2026
ca5a689
shared-pool: run-local.py --estimates-from, estimates from an earlier…
gabehamilton Nov 14, 2026
452de51
shared-pool: run-local.py --estimates-from also raises a job's limit …
gabehamilton Nov 14, 2026
e4bcc91
shared-pool: run-local.py --estimates-from raises a mutant's limit wi…
gabehamilton Nov 14, 2026
a06e2b5
shared-pool: kani/RESULTS.md for v1.1.0, its tables generated by kani…
gabehamilton Nov 14, 2026
188e880
shared-pool: record.py assembles the local Kani record from several r…
gabehamilton Nov 14, 2026
c4b75ef
shared-pool: not-run.tsv declares the 16 large mutants not run locall…
gabehamilton Nov 14, 2026
b9e890c
shared-pool: kani-matrices.py writes the four Kani matrices from the …
gabehamilton Nov 14, 2026
dec17ea
shared-pool: kani/local/README.md, not-run.tsv's format in plainer words
gabehamilton Nov 14, 2026
da6c12e
shared-pool: results-tables.py review fixes (matrix errors, Verdict l…
gabehamilton Nov 14, 2026
1a7d0d5
shared-pool: Kani matrices regenerated with run 3's first 9 rows
gabehamilton Nov 14, 2026
6a54c97
shared-pool: record.py takes each job from the latest run that passed…
gabehamilton Nov 14, 2026
d3544df
shared-pool: Kani matrices regenerated with run 3's first 12 rows
gabehamilton Nov 14, 2026
199f223
shared-pool: kani/local/README.md, results-tables.py, the runner-size…
gabehamilton Nov 14, 2026
148e90c
shared-pool: kani/local/README.md, the fallback when a hosted Kani ha…
gabehamilton Nov 14, 2026
38058f1
shared-pool: RESULTS.md and record.py say a resident peak can underst…
gabehamilton Nov 14, 2026
15b7c6b
shared-pool: Kani matrices and RESULTS.md tables from run 3's 38 harn…
gabehamilton Nov 14, 2026
7e3202f
shared-pool: RESULTS.md and kani/local/README.md name run 4 (h_energy…
gabehamilton Nov 14, 2026
7bcbc51
shared-pool: Kani matrices regenerated from the final run 3 rows
gabehamilton Nov 14, 2026
c8dd19f
shared-pool: local Kani record for v1.1.0 from the all-2d33d33, run3-…
gabehamilton Nov 14, 2026
7c79d32
shared-pool: RESULTS.md measured tables from runs 1, 3 and 4 (final)
gabehamilton Nov 14, 2026
da343e2
shared-pool: v1.1.0 Kani close-out in README.md, status.toml and stra…
gabehamilton Nov 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion .github/workflows/near-approval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,12 @@ jobs:
run: tools/scripts/check-pin.sh near-approval
# status-lint (strategy.md section 14): status.toml claims nothing the
# repository doesn't back. Runs only when a verification layer is selected.
# The self-test runs its near-approval cases only: its shared-pool cases
# read shared-pool's files and run in shared-pool.yml.
- name: status-lint
if: steps.areas.outputs.verification == 'true'
run: |
tools/scripts/test-check-status.sh
tools/scripts/test-check-status.sh near-approval
tools/scripts/check-status.sh near-approval

plain:
Expand Down
536 changes: 335 additions & 201 deletions .github/workflows/shared-pool.yml

Large diffs are not rendered by default.

34 changes: 18 additions & 16 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion projects/shared-pool/conformance/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

313 changes: 313 additions & 0 deletions projects/shared-pool/conformance/coverage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,313 @@
#!/usr/bin/env python3
"""The call classes of a conformance core.txt (strategy.md section 10).

usage: python3 coverage.py [--quiet] CORE_TXT

Reads a core.txt in either format, v1.0.0's (State = s/5) or v1.1.0's
(s/7, init_error; the header of src/main.rs), recomputes from the terms
alone the class of every call (`Op:Result`) and the derived classes of the
v1.1.0 contract, and applies the REQUIRED and FORBIDDEN lists:

submit:prune submit ok and FirstId grew
submit:full_open_front submit full, 256 records retained, the oldest open
submit:prereq_after_prune submit ok of a recipe with a prerequisite that the
retained Completed records alone do not meet
submit:recovery_admitted submit ok in a disturbed pre-state (a value
outside its metric's range)
<op>:not_found_pruned dispatch, ack, cancel or settle not_found on an
id below FirstId
observe:refresh observe ok with a record open
init:invalid_config a refused configuration (init_error)

A v1.0.0 state has FirstId 0. It also checks that no state has a version at
or above VERSION_CAP (TLC's integers; the contract keeps cap states out of
core.txt).

This is a second implementation of the generator's classification
(`classes` in src/main.rs), written from the trace contract, not from that
code. The two lists are the generator's; when src/main.rs is next to this
file, they must be equal (else exit 2).

Exit 0: every required class occurs, no forbidden one does, no state at the
cap. Exit 1: otherwise (the classes missing or forbidden are listed). Exit 2:
the file does not parse, or the lists differ from src/main.rs.

On the v1.0.0 corpus (traces/core.txt at commit a072a2d, the v1.0.0
verification's head) it exits 1; on the v1.1.0 corpus, 0. Standard library
only.
"""

import re
import sys
from collections import Counter
from pathlib import Path

MAX_RECORDS = 256
VERSION_CAP = 2**32 - 1 - 3 * MAX_RECORDS

REQUIRED = [
"submit:ok", "submit:arithmetic", "submit:full", "submit:paused", "submit:stale", "submit:expired",
"submit:snapshot_expired", "submit:invalid_recipe", "submit:unauthorized", "submit:invalid_units",
"submit:prerequisite", "submit:bounds", "submit:energy", "dispatch:ok", "dispatch:not_found",
"dispatch:unauthorized", "dispatch:paused", "dispatch:invalid_state", "dispatch:expired",
"dispatch:snapshot_expired", "ack:ok", "ack:not_found", "cancel:ok", "cancel:not_found",
"cancel:unauthorized", "cancel:pending", "cancel:invalid_state", "settle:ok", "settle:not_found",
"settle:unauthorized", "settle:invalid_state", "pause:ok", "pause:unauthorized", "observe:ok",
"observe:unauthorized", "observe:pending", "observe:bounds",
"submit:prune", "submit:full_open_front", "submit:prereq_after_prune", "submit:recovery_admitted",
"dispatch:not_found_pruned", "ack:not_found_pruned", "cancel:not_found_pruned", "settle:not_found_pruned",
"observe:refresh", "init:invalid_config",
]
FORBIDDEN = ["cancel:bounds", "cancel:arithmetic", "settle:bounds", "settle:arithmetic"]

OPEN = {"reserved", "dispatched", "active", "unknown"}


class ParseError(Exception):
pass


# --- terms ----------------------------------------------------------------
# An atom is a str, an integer an int, a list a Python list, a compound
# term a tuple (name, arg, ...).

TOKEN = re.compile(r"\s*(?:(-?\d+)|([a-z][A-Za-z0-9_]*)|([\[\](),.]))")


def parse_line(line):
"""The one term of a line `Term.`."""
toks = []
pos = 0
while pos < len(line):
m = TOKEN.match(line, pos)
if not m:
if line[pos:].strip() == "":
break
raise ParseError(f"bad character at column {pos + 1}")
pos = m.end()
if m.group(1) is not None:
toks.append(("int", int(m.group(1))))
elif m.group(2) is not None:
toks.append(("atom", m.group(2)))
else:
toks.append(("punct", m.group(3)))
if not toks or toks[-1] != ("punct", "."):
raise ParseError("no terminating '.'")
term, i = parse_term(toks, 0)
if i != len(toks) - 1:
raise ParseError("text after the term")
return term


def parse_term(toks, i):
kind, v = toks[i]
if kind == "int":
return v, i + 1
if kind == "atom":
if i + 1 < len(toks) and toks[i + 1] == ("punct", "("):
args, i = parse_seq(toks, i + 2, ")")
return (v, *args), i
return v, i + 1
if v == "[":
if toks[i + 1] == ("punct", "]"):
return [], i + 2
args, i = parse_seq(toks, i + 1, "]")
return args, i
raise ParseError(f"unexpected {v!r}")


def parse_seq(toks, i, close):
args = []
while True:
t, i = parse_term(toks, i)
args.append(t)
if toks[i] == ("punct", ","):
i += 1
elif toks[i] == ("punct", close):
return args, i + 1
else:
raise ParseError(f"expected ',' or {close!r}")


def functor(t):
return (t[0], len(t) - 1) if isinstance(t, tuple) else (t, 0)


# --- states ---------------------------------------------------------------


class State:
def __init__(self, t):
if functor(t) not in (("s", 5), ("s", 7)):
raise ParseError(f"not a state: {functor(t)}")
self.values, self.version, self.observed_at, self.paused, recs = t[1:6]
self.records = [r[1:] for r in recs] # (recipe, units, expires_at, status)
self.first_id = t[6] if len(t) == 8 else 0
self.done = t[7] if len(t) == 8 else None


class Config:
def __init__(self, t):
if functor(t) != ("config", 5):
raise ParseError("expected config/5")
_, self.owner, self.max_age, ms, _ts, rs = t
self.metrics = [(m[1], m[2]) for m in ms] # (min, max)
self.requires = [[(p[1], p[2]) for p in r[6]] for r in rs]


def disturbed(cfg, st):
return any(v < lo or v > hi for v, (lo, hi) in zip(st.values, cfg.metrics))


def has_open(st):
return any(r[3] in OPEN for r in st.records)


def result_name(res):
if res == "ok" or functor(res) == ("ok", 1):
return "ok"
if functor(res) == ("err", 1):
return res[1]
raise ParseError(f"bad result {res!r}")


def classes(cfg, op, res, a, b):
"""The classes of one call: op, result, pre-state a, post-state b."""
name = op[0]
r = result_name(res)
ks = [f"{name}:{r}"]
if name == "submit" and r == "ok":
if b.first_id > a.first_id:
ks.append("submit:prune")
if disturbed(cfg, a):
ks.append("submit:recovery_admitted")
recipe = op[2]

def retained(q):
return sum(u for (rq, u, _e, s) in a.records if rq == q and s == "completed")

if any(retained(q) < u for (q, u) in cfg.requires[recipe]):
ks.append("submit:prereq_after_prune")
elif name == "submit" and r == "full":
if len(a.records) >= MAX_RECORDS and a.records[0][3] in OPEN:
ks.append("submit:full_open_front")
elif name in ("dispatch", "ack", "cancel", "settle") and r == "not_found":
rid = op[1] if name == "ack" else op[2]
if rid < a.first_id:
ks.append(f"{name}:not_found_pruned")
elif name == "observe" and r == "ok" and has_open(a):
ks.append("observe:refresh")
return ks


# --- the file -------------------------------------------------------------


def scan(path):
"""(hits, where, problems): class counts, the first places of each class
(trace, call), and contract problems (states at the cap)."""
hits = Counter()
where = {}
problems = []
traces = 0
calls = 0
n = cfg = st = None
with open(path) as f:
for lineno, line in enumerate(f, 1):
if not line.strip():
continue
try:
t = parse_line(line)
fn = functor(t)
if fn == ("trace", 1):
n, cfg, st, k = t[1], None, None, 0
traces += 1
elif fn == ("config", 5):
cfg = Config(t)
elif fn == ("init", 2):
st = State(t[2])
elif fn == ("init_error", 1):
key = f"init:{t[1]}"
hits[key] += 1
where.setdefault(key, []).append((n, 0))
elif fn == ("call", 3):
k += 1
calls += 1
b = State(t[3])
for key in classes(cfg, t[1], t[2], st, b):
hits[key] += 1
if len(where.setdefault(key, [])) < 5:
where[key].append((n, k))
st = b
if st.version >= VERSION_CAP:
problems.append(f"trace {n} call {k}: version {st.version} >= VERSION_CAP")
elif fn == ("end", 0):
pass
else:
raise ParseError(f"unexpected {fn[0]}/{fn[1]}")
except (ParseError, IndexError, TypeError, ValueError) as e:
raise ParseError(f"{path}:{lineno}: {e}") from None
return hits, where, problems, traces, calls


def rust_list(src, name):
m = re.search(r"const " + name + r": \[&str; \d+\] = \[(.*?)\];", src, re.S)
return re.findall(r'"([^"]+)"', m.group(1)) if m else None


def lists_agree():
main = Path(__file__).resolve().parent / "src" / "main.rs"
if not main.exists():
return True
src = main.read_text()
ok = True
for name, mine in (("REQUIRED", REQUIRED), ("FORBIDDEN", FORBIDDEN)):
theirs = rust_list(src, name)
if theirs is None:
print(f"coverage.py: no const {name} in {main}", file=sys.stderr)
ok = False
elif theirs != mine:
only_here = [k for k in mine if k not in theirs]
only_there = [k for k in theirs if k not in mine]
print(f"coverage.py: {name} differs from {main}: only here {only_here}, "
f"only there {only_there}" + ("" if only_here or only_there else " (order)"),
file=sys.stderr)
ok = False
return ok


def main(argv):
args = [a for a in argv[1:] if a != "--quiet"]
quiet = "--quiet" in argv[1:]
if len(args) != 1:
print(__doc__.split("\n\n")[1], file=sys.stderr)
return 2
if not lists_agree():
return 2
try:
hits, where, problems, traces, calls = scan(args[0])
except (OSError, ParseError) as e:
print(f"coverage.py: {e}", file=sys.stderr)
return 2
if not quiet:
for k in sorted(hits):
print(f"{k:32} {hits[k]}")
print(f"{args[0]}: {traces} traces, {calls} calls")
missing = [k for k in REQUIRED if k not in hits]
forbidden = [k for k in FORBIDDEN if k in hits]
for k in missing:
print(f"missing (required): {k}")
for k in forbidden:
at = ", ".join(f"trace {n} call {c}" for n, c in where[k])
print(f"forbidden: {k} x{hits[k]} (first at {at})")
for p in problems[:10]:
print(f"at the cap: {p}")
if missing or forbidden or problems:
print(f"coverage: FAIL ({len(missing)} missing, {len(forbidden)} forbidden, {len(problems)} at the cap)")
return 1
print("coverage: ok")
return 0


if __name__ == "__main__":
sys.exit(main(sys.argv))
Loading
Loading