# e4-trunk-candidate / cand — result Credit: Taylor (gtmcknight) — solved policy, Gaussian filter, replica, qm tables. ## Files changed (all inside contracts/**, reference/candidate/**, reference/combo/**, README.md) | File | Bytes | sha256 | What | | --- | ---: | --- | --- | | `contracts/Candidate.sol` | 44,963 | `b87234c89e094f4955578417c1266129b0f96e6dfda68e3fb8866e00eeda71a2` | TC-A = `reference/qtr2/Strategy.sol` + diff, `patch -p1`. **Hash matched on first application; no fence whitespace repair was needed, nothing mangled.** Contract not otherwise edited. | | `contracts/candidate.diff` | 7,569 | `7ccea88d502451c3c2acdfb79796c28e534d2c82593a893b7d2046938075eb53` | Verbatim diff fence under `## Contract: exact unified diff against R` in A (fence lines only, final newline). | | `reference/candidate/GATES.md` | 20,579 | `23bbfa48396b0e262fc8ae1fb0dd5df631eb90cf4d565499a0f9592f41880de8` | TC-A gate record from A (P, Q choose+report vs qt1-ref, gas probe, F vs `twocomp.TwoComp`, engine 9800704..9800831 paired stats, peaks, OOG, runtime, per-seed CSV) and B (port-b: different source sha `d5e8b794…`, runtime 21,197, engine 9800832..9800959 +0.438501 ± 0.045224, peak 213,439), links; states reference is `reference/twocomp/twocomp.py` (DUAL_CUTS=2); appends this wave's re-checks. | | `reference/combo/combo.py` | 5,929 | `c5b711a0b4fb4783e8879a484bf87a427171f4a11aa5eb5ec3513c24ead1a796` | `## Code` python fence of C; matches the required hash. | | `reference/combo/combo_fees.py` | 3,794 | `588860199d751b3af5c93f61bc21f0111495468c0216b0fa23911a78c0b32de9` | `## Code` python fence (`combo.py`) of CF, renamed. CF asserts no hash, so none to compare. | | `reference/combo/twocomp.py` | 11,202 | `9d3c1833321493fb51bbde4e1b4dabc2f8978bd6d774ee2af8dc8aed13f0f0af` | Byte copy of `reference/twocomp/twocomp.py` (same hash C cites). | | `reference/combo/README.md` | 4,807 | `cfed4506552df43d2c57a9285f05296ebb7e664f2194a1eb5e369f5436102eb7` | Both items' paired figures vs qt1-ref and vs TwoComp on choose and report windows, 10000..10002 edges (offsets 444.195330/572.172682/526.274760), gas caveat (second lookup; dt gate chosen by e4-combo-port). | | `README.md` | 5,043 | `f9fcd089497ab5eaa1bd6387a30da584073e83af2543e78647fcb4c070d22053` | Seed ledger: 9801090..9802113 / 9802114..9803137 TC-A confirmation blocks A/B (e4-confirm-*); 9803138..9803185 e4-combo-port (3 x 16); 9803186..9803187 this wave's smoke; NEXT FREE ENGINE SEED 9803188. New `## Candidate` section (file, sha256, runtime 21,102 B, reference, gates file, COMBO link); one line in "Where things are". | Sources: A=https://api.imd.fun/artifacts/ebab165bd9bc568057d042f7a9364713eb9cbef3f895e046fc1fde8264134fd2, B=…/5f15282941e18c32fba78180ce53286fde0f521fc79322ea1d1dc7fa23f60134, C=…/d360bea6c8c982717b7b43a8069a87013169c89ee3e4da25622db4d880b936d4, CF=…/9169c2f7ccbc74467bcfe40c4c6bb7ef97010d089b60c32134f11e7b10b3583b (fetched with curl, fences extracted by line, final newline kept). ## Commands and outcomes (Linux x86_64) 1. `sha256sum reference/qtr2/Strategy.sol` → `7b99afae…e664f` (R as expected). `patch -p1 --dry-run` then `patch -p1 < cand.diff` on a scratch copy → clean; result sha256 `b87234c8…a71a2` ✔. 2. Clone `benedictbrady/amm-challenge` @6b6921f8 into `test/scratch/amm-challenge`, `cp tools/setup.sh scratch/`, `timeout 470 sh scratch/setup.sh` → `amm_sim_rs.abi3.so sha256 ff88b635…efd37`, `Strategy 'StarterStrategy' validated successfully!` ✔. 3. `. scratch/env.sh && amm-match validate contracts/Candidate.sol` → `Strategy 'TaylorTwoCompQmTrim2' validated successfully!` ✔. 4. Compile with the challenge `SolidityCompiler` (via `tools/check.py`): `compiled b87234c8… 21102` → **runtime 21,102 B** ✔ (≤ 24,576). qt1 compiled to 20,605 B. 5. `. scratch/env.sh && timeout 470 python tools/check.py contracts/Candidate.sol twocomp.TwoComp 70000 70002 scratch/F_cand_70000_70002.json` (seeds 70000..70001) → 2,000 callbacks each, max error 1.5110e-06 / 1.5556e-06 bps (≤ 1e-5 ✔), pyrevm peaks 158,806 / 155,206, sum gas 231,935,463 / 224,765,654 — identical to A's Gate F rows for those seeds. 6. `. scratch/env.sh && timeout 470 python tools/engine.py contracts/Candidate.sol reference/qt1/Strategy.sol 9803186 9803188 scratch/engine_cand_qt1_9803186_9803188.json` (once; END exclusive → seeds 9803186, 9803187) → edges candidate 520.818729 / 518.141460, qt1 520.261956 / 518.291168; paired {n 2, mean_diff +0.203532, se 0.353241, worst5 [9803187 −0.149708, 9803186 +0.556773]}; `gas_stats` Submission afterSwap: candidate 20,789 calls, max 199,870, 0 OOG, 0 revert; qt1 20,875 calls, max 203,691, 0 OOG, 0 revert. ✔ (smoke only, not evidence of gain). 7. `python3 -I` py_compile of `reference/combo/combo.py`, `combo_fees.py`, `twocomp.py` → all compile ✔ (bytecode written to scratch / removed). 8. Replica spot check, `python3 -I` with `reference/taylor` + `reference/combo` on path, `replica2.run(s, cls('reference/qt1/blob.bin'))`, seeds 10000..10002: `combo.Combo` 444.195330 / 572.172682 / 526.274760 (= C) ✔; `combo_fees.Combo` 444.206282 / 572.143046 / 526.298146; `twocomp.TwoComp` 443.690614 / 571.968071 / 526.124475 (= CHECKS.md) ✔. `__pycache__` directories created by these runs under `reference/` and `tools/` were removed (gitignored anyway). Engine/replica state stayed under `test/scratch/`. ## Not done / notes - Full Gate P/Q/F and the 128-seed engine runs were not re-run here; GATES.md copies A's and B's records (marked as such) plus this wave's smoke checks. - B is a *different* port (sha `d5e8b794…`, 6 storage words, runtime 21,197, engine peak 213,439); it is recorded for comparison only. The frozen candidate is TC-A. - `tools/README.md` still says the next free seed is 9801090; it lies outside this item's paths and was not edited. The root README ledger is authoritative (next free 9803188). - e4-combo-port's own results (its chosen dt gate, gas) are not in my sources; reference/combo/README.md only names it as owner of that choice and of seeds 9803138..9803185. - No commit made; untracked dotfiles in the checkout root (`.bashrc`, `.claude/`, …) are not mine and were left untouched.