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
98 changes: 98 additions & 0 deletions research/selected-word-reject-exhaustion/CERTIFICATE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"claim": {
"closed_form": "agree iff d not in srcs, or count(d) odd and every non-d has even multiplicity before the last d",
"four_exhaustive_for_len2_divergence": false,
"length2": {
"dest_free": 436261,
"dest_in_agree": 661,
"destination": 111,
"divergences": 661,
"form": "[[d,d]] U [[a,d] : a != d]",
"n_registers": 661,
"total_lists": 437583
},
"named_diverge_count": 2,
"named_rejects": {
"dest_with_src": {
"diverges": true,
"in_len2_divergence_set": true,
"srcs": [
3,
111
]
},
"dup_src": {
"diverges": false,
"in_len2_divergence_set": false,
"srcs": [
3,
3
]
},
"self_even": {
"diverges": true,
"in_len2_divergence_set": true,
"srcs": [
111,
111
]
},
"self_once": {
"diverges": false,
"in_len2_divergence_set": false,
"srcs": [
111
]
}
},
"small_domain_closed_form": {
"max_len": 5,
"mismatches": 0,
"n": 8
}
},
"controls": {
"all_len2_divergences_fail_distinctness": true,
"checker_rejects": [
"self_even",
"dest_with_src",
"dup_src",
"self_once"
],
"checker_spot_divergences": [
[
111,
111
],
[
0,
111
],
[
660,
111
],
[
3,
111
]
]
},
"kappa_decimal": "0.001672660197076918",
"no_new_kappa": true,
"schema_version": 1,
"selected_word": {
"B0": [
127,
111,
[
3
]
],
"gates": 5472,
"n_registers": 661,
"path": "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz",
"sha256": "e3e301e62bc2b41dbf1ceac0acf3d35824ebeab1848c5a2142d4577b109da52f"
},
"status": "PASS_SELECTED_WORD_REJECT_EXHAUSTION"
}
80 changes: 80 additions & 0 deletions research/selected-word-reject-exhaustion/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Selected-word reject exhaustiveness for length-≤2 dest-in divergence

## Claim

Fix the pinned tuned PR589 word
`research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz` and the B[0]
destination `d = 111` (source alphabet size `n = 2v+R = 661`). Compare Sym
(accumulate-XOR from the pre-gate valuation) with Exp (sequential ADD into the
destination, re-reading the current valuation), as linear maps over `F_2`.

