Skip to content

Reduce complete precision qualification time by 19% with C bookkeeping - #5864

Merged
Mister-Meeseeks merged 4 commits into
CrocSwap:mainfrom
Clear1nsight:verify/fraction-native-qualification-20261027
Oct 27, 2026
Merged

Mister-Meeseeks merged 4 commits into
CrocSwap:mainfrom
Clear1nsight:verify/fraction-native-qualification-20261027

Conversation

@Clear1nsight

Copy link
Copy Markdown
Contributor

Change and mathematical scope

The complete frozen PR #5848 qualifier spends substantial time in Fraction contribution bookkeeping. This opt-in package combines the exact bounded table and source-bound entry/compact/slot keys with a small C cache and coefficient-loop helper. It retains original Python Fraction arithmetic on every miss and ordered Python score additions, plus all independent integer, reverse, observation, witness, hash and source checks.

Across six fresh serial B,C,C,B,B,C processes on Linux, each candidate paying its new checks and a cold compile/link/load:

Complete command median Baseline Candidate Saved
Wall 40.516156 s 32.771297 s 19.12%
CPU including compiler children 40.33 s 32.74 s 18.82%

This is a source-pinned local tooling result, not a universal speedup, hosted performance certification, mathematical construction or kappa claim. Both 15% gates passed before expansion. Mutable answers never cross traces or backends; only loaded immutable code is shared within a fresh process. No compiled binary or dependency installation is included. Kappa research remains paused.

Task and overlap

Task replay-runtime, refined scope PR5848/frozen66fb6c6/native-cache-complete-qualification. Canonical main is de5ec2e7a6074068452f45b1a191b5c72832df4a, priority 8; frozen PR5848 is 66fb6c6b8683b37967e9d7f313b3df99a49d2406. Own input ancestor is 2ebc3a071c62fc839aaed1291220d78a317395d4.

This builds on PR #5852, PR #5853 and the entry-domain finding, whose earlier complete-cost screens stayed below 15%. The native loop changes a measured cost after finite feasibility and one complete actual audit. The direct-add, compact/slot-only and cache-only C negative results remain in the evidence. Recent targeted PR/comment searches found no matching active native implementation within bounded coverage; unpublished overlap is not excluded. Canonical progress claim.

The branch also retains Ali Romman’s exact test-only PR #5761 repair, cherry-picked as 01014cbe772ea5a59ccbc55266222433944c7368 from ba8a9e640e1983f3c29993fefa3f46e8ed03313a; it is an inherited dependency, not new work here.

Validation

The package retains 964 complete finite comparisons, 73 inherited +45 native controls, and all four unchanged custody controls. Complete qualification covers 25,984 events / 799 coordinates, all 120 independent finite fixtures, six source controls, signed witnesses and the full scientific receipt. Full optimized qualification also passes. The Git-free read-only export replays the full command in 33.03 seconds, with all 159 exported files unchanged.

python3 -B scripts/research_package.py --package research/fraction-native-qualification
python3 -B research/fraction-native-qualification/replay.py /tmp/native-qualification-evidence

Registered verification runs finite/native/source checks in about three seconds; full replay is separately opt-in. Linux CPython 3.12, an existing cc and Python development headers are required. No silent native skips. The complete benchmark includes cold compilation and compiler-child CPU; inner qualify.seconds alone is not the complete bill.

Meaningful controls include full-key/hash collisions, FIFO wrap, callback exceptions and re-entry, source/getter/callback drift, malformed packets, metadata ownership and cyclic GC. Two diagnosed harness failures and their corrections are retained: an explicit-cleanup warning and an inert forced-GC constructor fixture. The latter did not demonstrate the intended interleaving; no such empirical claim is made. No automatic retries or discarded timing samples. Same 180-second command / 1 GiB sampled group RSS / 600-second initial and 1,500-second shared budget; one serial numerical runner.

Metadata/source pins, all committed bytes/modes and complete export/input coverage pass. Full-history preflight is unavailable in this shallow checkout. Hosted CI status is separate and will be reported at the exact head; no hosted performance replay is claimed. Independent human or proof-kernel acceptance remains open.

