Skip to content
Draft
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
46 changes: 37 additions & 9 deletions .github/workflows/elder-cusp-parity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ name: Elder cusp kernel parity exact controls
paths:
- 'frontiers/elder_cusp_parity_20261002/**'
- '.github/workflows/elder-cusp-parity.yml'
- 'tests/test_elder_cusp_parity_workflow.py'
# bound merged sources (consumed and cited in SOURCES.json); the cited unmerged sources are bound through the API
- 'frontiers/three_fronts_20260924/LIFETIME_REMAINDER.md'
- 'imports/lifetime_parent_20260925/UNIFORM_MATRIX_CAP_AND_LIFETIME.md'
Expand Down Expand Up @@ -143,17 +144,44 @@ jobs:
'via': where, 'current_ref_checked': now}))
script = str(root / 'ecp_check.py')
expected = (root / 'RESULTS.json').read_bytes()
manifest_mutants = {'M1': 'X3', 'M2': 'X4', 'M3': 'X5', 'M4': 'X2',
'M5': 'X1', 'M6': 'X3', 'M7': 'X6'}
if manifest['mutants'] != manifest_mutants:
raise ValueError('mutant inventory differs from the source-bound protocol')
failed_controls = {
'M1': 'X3_pinned_fields_and_Omega_a',
'M2': 'X4_Q1_identities_and_parity',
'M3': 'X5_first_order_bookkeeping',
'M4': 'X2_model_ridge_and_edges',
'M5': 'X1_lemma_Q_prime_and_CE',
'M6': 'X3_pinned_fields_and_Omega_a',
'M7': 'X6_corollary_and_ledgers',
}
for flags in (['-B', '-S'], ['-B', '-O', '-S']):
out = subprocess.run([sys.executable, *flags, script], check=True, capture_output=True, timeout=600).stdout
if out != expected:
out = subprocess.run([sys.executable, *flags, script], capture_output=True, timeout=600)
if out.returncode != 0:
raise RuntimeError('baseline exit differs from 0 under ' + ' '.join(flags))
if out.stdout != expected:
raise RuntimeError('output differs from RESULTS.json under ' + ' '.join(flags))
for m in manifest['mutants']:
rc = subprocess.run([sys.executable, *flags, script, '--mutant', m], capture_output=True, timeout=600).returncode
if rc != 1:
raise RuntimeError('mutant ' + m + ' not rejected')
rc = subprocess.run([sys.executable, *flags, script, '--mutant', 'M99'], capture_output=True, timeout=600).returncode
if rc != 2:
raise RuntimeError('unknown mutant label not rejected with exit 2')
if out.stderr:
raise RuntimeError('baseline stderr under ' + ' '.join(flags))
for m in manifest_mutants:
out = subprocess.run([sys.executable, *flags, script, '--mutant', m],
capture_output=True, timeout=600)
report = (json.dumps({'failed_controls': [failed_controls[m]], 'mutant': m,
'scientific_effect': 'NONE'},
sort_keys=True, separators=(',', ':')) + '\n').encode()
if out.returncode != 1 or out.stdout != report or out.stderr:
raise RuntimeError('mutant ' + m + ' not rejected with exact control report')
out = subprocess.run([sys.executable, *flags, script, '--mutant', 'M99'],
capture_output=True, timeout=600)
if out.returncode != 2 or out.stdout or out.stderr != b'unknown mutant label\n':
raise RuntimeError('unknown mutant label not rejected with exact protocol')
print(json.dumps({'scientific_effect': 'NONE', 'mathematical_acceptance': False}))
PY
git diff --exit-code
- name: Full-shell protocol regression tests in both modes
run: |
set -euo pipefail
python -B -S -m unittest discover -s tests -p 'test_elder_cusp_parity_workflow.py' -v
python -B -O -S -m unittest discover -s tests -p 'test_elder_cusp_parity_workflow.py' -v
4 changes: 2 additions & 2 deletions frontiers/elder_cusp_parity_20261002/SOURCES.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@
},
{
"path": "ecp_check.py",
"bytes": 38573,
"sha256": "673c553c629cb09fdead24b7ae2a390ec55ed6a197007bc5e5c0e1c53525a177"
"bytes": 38847,
"sha256": "f6b7d134cc69d7a6d3cd9442d23fd0f86584f7d20553fcc61eab453e4176642f"
},
{
"path": "RESULTS.json",
Expand Down
6 changes: 5 additions & 1 deletion frontiers/elder_cusp_parity_20261002/ecp_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Standard library only; exact rationals throughout; deterministic (a fixed linear congruential generator).
Output: RESULTS.json (sorted keys), byte-identical under -O. Usage:
python3 -B -S ecp_check.py # exit 0, prints RESULTS.json
python3 -B -S ecp_check.py --mutant M3 # exit 1 (only its control fails)
python3 -B -S ecp_check.py --mutant M3 # exit 1, exact JSON names its sole failed control
unknown mutant label -> exit 2

Controls
Expand Down Expand Up @@ -799,6 +799,10 @@ def main(argv):
ok = all(res['controls'].values())
if MUT is None:
print(json.dumps(res, indent=1, sort_keys=True))
else:
print(json.dumps({'failed_controls': [name for name, passed in res['controls'].items() if not passed],
'mutant': MUT, 'scientific_effect': 'NONE'},
sort_keys=True, separators=(',', ':')))
return 0 if ok else 1


Expand Down
Loading
Loading