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
151 changes: 151 additions & 0 deletions research/compact-two-target-symbolic-core/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# The invariant core of the two-target compact switch

## Word and agreement contract

Let the control radix $B=2^g$ and window modulus $N=2^m$ satisfy
$g\ge 1$ and $N>B$. Put $L=2N$. Write the two control fields as
$u=u_0+Bu_1$ and $t=t_0+Bt_1$, taken modulo $B^2$. The data field is

$$
y=b_0+2W_0+L(b_1+2W_1)\pmod{L^2},
$$

with $0\le W_i<N$ and target bits $b_i\in\{0,1\}$. All these fields are
arbitrary at entry. Use the two-target switch of PR #6812 with constant
source bits $(1,1)$. A subcall fixes $u$, sets $z_i=u_i\bmod 2$, and
executes the following four packed updates in order. Each right-hand side
uses the field values at that point.

$$
\begin{aligned}
y &\gets y+\sum_{i=0}^1 2 z_i t_i L^i &&\pmod{L^2}\\
t &\gets t+\sum_{i=0}^1 b_i(y)B^i &&\pmod{B^2}\\
y &\gets y+\sum_{i=0}^1 z_i(1-2t_i)L^i &&\pmod{L^2}\\
t &\gets t-\sum_{i=0}^1 (b_i(y)\mathbin{\mathrm{XOR}} z_i) B^i
&&\pmod{B^2}.
\end{aligned}
$$

The complete raw word $S$ runs a subcall, adds $1+B$ to $u$, runs a
second subcall, and subtracts $1+B$ from $u$. The ideal endpoint $T$
keeps both controls and both windows and flips both target bits.

**Theorem.** For every specified $B,N$, the maximal $T$-invariant
subset of $\{x:S(x)=T(x)\}$ is

$$
u_0<B-1,\qquad t_0<B-1,\qquad t_1<B-1,\qquad W_0+t_0<N.
\tag{1}
$$

Since $T$ is an involution, this subset consists exactly of states
$x$ for which both $S(x)=T(x)$ and $S(T(x))=x$. It is sufficient to
analyze each ideal pair together.

## Lower digit and window

In one subcall let $b=b_0$ and $z=z_0$ at entry, and put
$c=\lfloor (t_0+b)/B\rfloor$. The first data update preserves the
lower target parity. The live low temporary is $t_0+b-Bc$, so the
total lower-block increment before reduction modulo $L$ is

$$
2zt_0+z(1-2(t_0+b-Bc))=z(1-2b)+2Bzc.
$$

The output lower target is $b\mathbin{\mathrm{XOR}}z$. The unload
therefore subtracts $b$ in the lower temporary digit. In particular
$t_0$ is restored modulo $B$ whether or not the load carries. The
output lower window is $W_0+Bzc$ modulo $N$.

The load of $1+B$ flips the parity of $u_0$, so exactly one of the two
subcalls has $z_0=1$. Before that subcall the lower target is still
its entry bit. If $t_0=B-1$, the orbit member with $b_0=1$ therefore
shifts $W_0$ by $B$ modulo $N$. This shift is nonzero by $N>B$ and
the inactive subcall cannot cancel it. Thus every invariant
agreement requires $t_0<B-1$.

Now suppose $t_0<B-1$. The net lower increment is the exact lower
bit flip with zero carry into the upper block. The first data
update, however, has an intermediate carry
$a=\mathbf 1_{W_0+z_0t_0\ge N}$. If $h=b_1$ at subcall entry, the
high temporary is loaded by $h\mathbin{\mathrm{XOR}}a$. The upper
block receives zero **net** lower carry and its own signed
increment has parity $z_1$, so its output bit is
$h\mathbin{\mathrm{XOR}}z_1$. The high temporary unload subtracts $h$.
Thus the subcall changes the high temporary modulo $B$ by

$$
(h\mathbin{\mathrm{XOR}}a)-h.
$$

Here $W_0$ and $t_0$ stay fixed through both subcalls. If
$W_0+t_0\ge N$, only the active lower subcall has $a=1$, and its
temporary change is $+1$ or $-1$ modulo $B$. The other subcall
cannot remove that change. Hence $W_0+t_0<N$ is necessary even for
an individual agreement with nonsaturated $t_0$.

