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
90 changes: 90 additions & 0 deletions research/selected-quadratic-replay/BENCHMARK.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"implementation_sha256": {
"benchmark.py": "74741a624954f0f1dd318f1adca9a565b8587ddf91638df8bce22d59ba4e1683",
"binding.py": "4e45c0a3ccabfb0adbf24e10f4b6e2ac3539ad8e1f6ceddd6e4ef10852cd8340",
"checks.py": "b92ac7c366e30f31a5f613f06ef12fec62e5998ae952c5ae80c1b9b88b3dfc5f",
"clifford_fast.py": "db570d2797f6280c8399f6001a4547ab20126353e9fb149e0e93ad0a079453b5",
"cross.py": "a9ea3bdfed7b96dd79cde32edf04aff7167a63712dcd14882b27ed0b06d4de32",
"local_fast.py": "ce9ff9e7bf5981c91642e712bbfec47c872b1260f7da3ea586e65473ceee5156",
"native_fast.py": "f70834109e904cf6046fe55667e4fe29504499aafb7262716b099d75027bd513",
"pins.py": "f1e7b282065aa8b9cea3f501598beb13cdf40b7343e4591393ee172fe8bb5741",
"run.py": "2bd1f562e786fb5c7b77c056d5f304e92cc29642d533a4dfd9dc5d0586cf0ca8",
"state_adapter.py": "ed3390ad0e4484a2e0127d63a1df5fd9c30e51fc7bc6014a8f9498e09702215b",
"verify.py": "4b8b0bb4127b42099494afcfec2062a7061d623a1261466c808bacd98fc6b9b5",
"verify_source.py": "166e680bb8f5729f5bcf984f8667f823a5bdb7fb2aa8f16418b6c770a483b3d5"
},
"inputs": {
"research/exact-clifford-quadratic-replay/NOTICE.md": "a77adc71861e3b9c73c703c5db5b671f61a1101d85d14cca08547e21d6d8dce4",
"research/exact-clifford-quadratic-replay/PROOF.md": "e5039414a02e36cdeab82fb9803fc4de0c3e0f3997e8812ef9d227e5d417ec91",
"research/exact-clifford-quadratic-replay/quadratic.py": "d406584aed1479b75c387bc964b9e797b2f4f75e5f8c6bbea00df07f7d590a91",
"research/higher-moment-strictification/verify.py": "0ce7e7137422d5ffeda22085c81fa88471bbe963100fdad62e659f1e3bf89326",
"research/joint-helper-lattice/CONTROLLER.json": "1f5d6aa267e4e66048818714b5d3b5eae17a58abe91d15deeaa34574f7391a5f",
"research/kappa-0023-productive-jobs/dependencies/kappa-next-regime/direct-decoder/sources/DATA-PHASES.json": "c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa",
"research/kappa-rebuild/architecture/mixed_target_probe.py": "011c3c9d0cf81103dc84d709a0e36793eb7c5ae3f23c85eac27650ef13afa04a",
"research/p104-helper-subspace-splits/NOTICE": "8bbda66537ac761d632603066bdbb568ab5b26545030ea7979e27a85fcbe040c",
"research/p104-helper-subspace-splits/PROOF.md": "f4c68acf9373e34d88e14e1a7791b4b739c8b5297a1ae4c0121f579a02fde04e",
"research/p104-helper-subspace-splits/README.md": "a83c5c3ae7a31a5dfbc3c7c59669ee55cc15f966a0cb4405cb48cb8fa2a94f56",
"research/p104-helper-subspace-splits/RESULT.json": "1d92e587915052110dfb3aca8890df5afdaf496164efa5a4a52e69ceeb3c70f3",
"research/p104-helper-subspace-splits/SOURCES.json": "3c6dab6b491c904c8c2d2c76d5101ea13223ce7dc9b9a2acd2a37b038d1e6887",
"research/p104-helper-subspace-splits/SPLITS.json": "0bf3cf7d2abe118daa6d319a40f4f1b74b3c993d21b8d0fcb95299624797b244",
"research/p104-helper-subspace-splits/TASK.json": "4e5928f3a40f831668fd759ddc5b131198622e2c6dd2229b3b0d56de89c41ce3",
"research/p104-helper-subspace-splits/VALIDATION.md": "218e0e81fcd70c02fa2a1ae2f24676487ed498d93ce8dbc60f51c51d89e538ce",
"research/p104-helper-subspace-splits/VERIFY.json": "30499c00a5c6a9718561a152e8008ce1a765535647306dc4b2d2a7ce78b7b2ac",
"research/p104-helper-subspace-splits/WORD.json.gz": "bbb072bced5824a8d9094c49be2fc51fbfdd05fb2b7dab8106e1275053075099",
"research/p104-helper-subspace-splits/construct.py": "8e1a674ebed7bffb9fd6995555895a9925b665c2dec0e91f2876ff043901006f",
"research/p104-helper-subspace-splits/inputs/PR5565-WORD.json.gz": "3d62828f53e654e3db218bf4611a47aed4a677d48043713dc004db0f8a32990d",
"research/p104-helper-subspace-splits/inputs/PR5580-WORD.json.gz": "b2a98c4bd0dbe86c09e9d15ee060dcf1aab09dbef90aa1e2127676f4039f406b",
"research/p104-helper-subspace-splits/local.py": "ef430511ce36fc658ab711bd84cd2d7b484b8af173238ff89cbfec6139fefbad",
"research/p104-helper-subspace-splits/pricing.py": "637c8b0eea8bf870d866707de8230aa8ddd0c7401b56153f65b60913b025000b",
"research/p104-helper-subspace-splits/search.py": "668022953f53929fd4d95ed1b5c01ac2ba3b4bdf6be7babae511757eb21b7e6a",
"research/p104-helper-subspace-splits/verify.py": "f79c78d009d8a88bc5721644237074569fbb992fe7e49784f4b0c0a97523ea91",
"research/p104-native-channel/vendor/clifford_exact.py": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962",
"research/p104-native-channel/vendor/native_verify.py": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38",
"research/p104-productive-controller/CONTROLLER.json": "a84f6bbd547379597464e56c420cc665f96bc43a9a1351eed4b7cd0fce3cc4b9",
"research/p104-productive-controller/caller.py": "300d40043953e4f6aecfde8f2d1004b8ad6dc5a79ec3c7666c9908c2466c91c8",
"research/pr4359-p7-padding/dependencies/compiler-refill/endpoint.py": "d097e55f06c3f244f2074ffd7c1a0a5f3c4b4b6a6accf9619d1dde5c0ae85e15",
"research/pr4359-p7-padding/native_inventory.py": "65539acaf45bdfe8c5aee6830f9c9b3d1107c442a60842ef803fdd7688de8f32",
"research/query-thinned-controllers/RESULT.json": "6ebfc8c0f09166f4834e9d7427410cb31aefff2cd4d4ce588c8e52c9c70e9a0f"
},
"machine": "arm64",
"median_seconds": {
"literal": 269.0034654160263,
"quadratic": 98.37080179096665
},
"median_speedup": 2.7345864882513213,
"platform": "macOS-26.6.1-arm64-arm-64bit",
"python": "3.12.14 (main, Aug 25 2026, 13:50:33) [Clang 22.1.3 ]",
"rows": [
{
"mode": "literal",
"seconds": 264.334065125091,
"stdout_sha256": "1975d01770a017b3f0b3a98a54c7c79b887d90ba0a2e1a77c37db05c385fa42b"
},
{
"mode": "quadratic",
"seconds": 80.88713349995669,
"stdout_sha256": "1975d01770a017b3f0b3a98a54c7c79b887d90ba0a2e1a77c37db05c385fa42b"
},
{
"mode": "quadratic",
"seconds": 98.37080179096665,
"stdout_sha256": "1975d01770a017b3f0b3a98a54c7c79b887d90ba0a2e1a77c37db05c385fa42b"
},
{
"mode": "literal",
"seconds": 305.8997332500294,
"stdout_sha256": "1975d01770a017b3f0b3a98a54c7c79b887d90ba0a2e1a77c37db05c385fa42b"
},
{
"mode": "literal",
"seconds": 269.0034654160263,
"stdout_sha256": "1975d01770a017b3f0b3a98a54c7c79b887d90ba0a2e1a77c37db05c385fa42b"
},
{
"mode": "quadratic",
"seconds": 175.99428945791442,
"stdout_sha256": "1975d01770a017b3f0b3a98a54c7c79b887d90ba0a2e1a77c37db05c385fa42b"
}
],
"scope": "Complete selected scientific replay; fresh processes, warm OS caches, variable host load. Extra adapter corpus and literal cross-check are separate."
}
12 changes: 12 additions & 0 deletions research/selected-quadratic-replay/CROSS.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"actual_state_calls": {
"amplitude_entries": 19988992,
"dense": 32777,
"evaluations": 39041,
"sparse": 6264
},
"amplitudes_per_literal_interpreter": 9037312,
"distinct_inputs": 17651,
"input_trace_sha256": "73ac04db73d83151efb474925d48298664cc7490d31bdec7a70dcf79b448f481",
"literal_interpreters": 2
}
31 changes: 31 additions & 0 deletions research/selected-quadratic-replay/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
New selected-caller integration, format adapter, bounded input cache and checks:
Ali Romman with substantial OpenAI Codex assistance. Apache-2.0.
The same assistant wrote the code and performed the author-side checks.

