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
22 changes: 22 additions & 0 deletions .github/workflows/exact-exp-performance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Exact exponential interval checks

on:
pull_request:
paths:
- 'research/exact-exp-performance/**'
- '.github/workflows/exact-exp-performance.yml'
workflow_dispatch:

jobs:
focused-checks:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.11', '3.14']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Exact arithmetic and full checker controls
run: python -B -m unittest discover -s research/exact-exp-performance -p 'test_*.py' -v
60 changes: 60 additions & 0 deletions research/exact-exp-performance/CLAIM.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"track": "Verification engineering",
"assignment_seed": 91,
"seed_source": "Python secrets.randbelow(100), operating-system randomness",
"base_commit": "66849e1475c930fd7732b1a0067ffee7e1e95f60",
"started_utc": "2026-10-13T03:25:21Z",
"claimed_utc": "2026-10-13T03:27:07.120724+00:00",
"expected_finish_utc": "2026-10-13T04:10:00Z",
"time_budget": "45-minute cap; orientation completed in under 2 minutes; final verification/handoff phase begins at the recorded time and occupies at least the final quarter of actual work.",
"coordination": "No pinned issues and no sprint coordination issue among the open issues; local claim per sprint instructions.",
"candidates": [
"Clifford state evaluation (overlaps PR662)",
"Independent owner-checker exact exponential intervals (selected: 91 modulo 3 = 1)",
"Streaming selected inventory hashes (unmeasured benefit)"
],
"scope": "The 16-term Taylor exponential interval helper in research/complex-k492-owner-repair/extras/exact_intervals.py, used by the independent owner-map moment check.",
"hypothesis": "Homogeneous integer polynomial evaluation can return exactly the same rational lower/upper bounds with fewer Fraction reductions.",
"method": "Same 16 Taylor terms, same tail x^17/(17!*(1-x/18)), same 200-bit outward rounding, exact input domain 0 <= a <= b < 1; differential tests and same-input alternating benchmarks, including the complete pinned independent owner check if fixtures are available.",
"deliverable": "Opt-in source-pinned kernel and replay adapter, exact equivalence argument, negative controls, raw before/after timings, no new kappa.",
"overlap_review": {
"open_pr_count": 488,
"most_recent_seen": 668,
"relevant_prs": [
662,
667,
367,
452,
333,
220
],
"distinction": "PR667 optimizes a logarithm helper in a different moment engine; this work changes only the independent checker exponential polynomial. No dependency on pending PR code."
},
"limits": "No frozen sources or selected frontier edits; finite validation is not a full multiplication theorem.",
"final_verification_started_utc": "2026-10-13T03:35:00Z",
"overlap_refresh": {
"checked_utc": "2026-10-13T03:36:28.422795+00:00",
"open_pr_count": 491,
"highest_number": 671,
"pinned_coordination_issues": [],
"main_commit": "66849e1475c930fd7732b1a0067ffee7e1e95f60",
"exact_intervals_search_results": [],
"exponential_search_results": [
479,
67,
605,
229,
91,
70,
634,
585
],
"assessment": "No competing exponential-kernel implementation found; PR667 logarithm optimization is adjacent but distinct."
},
"result": {
"status": "completed tooling contribution; no new kappa",
"summary": "Exact integer exponential kernel with full receipt equality; no claimed substantial full-check speedup. Focused correctness and rejection tests pass on Python3.13/3.14. See README and evidence for measured timings.",
"link": "https://github.com/steph4n-gh/integer-mult-bounds/tree/codex/exact-exp-interval-performance/research/exact-exp-performance",
"scope": "Same 16-term Taylor polynomial, tail and 200-bit rounding; unchanged frozen verifier executed on archived native fixtures."
}
}
24 changes: 24 additions & 0 deletions research/exact-exp-performance/NOTICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Attribution and license

Prepared for Stephan Arrington (`steph4n-gh`) with substantial OpenAI Codex
assistance in implementation, mathematical derivation, tests and review.
New files are under the repository's Apache-2.0 license.

