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
1 change: 1 addition & 0 deletions research/fraction-zero-unit-feasibility/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__/
5 changes: 5 additions & 0 deletions research/fraction-zero-unit-feasibility/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Fraction zero/unit feasibility study
====================================
Original signed-error arithmetic: Ali Romman, with substantial OpenAI Codex assistance, retaining Adam Gall/ywz65/PR2878, PR5826/5819 and Mason Hale/PR5811/native/compiler/precision credit. The complete PR5848, PR5831 and nested source archives/notices remain unchanged. Apache-2.0.

New profiling, exact Fraction shortcut derivation, finite and actual comparisons, guard diagnoses and negative gate: Chris R / Clear1nsight, substantial OpenAI Codex assistance; no subagents, independent human or formal-kernel acceptance. No performance, physical-supplier, kappa or selected-frontier improvement. PR5848 and PR5839 supplied the complete-qualification baseline; guard/custody lineage follows PR5816/5818/5832/5761 with original authorship preserved.
13 changes: 13 additions & 0 deletions research/fraction-zero-unit-feasibility/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Exact-value scope of the proposed shortcuts

This argument concerns the authenticated Fraction `error_trace` function and its standard exact-rational inputs. It does not change a native operator, admitted cost, precision theorem or complete supplier.

Assume both versions start an event with the same coefficient rows, scores, peaks, witness dictionaries, pairs and hash stream. Shared constants are ordinary immutable Fraction values 0,1,-1. Replacing repeated construction of those constants preserves exact values/types and does not share mutable row/score containers.

For an ADD/COPY coefficient update, let x be the destination coefficient, y the source coefficient and q the parsed exact scalar. The original computes x+q*y. If q=1, the derived expression is x+y; if q=-1, it is x+(-y); otherwise it retains x+q*y. All are exactly equal standard Fraction values. With d=abs(x+q*y)-abs(x), the original updates each weighted score s by s+d*a, and the unweighted score by s+d. If d=1, addition of a is equal; if d=-1, subtraction of a is equal; if d=0, leaving the score unchanged is equal; otherwise the original expression is retained. There is no floating arithmetic, truncation, reassociation across distinct coefficient contributions or integer-backend reuse.

The resulting coefficient is inserted or removed by the same zero predicate. The event order, rounded-site injections, prefix peak/tie rules, full witness copies, final scores/coefficients, Pareto rows and hash updates remain in their original order. Induction on the coefficient and event loops therefore preserves every returned value, including attaining witnesses and signed coefficient streams. Mutable output dictionaries/lists remain fresh. The scope excludes arbitrary user-defined numeric classes with observable operator side effects; standard Fraction arithmetic and the authenticated caller supply the declared domain.

Exact module/function source hashes and uniquely bound edits prevent transfer to a changed source. The unmodified callable must match a fresh compilation's recursive executable structure; only file/line metadata is ignored. The original callable is restored by a context manager even on exceptions. Tests reject both outer and nested live-code drift, and compare numeric types as well as values. The three declared malformed-input probes preserve the original exception type/message; no universal malformed-object API claim is made.

Finite evidence covers 241 programs/10,164 events, all six operations, zero/unit/general coefficients and weights, sign flips, cancellation and 16 failure/isolation controls. One full actual trace additionally checks every value/type and unchanged input on all 25,984 events/799 coordinates. This establishes source-bound exactness evidence. It does not fund a performance claim: the observed 0.237-second trace difference is insufficient headroom for the complete qualification target. The experiment stops before complete optimization construction.
49 changes: 49 additions & 0 deletions research/fraction-zero-unit-feasibility/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Scoped negative Fraction zero/unit feasibility

