Skip to content
Open
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
19 changes: 18 additions & 1 deletion docs/ci-verification.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
# CI verification

## Current selected-family replay: #6030
## Current selected-family replay: #7000 with #7001

The [selected record](../certificates/selected-result.json) binds conditional
κ = 0.00363005817 to the [application review](research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md),
[validation receipts](research/pr-intake-evidence/pr7000-application/VALIDATION.json),
and [explicit source closure](../certificates/frontier7000-source.json).
`make frontier7000-verify` follows that exact-source selected replay. The review
reuses eleven authenticated preceding executions and records seven fresh serial
application, scalar and complete native-catalogue executions. The earlier
monolithic timeout is retained separately and is not completed coverage.
Consult the receipts for exact commands, source heads and limits.

The five inherited framework assumptions remain. No complete uniform word,
literal multiplier execution, independent human proof or formal-kernel proof
is asserted. Routine research submissions do not need to rerun this
selected-family replay. The sections below preserve historical checkpoints.

## Historical selected-family replay: #6030

The [historical checkpoint](../certificates/checkpoints/frontier6030.json) binds conditional
κ = 0.003125804 to the [proof review](research/pr-intake-evidence/pr6030-audit/PROOF-REVIEW.md),
[validation receipts](research/pr-intake-evidence/pr6030-audit/VALIDATION.json),
and [explicit source closure](../certificates/frontier6030-source.json).
Expand Down
177 changes: 177 additions & 0 deletions research/dense-quadratic-phase-stream/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
# A restored cofactor stream for dense quadratic phases

This scoped constructive proof was produced by Nick Petalas. Apache-2.0.

## Proposition and accounting model

Let L be any nonnegative integer, N=2^L, and let all coefficients below
belong to Z/4. On Boolean arguments define

```text
q(x) = c + sum_i a_i x_i + sum_(i<j) b_ij x_i x_j.
```

The coefficients may be completely dense. There is a stream producing q(x)
in increasing binary-address order, with bit zero varying fastest, using

```text
N emitted residues,
4N - 2L - 4 additions/subtractions in Z/4,
2(N - L - 1) reads of quadratic coefficients,
4N - 3 control events,
at most 3L + 1 pending event records.
```

The current constant and L current linear coefficients return to their
entry values after complete exhaustion. Quadratic coefficients are read-only.
There is no N-entry phase table. Besides the supplied quadratic coefficient
table, mutable coefficient state is L+1 residues, with O(1) additional
temporary residues for an update. Event records contain one
of three tags and a level in 0..L, so their storage is O(L log(L+2)) bits.
The input table occupies O(L^2) bits. Initialization, input validation and
the O(L) copy of the linear coefficients are additional, bounded by O(L^2).

An addition or subtraction of two residues followed by reduction modulo four
is one arithmetic update. Indexing, coefficient reads, stack operations,
output delivery and coefficient preparation are not free physical actions.
The event/read counts above expose part of that work; they are not a tape
tariff. In particular this is not a speed comparison with #5375's physical
action count. Even zero-valued updates are executed and included.

## Restored cofactor invariant

At a visit with j free low bits, fix the higher bits according to the path.
The mutable constant C and linear array A satisfy

```text
q(x_low, fixed_high)
= C + sum_(i<j) A_i x_i + sum_(i<k<j) b_ik x_i x_k.
```

The quadratic part on the remaining variables never changes. To enumerate
this subcube, first visit x_(j-1)=0 using the current state. When that visit
returns, enter the one branch by performing

```text
C += A_(j-1)
A_i += b_(i,j-1) for 0 <= i < j-1.
```

These j updates give exactly the cofactor with x_(j-1)=1. Visit the remaining
j-1 low bits. On return subtract the same quantities to restore the state.
The lower visit never changes A_(j-1), so the final constant subtraction
uses precisely the same residue as the earlier addition. The higher linear
coefficients are also untouched.