The exact quadratic engine and its proof are retained from Ali Romman PR 5704,
head daa4d9dbd102d2a3677afc5614c56466bd2cf3a2. Its NOTICE.md remains byte-exact
and credits classical stabilizer simulation, Charles Bethin PR 662 and all
native/compiler predecessors. This package does not claim that engine as new.

The complete selected source is Ali Romman PR 5599, audited source head
09dd0965711ca7eeb169057a420abab1c9052137. Its exact word, receipt, proof and
NOTICE remain inputs. That notice retains Pierre-Loic Doulcet/hexapode,
Joel Pulikkan/GamingPuzzled, DreamingOfClouds, thu-nmrc, Gareth Davidson/bitplane,
David Arias, Cinna Davis, Jacob Alan Sussman, zxv, Cao Yifan and earlier geometry,
BIT and analytic credit. The derived files retain their original module text.

Classical deterministic memoization and exact affine-support enumeration are
not new general algorithms. The new result is their checked integration into
this complete source replay, with every scalar/native/invoice/compiler check,
independent literal-state evidence and whole-replay measurements. No original
source, selected record, native bill or kappa is changed. Archive inclusion,
local replay and hosted CI are separate from independent mathematical review.

Native-channel attribution from its pinned README: Rohan Arun PR 1972 supplied
the scalar/frame channel; Adam Gall PR 1940 supplied the schedule. Josie Elliston
PR 1071 supplied the P104 fixture/decoder, with Ali Romman PR 1125 and the retained
PR 968/717/446/595/620 lineage. icekylinx's frame-sa504 retains the exact compiler;
Ali Romman PR 1862/1931 retains the independent Gaussian interpreter. Native
lowering and physical binding were prepared for Chafik Boukhalfa with OpenAI
Codex assistance. These are predecessor contributions, not work of this adapter.
Source: https://github.com/CrocSwap/integer-mult-bounds/blob/553d26d796fde9871ff2661a49ac7732e945410f/research/p104-native-channel/README.md
27 changes: 27 additions & 0 deletions research/selected-quadratic-replay/PORTABILITY.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"readonly_files_unchanged": 54,
"optimized_git_free": true,
"empty_path": true,
"source_corruption_rejected": true,
"python": "Python 3.12.14",
"science_commit": "83823449895cb1126c246570b92992d45157fe02",
"export_sha256": "7d9369a6870deb505aba75f53fcb5a08db2d2b95dec67d4946f58cc59b7b93f3",
"registered_commands": "Both VERIFY.json commands, serially, with -I -O -B and empty PATH",
"actual_input_controls": [
{
"path": "research/exact-clifford-quadratic-replay/quadratic.py",
"rejected": true,
"restored_sha256": "d406584aed1479b75c387bc964b9e797b2f4f75e5f8c6bbea00df07f7d590a91"
},
{
"path": "research/p104-helper-subspace-splits/WORD.json.gz",
"rejected": true,
"restored_sha256": "bbb072bced5824a8d9094c49be2fc51fbfdd05fb2b7dab8106e1275053075099"
},
{
"path": "research/p104-native-channel/vendor/clifford_exact.py",
"rejected": true,
"restored_sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962"
}
]
}
97 changes: 97 additions & 0 deletions research/selected-quadratic-replay/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Exact selected-state adapter

