# reference-gate result Implemented the reference and Gate P foundation. No engine seeds were run and no policies were tuned. No dependencies were installed. Work completed within the 55-minute item cap; every command completed below 480 seconds. ## Delivered paths - `reference/envelopes/*.json`: 35 credited base64+zlib text envelopes preserving exact upstream bytes. Includes all 17 Taylor solved-directory files (including QM and HA calibration JSON), starter qt1/TwoComp/COMBO directories, all three requested tools plus their README, and the decoded Numba JSON plus its three source members. - `reference/sources.json`: per-file upstream URL, original SHA256/size, envelope SHA256, source commit, and available license information. - `reference/LICENSES.md`: available notices and explicit absence of standalone upstream license files. Neither pinned repository tree contains a LICENSE/COPYING file; the Numba artifact provides no separate license. qt1's original MIT SPDX identifier is preserved. No blanket license was invented. - `reference/materialize.py`: offline, stdlib-only verified extraction; atomic file writes, partial-extraction resume, idempotence, rejection of corrupted/extra destinations, unsafe paths, and symlinks. - `gatep.py`: full Taylor input verification on every call, verified snapshot execution of unmodified gates.py with `-I -B`, all 12 values compared to verified upstream README, per-key flock, bounded subprocess execution, atomic successful-output caching. Cache keys include upstream commit, full Python version, implementation, and all Taylor input hashes. Cache hits revalidate inputs, identity, exit/status, stderr, elapsed time, stdout hash, and exact output. Failed/malformed/timed-out outputs fail closed. - `tests/test_gatep.py`: 24 offline tests, including actual Gate P, concurrent subprocess callers, real child timeout, fault injection, all 17 Taylor input tampering cases on cache hits, cache corruption, all twelve wrong-value cases, Python-version separation, manifest/envelope tampering, symlink rejection, partial extraction and idempotence. - `docs/reference.md`, `docs/contracts.md`, `README.md`: exact commands, cache behavior, archive limitations, API and bank contracts, raw pinned upstream URLs, and honest pending publication status. 43 source/documentation files delivered, plus this result. The entire `reference/` directory is **2,890,567 bytes**, below 8 MiB. Every delivered file has the requested attribution header; JSON begins with `_credit`. Immutable originals are attributed by their envelopes, not altered. ## Benchmark and checks Before compression, full Gate P, or the test suite, the representative workload loaded `pol_mid.json` and called `replica2.run(10000, DPPolicy(table), n_steps=100)` using the pinned CPython reference. Table load: **0.018908 seconds**. The 100-step run: **0.000942 seconds**, edge **4.814647826753683**. This tiny workload is a budget estimate, not a full-run throughput claim. Source fetching and required-hash verification for the 35 original entries completed in **0.694575 seconds** using `python3 scratch/fetch.py`; the artifact was decoded as data and none of its commands were executed. `python3 scratch/bundle.py` produced the immutable envelopes and manifest. Interpreter: `3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]`. Commands were run from repository root. Timed end-to-end checks: | Command | Seconds | Result | |---|---:|---| | `python3 -B reference/materialize.py --out scratch/timing-reference` | 0.406783 | exit 0 / PASS | | `python3 -B gatep.py --reference scratch/timing-reference/taylor --cache scratch/cache/timing-gatep` | 9.985786 | exit 0 / PASS | | `python3 -B gatep.py --reference scratch/timing-reference/taylor --cache scratch/cache/timing-gatep` | 0.327788 | exit 0 / PASS | | `python3 -B -m unittest discover -s tests -p test_gatep.py -v` | 26.628082 | exit 0 / PASS | The timing harness used `subprocess.run(..., timeout=470)` inside `timeout 480s python3 -B scratch/check.py` and checkpointed each completed check in scratch. The initial suite passed 21 tests in 23.004 seconds. Review then found and repaired a directory-in-place-of-file extraction edge case; three further tests cover that case, partial extraction recovery, and a real subprocess timeout. The final suite passed **24 tests in 26.429 seconds** (26.628082 seconds including process startup). No observed test failures remain. Negative tests intentionally exercise rejection paths and pass only when rejected. Fresh Gate P stdout (all twelve match the upstream README): ```text seed perfect-info gaussian+plain gaussian+qm lattice+qm 10000 448.261189 443.455598 443.522608 443.663520 10001 576.779199 571.463409 571.623551 571.977293 10002 531.886497 525.168028 525.865859 526.411631 ``` Concurrency check: three actual CLI calls to one empty cache produced one execution and two verified hits, with identical stdout and one complete JSON cache record. Real timeout testing left no success record or live temporary snapshot. All delivered Python files parsed with `ast.parse`; all 43 source/documentation credit headers and first JSON `_credit` fields passed audit. No Numba parity, baseline-bank, or engine performance claim is made by these tests. ## Verified hashes | Input | SHA256 | |---|---| | Decoded Numba JSON | `a5d32e4c06dc93881821d568d8d89ca50adfdba56d5dccd92afef6c6c2157952` | | qt1/Strategy.sol | `c68887cff61180e12ba2b1ceb333edf76a830f91f63b5d775a8806fb9ec08aca` | | Taylor gates.py | `603280c1f595ca163ffaf2ba1ebdc7945fdb08dabae67fc53c922d39e1cce604` | | Taylor replica2.py | `6e37b4e61e1ffa5ffb1e43912ddb8659105989aa986eb48fcd1d7608f8dca685` | | Taylor qm_k1e-5.json | `5ff53e42ca87390e5f65d1caa3f7a480e67a8212fb0670274dfd562b05ba1afd` | | Taylor calib_out_2048.json | `fdf24c7aa2b604d770336a5783276da8ed4d50bca9dbcc02e98b4da58f608d26` | | sources.json | `62147ff112987f666e2c1ad5041012276a66033baec543c2b014f766cd8f01f5` | | Taylor input-map digest in Gate P cache | `0dabe003f62d413d6cb222acca4586f806e2a3f94b183d02569f04fd010f2d5e` | Every remaining original and envelope hash is recorded in `reference/sources.json` and checked by the materializer. The manifest digest is pinned in its source. ## Limits and missing work - This foundation does not implement ammfast, generate banks, run the 384-row Numba parity gate, benchmark runs/core, implement score.py, or implement setup_fast.sh. Those belong to subsequent kit items. - The archived Numba driver expects additional HEAD8 files and a flattened directory. Its archive is preserved faithfully; it is not claimed to be an installed runnable public API. Starter setup is preserved as source, not executed or represented as the required no-Rust installer. - Linux/Python 3.12.3 was tested. macOS arm64 and other Python versions were not tested. - Cache validation is local integrity checking, not cryptographic execution attestation. Changing the verifier itself is outside the threat model. Default cache is `~/.cache/imd-amm/gatep`, but all actual checks used explicit scratch paths and did not read host identifiers/configuration. - Final merged commit and goal raw URLs are not available to this worker. README lists real pinned upstream raw URLs and marks final publication pending; no final URL was guessed. ## Resume / rerun Fresh or partial extraction, then verified cache reuse: ```sh python3 -B reference/materialize.py --out scratch/reference python3 -B gatep.py --reference scratch/reference/taylor --cache scratch/cache/gatep python3 -B -m unittest discover -s tests -p test_gatep.py -v ``` To avoid submitting runtime state outside the allowed source paths, this run's scratch checkpoints/logs and caches were moved to the explicitly disposable `test/scratch/reference-gate-run/`. A local cached resume command is: ```sh python3 -B gatep.py --reference test/scratch/reference-gate-run/timing-reference/taylor --cache test/scratch/reference-gate-run/cache/timing-gatep ``` Those disposable files are not part of the deliverable and are deleted by the verifier. The first command block fully reconstructs the reference offline from delivered source. This result is left untracked for separate upload. ## Final submission audit `git add -- README.md gatep.py reference docs/contracts.md docs/reference.md tests/test_gatep.py` could not stage files: Git reported `Unable to create .git/index.lock: Read-only file system`. No commit was created; source files remain in the working tree for collection. This does not affect the executed offline checks. `git diff --cached --check` returned zero but had no staged content, so it is not counted as validation. An independent working-tree audit checked path scope, attribution, Python syntax and trailing whitespace instead. The result remains untracked as required. The relocated-cache resume command above was executed successfully and returned `PASS (verified cache hit)`. No work requires host permissions to rerun the delivered source.