## Source carry and upper digit

Assume both lower conditions. The intermediate lower carry is then
zero in each subcall, and the temporary field is restored after each.
The high target flips once for each active high parity $z_1$. In
the load $u\gets u+1+B$, the high digit receives $1$ plus the
carry $\mathbf 1_{u_0=B-1}$. If $u_0=B-1$, the high parity is unchanged
and the two subcalls leave $b_1$ unchanged. Agreement requires
$u_0<B-1$.

Under this last condition exactly one subcall is active in the upper
block. Its entry high target is the original $b_1$, as the other
subcall has no high data effect. The same increment formula used
for the lower digit now gives a high window change of $B$ modulo
$N$ if $t_1=B-1$ and $b_1=1$, and zero otherwise. The $b_1=1$ orbit
member rules out $t_1=B-1$ because $N>B$.

Conversely, under (1), neither subcall has a temporary carry or a
lower-window spill. Each flips its active target bits and leaves
both windows and the entire temporary field fixed. The source load
complements both active parities, and the final source unload
restores the entire source field. Therefore $S=T$ on (1). All four
conditions are independent of the target bits, so their intersection
is $T$-invariant.

The condition $N>B$ is used to see the saturation error in the
restored window. For example, at $N=B=4$ the state $(u,t,y)=(0,12,0)$
and its ideal mate both agree even though $t_1$ is saturated. The
upper-window increment wraps at the full data modulus.

## Translation consequence

An entry translates each digit and each window independently by a
fixed constant modulo its own period. It preserves both target bits
and therefore commutes with $T$. A selector with
$\sigma(T(x))=\sigma(x)$ can use an entry on the ideal orbit of $x$
exactly when the translated state belongs to (1). The selector is
logical. Its preparation, execution and cleanup have separate costs.

For $B\ge4$, four entries cannot cover (1). Extend the finite
adversary of PR #7197 as follows. Label four entries $C,D,E,F$.
Order the first two so that their lower-temporary shifts differ
by something other than $1$ from $C$ to $D$ modulo $B$. Such an
order exists because reversing a difference of $1$ gives $-1$.
Choose $u_0$ to saturate in $E$, $t_1$ to saturate in $F$, and
$t_0$ to saturate in $C$. The translated $t_0$ in $D$ is then
some $v>0$. Choose $W_0$ to become $N-v$ in $D$. The first three
entries each fail a saturation condition, while $D$ fails the
window inequality. Any smaller nonempty menu pads to four by
repetition.

For $B\ge8$ and $N\ge5(B-2)$, PR #6812's five-entry menu applies.
In phase $k\in\{0,1,2,3,4\}$, shift $u_0,t_0,t_1$ by $k$ and
$W_0$ by $k(B-2)$. Each guarded control rejects at most one phase.
The five preimages of $W_0>N-B+1$ are disjoint intervals of length
$B-2$, so the window rejects at most one phase. At least one phase
has all three nonsaturated controls and $W_0\le N-B+1$, which
implies $W_0+t_0<N$. Choosing the least such phase gives an
invariant selector. The exact minimum in this parameter range is
therefore five.

The all-width step is the core identity (1). The menu construction
and the form of its lower-bound adversary are credited specializations
of PR #6812 and PR #7197.
99 changes: 99 additions & 0 deletions research/compact-two-target-symbolic-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Exact invariant agreement for the two-target compact switch

For control radix `B=2^g` and window modulus `N=2^m>B`, the
two-target compact switch with constant source bits `(1,1)` agrees
with the ideal XOR on both members of an ideal orbit exactly when

```text
u0 < B-1, t0 < B-1, t1 < B-1, W0 + t0 < N.
```

[The proof](PROOF.md) establishes this formula for every binary
radix and width in the stated range. PR #7197 obtained the formula
at `B=8, N=32` by finite enumeration and left the symbolic
classification open. The new proof accounts for lower-window
spills across the two subcalls, source-load carries, and saturation
in both temporary digits. The word and five-phase upper construction
come from PR #6812. [PR #7197](https://github.com/CrocSwap/integer-mult-bounds/pull/7197) · [PR #6812](https://github.com/CrocSwap/integer-mult-bounds/pull/6812)

