Skip to content
Merged
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
20 changes: 13 additions & 7 deletions .github/workflows/frontier741.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
- 'research/direct-delivery504-global/**'
- 'research/complex-sw4-frame8/**'
- 'scripts/verify_frontier741*.py'
- 'scripts/verify_frontier_replay.py'
- 'tests/test_frontier_replay_coverage.py'
- 'tests/test_frontier741_bindings.py'
- 'scripts/verify_selected_result.py'
- 'certificates/selected-result.json'
Expand All @@ -23,6 +25,8 @@ on:
- 'research/direct-delivery504-global/**'
- 'research/complex-sw4-frame8/**'
- 'scripts/verify_frontier741*.py'
- 'scripts/verify_frontier_replay.py'
- 'tests/test_frontier_replay_coverage.py'
- 'tests/test_frontier741_bindings.py'
- 'scripts/verify_selected_result.py'
- 'certificates/selected-result.json'
Expand Down Expand Up @@ -53,11 +57,13 @@ jobs:
run: |
python -B scripts/verify_selected_result.py
python -B scripts/verify_pr_reconciliation.py
- name: Receipt coverage regression checks
run: python -B -m unittest discover -s tests -p 'test_frontier_replay_coverage.py' -v
- name: Cold finite replay and exact composition binding
env:
CXX: g++
BOOST_INCLUDE: /usr/include
run: python -B scripts/verify_frontier741.py --work "$RUNNER_TEMP/frontier741"
run: python -B scripts/verify_frontier_replay.py --frontier 741 --work "$RUNNER_TEMP/frontier741"
- name: Require committed files unchanged
run: git diff --exit-code
- uses: actions/upload-artifact@v4
Expand All @@ -66,9 +72,9 @@ jobs:
name: frontier741-linux-python312
path: |
${{ runner.temp }}/frontier741/RESULT.json
${{ runner.temp }}/frontier741/STEPS.json
${{ runner.temp }}/frontier741/*.log
${{ runner.temp }}/frontier741/complex/RESULT.json
${{ runner.temp }}/frontier741/complex/RECEIPT.json
${{ runner.temp }}/frontier741/complex/STAGES.json
${{ runner.temp }}/frontier741/complex/global-replay/ASSEMBLY.json
${{ runner.temp }}/frontier741/replay/STEPS.json
${{ runner.temp }}/frontier741/replay/*.log
${{ runner.temp }}/frontier741/replay/complex/RESULT.json
${{ runner.temp }}/frontier741/replay/complex/RECEIPT.json
${{ runner.temp }}/frontier741/replay/complex/STAGES.json
${{ runner.temp }}/frontier741/replay/complex/global-replay/ASSEMBLY.json
24 changes: 16 additions & 8 deletions .github/workflows/frontier799.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ on:
- 'research/direct-delivery504-global/**'
- 'research/complex-sw4-frame8/**'
- 'research/gauge44-frames-x/**'
- 'scripts/verify_frontier741*.py'
- 'scripts/verify_frontier799*.py'
- 'scripts/verify_frontier_replay.py'
- 'tests/test_frontier_replay_coverage.py'
- 'tests/test_frontier799_bindings.py'
- 'scripts/verify_selected_result.py'
- 'certificates/selected-result.json'
Expand All @@ -24,7 +27,10 @@ on:
- 'research/direct-delivery504-global/**'
- 'research/complex-sw4-frame8/**'
- 'research/gauge44-frames-x/**'
- 'scripts/verify_frontier741*.py'
- 'scripts/verify_frontier799*.py'
- 'scripts/verify_frontier_replay.py'
- 'tests/test_frontier_replay_coverage.py'
- 'tests/test_frontier799_bindings.py'
- 'scripts/verify_selected_result.py'
- 'certificates/selected-result.json'
Expand Down Expand Up @@ -55,11 +61,13 @@ jobs:
run: |
python -B scripts/verify_selected_result.py
python -B scripts/verify_pr_reconciliation.py
- name: Receipt coverage regression checks
run: python -B -m unittest discover -s tests -p 'test_frontier_replay_coverage.py' -v
- name: Cold finite replay and exact composition binding
env:
CXX: g++
BOOST_INCLUDE: /usr/include
run: python -B scripts/verify_frontier799.py --work "$RUNNER_TEMP/frontier799"
run: python -B scripts/verify_frontier_replay.py --frontier 799 --work "$RUNNER_TEMP/frontier799"
- name: Require committed files unchanged
run: git diff --exit-code
- uses: actions/upload-artifact@v4
Expand All @@ -68,10 +76,10 @@ jobs:
name: frontier799-linux-python312
path: |
${{ runner.temp }}/frontier799/RESULT.json
${{ runner.temp }}/frontier799/ANCESTRY.json
${{ runner.temp }}/frontier799/STEPS.json
${{ runner.temp }}/frontier799/*.log
${{ runner.temp }}/frontier799/INDEPENDENT-*.json
${{ runner.temp }}/frontier799/global/ASSEMBLY.json
${{ runner.temp }}/frontier799/global/STAGES.json
${{ runner.temp }}/frontier799/native/STEPS.json
${{ runner.temp }}/frontier799/replay/ANCESTRY.json
${{ runner.temp }}/frontier799/replay/STEPS.json
${{ runner.temp }}/frontier799/replay/*.log
${{ runner.temp }}/frontier799/replay/INDEPENDENT-*.json
${{ runner.temp }}/frontier799/replay/global/ASSEMBLY.json
${{ runner.temp }}/frontier799/replay/global/STAGES.json
${{ runner.temp }}/frontier799/replay/native/STEPS.json
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -582,9 +582,9 @@ frontier626-verify: selected-record-check
.PHONY: frontier741-verify
frontier741-verify: selected-record-check
@work=$$(mktemp -d "$${TMPDIR:-/tmp}/integer-mult-frontier741.XXXXXX"); \
python3 -B scripts/verify_frontier741.py --work "$$work/replay"
python3 -B scripts/verify_frontier_replay.py --frontier 741 --work "$$work/replay"

.PHONY: frontier799-verify
frontier799-verify: selected-record-check
@work=$$(mktemp -d "$${TMPDIR:-/tmp}/integer-mult-frontier799.XXXXXX"); \
python3 -B scripts/verify_frontier799.py --work "$$work/replay"
python3 -B scripts/verify_frontier_replay.py --frontier 799 --work "$$work/replay"
83 changes: 83 additions & 0 deletions docs/research/frontier-replay-coverage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Required evidence coverage for public frontier replay

Tooling integration; no new kappa or mathematical construction.

[Lucas's PR838](https://github.com/CrocSwap/integer-mult-bounds/pull/838), at
`2a50020bb9564229874cbfbdc112e17b235bacfc`, identified a receipt-coverage gap:
the PR741 composition checker accepts an unrelated successful stage in place
of a required stage, or an omitted artifact when its receipt entry is omitted
too. Its existing checks validate the hashes of listed evidence, but do not
require the producer's complete inventory. PR799 uses that checker for ancestry.

The public `make frontier741-verify` and `make frontier799-verify` commands and
both frontier CI workflows now use `scripts/verify_frontier_replay.py`. It
requires the frozen PR741 producer's 22 ordered stages, all 44 artifact paths,
and agreement between the receipt and `STAGES.json`, then applies every
historical composition check, including file/log hashes and path containment.
The inventory comes from the producer and retained complete run, not the
candidate receipt. A regression checks agreement with the producer's 34 fixed
outputs and its ten local outputs.

The entrypoint checks reused ancestry before starting a supplier. After a cold
run it checks ancestry again, before writing the public completion record.
The implementation delegates construction to the existing scripts; it does not
copy or change their mathematics, source packages, selected records or proof
hashes. Existing historical script entrypoints retain their historical checks.

## Commands and output layout

```sh
python3 -B -m unittest discover -s tests -p 'test_frontier_replay_coverage.py' -v
make frontier799-verify
```

For an explicit output directory, which must be fresh and outside the repository:

```sh
python3 -B scripts/verify_frontier_replay.py --frontier 799 --work /tmp/frontier-run
```

`/tmp/frontier-run/replay/` contains the historical script's logs and output.
Only `/tmp/frontier-run/RESULT.json` marks successful completion of the public
entrypoint. It retains the historical result fields and adds receipt coverage
counts. Expected final output for the base selection:

```text
PASS_COMPLETE_REPLAY_RECEIPT_COVERAGE 0.001661634653669567
```

To reuse a complete PR741 run, add `--ancestor /path/to/pr741`. That directory
must contain `bit/` and `complex/`; for output from this new entrypoint, use its
`replay/` subdirectory. Incomplete reuse is rejected before creating the output
directory. Construction failure or failed postflight coverage leaves no public
top-level `RESULT.json`; diagnostic files may remain in `replay/`.

## Scope and attribution

Base: `f567884aeb8851b6e794af1184119a3bfbe1e631`. The source contract is
`research/complex-sw4-frame8/verify.py` and its retained complete archive
`research/community-queue-20261013/pr741-fresh-replay.tar.gz` at that commit.
Changing that producer's coverage requires reviewing this contract and tests.

Validation on Linux CPython 3.12.15 in a network-disabled, read-only Docker
container: all 11 new tests pass, the existing PR741/PR799 binding suites pass,
and the selected-record integrity check passes with its original hashes. Tests
physically delete each of the 44 artifacts and reproduce historical acceptance
of representative coherently rehashed omissions. Publication tests substitute
only the expensive subprocess boundary and validate real archived evidence;
they are not fresh native construction runs. A fresh full cold replay and
hosted CI are not claimed as locally completed; the updated workflows perform
the full cold replay when run.

This closes omission acceptance in the public entrypoint. It does not
authenticate a fabricated log, establish that an arbitrary receipt records
an actual execution, or replace mathematical certificate replay. It does not
audit all PR799 evidence or prove the full multiplication theorem. Inherited
realization, all-size, hosting, precision/tape and analytic assumptions remain.

Credit Lucas (@ljste) for PR838's finding and supplemental coverage predicate;
Douglas Colkitt for the composition checkers and retained replays; Chafik
Boukhalfa for PR741; and DreamingOfClouds and eumemic for PR589/PR555 and their
retained predecessors. Production integration and regression tests by
Chinmay (@chinmayarvind23), with substantial OpenAI Codex assistance, under
Apache-2.0. This is a follow-up to PR838, not an independent discovery.
111 changes: 111 additions & 0 deletions scripts/verify_frontier_replay.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
#!/usr/bin/env python3
"""Run the frozen PR741/799 verifiers with mandatory PR741 receipt coverage.

The historical scripts and their proof-record hashes remain unchanged. A run
is complete only when this entrypoint writes its top-level RESULT.json.
Coverage finding: Lucas (@ljste), PR838. Integration: Chinmay (@chinmayarvind23), with
substantial OpenAI Codex assistance. Apache-2.0. No new mathematical bound.
"""
import argparse
import json
from pathlib import Path
import subprocess
import sys

from verify_frontier741_bindings import check as check_composition, read, require

ROOT = Path(__file__).resolve().parents[1]

# Contract of the frozen complex-sw4-frame8/verify.py producer. Its 34 fixed
# outputs and ten local outputs are deliberately independent of the candidate
# receipt. Tests bind this list to the producer and the retained complete run.
EXPECTED_STAGES = (
'ancestral558-fresh', 'gauge44-exact-construction', 'notri56-construction',
'notri-control-g44', 'layered66-construction', 'p6n-cold72-construction',
'four-promotions', 'promotion-controls', 'sw4-read-exchanges',
'eight-B-frame-construction', 'all728-columns-native', 'both-native-ledgers',
'independent-native-controls', 'residual-wrappers', 'all-native-phase-edges',
'independent-scalar-frames-cones', 'inherited-cold-controls',
'eight-frame-controls', 'owner-construction-controls',
'strict-global-admission', 'independent-literal-map-moment',
'independent-two-engine-outer47',
)
EXPECTED_ARTIFACTS = frozenset((
'RESULT.json', 'ANCESTRAL-LINK.json', 'STAGES.json',
'INDEPENDENT-LOCAL.json', 'INDEPENDENT-MAP.json', 'INDEPENDENT-PRICE.json',
'RECONSTRUCTED-OWNERS.json.gz', 'OWNER-CONSTRUCTION-CONTROLS.json',
'FRAME-CONTROLS.json', 'cold-controls/COLD-END-CONTROLS.json',
'PROMO-CONTROLS.json', 'promoted/FULL-WORD.json.gz', 'p6n/STEPS.json',
'p6n/controls/COLD-END-CONTROLS.json', 'p6n/p6n/FULL-WORD.json.gz',
'sw4/BUILD.json', 'sw4/FULL-WORD.json.gz', 'frames/BUILD.json',
'frames/FULL-WORD.json.gz', 'gauge44/STEPS.json', 'notri56/STEPS.json',
'notri56/cold44/CONSTRUCTION.json', 'notri-control/STEPS.json',
'layered66/STEPS.json', 'layered66/swap/PIVOT-SWAP.json',
'layered66/controls/COLD-END-CONTROLS.json', 'global-replay/REPLAY.json',
'global-replay/ASSEMBLY.json', 'global-replay/STAGES.json',
'global-replay/ADMISSION-CONTROLS.json', 'global-replay/BIT-SUPPLIER-CONTROLS.json',
'global-replay/global/audit/OWNERS-AND-PROFILE.json',
'global-replay/global/audit/PREFIX-AND-INVOICE.json',
'global-replay/global/audit/ASYNC-AUDIT.json',
'local/CANONICAL-WORD.json.gz', 'local/CLIFFORD-RECIPES.json',
'local/CLIFFORD-REVIEW.json', 'local/FULL-WORD.json.gz',
'local/INDEPENDENT-LOCAL-REPLAY.json', 'local/LOCAL-CHECKS.json',
'local/LOCAL-PROGRAMS.json.gz', 'local/RESIDUAL-ADAPTERS.json',
'local/SCALAR-FRAME-AUDIT.json', 'local/WRAPPER-CHECKS.json',
))


def check_coverage(complex_dir):
receipt = read(complex_dir / 'RECEIPT.json')
stages = receipt['stages']
require(tuple(s['name'] for s in stages) == EXPECTED_STAGES and
all(s['exit_code'] == 0 for s in stages), 'Required replay stages differ')
require(set(receipt['artifacts']) == EXPECTED_ARTIFACTS,
'Required replay artifact inventory differs')
require(read(complex_dir / 'STAGES.json') == stages,
'Receipt stages differ from recorded execution stages')


def check_ancestry(ancestor):
"""Enforce coverage, then retain every original source/hash/math check."""
check_coverage(ancestor / 'complex')
return check_composition(ancestor / 'bit', ancestor / 'complex')


def main(argv=None):
p = argparse.ArgumentParser(description=__doc__)
p.add_argument('--frontier', choices=('741', '799'), required=True)
p.add_argument('--work', type=Path, required=True)
p.add_argument('--ancestor', type=Path,
help='PR799 only: reuse a complete historical PR741 output '
'(or the replay/ directory of this entrypoint)')
a = p.parse_args(argv)
work = a.work.resolve()
if sys.flags.optimize or work.exists() or work.is_relative_to(ROOT):
p.error('Use enabled assertions and a fresh output directory outside the repository')
if a.ancestor is not None and a.frontier != '799':
p.error('--ancestor is only supported for frontier 799')
ancestor = a.ancestor.resolve() if a.ancestor is not None else None
# Reject incomplete reused evidence before starting any supplier work.
if ancestor is not None:
check_ancestry(ancestor)
work.mkdir(parents=True)
replay = work / 'replay'
command = [sys.executable, '-B', str(ROOT / ('scripts/verify_frontier' + a.frontier + '.py')),
'--work', str(replay)]
if ancestor is not None:
command += ['--ancestor', str(ancestor)]
subprocess.run(command, cwd=ROOT, check=True)
if ancestor is None:
ancestor = replay if a.frontier == '741' else replay / 'ancestor'
check_ancestry(ancestor)
result = read(replay / 'RESULT.json')
result['receipt_coverage'] = dict(stages=len(EXPECTED_STAGES), artifacts=len(EXPECTED_ARTIFACTS))
# Nested files are the historical producer's output. Publish the public
# completion record only after the additional evidence checks succeed.
(work / 'RESULT.json').write_text(json.dumps(result, indent=2) + '\n', encoding='utf-8')
print('PASS_COMPLETE_REPLAY_RECEIPT_COVERAGE', result['decimal'], flush=True)


if __name__ == '__main__':
main()
Loading