Induction on j proves both correctness and restoration. At j=0, output C.
At j>0, the zero branch and then the one branch cover the two consecutive
binary-address halves exactly once. Each child restores its entry state,
and the explicit subtractions restore the parent's entry state. No
zero-initialization of the coefficient values is used. Every entry residue,
including the constant, may be arbitrary. The event storage itself is newly
allocated bookkeeping, not arbitrary dirty workspace supplied for free.

For a Gaussian phase, the emitted q is interpreted as i^q. The proof keeps
the constant c and hence absolute phase. General Z/4 cross coefficients are
allowed. Restricting cross coefficients to 0 and 2 gives the usual Boolean
quadratic Clifford phase subclass. This inclusion does not establish that
every general phase in the larger class is a native Clifford operation.

## Nonrecursive execution and exact counts

An event is visit(j), enter-one(j) or leave-one(j). Expanding visit(j), j>0,
schedules the following chronological sequence on a last-in-first-out stack:

```text
visit(j-1), enter-one(j), visit(j-1), leave-one(j).
```

The reference pushes these in reverse order. A leaf emits a single residue.
The complete binary tree has N leaves and N-1 internal vertices. Each
internal vertex contributes one visit and two update events. Thus the exact
number of processed events is N+3(N-1)=4N-3. This supplies an explicit loop
bound; no recursive Python call is used.

There are 2^(L-j) internal vertices with j free bits. Each executes j updates
on entry to its one branch and j on exit. Therefore

```text
U_L = 2 sum_(j=1..L) j 2^(L-j)
= 4*2^L - 2L - 4.
```

For example the identity follows from U_0=0 and U_L=2U_(L-1)+2L.
It proves fewer than four arithmetic updates per emitted phase, uniformly
in L. The linear-coefficient updates, and hence quadratic coefficient reads,
number

```text
R_L = 2 sum_(j=1..L) (j-1) 2^(L-j)
= 2(2^L-L-1).
```

Each initial descent through an internal visit replaces one pending event by
four, increasing stack length by three. The first leaf therefore reaches
exactly 3L+1 pending events immediately before its visit. No later descent
can exceed it: at most three pending siblings/update events remain at each
ancestor level, plus the current visit. This also covers L=0, when the sole
pending event is visit(0).

There are 2(N-1) reads of the current top linear coefficient for constant
updates, R_L reads of current lower linear coefficients, and U_L writes of
current residues. These are abstract array accesses. Their movement on a
fixed tape, the binary representation of levels, source serialization and
output-consumer costs are not certified here.

Every implementation which explicitly emits N phase symbols requires at
least N output actions in a unit-output model. This construction has
O(L^2+N) abstract work, including initialization, and is order-optimal in
that model. The exact arithmetic constant is an upper bound, not a proved
minimum. No fixed-tape order-optimality follows.

## The completed-return boundary

Python yields at each leaf. After the last yield, the remaining leave-one
events still need execution. The return theorem therefore requires complete
iterator exhaustion, including the call that observes StopIteration.
Merely requesting exactly N yielded values does not meet that condition.
The verifier exercises this distinction. If a consumer stops early, cleanup
of the suspended stream's private cofactor state is unclaimed. Immutable
public input tuples are preserved at every prefix regardless.

The mathematical construction works for every L. The supplied reference
intentionally validates 0<=L<=20 to bound executable memory and iteration
counts. Its finite checks establish only their enumerated cases; the
induction and sums above establish the quantified proposition.

## Predecessors, new scope and remaining work

Ali Romman's [#5375](https://github.com/CrocSwap/integer-mult-bounds/pull/5375)
supplies the physical sequential monomial phase producer, with fixed recipe
dimension, borrowed mask, complete counter and coefficient bills. Its
source-specific correctness and bills are cited results, not replayed here.
That package credits Jose Manuel / jmbarrancoml #2250, JoyboyBrian #5329,
Cinna Davis and Ryanson Jonathan #4325, together with their native lineage.
Their results and notices retain their attribution.