This package reuses the quadratic-state engine and proof from PR 5704. It does
not change the native compiler, controller, local word or invoice. Its new
claims concern the state-format conversion, bounded cache and complete source
integration.

## State-format conversion

The retained engine returns `(n,o,C,p,a,b,d)`. Its nonzero support is
`o + span(C)` over F2. The columns C are independent. For a coefficient vector
z, the amplitude at `o + C*z` is `(a+ib)*i^p(z)/2^d`. Its proof covers each gate
in the retained P/D/X/C/phase grammar and includes the absolute phase.

The adapter enumerates every z in `{0,1}^len(C)`. Independence makes each address
unique, so assignment to the output map cannot overwrite another amplitude.
All other addresses have amplitude zero. The dense result fills those addresses
with `(0,0)`; the sparse result omits them. Both use the same denominator d.
The engine divides the scalar pair by every common factor of two. Every nonzero
amplitude is a rotation of that pair, so it has the same common factor of two.
Thus this denominator is the same minimal denominator used by both original
literal interpreters. The returned vectors and maps are exactly equal to the
original representations, not merely scalar multiples or the same support.

The selected native width is 9. Dense conversion therefore retains all 512
entries. This adapter does not claim polynomial storage for its dense public
interface. The reused engine avoids literal state evolution at each gate;
the final dense result remains available to every original caller check.