Proof, code, complete timing receipts and raw evidence.

Credit

Original arithmetic and independent integer backend: Ali Romman, retaining Adam Gall, ywz65/PR #2878, Mason Hale/PR #5811, PR #5831, PR #5826, PR #5819 and all nested P104/native/compiler/precision notices. Tooling lineage includes PR #5839, PR #5816, PR #5818, PR #5832, PR5848/5852/5853 and the exact PR5761 repair.

New implementation and execution: Chris R / Clear1nsight with substantial OpenAI Codex assistance. GPT-6-astra xhigh performed static C API/source review only, with zero compiler or numerical runs. Memoization, loop invariants and C API techniques are standard. Apache-2.0; original archives and notices are retained.

Open next questions

Can one further source-bound reduction in the remaining bookkeeping pay its additional validation bill? Refresh overlap and census the new candidate, then nominate one small feasibility test before further construction. Keep this measured contribution frozen during publication; a new rational-arithmetic port requires a separate, broader proof and cost bill. See the package’s open questions.

@Clear1nsight

Copy link
Copy Markdown
Contributor Author

FINDING / DONE / RELEASED — measured native bookkeeping passes the complete 15% wall AND CPU gate; PR #5864 is open. Kappa research remains paused.

  1. Research discussion / PR / artifact: PR #5864, following PR #5848, PR #5852, PR #5853, the entry-domain handoff and canonical progress claim. Public code, proof, raw measurements and portable evidence.
  2. Exact commit: public head 3f15c943e4ad6479f03e674c80fff1269a16ccfe; own input ancestor 2ebc3a071c62fc839aaed1291220d78a317395d4; frozen complete PR5848 66fb6c6b8683b37967e9d7f313b3df99a49d2406; canonical main freshly checked de5ec2e7a6074068452f45b1a191b5c72832df4a, priority 8. All 23 measured scientific-core files exactly match the published files and the benchmark source-inventory digest 94948995f7ffb81a2215df2828296156bd0e579a5d15fe2e998f72ca1ab94674. All 163 public package files/bytes/modes, metadata, source pins and complete export with 12 declared inputs pass. Targeted overlap checks found no matching active native implementation within bounded coverage; unpublished overlap is not excluded.
  3. What is established: source-bound exact table/entry/compact/slot mechanisms plus native cache/coefficient-loop bookkeeping preserve all tested outputs. C retains original Python Fraction miss arithmetic, ordered Python score additions, F(0) construction, exact FIFO and fresh trace ownership. Six fresh serial B,C,C,B,B,C complete commands give median wall 40.516156→32.771297 seconds (19.1155% less) and CPU including compiler children 40.33→32.74 seconds (18.8197% less). Every C command pays 964 complete finite comparisons, 73 inherited +45 native controls and a cold compile/link/load before the unchanged qualifier. All 25,984 events / 799 coordinates, 120 independent finite fixtures, six source controls, reverse checks, guards, full ideal/error outputs, signed witnesses and hashes remain. Actual digest is 954c7448ff74d78753828e9623ad44c46da9e5ce459420b6e50a5d47294250b9; all cache counters agree. Complete optimized replay passes. Packaged normal/O checks include all four inherited custody controls. Git-free read-only full replay passes in 33.03 seconds with 159 exported files unchanged at candidate commit 8f04865e903eead8730be622357e3604c6fea179; the final public commit adds only portable evidence/metadata. Same 180-second command / 1 GiB sampled group RSS / 600-second initial and 1,500-second shared caps, one serial runner, zero automatic retries.
  4. What remains uncertain: this is local assisted engineering verification for one frozen Linux CPython 3.12/GCC fixture, not a universal speedup, independent human/kernel acceptance or hosted performance result. Exact-head hosted CI has passed planning, with its registered replay queued; that replay covers finite/native/source checks, not the complete local performance experiment. Full-history preflight is unavailable in this shallow checkout. Native API safety checks do not prove arbitrary callbacks/tokens have source semantics; the qualified stable-packet premise remains explicit. The earlier cache-only C micro was slower. All negative screens and two diagnosed harness failures remain: explicit temporary cleanup and an inert forced-GC constructor fixture. The latter did not empirically exercise the desired interleaving; it was replaced by deterministic ownership coverage while checked token reads remain source-reviewed. No dropped timing or hidden retry.
  5. Smallest useful next task: review this frozen source/ownership/cost argument or independently reproduce the complete benchmark. The minimum goal now passes locally; any additional optimization needs fresh overlap, a concrete remaining-cost census and one bounded feasibility test before construction. Do not expand into a new rational engine or duplicate the paused kappa streams. This measured construction scope is released; publication/CI follow-up remains owned here.
  6. Reproduction command / expected runtime: python3 -B scripts/research_package.py --package research/fraction-native-qualification runs all finite/native/source checks in about three seconds. python3 -B research/fraction-native-qualification/replay.py /tmp/native-qualification-evidence runs the guarded complete replay in about 33 seconds, retaining evidence outside the immutable package. Existing cc and Python 3.12 development headers are required; no installation or silent native skip. For a fresh performance round, use documented benchmark.py pair then remaining commands, about 220 seconds total; expand only if both first-pair gates pass. Inner qualify.seconds is not the complete bill.
  7. Predecessor credit: Ali Romman and all original Fraction/integer/P104/native/compiler/precision sources; retain Adam Gall, ywz65/PR #2878, Mason Hale/PR #5811, PR #5831, PR #5826, PR #5819, PR #5839, PR #5816, PR #5818, PR #5832 and PR5848/5852/5853. Exact test-only PR #5761 repair is Ali Romman’s ba8a9e640e1983f3c29993fefa3f46e8ed03313a, cherry-picked as 01014cbe772ea5a59ccbc55266222433944c7368; not new work here. New implementation/execution: Chris R / Clear1nsight with substantial OpenAI Codex assistance. GPT-6-astra xhigh performed static review only, zero compiler/numerical runs. Standard memoization/loop/C API techniques; Apache-2.0. No kappa, merge or selected-frontier change.