Dugongue's [#4538](https://github.com/CrocSwap/integer-mult-bounds/pull/4538),
Theorem 2, already proves O(N+L) phase generation when cross coefficients
are even. Its representation packs the binary matrix columns and gradient
into address-width words, using one whole-gradient XOR per bit flip.
Ryanson Jonathan #4555 supplies a separate finite check of that theorem.
The published theorem is a cited predecessor, not a replay target.

The new project contribution covers arbitrary Z/4 cross coefficients,
including odd coefficients, gives an exact count of individual unpacked
residue updates, and restores the cofactor state explicitly. It does not
claim the first linear-time phase stream or a faster packed-word algorithm.
Polynomial cofactoring and Shannon expansion are classical; no
literature-priority claim is made for those methods. We do not claim that
the input-matrix representation improves #5375's physical implementation.

The three frozen predecessor documents are hashed live context inputs. No
predecessor executable is imported, and no selected source is changed.
Native recipe acquisition, fixed-tape source access and control, output
rotation, affine routing, common-grid/rounding, owned storage, the complete
caller invoice and all five multiplication-framework assumptions remain.
There is no new kappa, supplier admission or complete multiplication theorem.
114 changes: 114 additions & 0 deletions research/dense-quadratic-phase-stream/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Dense quadratic phase streams with restored coefficients

This contribution was produced by Nick Petalas. Apache-2.0.

Claim type: scoped constructive written proof with exact finite corroboration.
For every L>=0, a supplied dense quadratic polynomial q on L Boolean address
bits, with coefficients in Z/4, can emit its N=2^L phases in binary-address
order using exactly

```text
4N - 2L - 4 residue additions/subtractions,
2(N - L - 1) quadratic-coefficient reads,
4N - 3 control events, and at most 3L + 1 pending event records.
```

The current constant and L linear coefficients return to their entry values
after iterator exhaustion. The construction stores no N-entry phase table.
The supplied coefficient matrix uses O(L^2) bits; event records use
O(L log(L+2)) bits. Input validation and linear copying add
O(L^2) abstract work. [PROOF.md](PROOF.md) proves the all-L statement.
[stream.py](stream.py) is a nonrecursive bounded reference for L<=20.

