Skip to content

Reduce the 1076-bit half-sum CLEAR to 93,811 reversible gates - #7721

Open
petalas wants to merge 2 commits into
CrocSwap:mainfrom
petalas:research/w1-1118a-scoped-bound
Open

petalas wants to merge 2 commits into
CrocSwap:mainfrom
petalas:research/w1-1118a-scoped-bound

Conversation

@petalas

@petalas petalas commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

For the eight-limb signed half-sum CLEAR row at event 88937, the specialized reversible circuit uses 184,118 fewer gates and 71,422 fewer internal zero bits at signed width 1,076. This answers question 3 of SYLforge's #7687 for its representative row.

Complete circuit at width 1,076 Gates Internal zero bits
Published #7687 277,929 86,525
Specialized row 93,811 15,103

Evidence

Scoped proof and finite gate certificate. For every positive signed width w, seven signed additions or subtractions compute the numerator in w+3 bits. Its low bit gives the remainder. A bit slice supplies the quotient and two high-bit comparisons detect overflow. Copying the output and reversing the internal list restores all workspace even on invalid inputs. The construction uses 87w+199 gates and 14w+39 internal zero bits.

The local CPython 3.12.15 replay executed all donor tuples at widths one and two (256 and 65,536), plus 32 cases at width 1,076. The gate simulator compares every wire against signed integer arithmetic, including the target and diagnostic on negative odd and wrapped-overflow cases. The direct registered command took 0.17 s. Package replay and the six-file committed-byte/source-history preflight passed for bc860f3314d9e94dda743c6ba4b3997a25d9264d.

Run these commands from the repository root with CPython 3.12.

python3.12 -B research/half-sum-clear-circuit/verify.py
python3.12 -B scripts/research_package.py --package research/half-sum-clear-circuit
python3.12 -B scripts/check_research_commit.py --package research/half-sum-clear-circuit --check-source-history

Scope

The result covers one real output coordinate. The row identification and comparison counts come from #7687. Gate-count optimality, rounded producer reachability, physical tape lowering, reset services and any change to κ remain open. No full native replay or proof-kernel run was performed.

Open next questions

What does the row cost with fixed tape positions and clean banks? Assign the work blocks to tapes and count the forward, copy and reverse scans, including initial allocation.

Related open work

CI notes

This PR carries the shared CI-doc and replay-gap sync used by other open PRs.

All six current-status tests and the registered historical replay-gap check passed locally. The plan, half-sum circuit replay and historical replay-gap replay all passed on 8f6279527c4362e2638737c90fa18c3cfec724fa. CI run 44363455119

Merge scope

The research commit adds six files in the new package. A separate commit carries the five shared CI files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant