Skip to content

Tooling: pack cyclic routing states with identical exhaustive receipts - #808

Merged
Mister-Meeseeks merged 2 commits into
CrocSwap:mainfrom
4RchYMing:research/seed87-verification-engineering
Oct 14, 2026
Merged

Mister-Meeseeks merged 2 commits into
CrocSwap:mainfrom
4RchYMing:research/seed87-verification-engineering

Conversation

@4RchYMing

@4RchYMing 4RchYMing commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

The historical cyclic routing checker stores more than half a million nested scalar/routing states. This replaces those state keys with an injective, order-preserving integer encoding, reducing verification time and Python allocation peaks while retaining every original exhaustive-search receipt. Tooling improvement; no new κ or negative result.

Contributor

4RchYMing (GitHub, authenticated account ID 275918740). Git author: 4RchYMing <275918740+4RchYMing@users.noreply.github.com>, explicitly specified by the contributor. The predecessor's authorship and notices remain intact.

AI Assistance

Prepared with substantial OpenAI Codex assistance for implementation, mathematical reasoning, independent test implementation, experiments, documentation, and delivery. No independent human peer review is claimed.

Base Commit

66849e1475c930fd7732b1a0067ffee7e1e95f60 is the original implementation and benchmark baseline. Upstream subsequently advanced to 7ee02b7c96d85f22b38d28bd7ed49bb8c1aeb261; all 19 relevant original checker/certificate, pinned dependency, test-runner and CI input files there are byte-identical. The compatibility receipt is retained in VALIDATION-MATRIX.json. OS-cryptographic assignment seed 87, verification-engineering track. Three candidates, measurements, the local claim, and overlap review are recorded in research/cyclic-routing-performance/SELECTION.json. There is no pinned coordination issue.

Research Scope

Only audit_cyclic_topology.routing_state_search: two-port XOR words on 2, 3, or 4 arbitrary-input roles, with the existing depth cap of seven. Preserve scalar/routing joint-state distinctions, full-routing saturation pruning, stopping rules, terminal tests, every frontier digest, and all eight cyclic seed controls. Selected-frontier records, upstream/, and the contributor list are unchanged. The #741 frontier selected by newer upstream commits is outside this contribution.

Method

Place each scalar row in a separate fixed-width integer lane and the complete routing bit set in the low bits. The encoding is injective and preserves the original tuple ordering. XOR updates affect only the target lane; the routing extension remains unchanged. Decode sorted keys to preserve the exact original hash input. The README proves these invariants and explains why the permutation lookup agrees with the old predicate on reachable invertible matrices.

Only the historical certificate's changed checker-source binding is regenerated. Benchmark processes load the original implementation from its pinned Git object and compare the entire certificate after restoring that one binding. Source dependencies and the original certificate are hash-pinned.

Results

  • 529,066 four-role states, all frontier digests, terminal counts, saturation counts, and complete historical certificate fields are preserved.
  • Final seven alternating fresh-process pairs on Windows 10 / CPython 3.12.14: complete-process median 3.788324 s → 2.680431 s, 1.413× faster / 29.24% less elapsed time. The earlier seven-pair run is retained too: 1.368×. All 80 receipts across five benchmark series, including the separate memory runs, agree.
  • Separately traced Python allocation peak: 131,099,209 → 80,510,849 bytes, 38.59% lower. This is not RSS; tracing is disabled in timing runs.
  • Full independent coverage: the dense-F2/literal-permutation-set oracle checks every cap 0–7 for all three widths, including all 529,066 four-role states. Every receipt field agrees. A scalar-only merge control loses coverage despite retaining the same negative Boolean and is detected.
  • 14 tests pass on each of CPython 3.11.16, 3.13.15 and 3.14.7, plus all 14 under 3.14.7 -O (56 successful test executions). VALIDATION-MATRIX.json retains command output and source hashes.
  • Minimal offline replays in a path with spaces pass. Modified dependencies, reused output paths, and invalid parameters are rejected. Selected-record/source-inventory and staged whitespace checks pass. VALIDATION.txt retains command output.

Additional same-host, same-input pairs on the CI interpreter versions show that the speedup varies by interpreter:

