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
108 changes: 108 additions & 0 deletions research/r420-decoder-sharing/CERTIFICATE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"status": "PASS_R420_DECODER_SHARING",
"assignment_seed": 15,
"search": {
"operands": 80,
"oriented_pairs": 6320,
"positive_pairs": 463,
"matchings_tried": 1
},
"pairs": 27,
"columns": 660,
"decoder_additions_before": 321,
"decoder_additions_after": 264,
"native_additions_before": 26916,
"native_additions_after": 26802,
"saved_with_cleanup": 114,
"baseline_canonical_sha256": "e597e3885c0a8daa262afa5985ee2930443329126aece76d33159d81882bdcc2",
"candidate_canonical_sha256": "9d54dae007fa9dd874b825a7614ee1e572db9ab6ff9d4f0f7da02443be4f75b9",
"original_H1_H5": true,
"independent": {
"status": "PASS",
"scope": "relative scalar-word rewrite; baseline geometry and hosted realization inherited",
"symbolic_columns": 660,
"checks": {
"only_A_and_C_changed": true,
"whole_A_operator_equal": true,
"full_operator_equal": true,
"baseline_full_operator_is_target_add": true,
"candidate_full_operator_is_target_add": true,
"all_register_frame_paths_equal": true,
"interface_checks_hold": true
},
"changed_immutable_keys": [],
"different_A_output_registers": [],
"different_frame_path_registers": [],
"interface": {
"baseline": {
"H1_no_target_feeds_z": true,
"H2_D_frame0_targets_from_helpers": true,
"H3_A_writes_z": true,
"H4_C_literal_reverse_at_full": true
},
"candidate": {
"H1_no_target_feeds_z": true,
"H2_D_frame0_targets_from_helpers": true,
"H3_A_writes_z": true,
"H4_C_literal_reverse_at_full": true
}
},
"counts": {
"baseline": {
"gates": {
"D": 120,
"A": 2064,
"B": 837,
"C": 2661
},
"adds": {
"D": 19922,
"A": 2376,
"B": 1077,
"C": 2973
},
"scatter_adds": 568
},
"candidate": {
"gates": {
"D": 120,
"A": 2118,
"B": 837,
"C": 2715
},
"adds": {
"D": 19922,
"A": 2319,
"B": 1077,
"C": 2916
},
"scatter_adds": 568
}
},
"scalar_ADD_saving_including_C": 114,
"positive_scalar_word_bounds": {
"baseline": {
"max_row_sum": 144651,
"max_column_sum": 40742,
"row_sum_bits": 18,
"column_sum_bits": 16
},
"candidate": {
"max_row_sum": 193441,
"max_column_sum": 53780,
"row_sum_bits": 18,
"column_sum_bits": 16
}
}
},
"negative_controls": [
"missing helper restoration",
"uncancelled decoder operand",
"scalar-valid nonliteral cleanup",
"illegal frame-zero preparation",
"retained register used as temporary",
"overlapping temporary pairs",
"missing dirty compensation"
],
"kappa_claim": "none"
}
26 changes: 26 additions & 0 deletions research/r420-decoder-sharing/CLAIM.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"track": "bit supplier",
"assignment_seed": 15,
"seed_source": "Python secrets.randbelow(100), operating-system randomness",
"base_commit": "66849e1475c930fd7732b1a0067ffee7e1e95f60",
"started_utc": "2026-10-13T04:24:07Z",
"expected_finish_utc": "2026-10-13T05:04:07Z",
"coordination": "No pinned issues returned by GitHub; local claim, overlap refreshed through PR700 before selection.",
"candidates": [
"Restored sharing among non-retained operands of the nine phase-A decoder-total gates",
"Rechoose decoder-total hosts and their order with fixed retained dimension",
"Reassign phase-A D6 frames at fixed scalar gate order"
],
"chosen": "Restored disjoint-pair sharing in PR543 R420's nine final phase-A decoder-total gates, preserving their complete dirty-input operator and literal reverse cleanup",
"method": "Enumerate oriented pairs of non-retained operands, price preparation plus restoration and matching cleanup, then select a positive-saving disjoint matching with seed-15 tie ordering. Exact full-column and frame checks; recompute positive-prefix bounds.",
"expected_deliverable": "One finite circuit improvement with frozen recipe, exact checks, negative controls, proof and source pins; or a scoped negative result if the complete budget fails. No new kappa.",
"overlap": "PR670/674/688 change phase-B blocks; PR691 changes phase-A quad 13; PR686/694 factor frame-zero compensation and change H2. This task factors decoder totals at FULL under the original H1-H5 and does not import those changes. PR661 fixes phase-B gates and excludes resynthesis. PR620's decoder rank/floor research does not synthesize this fixed nine-total circuit.",
"status": "completed",
"result": {
"pull_request": "https://github.com/CrocSwap/integer-mult-bounds/pull/708",
"summary": "27 restored operand pairs reduce the nine decoder totals from 321 to 264 ADDs; matching cleanup gives 114 fewer native ADDs. All 660 symbolic columns, all frame paths and H1-H5 pass. Unchanged native nine-stage replay passes 1380 physical columns and 18 controls per word; payload rises from 100 to 102 bits, below 104. No new kappa.",
"final_overlap_refresh_through": 704,
"main_at_refresh": "66849e1475c930fd7732b1a0067ffee7e1e95f60",
"scope_remaining": "Full hosted-parent construction and changed global invoice; inherited all-size and analytic assumptions."
}
}
162 changes: 162 additions & 0 deletions research/r420-decoder-sharing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Restored sharing in R420's nine decoder totals

