Skip to content
Merged
99 changes: 99 additions & 0 deletions .github/workflows/cusp-second-order.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Cusp second-order exact controls

'on':
pull_request:
paths:
- 'frontiers/cusp_second_order_20261001/**'
- '.github/workflows/cusp-second-order.yml'
# bound merged sources (consumed in SOURCES.json) and the pinned unmerged dependencies (#191, #198; verified by blob)
- 'frontiers/remainder_vanishing_20260930/PROOF.md'
- 'frontiers/remainder_rate_20260930/PROOF.md'
- 'frontiers/three_fronts_20260924/LIFETIME_REMAINDER.md'
- 'frontiers/c7_total_bounded_20260929/PROOF.md'
- 'imports/lifetime_parent_20260925/UNIFORM_MATRIX_CAP_AND_LIFETIME.md'
- 'imports/lifetime_parent_20260925/ERRATUM_CONGRUENCE.md'
- 'reviews/d1_section9_borel_repair_20260925/REPAIR.md'
- 'reviews/d1_chain_reconciliation_20260928/RECONCILIATION.md'
- 'frontiers/fixed_r_inverse_lifetime_20260930/PROOF.md'
- 'frontiers/c7_zero_gap_limit_20260929/PROOF.md'
workflow_dispatch:

permissions:
contents: read

