Skip to content

Save six more scalar units after P104 sign normalization (no new κ) - #5969

Open
petalas wants to merge 1 commit into
CrocSwap:mainfrom
petalas:research/w5-1022ae-scoped-obstruction
Open

petalas wants to merge 1 commit into
CrocSwap:mainfrom
petalas:research/w5-1022ae-scoped-obstruction

Conversation

@petalas

@petalas petalas commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

An exact local replacement removes one ADD macro and saves six more scalar allowance units after Sricharan Vagvala / theon199's merged #5750 sign normalization: 219258 → 219252, with 25253 → 25252 events. It also applies directly to selected #5599, giving 220232 → 220226.

-225 += -234
+225 += -2 * 234
 229 += 234
 227 += 234
-225 += -234

Claim type: exact finite circuit improvement with a scoped all-input algebraic proof. All four operations share actual frame 267. The two middle operations preserve source 234 and do not observe target 225. Every dirty input, helper target and paid native occurrence is preserved by the local identity and identical complete contexts. No new kappa is claimed.

The first positive rewrite ended the search. Publication overlap found #5750; its same literal block permits composition without another improvement search. The existing 974-unit normalization is inherited. Cinna Davis #4692 retains credit for commuting-ADD compression on the older word. The new patch, proof and standalone checker were produced by Nick Petalas. Retain Ali Romman #5599, Pierre-Loic Doulcet #5565, David Arias, Gareth Davidson, Cinna Davis and the cumulative P104/native/caller/pricing lineage.

Proof, exact source pins and verifier. Canonical base is 19fdb086ea96af9a9f87936a2b888e10af4ed810, priority revision 8. Only this five-file package is added.

Evidence

  • Before, each coefficient-minus-one ADD costs 8 under the retained scalar tariff. After, the single coefficient-minus-two ADD costs 10, saving 6. The independent full-word tariff sums give both totals above.
  • Exact rational local matrices, every local prefix and the actual common-frame cut pass. The maximum per-role magnitude at macro boundaries does not increase.
  • Complete normalized 756-row endpoint comparisons pass for each source and its replacement. Every one of the 3447 MOVE occurrences and all non-ADD events remain identical.
  • Eleven rejecting controls per source pass, including wrong signs/ports/frame, an omitted fanout, changed helper metadata or paid transport, and intervening source updates or target observations.
  • Warning-strict normal/optimized runs, both registered commands, Ruff 0.17.2, syntax/indentation/function bounds, committed bytes/source history, official export integrity and read-only Git-free normal/optimized replay pass locally on CPython 3.12.15 / macOS arm64. Actual exported-source corruption and an unexpected argument are rejected. Each registered check takes about 0.9 seconds locally; the complete wrapper takes about 2.1 seconds. These are replay durations, not speedup measurements.

From the repository root:

/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -W error -I -B research/p104-selected-scalar-pair/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -W error -I -O -B research/p104-selected-scalar-pair/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/p104-selected-scalar-pair
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/check_research_commit.py --package research/p104-selected-scalar-pair --check-source-history

An equivalent CPython 3.12 path may be substituted. Expected status: PASS_P104_SELECTED_SCALAR_PAIR, with scalar_saving: 6 in both source cases. Stdout contains generated receipts bound to every package file and both exact sources; no receipt is handwritten. The verifier imports no predecessor executable and writes no files.

Limitations and unrun obligations

This is a saving in the stated scalar allowance, not a physical runtime claim or global circuit minimum. The paid and productive rank profiles are unchanged, so the recursive moment and selected kappa do not improve. The normalized endpoint diagnostic treats MOVE as a chart identification; actual native equality follows from the exact local identity in identical contexts, rather than a fresh Gaussian phase replay.

Full selected replay, all-size/compiler admission, rounded native arithmetic, primitive intermediate states, physical tape/setup costs, a complete multiplier and formal-kernel review were not run. The five inherited framework assumptions remain. Exact algebraic equivalence does not assert identical rounded executions. Independent human and formal proof-kernel review are unclaimed.

Merged #5830 optimizes dyadic gauges on a different 782-input word. This patch removes an ADD in the pinned 748-input words; their scalar totals are not compared.

Open next questions

  1. Can a later scalar rewrite remove an actual paid frame transition? Specify a different block's complete entry/exit frames and price every changed native occurrence before searching.
  2. Does a later supplier word retain this exact block? Locate it by roles, coefficients and chart in one pinned source, then prove its legal boundary. Event indices alone do not transfer the patch. No follow-up is reserved.

Related open work

Completion refresh inspected this account's other open PRs created since the CLAIM: #5961, #5962, #5963, #5964, #5965, #5966, #5967, #5968, #5970, #5971. The P104-adjacent items are #5964 and #5971, distinguished above. None computes a conflicting allowance for the two pinned words; no extra comparison computations were run.

CI notes

At commit 7e40c9fe9889e2196f1b5f4a5009d29765a5e0ee, run 40540740947 passed both hosted checks: plan and replay (research/p104-selected-scalar-pair). The completed check list was read once and the run head matches the PR head. Both registered normal and optimized checks were exercised. CI certifies the bounded automated replay; independent human and formal proof-kernel acceptance remain unclaimed.

Merge Danger

Door: two-way.

Blast Radius: isolated.

Only a new research package and explicit replay manifest are added. The selected record and predecessor packages retain their bytes.

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