CPython Original process median Packed process median Speedup Python allocation peak reduction
3.11.16 3.436026 s 2.553110 s 1.346x 38.59%
3.13.15 3.628811 s 2.902232 s 1.250x 38.61%
3.14.7 3.842965 s 3.198651 s 1.201x 42.42%

Each row uses seven alternating fresh-process pairs and separate memory runs. All samples, including the more variable 3.14 timings, are retained. These are within-version comparisons; 1.413x is not a universal guarantee.

Reproduction

Python 3.11+ standard library and Git; use a full clone containing the base commit and a fresh output path:

python3 -B research/cyclic-routing-performance/benchmark.py --pairs 7 --out routing-benchmark.json
python3 -B -m unittest discover -s tests -p test_cyclic_routing_packed.py -v
python3 -B -m unittest discover -s tests -p test_finite_bit_contract.py -v

Expected: PASS_IDENTICAL_COMPLETE_ROUTING_RECEIPTS; five and nine tests pass. SOURCE.json, RESULT.json, INITIAL-RESULT.json, RESULT-python311.json, RESULT-python313.json, RESULT-python314.json, VALIDATION-MATRIX.json, and EXPLORATION.json retain pins, exact dependency versions, all measurements, and exploratory evidence. Repeat the commands under each Python interpreter with fresh benchmark output paths; add -O before -m to reproduce the optimized-mode tests. The README gives the argument and review map.

Limitations

This measures one historical verifier, not selected-supplier replay or multiplication runtime. OS caches were not flushed; absolute timings vary. There is one separately traced memory run per mode in each benchmark series. The four-role frontier remains unclosed; no claim extends beyond depth seven. The independent implementation shares the documented joint-state reduction and saturation rule; it does not independently prove those reductions. This is not a Lean formalization or a new multiplication theorem, and all inherited transfer/physical/compiler/precision/tape/analytic assumptions remain.

Full make verify, the selected cold replay, Lean, and remote Linux CI were not run locally. This Windows environment lacks make and a C++ compiler. The local version matrix ran on Windows. Upstream Actions returned action_required, requiring maintainer approval; Linux CI and maintainer review are separate from this local evidence.

Prior Work

Douglas R. Colkitt's original checker, certificate, and docs/research/cyclic-topology-audit.md provide the routing obstruction and finite-state reduction (historical source commit d55bcd62ceb8f322bcf311a5a66e94c3ac7724f0). Original notices and Apache-2.0 licensing remain.

eumemic's pending #154 profiles other verifier hotspots; Victor Li's pending #756 optimizes the distinct balanced-Fano search. Neither supplies code here. The original overlap refresh covered 614 open PRs through #795 and fresh arrivals through #799. The follow-up checked the 100 latest open PRs through #820; only this PR matched the cyclic-routing optimization scope. Earlier original-hash inventories and frozen supplier copies are preserved as historical provenance.

Preserve every original frontier and complete certificate receipt while
reducing full-check wall time and Python allocation peaks. Include an
independent literal-state oracle, negative controls, pinned original
replays, and alternating same-environment benchmarks.

Base-Commit: 66849e1
AI-Assistance: OpenAI Codex provided substantial implementation, mathematical
 reasoning, experimentation, validation, and documentation assistance.
Check every depth cap through seven for all supported widths. Preserve
Python 3.11/3.13/3.14 tests, paired benchmarks and current-upstream
dependency comparisons without changing the verifier or its certificate.

AI assistance: substantial OpenAI Codex assistance with verification,
experiments, documentation and delivery.
@Mister-Meeseeks

Copy link
Copy Markdown
Contributor

100-PR batch review at 9ce9273e6b2b6f66b9aabd2fe6d366b6b3988a97.

Merged to main, preserving the original contributor commits and package attribution.

Reviewed scope: Packed cyclic routing states retain full routing set and lexicographic order; dense independent oracle, closure/cutoff and corrupted-state controls.

The pinned scoped command passed; the batch ledger contains its command, input hashes, environment and log. This incorporates the research/tooling contribution and does not change the selected κ or discharge the inherited multiplication-theorem assumptions.

Batch review, attribution and evidence. Thank you for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants