"""Exact quorum arithmetic; not a SKYROS protocol simulator.""" import argparse import json from pathlib import Path MAX_FAILURES = 1_000_000 def quorum_sizes(f): if type(f) is not int or not 1 <= f <= MAX_FAILURES: raise ValueError("f must be an integer between 1 and 1000000") replicas = 2 * f + 1 recovery = f + 1 fast = f + (f + 1) // 2 + 1 return { "failure_budget": f, "replicas": replicas, "fast_responses": fast, "recovery_responses": recovery, "minimum_intersection": fast + recovery - replicas, "fast_path_missing_response_budget": replicas - fast, } def result(): return { "schema_version": 1, "kind": "exact-set-arithmetic", "generated_on": "2026-12-01", "source": "https://research.cs.wisc.edu/adsl/Publications/nilext.pdf", "source_sections": ["4.2", "4.6", "4.8"], "units": "replicas", "formula": "N=2f+1; Q=f+ceil(f/2)+1; R=f+1; min_intersection=Q+R-N", "assumptions": [ "One fixed replica universe; each response represents a distinct replica.", "The fast response set includes the current leader and one common view.", "The missing-response budget is only a count bound, not sufficient for progress.", ], "exclusions": [ "No log contents, view transitions, Byzantine behavior or network timing.", "No protocol correctness proof, performance measurement or probability estimate.", ], "rows": [quorum_sizes(f) for f in range(1, 9)], } if __name__ == "__main__": parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--check", action="store_true") args = parser.parse_args() output = json.dumps(result(), indent=2) + "\n" path = Path(__file__).with_name("results.json") if args.check: if path.read_text() != output: raise SystemExit("results.json does not match exact calculation") print("SKYROS quorum results match") else: path.write_text(output)