**Decision: stop before complete candidate construction. No speedup or kappa claim.** The full current [PR #5848](https://github.com/CrocSwap/integer-mult-bounds/pull/5848) qualifier profiles at 38.314 seconds. Its Fraction error propagation takes 20.053 seconds. A source-bound zero/unit shortcut routine passes correctness, but one fresh full-word comparison measures **20.180 seconds original versus 19.943 seconds derived**: only 0.237 seconds difference. That is about 0.62% of the profiled whole qualifier, far below the roughly 5.75 seconds needed for a 15% complete-stage saving. This is an insufficient-headroom decision, not a universal performance obstruction or verified kernel speedup.

No complete optimized qualifier, first complete B/C pair, six-process benchmark or performance PR was built. The numerical/physical construction, source archives, precision guards, original independent integer backend and selected result remain unchanged. Kappa research, Work 1/2, feeds, agents and automations stay paused.

## Sources and scope

The input is the complete official 97-file PR #5848 export at `66fb6c6b8683b37967e9d7f313b3df99a49d2406`, containing unchanged PR #5831 and nested PR #5826 sources and notices. The exact original Fraction module SHA256 is `a4c743e79c55e9c2ac26deb6d87cb948b1b0fbe942e4f7912ccbfba55db4b32a`; its `error_trace` source SHA256 is `379c0e7c1c5ab7433ab5ad2669c1bda1234dbf0530fc61b21bfbe83528f37f53`.

The prototype reuses immutable Fraction constants and applies exact identities for coefficients ±1 and magnitude changes 0/±1. It preserves generic Fraction arithmetic for every other case. Exact full-module/function hashes, unique replacement sites, ordinary function shape and recursive executable-code binding are required before deriving a function. The frozen files are never edited. The scoped installer restores the original callable on success and exception. `PROOF.md` explains the value/type invariants.

The finite gate precedes the actual audit and any complete candidate. All **241 programs / 10,164 events**, complete traces, signed witnesses, numeric types and unmodified inputs agree. **16 controls** cover returned-output mutation, source/module/type/live/nested-code drift, wrong signs, missing witnesses/rounding/zero-delta arithmetic, original malformed-input exceptions, installation/restoration and a fresh derivation. Normal and optimized gates pass.

The full actual audit compares all **25,984 events / 799 coordinates**, every trace/witness value and type, with unchanged inputs. The complete output digest is `954c7448ff74d78753828e9623ad44c46da9e5ce459420b6e50a5d47294250b9`, weights digest `cf98bf5da5df28ec1ca3ca7e8723d740b98e142f31e94ff7ec36815cc387c373`.

## Reproduce

Python 3.12, standard library only:

```sh
python3 -B scripts/research_package.py --package research/fraction-zero-unit-feasibility
```

This runs a **fresh finite differential and all 16 controls**, about one second locally. It does not replay the full actual trace, substitute for PR #5848 qualification, establish performance or admit a mathematical theorem. The manifest states this limited coverage explicitly.

The separately opt-in full actual audit is:

```sh
python3 -B research/fraction-zero-unit-feasibility/actual_audit.py
```

It took 42.807 seconds locally and should run only under a fresh serial budget with the original 180-second cap, 1 GiB sampled group RSS and no automatic retries. Do not rerun it merely to validate these recorded results. Its within-process old/derived timers are not fresh-process wall/CPU qualification benchmarks. Ordering, retained output, unflushed caches and unreserved host load limit the timing inference.

## Failures preserved

Two attempts stopped before arithmetic comparison. The first wrapper retained an obsolete 14-member uniqueness count while checking the 98-member PR #5848 export. The official complete export check had already passed. The labelled correction requires both exact counts to be 98 and retains all 97 file/hash/mode bindings.

The second code-binding check compared nested code objects with source-location metadata, rejecting a recompiled comprehension. The labelled correction compares executable structure recursively, including nested bytecode/constants, names, argument layout, flags, free/cell variables, stack/local counts and exception table, while excluding location metadata. Exact source hashes remain mandatory; a new nested-code corruption control verifies rejection.

Original failed receipts, original hashes, reconstructed rejected sources and diagnoses are retained in `evidence/`. Public stderr replaces only the workspace prefix; its public hash and original stderr hash are both retained. Neither correction changes source arithmetic or expected scientific outputs. Every attempt is charged to the common cap. No failed arithmetic differential was repaired.

## Open next questions

The most useful next nomination would require a separately authorized primitive-level Fraction profile and an explicit bound on complete-stage headroom. The current data do not establish which branch, allocation or arithmetic primitive dominates the remaining cost. Repeating zero/unit tweaks or removing independent oracles is not justified by this result. A broader algorithm needs new source/coverage/purity review and finite feasibility before construction.

## Credit

Ali Romman supplied the original precision/error arithmetic and exact integer backend. Retain [PR #5831](https://github.com/CrocSwap/integer-mult-bounds/pull/5831), [PR #5826](https://github.com/CrocSwap/integer-mult-bounds/pull/5826), [PR #5819](https://github.com/CrocSwap/integer-mult-bounds/pull/5819), Adam Gall, ywz65, [PR #2878](https://github.com/CrocSwap/integer-mult-bounds/pull/2878), Mason Hale/[PR #5811](https://github.com/CrocSwap/integer-mult-bounds/pull/5811) and all retained P104/native/compiler/precision notices. PR #5848 and [PR #5839](https://github.com/CrocSwap/integer-mult-bounds/pull/5839) supply the qualifier and Linux baseline. Guard and custody lineage follows [PR #5816](https://github.com/CrocSwap/integer-mult-bounds/pull/5816), [PR #5818](https://github.com/CrocSwap/integer-mult-bounds/pull/5818), [PR #5832](https://github.com/CrocSwap/integer-mult-bounds/pull/5832) and the exact test-only [PR #5761](https://github.com/CrocSwap/integer-mult-bounds/pull/5761) dependency with original authorship/cherry-pick credit. New feasibility work by Chris R / Clear1nsight with substantial OpenAI Codex assistance; no subagents or independent human/kernel acceptance. Apache-2.0.
105 changes: 105 additions & 0 deletions research/fraction-zero-unit-feasibility/RESULT.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"actual_audit": {
"all_values_types_and_inputs_preserved": true,
"baseline_trace_seconds": 20.17961209200439,
"coordinates": 799,
"derived_trace_seconds": 19.942737821984338,
"events": 25984,
"full_output_sha256": "954c7448ff74d78753828e9623ad44c46da9e5ce459420b6e50a5d47294250b9",
"observed_seconds_removed": 0.2368742700200528,
"profile_whole_qualifier_seconds": 38.31372155799181,
"status": "PASS_FULL_ACTUAL_FRACTION_TRACE_EQUIVALENCE",
"weights_sha256": "cf98bf5da5df28ec1ca3ca7e8723d740b98e142f31e94ff7ec36815cc387c373"
},
"decision": "The observed trace difference of 0.237 seconds is insufficient to justify constructing a complete qualifier for a 15% whole-stage target. This is a scoped observation, not a universal obstruction.",
"finite": {
"all_complete_values_and_types_equal": true,
"cases": 241,
"controls": [
"returned-mutation-isolated",
"source-drift",
"Fraction-type-drift",
"module-byte-drift",
"live-code-drift",
"nested-live-code-drift",
"wrong-signed-update",
"omitted-witness",
"omitted-rounded-sites",
"wrong-zero-delta",
"bad-role",
"bad-scalar",
"missing-weight",
"restore-success",
"restore-exception",
"fresh-derivation"
],
"events": 10164,
"status": "PASS_FINITE_FRACTION_FEASIBILITY"
},
"full_BC_benchmark_run": false,
"full_candidate_constructed": false,
"performance_claim": null,
"profile": {
"inclusive_profiles": {
"Fraction.calculate.inclusive": [
1,
29.56573735800339
],
"Fraction.error_trace": [
1,
20.052949415985495
],
"Fraction.execute": [
6,
0.5582490059896372
],
"Fraction.ideal": [
4,
4.049590509006521
],
"Fraction.reverse_all": [
1,
2.8532538060098886
],
"Fraction.reverse_cut": [
4,
0.07846067700302228
],
"integer.calculate.inclusive": [
1,
7.428388572006952
],
"integer.error_trace": [
121,
3.0883288670156617
],
"integer.ideal": [
4,
0.8438016349391546
],
"integer.reverse_all": [
121,
1.0509023397462443
],
"observation.calls.inclusive": [
35,
30.843270772049436
],
"observation.deepcopy": [
16,
0.11094509204849601
],
"observation.take": [
18,
0.30852267597219907
],
"reference.digest": [
44,
3.5292127177817747
]
},
"seconds": 38.02564648500993,
"status": "PASS_FULL_QUALIFIER_PROFILE"
},
"status": "NEGATIVE_COMPLETE_COST_FEASIBILITY"
}
30 changes: 30 additions & 0 deletions research/fraction-zero-unit-feasibility/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"schema_version": 1,
"base_commit": "de5ec2e7a6074068452f45b1a191b5c72832df4a",
"files": [
{
"path": "docs/research/agent-task-catalog.json",
"usage": "provenance",
"git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec",
"sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81"
},
{
"path": "certificates/selected-result.json",
"usage": "provenance",
"git_blob": "581f8d87008354eb5b869f7ed9de1317ad837ce8",
"sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5"
},
{
"path": "research/fraction-zero-unit-feasibility/inputs/PR5848.tar",
"usage": "input",
"git_blob": "307d09d2a968e1bbec8025d9fbd0a884df790d12",
"sha256": "f899600acb6966a6b028ffbf1e33a94061615626b510feaca8cb073f03a34de6",
"pin": "head:e5614e94d93945963268e76fbd37f7dec58fde78:research/fraction-zero-unit-feasibility/inputs/PR5848.tar"
}
],
"external_origin": {
"pr": 5848,
"head": "66fb6c6b8683b37967e9d7f313b3df99a49d2406",
"complete_export_files": 97
}
}
60 changes: 60 additions & 0 deletions research/fraction-zero-unit-feasibility/TASK.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"schema_version": 1,
"task_id": "replay-runtime",
"original_card": {
"id": "replay-runtime",
"question": "Can one measured replay bottleneck be sped up without dropping coverage?",
"starting_points": [
"scripts/run_isolated_tests.py",
"scripts/verify_replay_coverage.py",
"certificates/selected-result.json"
],
"methods": [
"Profile one isolated replay and optimize the measured bottleneck.",
"Design source-bound reuse with explicit dependency invalidation and negative controls."
],
"acceptance_gate": "Report before/after wall time on the same fixture, retained checks and invalidation behavior.",
"first_step": {
"command": [
"python3",
"-B",
"scripts/research_selected_baseline.py"
],
"expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY",
"inspect": "Resolve the current selected review, separate complex/ordinary BIT/admitted BIT/outer budgets, and compare the card against live handoffs before starting. Historical ceilings require exact source/model equivalence.",
"scope": "Source-binding orientation only; not a scientific replay or all-size proof. Materialize selected inputs if this checkout is sparse."
},
"first_experiment": "Measure one unchanged fixture, preserve check coverage, and test one optimization with invalidation controls.",
"bottleneck_link": "Faster trustworthy replays increase review throughput and let mechanism candidates be checked sooner.",
"allowed_variations": [
"Profile one stage or design one source-bound cache boundary."
],
"scope_change_triggers": [
"Skipping coverage or comparing different fixtures to claim speedup."
],
"overlap_terms": [
"replay runtime",
"cache invalidation",
"isolated tests"
]
},
"scope_status": "refined",
"scope_change_reason": "Explicit donor requested profile and finite feasibility before construction. Full actual kernel comparison found insufficient saving; stop before a complete optimization candidate or performance PR.",
"actual_scope": "PR5848/frozen-66fb6c6/Fraction-zero-unit-small-feasibility",
"bottleneck_link": "Faster trustworthy replays increase review throughput and let mechanism candidates be checked sooner.",
"stop_rule": "Gate stopped after one full actual trace comparison:20.180\u219219.943s does not justify15% complete38-second qualification saving. No full candidate or six-run benchmark. Original180s science cap,600s finite/profile stage,1GiB sampled group RSS and zero automatic retries; pre-arithmetic diagnosed corrections labelled and charged.",
"time_budget_minutes": 90,
"outcome": "negative-result",
"evidence": "RESULT.json, PROOF.md, README.md and evidence/: exact241-case/10164-event equality,16 controls, full actual25984-event/799-coordinate trace and typed witness equality, measured insufficient headroom, two preserved pre-arithmetic wrapper binding failures and diagnoses.",
"author": "Chris R / Clear1nsight",
"ai_assistance": "Substantial OpenAI Codex assistance for source review, execution, tooling and report; no subagents, independent human or proof-kernel acceptance.",
"open_questions": [
{
"question": "Which Fraction primitive dominates the remaining20-second trace?",
"why_it_matters": "This zero/unit micro-optimization did not change the complete-cost decision.",
"first_step": "Under a separately authorized budget, profile arithmetic primitives with complete source-bound output checks before nominating another algorithm.",
"blocked_by": "New bounded nomination and overlap check; no authorization inferred from this checkpoint."
}
],
"base_commit": "de5ec2e7a6074068452f45b1a191b5c72832df4a"
}
17 changes: 17 additions & 0 deletions research/fraction-zero-unit-feasibility/VALIDATION.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"attempts": 9,
"automatic_retries": 0,
"complete_BC_benchmark_run": false,
"complete_qualifier_constructed": false,
"finite_replay": "pass normal and optimized",
"full_actual_trace": "values/types/inputs equal; timing insufficient for15% complete qualification",
"guarded_wall_seconds": 87.11620681601926,
"initial_stage_limit_seconds": 600,
"kappa_research": "PAUSED",
"nomination": "STOP: insufficient observed complete-stage headroom",
"passes": 7,
"per_command_limit_seconds": 180,
"pre_arithmetic_guard_rejections": 2,
"shared_limit_seconds": 1500,
"source": "66fb6c6b8683b37967e9d7f313b3df99a49d2406"
}
20 changes: 20 additions & 0 deletions research/fraction-zero-unit-feasibility/VERIFY.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"schema_version": 1,
"status": "ready",
"python": "3.12",
"requirements": [],
"inputs": [
"research/fraction-zero-unit-feasibility/inputs/PR5848.tar"
],
"commands": [
{
"argv": [
"{python}",
"-B",
"{package}/verify.py"
],
"timeout_seconds": 30,
"checks": "Fresh complete241-case/10164-event finite exact Fraction differential and16 source/code/type/mutation/exception/restoration controls. Finite negative feasibility only; this command does not rerun the full actual trace or qualify a multiplication theorem/performance claim."
}
]
}
Loading