@Clear1nsight

Copy link
Copy Markdown
Contributor Author

Exact-head CI is now green at 3f15c943e4ad6479f03e674c80fff1269a16ccfe: workflow 40480683014. Planning passed 513 shared tests with 22 unchanged platform skips, selected only research/fraction-native-qualification, and registered replay freshly compiled the C source on hosted CPython 3.12.15 / GCC 13.3, passing all 964 comparisons, 73 inherited +45 native controls, four source-custody checks and clean-tree validation.

This completes the pending CI item in the seven-field handoff. Hosted coverage is finite/native/source verification; the 19.12% wall / 18.82% CPU complete saving is supported separately by the retained local cold-process BCCBBC experiment, full normal/O and Git-free readonly replay. PR remains open and unmerged. No kappa or selected-frontier change.

@Clear1nsight

Copy link
Copy Markdown
Contributor Author

FINDING / DONE / RELEASED — scoped stop after the additional native score-dispatch screen. PR #5864's validated 19.12% wall / 18.82% CPU saving remains unchanged; no additional complete gain is claimed.

  1. Research discussion / PR / artifact: continuation of PR #5864 and its primary seven-field handoff. New fork-only source, finite replay and all micro evidence. This is a scoped negative feasibility finding, not a new performance PR.
  2. Exact commit: artifact 781440db2533bcfb6803d519ff5d71088861cb48; own input ancestor 71e738f2a52c29d2154c251d84fadfabae2f76f6; parent PR #5864 3f15c943e4ad6479f03e674c80fff1269a16ccfe; canonical main freshly checked remains de5ec2e7a6074068452f45b1a191b5c72832df4a, priority 8. Parent PR #5848 still has frozen head 66fb6c6b8683b37967e9d7f313b3df99a49d2406. All 52 new package files/bytes/modes, metadata, source pins and five declared export inputs pass. The entire successful 163-file parent package still matches its public head exactly. Targeted Fraction/native/score searches found no matching other active implementation within bounded coverage; unpublished overlap is not excluded.
  3. What is established: one fixed native B,C,C,B screen calls the existing authenticated Python Fraction._add from the literal parent C three-score loop, with exact operand guards and generic fallback. No rational arithmetic is ported. All 33 prefix value/type comparisons and ten functional/binding controls pass. Registered replay reproduces those controls normally, optimized and from a Git-free read-only export, without repeating the timing trial. Each timing arm uses 16 frozen increment triples, 32,768 groups / 98,304 additions. Wall B1/C1/C2/B2 is 0.083361725 / 0.067125316 / 0.067535516 / 0.069913598 seconds; CPU is 0.082788980 / 0.067122706 / 0.067539532 / 0.069917697. Both pairs improve, but the smaller-pair illustrative scaling to 7,739,250 source additions is only 0.187221 wall / 0.187228 CPU seconds. Parent complete C1/C2/C3 ranges are 0.460568 wall / 0.45 CPU seconds. Even assuming zero added full-validation cost, the declared conservative margin is −0.273348 wall / −0.262772 CPU seconds. STOP before full-control integration, an actual-word audit or complete construction. One timing command cost 0.710 seconds including compilation; all four samples and raw narrower PASS status remain. No timing retry or discarded sample.
  4. What remains uncertain: synthetic scaling is not a bound on actual gain, and this engineering stop is not a universal obstruction. The direct arm pays per-add dispatch counters while the generic arm reports an aggregate count; preserve that interpretation limit. The initial prose said 32 prefixes; code includes zero and tests 33. The planned 118 inherited/native controls, prior 19 dispatch controls, full Cache/Event lifetime integration and actual complete caller were not rerun or built for this rejected extension. The original published parent retains its full validation unchanged. A packaged source-authentication harness initially rejected isolated-function recompilation because imported-module call opcodes changed; complete-module binding repaired it without changing the measured probe or repeating timings. Local checkout setup hit a missing promisor blob, then restored and checked every parent byte; no remote or measured source changed. All failures/drafts remain. No hosted CI is claimed for this fork-only artifact; parent exact-head CI remains green.
  5. Smallest useful next task: no further measured expansion is justified in this round. Constructor-elision and descriptor-metadata ideas carry unpriced semantic/lifetime obligations and are deferred, not disproved. A future distinct nomination needs fresh source/overlap/coverage/cost justification before another fixed small test. Keep PR #5864 frozen for review; no larger arithmetic port follows from this screen. The user’s minimum complete 15% goal is already achieved and published. This continuation scope is released; kappa research, Work 1/2 and unrelated feeds remain paused.
  6. Reproduction command / expected runtime: python3 -B scripts/research_package.py --package research/fraction-native-score-dispatch-feasibility freshly compiles the probe and runs every finite control in about half a second here. It deliberately does not replay timings or assert their historical outcome. Existing Linux CPython 3.12, cc and development headers are required; known runtime binding is checked, with no silent skip. The complete parent benchmark and full scientific replay remain documented in PR #5864. Same 180-second command / 1 GiB sampled group RSS / 600-second initial and 1,500-second shared limits; one numerical runner, zero automatic retries.
  7. Predecessor credit: retain Ali Romman and all P104/Fraction/integer/native/compiler/precision sources, Adam Gall, ywz65, Mason Hale, and PR #2878, PR #5811, PR #5819, PR #5826, PR #5831, PR #5816, PR #5818, PR #5832, PR #5839, PR #5848, PR #5852, PR #5853, PR #5864. The exact PR #5761 test-only repair keeps Ali Romman’s original authorship. New probe/execution: Chris R / Clear1nsight with substantial OpenAI Codex assistance. GPT-6-astra xhigh performed static nomination/stop review only, no compiler or numerical run. Standard dispatch/C API techniques; Apache-2.0. No kappa, merge or selected-frontier change.

@Mister-Meeseeks
Mister-Meeseeks merged commit a3e1e3f into CrocSwap:main Oct 27, 2026
2 checks passed
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.

3 participants