The formula implies that four independent coordinate translations
cannot cover the invariant core when `B>=4`. The minimum is exactly
five when `B>=8` and `5(B-2)<=N`, with a selector that takes the same
value at both ends of the ideal XOR. This is a scoped algebraic proof
with finite corroboration.

## Reproduce

Run from the repository root with CPython 3.12. The local runs use
CPython 3.12.15 on macOS 27.0.1 arm64 and the standard library.

```sh
python3.12 -I -W error -B research/compact-two-target-symbolic-core/verify.py
python3.12 -I -O -W error -B research/compact-two-target-symbolic-core/verify.py
python3.12 -B scripts/research_package.py --package research/compact-two-target-symbolic-core
python3.12 -B scripts/check_research_commit.py --package research/compact-two-target-symbolic-core --check-source-history
```

The direct check writes a report with marker
`PASS_COMPACT_TWO_TARGET_SYMBOLIC_CORE` and SHA256 hashes of the six
package files. It compares the formula with literal packed execution
of both orbit members when needed. Across 984,064 input states it finds
534,112 invariant agreement states. It exhausts the complete dirty
fields at `(B,N)=(2,4),(4,8),(4,16)`. At `(8,16),(8,64)` it sweeps
every lower coordinate and temporary field with both upper source
parities and the four upper block endpoints. The prior
`(B,N)=(8,32)` census is not replayed.

The check also covers all 557,056 relevant coordinate tuples for
the five-entry menus at `(8,64),(16,128)`. Deleting the last entry
misses 72 and 168 tuples, respectively. Seven controls cover all
four clauses, the safe side of the window boundary, an individual raw
agreement whose ideal mate fails, and a valid full-width wrap at
`N=B`.

The largest state grid has 524,288 inputs and the largest cover check
has 524,288 tuples times five phases. The verifier streams the input
grids and keeps no state-indexed table. CPython allocates finite
integer and tuple values during execution. Every failure check
remains active under optimization.

## Scope

The proof concerns the two fixed target positions, exactly two
digits per control, constant sources and the declared live-digit
word. Its cover corollary assumes independent coordinate
translations and an invariant selector. The physical translation,
selection, data movement, cleanup and recursive costs remain open.
No selected assumption, full caller or κ is established. The selected
metadata baseline passed. The selected scientific cold replay, Lean,
Docker, independent human review and formal proof-kernel review are
unclaimed.

The `uniform-transfer-audit` card changes scope to this logical CRT
switch question. The core determines which addresses each translation
can serve without exceptional repair. [Advance claim](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19717713)

## Open next questions

- **Other source pairs.** Derive the invariant core when exactly one
source is constant one. The two lower parities then need not be
complementary. Begin with the resulting spill and restoration
equations before classifying any cover.
- **Small-radix menus.** Find the exact minimum when
`B>=4` and the five-phase packing conditions fail. Begin by deriving
a cover on the four relevant coordinates. The four-entry adversary
already applies there, while five-phase attainment is open.

## Credit

