Skip to content

Preserve 55 bounded-kernel assertions under optimized Python (no κ) - #6435

Open
petalas wants to merge 1 commit into
CrocSwap:mainfrom
petalas:research/w14-1102c-helper-boundary
Open

petalas wants to merge 1 commit into
CrocSwap:mainfrom
petalas:research/w14-1102c-helper-boundary

Conversation

@petalas

@petalas petalas commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The frozen PR5466 bounded Word RAM entry rejects optimized Python because certificate assertions would disappear. This opt-in adapter retains all 55 assertion sites and executes the complete checklist under -O, with frozen source bytes unchanged.

# Each authenticated assertion becomes an optimizer-resistant branch.
if not predicate:
    raise certificate_assertion_error(message)

Claim type: scoped implementation-preservation proof with finite conformance. The new result is interpreter portability, with no new arithmetic theorem, storage saving, runtime speedup, supplier admission or kappa. The complete scientific output equals a fresh original normal execution after removing only the clock field. Optimization stops at this first verified improvement.

Produced by Nick Petalas. Credit David Ganz / Dugongue for PR5466's kernel and complete checklist, with its unchanged tcslib, FastPoly, CatCrypt, mpfx and arithmetic/multiplication lineage. Python assertion semantics and AST lowering are standard techniques. PR5886's address-liveness allocation is separate context.

Evidence

Before: the original -O command exits with Run without Python -O: certificate assertions must be enabled. After: both complete adapted modes print PASS_WORDRAM_ASSERTION_PORTABILITY, with every assertion lowered to an explicit failure branch.

The complete original checklist is retained: eight NTT test groups, 65,537 modular-multiply inputs, 5,096 butterflies, 2,197 circuit fixtures, 277 complete programs and 20 approximate-backend pairs per precision. Those are predecessor domains preserved here, not new mathematical results.

New evidence includes 24 predicate/message/exception comparisons at compiler levels 0, 1 and 2, all 55 enumerated source sites, five boundary rejections and four actual-component result faults. Normal/optimized receipts agree except for requested flags. Individual complete commands took 10.46 and 10.10 seconds locally, each including its fresh original reference. These durations are check-budget evidence, not a performance improvement.

From the repository root, with standard-library CPython 3.12:

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

All commands pass locally. Metadata/pins, exact committed bytes, full declared source ancestry, official export integrity/input coverage and read-only Git-free normal/optimized replays pass. Both export replays leave all payload bytes and modes unchanged. Another CPython 3.12 path may replace the displayed interpreter. Sources are entirely available at main 7c49fe32c55de02c2c873655c804b16e4c3fef0a; no pending Git objects are required.

Limitations and unrun obligations

The proof concerns the fixed source checklist and ordinary assertion effects. It excludes traceback/debugger/coverage formatting, frame introspection, code-object identity and general source transformation. A syntactic assertion inventory and four component faults do not establish a separate falsifying fixture for every site. -OO has synthetic assertion-semantic checks only, and native Windows is unrun.

No selected cold replay, native/compiler/physical admission, Lean or Docker run, independent human acceptance or formal proof-kernel review is claimed. The selected frontier and five framework assumptions remain unchanged. This preservation work is not a scientific audit of PR5466.

Open next questions

  • Add per-site falsifying fixtures without changing the scientific domain. Begin with a visit trace that preserves lazy predicate/message evaluation; current component faults do not cover each site separately.
  • Run both complete commands on native Windows CPython 3.12 from the committed export. Actual subprocess/path behavior remains untested there.

Related open work

No other open PR studying this bounded-kernel optimized-replay seam was found. The completion refresh inspected all four other account PRs created since the advance CLAIM: #6429, #6430, #6431 and #6432. They concern rational-gate temporaries, P112 compatibility replay and mathematical bounds for different objects. #6430 supplies an implementation-preservation result for a different replay; no shared benchmark or instance is computed. PR5553 remains a historical manifest/planner search hit studying P104 handoffs. No extra computation checked another contribution.

CI notes

Both hosted checks, plan and replay (research/wordram-assertion-portability), passed at exact head dcbde65a7df2c88cc0717d7cb46018301601c453 in run 41538606733. The completed checks were read once; separate run metadata confirms completed success and the matching head. Hosted replay executes both registered normal and optimized commands. Local normal/optimized checks, committed-byte/source-history checks and read-only Git-free export replays also pass. CI certifies the registered finite replay and source bindings, not independent human acceptance or a formal proof-kernel theorem. No failed or waived check remains. Advance claim.

Merge Danger

Door: two-way

Blast Radius: research

Seven new files in one opt-in package. Shared code, predecessor bytes and the selected result are unchanged.

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