The pinned `exact_intervals.py` and `check_owner_map.py` are from Chafik
Boukhalfa/chafreaky's PR626 independent owner-map checking work, prepared with
OpenAI Codex. The native suppliers and dispatch come from Jeremy Kothe's
PR622/623 and their Claude-assisted construction. The PR622 fixture is the
maintainer's archived fresh replay. No frozen source is copied or edited here.

The underlying lineage includes DreamingOfClouds' cold-helper construction,
Rohan Arun's PR559 recurrence correction, eumemic's bit supplier, icekylinx's
direct-delivery work and GamingPuzzled's owner-headroom lead. Their source
notices, licenses and substantial-assistance disclosures remain in
`research/complex-k492-owner-repair/NOTICE.md` and its dependencies. This notice
does not replace them or claim their constructions as new work.

Related pending tooling contributions PR667 (logarithm arithmetic), PR662
(Clifford state evaluation), PR367 (exact frame algebra) and PR452 (native
replay) are acknowledged; their code is not imported and they are not
dependencies. Integer Horner evaluation is standard algebra, not a claimed
novel mathematical technique.
174 changes: 174 additions & 0 deletions research/exact-exp-performance/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# Exact exponential intervals with integer arithmetic

**Tooling improvement and bounded end-to-end performance result; no new κ.**

This opt-in kernel evaluates the independent PR626 owner checker's exponential
intervals with integer arithmetic. It returns exactly the same two rational
bounds as the pinned reference: the same degree-16 Taylor polynomial, geometric
remainder bound, and 200-bit outward rounding. It changes neither precision nor
the moment admission threshold.

On the actual 18 exponential argument pairs used by the archived owner check,
15 alternating pairs per interpreter on macOS arm64 measured approximately
**13× faster arithmetic**. Each kernel batch repeats those 18 pairs 50 times.

| Local interpreter | Kernel reference → integer | Ratio | Complete owner check reference → integer | Ratio |
| --- | ---: | ---: | ---: | ---: |
| CPython 3.14.4 | 0.62026 s → 0.04810 s | 12.90× | 0.38281 s → 0.37411 s | 1.023× |
| CPython 3.13.5 | 0.63399 s → 0.04867 s | 13.03× | 0.41303 s → 0.40023 s | 1.032× |

**The complete-check improvement is small (about 2–3% less wall time).** An
initial Python 3.14 run showed only 0.5% improvement. The checker also reads and
validates native programs and 35,424 owner roles. The arithmetic gain should
not be presented as a frontier-replay speedup or a substantial complete-check
acceleration.

Raw per-pair timings, environments, input/output fingerprints, implementation
hashes and receipt hashes are in [the Python 3.14 evidence](evidence/benchmark-python314.json)
and [Python 3.13 evidence](evidence/benchmark-python313.json). Earlier exploratory
runs are retained as `evidence/initial-benchmark-*.json`; they predate the addition
of implementation hashes to the reporting code. They are not discarded because
of their less favorable timings. Timings are machine-specific, include normal
OS caching, and have no pass/fail threshold. The final two interpreter runs were
sequential. Every complete-check receipt is byte-identical to the pinned baseline.

## Reproduce

From the repository root, with Python 3.11+ and the standard library only:

```sh
python3 -B -m unittest discover -s research/exact-exp-performance -p 'test_*.py' -v
```

Expected result: **11 tests pass**, including exact kernel comparisons and the
complete independent owner checker with negative controls. This does not run
supplier construction or the full selected frontier suite.

To repeat the timing experiment (use a fresh output filename):

```sh
python3 -B research/exact-exp-performance/benchmark.py --pairs 15 --out /tmp/exact-exp-benchmark.json
```

Expected marker: `PASS_EXACT_EXP_BENCHMARK`; timing ratios may differ.
Both engines receive identical input pairs. Pair order alternates. The complete
check runs in a fresh process for each engine, including source admission,
imports, JSON decoding, all existing owner checks and output writing. Entire
receipts are compared after each pair, in addition to each engine's baseline
receipt pin. Kernel timing excludes logarithm construction and input preparation;
the complete-check timing includes them.

