Skip to content
Open
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
2 changes: 2 additions & 0 deletions research/g20-member-bank-cache/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
frozen/** -text
frozen/sources/FRAMES.json whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol
118 changes: 118 additions & 0 deletions research/g20-member-bank-cache/BENCHMARK.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"bindings_sha256": {
"FROZEN.json": "3e74a49400d174b61049815a4ece5ff1ac3226d28e1eeac6f2b856b013989d47",
"benchmark.py": "28381cfbbc00922dd74883ff07525c31752ef561c17a73adc1558faa19b63d5a",
"replay.py": "be6ba7b9f3c3a20508fc46085c6dcebd5a606404acad747898d4cdbb7086c2d8"
},
"commands": {
"cached": [
"/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12",
"-I",
"-W",
"error",
"-B",
"/Users/nick/git/imb-research-11/research/g20-member-bank-cache/replay.py"
],
"original": [
"/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12",
"-I",
"-W",
"error",
"-B",
"/Users/nick/git/imb-research-11/research/g20-member-bank-cache/frozen/verify_full_census.py"
]
},
"coverage": "Both commands recompute the complete census and compare FULL-CENSUS.json; all successes have exactly the source CLI output. Cached command also authenticates its seventeen frozen inputs.",
"errors": 0,
"limits": "One shared macOS host, warm filesystem cache; no host-wide isolation or cross-host speed guarantee.",
"median_fraction_saved": 0.09775719817118311,
"pairs": 5,
"platform": "macOS-27.0.1-arm64-arm-64bit",
"python": "3.12.15 (main, Oct 14 2026, 00:55:37) [Clang 23.1.3 ]",
"rows": [
{
"output_matches": true,
"pair": 0,
"returncode": 0,
"seconds": 4.448015083093196,
"side": "original"
},
{
"output_matches": true,
"pair": 0,
"returncode": 0,
"seconds": 4.115210375050083,
"side": "cached"
},
{
"output_matches": true,
"pair": 1,
"returncode": 0,
"seconds": 4.285522875143215,
"side": "original"
},
{
"output_matches": true,
"pair": 1,
"returncode": 0,
"seconds": 3.929358124965802,
"side": "cached"
},
{
"output_matches": true,
"pair": 2,
"returncode": 0,
"seconds": 4.115515916841105,
"side": "original"
},
{
"output_matches": true,
"pair": 2,
"returncode": 0,
"seconds": 3.8665821661707014,
"side": "cached"
},
{
"output_matches": true,
"pair": 3,
"returncode": 0,
"seconds": 4.238487374968827,
"side": "original"
},
{
"output_matches": true,
"pair": 3,
"returncode": 0,
"seconds": 3.719846999971196,
"side": "cached"
},
{
"output_matches": true,
"pair": 4,
"returncode": 0,
"seconds": 4.802233333000913,
"side": "original"
},
{
"output_matches": true,
"pair": 4,
"returncode": 0,
"seconds": 3.6852905419655144,
"side": "cached"
}
],
"status": "PASS_COMPLETE_CENSUS_BENCHMARK",
"summary": {
"cached": {
"maximum_seconds": 4.115210375050083,
"median_seconds": 3.8665821661707014,
"minimum_seconds": 3.6852905419655144
},
"original": {
"maximum_seconds": 4.802233333000913,
"median_seconds": 4.285522875143215,
"minimum_seconds": 4.115515916841105
}
},
"timing_boundary": "Before subprocess creation through complete exit and captured output; validation after timer."
}
111 changes: 111 additions & 0 deletions research/g20-member-bank-cache/FROZEN.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"repository": "https://github.com/ToikY/integer-mult-bounds",
"pull_request": "https://github.com/CrocSwap/integer-mult-bounds/pull/6396",
"commit": "2a5bc94df6d741b49afbadd36d96eb2aea0f6f1f",
"tree": "5068e27893c375eb704b7e5af059ddcea40a3d62",
"package": "research/g20-member-bank-excess",
"files": [
{
"path": "FULL-CENSUS.json",
"sha256": "9d36dbd0889fa72e67ccbb91cd97e5d0fb2548b4f0190358d8148db4d6533718",
"git_blob": "2ebbfe38be32644343de165cc5e315572e133422",
"mode": 33188
},
{
"path": "ORACLE.json",
"sha256": "b726e0c8e7350226a701c9eed4c53537e81d355a91e1b7904b37a5845e934248",
"git_blob": "00da73cdc91bfafa86e308cbd6a1613417d1d2e6",
"mode": 33188
},
{
"path": "PROOF.md",
"sha256": "381a9736e234b8726b7f8fb389cab72a6b97f7d6838bc2f99597c20cf9b17be3",
"git_blob": "2ccdae357993637fe2b8ed4f8a2f2fc67f36a0c7",
"mode": 33188
},
{
"path": "RESULT.json",
"sha256": "c28cd4c7d375ea551a294d364f5b4fcf784b9bbf504dc836e46e53a0fee4f8e1",
"git_blob": "897999bc5ab5f63d0dc0ee1cba0d590b13929747",
"mode": 33188
},
{
"path": "SOURCE-PINS.json",
"sha256": "bb0272a4bc86649177ee229e6e6b9fc6ba37edc8cb240fda6cef4ade272f0b61",
"git_blob": "caacc70f097f863c393c130901c4a3ac5d5111e7",
"mode": 33188
},
{
"path": "oracle_witness.py",
"sha256": "0a6c57687e5ef9e27db672793549f2253b0899b01ff179553bf52f8382071dee",
"git_blob": "3ecf59a3c279114cfd09aa523dd353bf602b1fa5",
"mode": 33188
},
{
"path": "sources/FRAMES.json",
"sha256": "0d99fc6b8f45c03dfba5252a03dd9e7fe23be3a7593dfe15368e34da6629a654",
"git_blob": "9edf8d95b45a9c9c766a956bfcd3c19cf07bc13c",
"mode": 33188
},
{
"path": "sources/NOTICE.md",
"sha256": "a4fdb5e2dfeeb216f3f58417891fc0a084c218d9a75228fb977e3cb82973be72",
"git_blob": "accbc28384515af7b94b33e5f4eb57a150e0d9a1",
"mode": 33188
},
{
"path": "sources/PATHS.json",
"sha256": "f4dd58b78121040b1f054c0f7a626b25f6ef8d39f3de044d3456ea7dea8a6a5e",
"git_blob": "efbdf632746a971f9a593f57ccbb7d2cc67a6760",
"mode": 33188
},
{
"path": "sources/WORD.json.gz",
"sha256": "8dd441fdb9c8923df06eb5ebfda37d03e4539f2305763e688d8c7025d196c4b1",
"git_blob": "3877a72d8a15adb03f6492f7d2fd8fa902ecb639",
"mode": 33188
},
{
"path": "sources/gap-PROOF.md",
"sha256": "121649b47271f45e18a1053ca5615c94e1cc81cc42136d8ccf3b2dca7d93f706",
"git_blob": "26f776a79accbb8a6378e5ad5ebefc3693a26501",
"mode": 33188
},
{
"path": "sources/gap-source.py",
"sha256": "91e201fd3c96267c878863abba794a16025070c98145ae598ee0ed7383c7f9c6",
"git_blob": "93bf7baf7c01de63a57a8ad1e4653ca48047eaae",
"mode": 33188
},
{
"path": "sources/prior-PROOF.md",
"sha256": "af88b44f1c61fb91d63ace7a2ece8d798bf6378864b2c4e1d44e01070fd485db",
"git_blob": "c6d2f2c7626a7c42da025ef360ce1673f6a116dc",
"mode": 33188
},
{
"path": "sources/prior-source.py",
"sha256": "a9aea8b108ebbeae8041770cefecfdabdfaf91b72ba7b5cfa2ff13408f1d16dd",
"git_blob": "13326f590033f6633bc91f919c802b6ddaf576bc",
"mode": 33188
},
{
"path": "sources/source-README.md",
"sha256": "e443b2fd7b988316953bfc7d21045690ea0d3ce9069ce1a06880f6ccfc7ec054",
"git_blob": "b1655b59134ae7a5734628ba1efef6611b2dcd31",
"mode": 33188
},
{
"path": "verify_excess.py",
"sha256": "519029e6783bff1845e97f81c7cc92377b64a179f46021274ba6104a6163055f",
"git_blob": "a51a63d6903cd9730d149f08196a05d4dbe8dd70",
"mode": 33188
},
{
"path": "verify_full_census.py",
"sha256": "e9cde3a24fd19184e63dfb1d23542d789b9276188ebd3df1d46c8b8e22d67574",
"git_blob": "0b22a661ade0b9c6eecba2678baf008fd91c2327",
"mode": 33188
}
]
}
65 changes: 65 additions & 0 deletions research/g20-member-bank-cache/PROFILE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"kind": "Separate untimed-for-benchmark cProfile run of the complete original command",
"total_seconds": 12.013104185000001,
"total_calls": 73612940,
"rows": [
{
"file": "verify_full_census.py",
"line": 237,
"function": "evaluate",
"calls": 1328544,
"own_seconds": 0.5509447080000001,
"cumulative_seconds": 4.7845580210000005
},
{
"file": "oracle_witness.py",
"line": 104,
"function": "contains",
"calls": 14788,
"own_seconds": 0.055117075,
"cumulative_seconds": 3.3628777230000004
},
{
"file": "verify_full_census.py",
"line": 312,
"function": "run",
"calls": 1,
"own_seconds": 0.38836302100000003,
"cumulative_seconds": 9.232434542
},
{
"file": "verify_full_census.py",
"line": 188,
"function": "extension_profile",
"calls": 1241489,
"own_seconds": 2.4170578810000003,
"cumulative_seconds": 4.093578312
},
{
"file": "verify_full_census.py",
"line": 92,
"function": "__init__",
"calls": 1,
"own_seconds": 0.007632416,
"cumulative_seconds": 2.772876209
},
{
"file": "verify_full_census.py",
"line": 253,
"function": "replace",
"calls": 1328544,
"own_seconds": 1.501980102,
"cumulative_seconds": 7.192428852000001
},
{
"file": "oracle_witness.py",
"line": 80,
"function": "rational_space",
"calls": 15433,
"own_seconds": 0.471399628,
"cumulative_seconds": 3.069970955
}
],
"source_manifest_sha256": "3e74a49400d174b61049815a4ece5ff1ac3226d28e1eeac6f2b856b013989d47",
"limits": "Profiler overhead affects these durations; use BENCHMARK.json for the unprofiled gain."
}
82 changes: 82 additions & 0 deletions research/g20-member-bank-cache/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Exact reuse of immutable containment queries

This contribution was produced by Nick Petalas. Apache-2.0.

The claim is implementation equivalence for the one complete census command
in ToikY's PR6396 at `2a5bc94df6d741b49afbadd36d96eb2aea0f6f1f`.
Its scientific result and proof are credited premises. This contribution
does not audit, admit or extend that result.

The frozen oracle represents each rational space as a tuple of eight-entry
tuples of immutable `Fraction` values. Its `contains(outer, inner)` computes
`rational_space(outer + inner) == outer`, with temporary list conversions.
The function and the called rational elimination read their arguments,
allocate local temporaries and return a Boolean. They change neither an
argument nor external state. Containment is directional, so the ordered pair
of complete spaces is the key. No frame identifier, rank, digest or object
identity substitutes for either space.

The new adapter authenticates seventeen frozen files, loads the unchanged
census and oracle into private namespaces, and replaces exactly the oracle
namespace's `contains` binding. This also reaches `route_edges` through that
function's own globals. The retained function object remains the miss handler.
No source file, compiler statement, census loop or scientific receipt changes.

Induct on calls of the replaced binding. On a miss, the original function
computes the same result as before. The adapter stores it under the full
ordered input pair if capacity remains. On a hit, the key equals the pair
used for a previous completed call, whose result equals the original pure
function's value on these immutable arguments. Returning that stored Boolean
therefore preserves the result. Python dictionaries resolve hash collisions
by equality of the complete keys; a hash alone is never a containment test.
When the table is full, a miss still evaluates the original function and
returns its answer. Exhaustion changes reuse only. Exceptions from a miss
propagate without creating an entry.

Consequently each successful query returns the same Boolean, so the census
executes the same branches, context replacements, direct checks and receipt
construction. It retains the original full `FULL-CENSUS.json` comparison,
including both per-cut digests, every category and every first positive
checkpoint. The independent direct kernels and nonzero Schur control still
execute. No prior census answer is substituted for a current context.

The table is created inside each run and discarded afterwards. It holds at
most 32,768 pairs. Space arguments have at most eight rows of eight rational
coordinates in this fixed source domain. The finite run's observed entry
count is recorded by the new verifier. This is a bound on retained cache
entries, not on all allocations of the original census or Python runtime.

The proof is conditional on the authenticated source's stated immutable input
contract. It gives no theorem for mutable arguments, a stateful predicate,
changed frame geometry or a different caller. Finite controls corroborate
the adapter and source binding; they do not establish the predecessor's
mathematics or independent scientific acceptance.

## Engineering decisions

Build the Lever led to the opt-in replay and alternating benchmark commands.
Prove It Works led to complete receipt equality and actual source corruption
and implementation mutation controls. Explain the Number and the benchmark
checklist led to a separate profile, complete fresh-process measurements,
output/error checks and five alternating pairs.

Power of Ten inspection covers the four new Python programs and their
fixed source-loading boundary. New functions are below sixty lines. There
is no recursion. The cache has a hard entry limit and safe fallback. Fixture
loops have fixed finite domains; benchmark pairs are restricted to five
through ten and each subprocess has a 120-second timeout. Source iteration
is exactly seventeen declared files, and the receipt inventory is bounded
at sixty-four files.

Rules 3, 8 and 9 need managed-runtime deviations. Python allocates dictionary
entries and immutable objects, so no allocation-free steady state is claimed.
The cache entry bound and fixed eight-coordinate source domain constrain its
additional retained state. Dynamic compilation is restricted to authenticated
source modules and the two explicit implementation mutants in the verifier.
The original predicate callback and fixed dictionary function lookups are
required to preserve the private source namespace; no caller-selected code
or plugin discovery is provided. Before adopting this in a service or a
different caller, supply its own input, allocation and dispatch limits.
Warning-strict normal and optimized commands are the available Python
diagnostics. The frozen predecessor code retains its own resource behavior
and is not refactored here.
Loading