This finite bit-circuit construction saves **114 binary XOR additions** in
eumemic's PR543 R420 word: **26,916 to 26,802**. It changes the last nine
phase-A decoder-total gates and their literal reverse cleanup. It preserves
the complete phase-A operator on arbitrary source and helper inputs, every
register's ordered frame path, 420 helpers, nine retained totals, and the
original H1-H5 interface. **No new kappa is claimed.**

The exact base is `66849e1475c930fd7732b1a0067ffee7e1e95f60`. At that base the
selected conditional result is #626 with #543,
`kappa = 51110230636731/31250000000000000 = 0.001635527380375392`.
The source is followed through `certificates/selected-result.json` and
`docs/research/community-k492-review.md`, rather than historical frontiers
in the bit supplier's README. [SOURCES.json](SOURCES.json) pins the reviewed
PR543 head, canonical word content, checker, generator and supplier README proof.
No existing construction or selected-frontier file is edited.

## Reproduce

Python 3.11+ and its standard library suffice for the exact local check:

```sh
python3 -B research/r420-decoder-sharing/verify.py
```

Expected final line:

```text
PASS_R420_DECODER_SHARING decoder=321->264 native_ADDs=26916->26802 saved=114 columns=660 controls=7 no_new_kappa
```

This recomputes the bounded nomination, reconstructs the candidate, checks
source pins, runs the unchanged PR543 checker and the separate set-valued
interpreter, rejects seven controls, and compares every field of
[CERTIFICATE.json](CERTIFICATE.json). Run without `-O`, because the inherited
checker contains assertions. `--show-report` prints the full certificate;
`--output /absolute/new/directory` also writes both words and the report.
Existing output directories are refused.

For native nine-stage replay, choose two new output directories:

```sh
python3 -B research/r420-decoder-sharing/verify.py --output /tmp/decoder-words
BOOST_INCLUDE=/path/to/boost CXX=c++ python3 -B research/r420-decoder-sharing/native.py \
/tmp/decoder-words/baseline.json.gz /tmp/decoder-words/candidate.json.gz /tmp/decoder-native
```