1. **Closed form.** For every finite source list `srcs`, Sym and Exp agree if
and only if either `d ∉ srcs`, or else `count(d)` is odd and every non-`d`
value has even multiplicity in the strict prefix before the last occurrence
of `d`.
2. **Length-≤2 census.** Among all `srcs` of length at most 2 with entries in
`{0,...,660}`, Sym≠Exp on exactly **661** lists: `{[d,d]} ∪ {[a,d] : a ≠ d}`.
3. **Four named rejects are not exhaustive.** The four B[0] checker rejects named
in [#3696](https://github.com/CrocSwap/integer-mult-bounds/pull/3696)
(`self_even`, `dest_with_src`, `dup_src`, `self_once`) contain only **two**
of those 661 divergences (`[d,d]` and `[3,d]`). The other two named rejects
agree under Sym/Exp. Hence the four are not an exhaustive taxonomy of
length-≤2 dest-in-sources divergence on the pinned word.
4. Every length-≤2 divergence has `d ∈ srcs`, so
`len(set([d]+srcs)) < len([d]+srcs)` and the selected checker rejects it with
`bad operands`. Selected kappa is unchanged.

This is not a restatement of the dest-free Sym/Exp agreement already published
in #3696: the new content is the dest-in closed form, the exact length-≤2 count,
and the negative exhaustiveness answer.

## Proof of the closed form

Only register `d` is written. For `s ≠ d`, Exp therefore always reads `val0[s]`.
Reading `s = d` clears the current destination (`out[d] ← out[d] ⊕ out[d] = 0`).

- If `d ∉ srcs`, every Exp read sees `val0`, so Exp equals Sym.
- If `d ∈ srcs`, let `last` be the last index with `srcs[last] = d`. After that
clear, Exp's destination coefficient is the XOR of the suffix `srcs[last+1:]`
(which contains no `d`). Sym's destination coefficient is
`e_d ⊕ ⨁_s e_s` (multiplicity mod 2). These match if and only if the Sym
coefficient of `d` is `0` — i.e. `count(d)` is odd — and for every `s ≠ d`
the Sym parity equals the suffix parity, i.e. the multiplicity of `s` in
`srcs[:last]` is even.

## Proof of the length-≤2 census

Apply the closed form with `len(srcs) ≤ 2`:

- Length 0 or dest-free length 1–2: agree.
- `[d]`: `count(d)=1` odd, empty prefix → agree.
- `[d,d]`: `count(d)=2` even → disagree.
- `[d,a]` with `a ≠ d`: `count(d)=1`, empty prefix → agree.
- `[a,d]` with `a ≠ d`: `count(d)=1`, prefix `[a]` odd → disagree.
- `[a,a]` with `a ≠ d`: dest-free → agree.

Hence the disagreeing lists are exactly the `n` lists `[a,d]` for
`a ∈ {0,...,n-1}` (the case `a = d` is `[d,d]`), totaling `n = 661`. Direct
linear enumeration over all `1 + n + n^2` lists confirms the count.

## Four named rejects

| name | `srcs` | Sym=Exp? | in the 661? |
|---|---|---|---|
| `self_even` | `[111,111]` | no | yes |
| `dest_with_src` | `[3,111]` | no | yes |
| `dup_src` | `[3,3]` | yes | no |
| `self_once` | `[111]` | yes | no |

So at most two of the four meet dest-in divergence, against 661 total. The
checker still rejects all four (and all 661 divergences) by operand
distinctness; reject-count is not divergence-count.

## What this does not claim

- No new kappa and no production schema change.
- No claim that length ≥ 3 has only 661 divergences.
- No dest-absent schema corollary (left to maintainers; forbidden as a
definitional follow-up in this loop).
- No restatement that dest-free lists always agree beyond using it inside the
closed form.
74 changes: 74 additions & 0 deletions research/selected-word-reject-exhaustion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Selected-word reject exhaustion for length-≤2 dest-in divergence

**Card `supplier-boundary-audit`, priority revision 6**, changed to answer
[#3696](https://github.com/CrocSwap/integer-mult-bounds/pull/3696) open question 2
under the [#2977](https://github.com/CrocSwap/integer-mult-bounds/pull/2977) /
[#3004](https://github.com/CrocSwap/integer-mult-bounds/pull/3004) checker/exporter
cascade. No new kappa (`0.001672660197076918`).

#3696 showed dest-free gates always make Sym and Exp agree, named dest-in
witnesses that diverge, and four B[0] `bad operands` rejects. Its OQ2 asked
whether those four rejects are exhaustive for dest-in-sources divergence on the
pinned word. They are not.

This package proves a closed-form Sym/Exp agreement criterion for dest-in lists,
enumerates every source list of length at most 2 at B[0]'s destination `d=111`
over `n=661` registers, and obtains exactly **661** divergences
`{[d,d]} ∪ {[a,d] : a ≠ d}`. Only `self_even` and `dest_with_src` among the four
named rejects lie in that set; `dup_src` and `self_once` agree. Dest-free
agreement is used inside the closed form and is not republished as the claim.

```sh
python3.12 -I -B research/selected-word-reject-exhaustion/verify.py
```

Expected:

```text
PASS_SELECTED_WORD_REJECT_EXHAUSTION len2_divergences=661 named_diverge=2 four_exhaustive=false no_new_kappa
```

## Evidence

- Closed form matches linear Sym/Exp on all `(d,srcs)` with `n≤8`, `len(srcs)≤5`,
and on the full length-≤2 census at `d=111`.
- Length-≤2 census: **661** divergences, **661** dest-in agreements, total
`1+661+661²` lists.
- Named rejects: diverge `{self_even, dest_with_src}`; agree `{dup_src, self_once}`.
- Checker rejects all four named mutants and spot divergences
`[d,d]`, `[0,d]`, `[660,d]`, `[3,d]` with `bad operands`.
- Every length-≤2 divergence fails operand distinctness.

Default verify is read-only against `CERTIFICATE.json`. Admission uses `need()`
and stays enforced under `python -O`. Explicit `--write` regenerates the
certificate only.

## Reproduce

```sh
python3.12 -I -B research/selected-word-reject-exhaustion/verify.py
python3.12 -I -O -Werror -B research/selected-word-reject-exhaustion/verify.py
python3.12 -I -B research/selected-word-reject-exhaustion/independent.py
python3.12 -I -B research/selected-word-reject-exhaustion/test_package.py
python3.12 -B scripts/research_package.py --package research/selected-word-reject-exhaustion
```

## Open next questions

1. **Exact length-≤3 divergence count at the same destination?** First step:
count closed-form failures over `n=661` lists of length 3. Blocked by: none;
omitted to keep this package on the length-≤2 OQ2 scope.
2. **Should schema docs separate divergence classes from distinctness rejects?**
First step: optional exporter warning keyed to the closed-form predicate.
Blocked by: maintainer adoption.

## Credit

Closest prior: [#3696](https://github.com/CrocSwap/integer-mult-bounds/pull/3696)
`gate-operand-export-parity` (Wentao Li; dest-free lemma, four named rejects,
OQ2). Cascade priors: Nick Petalas / #2977; Kumagi / #3004; Dylan Crow exporter;
eumemic symbolic checker; tuned PR589 word. Scatter-parity contract audit is
credited as provenance only.

Prepared by Wentao Li with substantial AI assistance. Apache-2.0.
No independent human or proof-assistant review is claimed.
48 changes: 48 additions & 0 deletions research/selected-word-reject-exhaustion/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"schema_version": 1,
"base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90",
"files": [
{
"path": "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz",
"usage": "input",
"git_blob": "85a4499bf9e4911a705d50567a2c2ef6cf23739a",
"sha256": "e3e301e62bc2b41dbf1ceac0acf3d35824ebeab1848c5a2142d4577b109da52f",
"size_bytes": 42353
},
{
"path": "research/e8-bit-p111-tuned/code/xcheck_p.py",
"usage": "input",
"git_blob": "184f5dcf94a486cc7db91ca4db5865916bf26009",
"sha256": "af3decc877e27c00001cf56f50c6c09566e8e101297ab34c7860aed96a06d80e",
"size_bytes": 21651
},
{
"path": "research/scatter-parity-contract-audit/README.md",
"usage": "provenance",
"git_blob": "81cbe8e1756e0952028524addb0ed33188e617d1",
"sha256": "824ea617d818674b25c4d3dc7c7f6a7e252e217837d8473c2409d08096a48788",
"size_bytes": 7389
},
{
"path": "research/scatter-parity-contract-audit/TASK.json",
"usage": "provenance",
"git_blob": "fd03dc4c2c5028954e2165fb2358a3dfc70fae56",
"sha256": "b3619e9ad0c4b17b3f5ddffbe55fb25728bb3164fe32d4f614983cb8db28a7e9",
"size_bytes": 7192
},
{
"path": "certificates/selected-result.json",
"usage": "provenance",
"git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81",
"sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129",
"size_bytes": 10725
},
{
"path": "docs/research/agent-task-catalog.json",
"usage": "provenance",
"git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5",
"sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0",
"size_bytes": 58553
}
]
}
72 changes: 72 additions & 0 deletions research/selected-word-reject-exhaustion/TASK.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"schema_version": 1,
"task_id": "supplier-boundary-audit",
"priority_revision": 6,
"base_commit": "20ecf2891d80b5acf18d980b2164fb44ea7faa90",
"original_card": {
"id": "supplier-boundary-audit",
"question": "Does one selected supplier obligation follow from its actual source-bound checks?",
"starting_points": [
"certificates/selected-result.json",
"research/owner-boundary-audit/README.md",
"research/scatter-export-parity-audit/README.md"
],
"methods": [
"Trace one hypothesis through the source, checker and complete caller.",
"Construct one semantically invalid but superficially well-formed fixture and test rejection."
],
"acceptance_gate": "Pin the current sources and one obligation; the historical owner audit is an example, not evidence of a current bug.",
"first_step": {
"command": [
"python3",
"-B",
"scripts/research_baseline.py"
],
"expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY",
"inspect": "Read #2977 reported duplicate-scatter counterexample and its opt-in repair. The archive is not a production fix or an independently validated selected-result failure; the selected generator emits unique rows.",
"scope": "Source-binding orientation only; does not replay or validate the reported bug."
},
"first_experiment": "First check whether the scatter repair has been adopted. If still open, independently reproduce #2977 symbolic-versus-exported parity on the tiny duplicate fixture, compare the selected unique-row positive control, and define either enforced uniqueness or consistent multiplicity semantics. A bounded guard-adoption patch must preserve valid inputs and test the actual exported action. Stop after this obligation; no full historical replay or frontier change follows from the mutant alone.",
"bottleneck_link": "Closing a current acceptance gap or proof obligation strengthens reliability even without changing kappa.",
"allowed_variations": [
"Audit one named current condition using a new semantic counterexample."
],
"scope_change_triggers": [
"Reporting the historical timing-only diagnostic as a new current acceptance bug.",
"Calling a malformed mutant a failure of the selected construction, or importing an opt-in repair without testing the exporter boundary."
],
"overlap_terms": [
"owner boundary",
"bridge omission",
"hosting",
"2977",
"scatter export",
"duplicate index",
"parity semantics"
]
},
"scope_status": "changed",
"actual_scope": "Answer #3696 open question 2 on the pinned tuned word: are the four named B[0] checker rejects exhaustive for dest-in-sources Sym/Exp divergence? Prove a dest-in closed form, enumerate all length-≤2 source lists at destination 111 over n=661 registers, and show exactly 661 divergences of which only two lie among the four named rejects.",
"scope_change_reason": "Authorized follow-up to #3696 OQ2 under the supplier-boundary cascade. Dest-free Sym/Exp agreement is already published and is not restated as the claim; the new obligation is exhaustiveness of the four rejects versus the complete length-≤2 divergence set, plus the dest-in closed form that makes the census checkable.",
"bottleneck_link": "Knowing that reject samples are not a divergence taxonomy prevents treating four mutants as a complete gate-operand contract.",
"budget_minutes": 60,
"stop_rule": "Stop after the closed form, length-≤2 census, named-reject comparison, checker spot controls, and certificate admission. No dest-absent schema corollary, exporter rewrite, native replay, or kappa change.",
"outcome": "completed",
"evidence": "CERTIFICATE.json, PROOF.md, verify.py, independent.py and test_package.py. Closed form matches linear Sym/Exp on n≤8,len≤5 and on all length-≤2 lists at d=111; exactly 661 divergences; named diverge count 2; four_exhaustive=false; checker rejects the four named mutants and four spot divergences.",
"author": "Wentao Li",
"ai_assistance": "Substantial AI assistance for reading the #3696 cascade, deriving the dest-in closed form, implementing the length-≤2 census and package controls, and writing this package.",
"open_questions": [
{
"question": "What is the exact count of dest-in Sym/Exp divergences for source lists of length ≤3 at the same destination?",
"why_it_matters": "Length 3 is the next bound that appears in selected multi-source gates; a closed count would extend the taxonomy past the length-≤2 census.",
"first_step": "Apply the closed form to count odd-count(d) lists with even non-d prefix multiplicities over n=661.",
"blocked_by": "None mathematically; omitted here to keep the package inside the length-≤2 OQ2 scope."
},
{
"question": "Should a successor schema document divergence classes separately from distinctness rejects?",
"why_it_matters": "Distinctness rejects agreeing cases (dup_src, self_once, [d,a]) as well as diverging ones; a contract that only names four mutants understates the diverge set.",
"first_step": "Add an optional exporter warning keyed to the closed-form diverge predicate.",
"blocked_by": "Maintainer schema adoption; frozen exporters stay unchanged."
}
]
}
Loading