The new project result allows arbitrary Z/4 cross coefficients, including
odd coefficients, with fewer than four unpacked residue updates per emitted
phase and an explicit completed-return contract. Dugongue's
[#4538](https://github.com/CrocSwap/integer-mult-bounds/pull/4538), Theorem 2,
already gives O(N+L) packed-word phase generation for even cross coefficients.
We do not claim the first linear phase stream. The new exact bill uses
individual small residues and no packed gradient-word operations.
Ali Romman's [#5375](https://github.com/CrocSwap/integer-mult-bounds/pull/5375)
supplies the predecessor physical stream for fixed recipe dimension. Its
scientific executables and previous counts are not replayed. Polynomial
cofactoring and Shannon expansion are classical, with no literature-priority
claim here. This does not compare the new arithmetic count with the
predecessor's physical tape-action bill.

## Evidence and scope

The independent direct-polynomial expression agrees with the stream on every
coefficient choice through L=3: 16,660 cases and 132,132 output residues.
Another 72 generated fixtures at L=4..12 compare 65,408 output residues.
The zero polynomial at the L=20 capacity boundary emits all 1,048,576 phases
and executes 4,194,260 updates, with 4,194,301 events and stack peak 61.
Nine invalid-domain and six semantic/return controls pass. These counts
are enumerated by [verify.py](verify.py), which also checks three source
document hashes and emits a receipt bound to all seven package files.
The direct oracle was written with this package; it is not independent
human or formal proof-kernel acceptance.

The input tuples remain immutable at every prefix. Restoring the private
cofactor state requires complete iterator exhaustion, including the call
that observes StopIteration after the last output. Early-abandonment cleanup,
literal tape lowering, input-matrix acquisition, output rotation, affine
routing, native ownership, rounding and the complete physical caller invoice
remain open. An input table may cost more than a fixed compiled recipe.
There is no new kappa, supplier admission, selected-frontier change or
complete multiplication theorem.

## Reproduce

From the repository root with the CPython 3.12 standard library:

```sh
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/dense-quadratic-phase-stream
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B -W error research/dense-quadratic-phase-stream/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B -O -W error research/dense-quadratic-phase-stream/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/check_research_commit.py --package research/dense-quadratic-phase-stream --check-modes --check-source-history
```

Both registered commands must print `PASS_DENSE_QUADRATIC_PHASE_STREAM`.
The source-pin wrapper needs Git history; direct verification also works in
an official Git-free export containing the three declared input documents.
No command writes a receipt or cache into the checkout. Environment metadata
is in [TASK.json](TASK.json). Hosted CI is separate from local evidence.

## Open next questions

- Can a fixed finite tape program realize the stream with a complete source
access and retirement bill? Start with a triangular serialized coefficient
layout and every access/return at L=4. No literal machine graph is supplied.
- Can one actual native recipe supply this coefficient table and consume the
phases affordably? Pin a recipe, derive the table preparation and output
contract, and compare the complete bill. Acquisition, storage and rotation
are current blockers.

## Credit

Credit Ali Romman #5375 for the physical phase-stream interface; retain
Jose Manuel / jmbarrancoml #2250, JoyboyBrian #5329, Cinna Davis,
Ryanson Jonathan #4325 and the original native/Clifford lineage. Credit
Dugongue #4538 for the prior packed-word theorem and Ryanson Jonathan
#4555 for its separately published finite check. Neither checker is replayed.
[SOURCES.json](SOURCES.json) pins the unchanged predecessor context at
canonical main e54523517d0f03e58352e647c403a5af3e525a57. No predecessor
construction is used as the new main step. The exact card is retained in
TASK.json and explicitly changes scope to this algebraic side result.

## Implementation bounds

All functions are below 60 physical lines. Production loops have explicit
bounds from L<=20, at most 4,194,301 events and at most 61 pending records.
There is no recursion, generated code, subprocess, network call or output
file write. State belongs to one generator and its caller-owned meter.
Exceptions propagate; normal and optimized executions enforce the same
contracts. Direct file reads cover seven small package files and at most
three source documents bounded by one MiB apiece.

Python allocates tuples, integers and lists during execution. Validated
dimension, bounded stack and
the explicit event cap bound live state; the reference cannot accept an
unbounded input. A fixed-buffer runtime would be needed before claiming
allocation-free operation. Standard generator and SHA256 object dispatch
have fixed visible targets. Warning-strict normal/optimized execution and
in-memory compilation supply diagnostics.
36 changes: 36 additions & 0 deletions research/dense-quadratic-phase-stream/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"schema_version": 1,
"base_commit": "e54523517d0f03e58352e647c403a5af3e525a57",
"files": [
{
"path": "certificates/selected-result.json",
"usage": "provenance",
"git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8",
"sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1"
},
{
"path": "docs/research/agent-task-catalog.json",
"usage": "provenance",
"git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec",
"sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81"
},
{
"path": "research/sequential-monomial-phase/PROOF.md",
"usage": "input",
"git_blob": "42ffd4007c1416eb4a45e47d181194d3e87742bb",
"sha256": "aed63dc425a410627a290b2e0251b27bc1befce85614cefbb8a82f199a1d2764"
},
{
"path": "research/sequential-monomial-phase/README.md",
"usage": "input",
"git_blob": "0ca3d57c2baa7161b1c8534ffd74c2bb640c815c",
"sha256": "e69fbf8f61b1d212be69ce5fe6f31c816bec497f8dd5b895d6b709127ca8f511"
},
{
"path": "research/word-ram-transfer/cost/COST-THEOREMS.md",
"usage": "input",
"git_blob": "a5d940b20581ff2ddfd270026d5610cdb7ee4581",
"sha256": "79eef859eb2ae32a66879f294d626c3947bcfe55434b4a38a296d271b3aa9675"
}
]
}
Loading