The optional [native.py](native.py) helper binds both inputs to the canonical
word hashes in the local certificate.
It uses the unchanged record exporter, legality checker and C++ nine-stage
column checker. A C++17 compiler and Boost headers are required. Native
results and environment details are recorded separately in
[VALIDATION.json](VALIDATION.json).

## Circuit and full cost

At the start of the nine-total suffix, choose two non-retained operand
registers `a,b`. Temporarily apply `a <- a XOR b`. In each total's source
set containing `a`, toggle membership of `b`. After all nine totals,
apply `a <- a XOR b` again. The register `b` is unchanged, so this restores
the exact incoming value of `a`, including arbitrary dirty-input terms.

To check a total algebraically, let its old coefficients of `a,b` be `p,q`
in F2. Its new expression is `p(a+b)+(q+p)b = pa+qb`. All other operands
are unchanged. The 27 pairs are disjoint and exclude every retained total,
so their substitutions commute and no total gate writes a temporary
operand. Each retained total's value agrees after its gate, and the complete
phase-A operator agrees after restoration, with no zero-scratch assumption.
The same scatter, B and D then
remain valid. Rebuilding C as the literal reverse of all A/B z-gates
retains H4 and restores every source and helper.

For one oriented pair, write `u` for the number of rows containing both
operands and `v` for rows containing `a` but not `b`. The net phase-A
saving is `u-v-2`; the two charged operations are preparation and
restoration. The exact phase-A saving over the 27 pairs is 57. Cleanup
saves the same amount.

| Charged binary additions | Original | New |
|---|---:|---:|
| Decoder-total source reads | 321 | 210 |
| Temporary preparation and restoration | 0 | 54 |
| Complete decoder suffix | 321 | 264 |
| All phase A | 2,376 | 2,319 |
| All cleanup C | 2,973 | 2,916 |
| D, scatter and B together | 21,567 | 21,567 |
| Complete native word | 26,916 | 26,802 |

Every temporary operand already occurs at FULL in the old suffix. All
new operations are at FULL, after the same earlier frame visits. The
checker compares every register's entire frame-ID sequence, including
final climbs. All operand reads, including preparation and restoration,
are charged in the ADD counts. No helper, copy, erase, frame transition or
recursive child is added. The inherited paid profile therefore remains
`{1:1320, 2:1440, 4:60, 5:120, 8:9}`, with rank mass 5,112.
The JSON multi-source gate count increases by 108 across A and C; the
binary ADD count above is the physical scalar count, not that JSON count.

Positive arithmetic is priced separately. Cancellation-free scalar-word
maximum row sums rise from 144,651 to 193,441, and maximum column sums
from 40,742 to 53,780. These are exact integer norms, not bounds for the
complete hosted program. They do not justify inheriting its prefix bill.
The unchanged native checker gives forward bounds 144,651 to 193,441 and
reverse bounds 2,270,064 to 2,702,178. Its nine-stage payload charge rises
from 100 to 102 bits, still below its 104-bit budget. Both words pass all
1,380 formal physical columns and all 18 omitted-bridge controls. The
complete hosted invoice remains an integration obligation.

## Search coverage and controls

The operating-system assignment seed is 15. Three candidate tasks and the
local claim are recorded in [CLAIM.json](CLAIM.json); GitHub returned no
pinned coordination issue. The chosen search fixes the nine totals, their
hosts, their order, the original retained basis and the rest of the word.
It covers all **6,320 oriented pairs** of the 80 non-retained operands;
463 have positive complete savings. One greedy disjoint matching is taken
in descending saving order, after a seed-15 shuffle to break ties. The
stopping rule is the end of that single list. The frozen 27-pair recipe is
in [recipe.json](recipe.json). There is no claim of a minimum circuit or
optimal matching, and no closed decoder-rank search is reopened.