For a single opt-in replay:

```sh
python3 -B research/exact-exp-performance/run.py --engine integer --out /tmp/exact-exp-owner.json
```

Expected marker: `PASS independent map and exact moments`. The complete report
SHA-256 is `ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092`.
`--engine reference` executes the unchanged reference. Existing output paths and
paths inside the repository are refused. Run from a full checkout: the archived
fixtures are already committed and no network access is needed.

## Why the bounds are identical

For a reduced `Fraction` x = p/q with q > 0, let

```
c_j = 16! / j!
N = sum(c_j * p^j * q^(16-j), j=0..16)
d = 16! * q^16.
```

Thus N/d is exactly P₁₆(x) = Σ xʲ/j!. The reference forms the same polynomial
by rational term multiplication and addition. The candidate starts N=1 and
Q=1, then for j=15,…,0 sets Q←qQ and N←pN+c_jQ. After processing j,

```
N = sum(c_k * p^(k-j) * q^(16-k), k=j..16), Q = q^(16-j).
```

This invariant follows directly by multiplication by p and adding the k=j
term. At j=0 it gives the numerator and denominator above without intermediate
fraction normalization.

The reference's upper remainder is

```
R(x) = x^17 / (17! * (1 - x/18)).
```

For 0≤x<1, all Taylor terms are nonnegative and the ratios after the first
omitted term are at most x/18, so the geometric bound covers the entire tail.
With the same N,d and t = 17(18q-p)>0,

```
P₁₆(x) + R(x) = (N*t + 18*p^17) / (d*t).
```

The candidate therefore returns floor(2²⁰⁰P₁₆(a))/2²⁰⁰ and
ceil(2²⁰⁰(P₁₆(b)+R(b)))/2²⁰⁰ by integer division. These are exactly the
reference's `down` and `up`, including grid boundaries and zero. Python integers
are unbounded; there is no floating-point arithmetic or input-dependent cache.

Supported inputs are `Fraction` endpoints satisfying 0≤a≤b<1, exactly the
actual owner-checker calls. Other types are rejected explicitly. This does not
promise compatibility with accidental behavior on floats or other numeric types.
Invalid intervals raise `ValueError`; checks remain active under optimized Python.

## Validation scope

The kernel tests compare all **276 boundary pairs** and **480 seed-91 rational
pairs**, with denominator sizes through 1024 bits, to the source-pinned reference.
A separate direct-power/factorial implementation checks the arithmetic, and a
degree-64 enclosure supplies exact witnesses for rounding and tail controls.
Five negative mechanisms are detected: an omitted polynomial term, an omitted
tail, an incorrect tail ratio, and inward rounding at either endpoint. These
finite checks corroborate the algebraic argument; they are not a formal proof
of the multiplication theorem.

The replay test executes **32 subprocess controls** covering both engines:
normal and optimized-Python positives, existing-output protection, repository
output refusal, changed and missing pinned sources, and a wrong receipt digest.
Mathematical mutations exercise both moment thresholds, owner width/family/call/
footprint checks, call chronology, native hashes and orientation counts. For
these mutations only, the test bypasses adapter source admission and recomputes
the relevant input pins in a temporary copy, so rejection comes from the actual
checker obligation. It requires the specific expected error, not just any crash.
These controls pass on local Python 3.14.4 and Python 3.13.5 (the latter suite
also under `-O`); each suite runs the checker with and without optimization.
The dedicated Linux workflow is separate from these recorded local results.

`SOURCE.json` pins the exact base, reference helper, full checker, six package
inputs and four archived native artifacts. `run.py` executes the unchanged
checker via `runpy` and narrowly intercepts its import of `exact_intervals.py`:
the original module is loaded first, then only `exp` is replaced. The original
logarithm, source checks, geometry, both program orientations, owner capacities,
disjointness, compaction, rank mass, exact moments and outer conversion all run.
The import hook is restored afterward and must apply exactly once.