This contribution was produced by Nick Petalas. Apache-2.0. Credit the
finite predecessor and its first open question to PR #7197 at
`47419abcd185a088a6b5d2ef9e721ef2651d9729`, and the raw word and
sufficient cover to Benny Zhao in PR #6812 at
`297ad233e8d00d7a7af4a09dc13fed90ede63dc4`. The translation and
conjugation method comes from PR #6231. Credit Cinna Davis's PR #4100
and unpaidmoon's PR #4321 for the compact-switch and live-digit
contracts, John-Michael Smith and Hanson Sun for the terminal carry
and window arguments, and Arham Tahir, Aaron Wang, woklerx and
Douglas Colkitt for the retained agreement and repair work.
[Finite predecessor proof](https://github.com/petalas/integer-mult-bounds/blob/47419abcd185a088a6b5d2ef9e721ef2651d9729/research/compact-two-target-translation-minimum/PROOF.md)
24 changes: 24 additions & 0 deletions research/compact-two-target-symbolic-core/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"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/terminal-carry-guard-cover/PROOF.md",
"usage": "provenance",
"git_blob": "3dc4c0be7f6d0166407ba1bf27e5bf176f784a6f",
"sha256": "80833edf2a4796c07eb7b1be993e7dfe87123f13f6f8bc0d25c73a800cbc96f3"
}
]
}
89 changes: 89 additions & 0 deletions research/compact-two-target-symbolic-core/TASK.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"schema_version": 1,
"task_id": "uniform-transfer-audit",
"priority_revision": 8,
"base_commit": "e54523517d0f03e58352e647c403a5af3e525a57",
"original_card": {
"id": "uniform-transfer-audit",
"question": "Can one of the selected record's five inherited assumptions be proved at its actual caller?",
"starting_points": [
"docs/research/current-priorities.md",
"docs/research/research-family-status.md",
"certificates/selected-result.json",
"docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md"
],
"methods": [
"Construct and independently check one source-bound instance of the stated first experiment.",
"Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change."
],
"acceptance_gate": "Identify the proposition and what would change downstream; do not equate a finite replay with a universal proof.",
"first_step": {
"command": [
"python3",
"-B",
"scripts/research_selected_baseline.py"
],
"expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY",
"inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.",
"scope": "Source-bound orientation only, not a supplier replay or theorem proof."
},
"first_experiment": "Choose one assumption ID (native_all_columns, owned_erasure, compiler, precision_tape, analytic_recovery), one quantified implication and exact dependency closure. Check current handoffs, including #5625 row reentry and #5707 root-prefix lowering, without treating their partial scope as the whole theorem. Prove or falsify that implication with a caller-bound argument; stop at the chosen obligation. Finite tests or root digits do not discharge an all-size statement.",
"bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.",
"allowed_variations": [
"One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes."
],
"scope_change_triggers": [
"Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.",
"Treating an archived proposal or local numerical pass as complete supplier admission."
],
"overlap_terms": [
"native_all_columns",
"owned_erasure",
"compiler",
"precision_tape",
"analytic_recovery"
],
"existing_checks": [
{
"scope": "PR #4100: proposed unconditional construction and finite checks, without independent acceptance.",
"evidence": "research/unconditional-batched-crt/README.md",
"remaining": "Independent proof audit of one caller-bound all-size implication; all other premises remain explicit.",
"status": "author-checked",
"source_commit": "337d04939571a637aeab54a0f58f54fde811663a",
"selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129"
},
{
"scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.",
"evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md",
"remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.",
"status": "reviewed",
"source_commit": "09dd0965711ca7eeb169057a420abab1c9052137",
"selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5"
}
]
},
"scope_status": "changed",
"actual_scope": "Derive the exact maximal invariant agreement core of the all-one two-target compact switch for every binary radix B and window modulus N>B. Apply the core to the independent translation minimum under an invariant selector.",
"scope_change_reason": "PR #7197 leaves the symbolic invariant core open after its finite B=8, N=32 classification. This logical CRT switch question uses the PR #6812 word and changes the selected-assumption audit premise.",
"bottleneck_link": "The core gives the exact eligible address set for each translated switch in this logical CRT interface. It can bound the number of phases required before selection, movement and repair are priced.",
"budget_minutes": 60,
"stop_rule": "Stop after a written core proof and a bounded literal packed replay on new geometries, including the natural translation corollary.",
"outcome": "completed",
"evidence": "Symbolic proof for N>B, plus 984064 new packed input states, 557056 cover tuples and seven boundary controls. The written proof supplies the all-width and arbitrary-menu quantifiers.",
"author": "Nick Petalas",
"ai_assistance": "Independent human and formal proof-kernel review are unclaimed.",
"open_questions": [
{
"question": "What is the invariant core when one of the two constant source bits is zero?",
"why_it_matters": "A changed source pair may admit more addresses for each translation.",
"first_step": "Write the two lower parity trajectories and derive their net temporary and window defects.",
"blocked_by": "The lower parities need not be complementary. The present single-active-subcall argument does not apply."
},
{
"question": "What is the exact menu minimum for B>=4 outside the five-phase packing range?",
"why_it_matters": "The four-entry obstruction applies there but does not provide an attaining menu.",
"first_step": "Construct and price a cover of the four relevant restored coordinates at B=4 and N=8.",
"blocked_by": "Five disjoint bad-preimage intervals and five distinct control shifts are not both guaranteed."
}
]
}
Loading