jobs:
exact-controls:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: '3.11.16'
- name: Verify sources, replay both modes, reject mutants
env:
PYTHONDONTWRITEBYTECODE: '1'
GH_TOKEN: ${{ github.token }}
GH_REPOSITORY: ${{ github.repository }}
run: |
set -euo pipefail
python -B -S - <<'PY'
import base64, hashlib, json, os, pathlib, subprocess, sys, urllib.request
root = pathlib.Path('frontiers/cusp_second_order_20261001').resolve()
manifest = json.loads((root / 'SOURCES.json').read_text())
present = sorted(p.name for p in root.iterdir())
expected_names = sorted([e['path'] for e in manifest['files']] + ['SOURCES.json'])
if present != expected_names:
raise ValueError('packet tree differs from manifest: ' + repr(present))
for entry in manifest['files']:
path = root / entry['path']
if path.is_symlink():
raise ValueError('symlink: ' + entry['path'])
data = path.read_bytes()
if len(data) != entry['bytes'] or hashlib.sha256(data).hexdigest() != entry['sha256']:
raise ValueError('packet file identity mismatch: ' + entry['path'])
for entry in manifest['consumed'] + manifest['cited_only']:
data = pathlib.Path(entry['path']).read_bytes()
framed = b'blob ' + str(len(data)).encode() + b'\0' + data
if len(data) != entry['bytes'] or hashlib.sha256(data).hexdigest() != entry['sha256'] or hashlib.sha1(framed).hexdigest() != entry['git_blob']:
raise ValueError('merged source drifted: ' + entry['path'])
# each consumed unmerged dependency (#191, #198) is verified by its pinned blob: from the tree if the dependency
# has landed (then it must be byte-identical to the pinned version, else this packet needs rebinding),
# otherwise fetched by blob id through the repository API; absence or drift fails the job
for entry in manifest.get('consumed_unmerged', []):
tree_path = pathlib.Path(entry['path'])
if tree_path.exists():
data = tree_path.read_bytes()
where = 'tree'
else:
req = urllib.request.Request(
'https://api.github.com/repos/' + os.environ['GH_REPOSITORY'] + '/git/blobs/' + entry['git_blob'],
headers={'Authorization': 'Bearer ' + os.environ['GH_TOKEN'], 'Accept': 'application/vnd.github+json'})
with urllib.request.urlopen(req, timeout=60) as resp:
blob = json.load(resp)
if blob.get('encoding') != 'base64':
raise ValueError('unexpected blob encoding for ' + entry['path'])
data = base64.b64decode(blob['content'])
where = 'blob api'
framed = b'blob ' + str(len(data)).encode() + b'\0' + data
if len(data) != entry['bytes'] or hashlib.sha256(data).hexdigest() != entry['sha256'] or hashlib.sha1(framed).hexdigest() != entry['git_blob']:
raise ValueError('consumed unmerged dependency differs from the pinned blob (rebind required): ' + entry['path'] + ' via ' + where)
print(json.dumps({'consumed_unmerged_verified': entry['path'], 'git_blob': entry['git_blob'], 'via': where}))
script = str(root / 'cusp_check.py')
expected = (root / 'RESULTS.json').read_bytes()
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:
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', 'M9'], capture_output=True, timeout=600).returncode
if rc != 2:
raise RuntimeError('unknown mutant label not rejected with exit 2')
print(json.dumps({'scientific_effect': 'NONE', 'mathematical_acceptance': False}))
PY
git diff --exit-code
138 changes: 138 additions & 0 deletions frontiers/cusp_second_order_20261001/EXPLORE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{
"X1": {
"agree_with_window_1_3": 32,
"disagreements": [],
"r": 0.01,
"random_trials": 40,
"targeted_r_0.003": [
{
"elder": true,
"kappa": 0.799,
"phi_target": 0.3,
"typed": true
},
{
"elder": true,
"kappa": 0.61,
"phi_target": 0.3,
"typed": true
},
{
"elder": true,
"kappa": 1.483,
"phi_target": 0.32,
"typed": true
},
{
"elder": true,
"kappa": 2.774,
"phi_target": 0.32,
"typed": true
},
{
"elder": false,
"kappa": 0.419,
"phi_target": 0.345,
"typed": true
},
{
"elder": false,
"kappa": 1.618,
"phi_target": 0.345,
"typed": true
},
{
"elder": false,
"kappa": 1.494,
"phi_target": 0.36,
"typed": true
},
{
"elder": false,
"kappa": 2.471,
"phi_target": 0.36,
"typed": true
},
{
"elder": true,
"kappa": 1.776,
"phi_target": -0.3,
"typed": true
},
{
"elder": true,
"kappa": 0.885,
"phi_target": -0.3,
"typed": true
},
{
"elder": true,
"kappa": 1.088,
"phi_target": -0.32,
"typed": true
},
{
"elder": true,
"kappa": 0.802,
"phi_target": -0.32,
"typed": true
},
{
"elder": false,
"kappa": 0.932,
"phi_target": -0.345,
"typed": true
},
{
"elder": false,
"kappa": 0.484,
"phi_target": -0.345,
"typed": true
},
{
"elder": false,
"kappa": 0.482,
"phi_target": -0.36,
"typed": true
},
{
"elder": false,
"kappa": 1.798,
"phi_target": -0.36,
"typed": true
}
],
"typed": 32
},
"X2": {
"d2": {
"I_cand": -0.1772744,
"J": 0.5518754382,
"J_coarse": 0.5518754382,
"c": 0.073406919306,
"c1": -0.26939883,
"c1_over_c": -3.669938,
"method": "composite Gauss-Legendre, a = -w^4: 24x12 by 56x12 nodes (coarse: 12x12 by 28x12)",
"rejected_coefficient": 0.09212443
},
"d3": {
"I_cand": -0.13940406,
"J": 1.363390706,
"J_coarse": 1.363390722,
"c": 0.041775931841,
"c1": -0.21184835,
"c1_over_c": -5.071062,
"mc_check": {
"J": 1.36198,
"J_se": 0.00089,
"c1": -0.21163,
"c1_se": 0.00014,
"method": "Monte Carlo on the cone, 8000000 samples, seed 1001, 10 batches"
},
"method": "cone quadrature: Gauss-Legendre 64 x 64 in (rho, u), trapezoid 9 in theta, Gauss-Laguerre 64 in s (coarse: Laguerre 32)",
"rejected_coefficient": 0.0724443
}
},
"not_a_control": true,
"object": "CL-CUSP-SECOND-ORDER-20261001-v1.1 exploration"
}
Loading
Loading