## Bounded cache and invalidation

Each key contains width, the complete ordered circuit, and the initial basis
address. The key builder copies lists and tuples to nested immutable tuples.
Its only scalar types are exact integers and strings. It rejects booleans,
floats and other objects before cache lookup, so Python numeric aliases cannot
turn a malformed input into a hit on a valid integer key.

On a miss, the unchanged engine validates and evaluates that exact key. The
result contains only immutable tuples and integers. The function is pure with
respect to these inputs, so a hit has the same value as another evaluation.
Changing a gate, gate order, matrix entry, width or initial address changes the
key. Equal list and tuple forms have the same gate semantics. Each output vector
or map is constructed anew; a caller cannot mutate the cached signature.

The process holds at most 8192 keys. Eviction removes only a reusable answer;
a later request recomputes it. No entry is saved between processes. The cache
contains neither a selected result nor a claimed invoice. Source authentication
runs before the scientific replay. Every caller check still executes and every
new exact state input is evaluated. This is checked reuse of a pure function,
not reuse of a scientific acceptance decision.

## Complete source binding

`binding.py` constructs the expected syntax tree from four exact retained files.
It changes only these sites:

- The compiler's `Op.zero_state` calls the dense adapter.
- The independent native interpreter's `state` calls the sparse adapter.
- The local verifier loads those two explicit derived modules.
- The top-level verifier uses the derived local module, keeps all original input
paths, accepts an explicit argument list, and rejects its source-write option.
- Every remaining assertion becomes `if not condition: raise AssertionError`.
Its condition and optional message stay unchanged. This retains the check
when Python runs with `-O`.

All other source syntax must match. A missing native-phase check, a missing
public-row check and an omitted complete pricing call each fail this binding.
The only 13 assertions in the declared Python input closure are in the retained
Clifford compiler. All 13 are retained as explicit failures in its derived copy.
The original files and classes are never patched at runtime. Comments are not
part of the syntax comparison; source files and attribution stay in the export.

The derived main runs the same selected scientific obligations and compares
both the complete RESULT and regenerated WORD with the retained artifacts.
It preserves all 13 helper cuts, arbitrary rational input rows, dense reverse
columns, native maps and phases, productive target checks, physical contacts,
query and idle work, two moment engines, compiler and all outer inequalities.
The original rejected input/output/target/cost mutations still run.

## Independent checks and claim boundary

The small adapter corpus compares 1522 exact states and 22700 amplitude entries
with the original interpreters. Separate controls check type aliases, key
invalidation, mutable outputs, bounded capacity, eviction and source-proof
omissions. `cross.py` reruns the complete selected check and collects every
actual state input. It then compares each distinct input against both original
literal interpreters, including every numerator, zero and denominator.
Repeated equal inputs need one independent comparison; the fresh full replay
still records every call. The trace hash and counts are checked on replay.

The source's signed Pauli checks stay unchanged. Equality of a valid Clifford
operator's signed Pauli action and one nonzero state fixes its absolute phase;
the adapter does not substitute a zero-column test for those Pauli checks.
The saved selected receipt must stay identical. This retains the existing
conditional kappa statement and its five assumptions. It proves no new supplier,
physical runtime improvement, precision theorem or selected-frontier change.
The engine proof and scientific predecessor results remain credited dependencies.
Loading
Loading