The archived native words are reused from the maintainer's PR622 replay; the
owner map is PR626. **No fresh supplier construction, controller replay,
47-inequality assembly, Lean build or full `make verify` is claimed.** All-size
compilation, common-label/mutable-basis realization, pooled hosting,
precision/tape/recovery and analytic assumptions remain inherited. Frozen
packages, `upstream/`, default commands and the selected result are unchanged.

## Provenance and overlap

Base: `66849e1475c930fd7732b1a0067ffee7e1e95f60`. OS-random assignment seed: **91**.
The local claim and three considered tasks are recorded in `CLAIM.json`. No
pinned sprint coordination issue existed at the initial check.

Chafik Boukhalfa's PR626 supplies the independent checker; Jeremy Kothe's
PR622/623 supplies the native construction and inherited dispatch. The archive
comes from the maintainer's review. See [NOTICE.md](NOTICE.md) and the retained
[construction notice](../complex-k492-owner-repair/NOTICE.md) for the cumulative
contributor and AI-assistance record.

Pending PR667 optimizes logarithms in a different moment engine; it is related
work, not a dependency or a source of this implementation. PR662 addresses
Clifford states; PR367 and PR452 address frame algebra and native replay.
This submission changes only exponential interval evaluation and preserves its
negative end-to-end performance result. It makes no priority claim for integer
Horner evaluation.
20 changes: 20 additions & 0 deletions research/exact-exp-performance/SOURCE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"base_commit": "66849e1475c930fd7732b1a0067ffee7e1e95f60",
"reviewed_provider_head": "f69477f4f6d3c7eb1f740b166881bffed4ffa9f6",
"reviewed_owner_head": "660de893d27bb7abd1d5b01b1640207528a5c851",
"owner_receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092",
"files": {
"research/complex-k492-owner-repair/extras/check_owner_map.py": "d240458ad39a08c242d136c0f1edbda0cb0b93977897f6543c9f430576c9c7dd",
"research/complex-k492-owner-repair/extras/exact_intervals.py": "aa3c2327c5d3742248b720a87b2de0bbe2e34ed2af89a578e3c8d5bd2656a9cf",
"research/complex-k492-owner-repair/data/SPEC.json": "2a2577ac526535826fed9d5f7f83f6e2e0ec058a146c64f7286720b995fa2323",
"research/complex-k492-owner-repair/data/PLAN.json": "8c48ef6ce079916314126c5c3ff0003b32f24cf0fbfb2a033fc93e1e1949b5d5",
"research/complex-k492-owner-repair/data/OWNERS.json.gz": "251e82cec1f40e6c1289703667f403104b957f1254dc4f6baa6df9a3d0c751de",
"research/complex-k492-owner-repair/comparison/PR623-SPEC.json": "436d3df54e6ce2433d56435afd569708e5fb22bc638571f5134ab12a9f9099f5",
"research/complex-k492-owner-repair/comparison/PR623-PLAN.json": "c919c366ef1d3528f1884e47dfce858ab3164b099740e4c17cde6f697b3ec458",
"research/complex-k492-owner-repair/comparison/PR622-NATIVE-HASHES.json": "28479a183387bcb608bd9ee0572f617c17f316b79ce4a6fa1277ed8689fb3431",
"research/community-k492-audit/pr622/replay/ck-local/CANONICAL-WORD.json.gz": "ae3018c0646be06f47d345bb8baf0e6ea9220096a949fa30a8f7656aa4ad6f45",
"research/community-k492-audit/pr622/replay/ck-local/LOCAL-PROGRAMS.json.gz": "b5da54e049cc127a1065190a647cb71cac0c6ba03d9ccdb71719f4fcbfa886f3",
"research/community-k492-audit/pr622/replay/jp8-local/CANONICAL-WORD.json.gz": "7a3fec1022d3b2b1bd986302a327735ec521d17b043f4a5acb96253a56f6193c",
"research/community-k492-audit/pr622/replay/jp8-local/LOCAL-PROGRAMS.json.gz": "fa0c196f65bd6ec1424fdf7d789f6972075c7bb02bf43f573ea85eafab31be98"
}
}
Loading