The controls remove restoration, corrupt a decoder operand, retain a
scalar-valid but nonliteral old cleanup, move preparation illegally to
frame zero, attempt a retained-register temporary, overlap pairs, and
remove dirty compensation. The first two also fail the separate
set-valued checker. The old cleanup is deliberately classified as
scalar-valid but outside literal H4, not as a false endpoint identity.

## Scope, prior work and attribution

This stops at a finite native bit circuit. The selected assembly is
complex-limited; unchanged recursive profiles do not create a new bit
exponent. Full parent construction, whole-owner hosting and the changed
global positive-prefix invoice still need replay before integrating this
word into an accepted supplier. The all-size compiler, common-label and
mutable-basis realization, pooled-cell hosting, precision/tape, residual
and analytic-transfer assumptions remain inherited. Finite symbolic
execution is not a formal proof of the full multiplication theorem.

Credit belongs to eumemic for PR543/493's R420 construction, decoder-total
schedule and interleaved-source interface; Dylan Crow for the earlier
bit-word/exporter line; DreamingOfClouds for retained-total and supplier
pricing work; Zhihao Chen for the mutable-basis scalar interface; and the
full realization, geometry, hosting and assembly lineage retained by
the original package and selected review.

Concurrent PR686 and PR694 are credited for restored pair sharing in
frame-zero dirt compensation. This contribution applies that algebraic
mechanism to the separate nine-total suffix at FULL, with complete A
operator equality and the original H2 unchanged. It imports no code or
circuits from them. PR670/674/688 alter phase-B blocks, PR691 alters
phase-A quad 13, and PR661 fixes phase-B gates and excludes resynthesis.
Composition with those changes is not claimed. PR620's decoder-floor
research concerns a different question from synthesizing these fixed
retained totals.

Prepared for **Sagar Thakrar (@thakrarsagar)** with substantial **OpenAI
Codex assistance** in nomination, proof, implementation, verification and
packaging, including separate Codex workers for independent replay and
native checks. No independent human review is claimed. This contribution
is under Apache-2.0, retaining the repository and predecessor licenses.
23 changes: 23 additions & 0 deletions research/r420-decoder-sharing/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"base_commit": "66849e1475c930fd7732b1a0067ffee7e1e95f60",
"selected_kappa": "51110230636731/31250000000000000",
"selected_construction_pr": 626,
"selected_construction_head": "660de893d27bb7abd1d5b01b1640207528a5c851",
"bit_supplier_pr": 543,
"bit_supplier_author": "eumemic",
"bit_supplier_head": "2065fe4f72a914d907f1046603f5a36f17018535",
"word": "research/e8-bit-r420/data/bitE8mut-r420.json.gz",
"word_canonical_sha256": "e597e3885c0a8daa262afa5985ee2930443329126aece76d33159d81882bdcc2",
"word_hash_rule": "SHA-256 of parsed JSON reserialized with sorted keys and separators comma/colon; gzip container metadata is not mathematical identity",
"files_sha256": {
"research/e8-bit-r420/code/xcheck.py": "5737d18a7826fd51e131035f2d7bebba2e2868af91dd7672a5f11208b036d424",
"research/e8-bit-r420/README.md": "9807be57c6adf26b30e4f54e2f8160075bbc05091f1a6d157e43d2a4620c1c9f",
"research/e8-bit-r420/code/gen_l3.py": "d5c802447c99255db1bdfcae62b2116bfc9612c9dc9000d41aa4f5f2fec9f2f2",
"research/e8-bit-carrier-skeleton/code/bit/export_records.py": "8a5999601f917dbb492bb9ae9a344611f18cc7cedc53dc3c76496a369e530eb3"
},
"concurrent_context_not_dependencies": {
"686": "23dcb610c2b156b76b9d599ea296c3cbde224b2d",
"691": "ee6b9175fe006c11871802866c487b5ecc1a93a4",
"694": "9732ac127dd4bef98a846aaa904c20b5a84e72c1"
}
}
Loading