# Root merge 3 of 3: engine TML check, carry, AGE (Solidity and engine), QLX5+AGE stack, QLX5 certification Credit: everything below builds on Taylor (gtmcknight)'s solved policy, github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved (replica, Gaussian filter, tell posterior, qm tables, gates.py). The research snapshot several items used is 66604b3426d8e97a73e2c39940b9b4dece51cc73. Inputs merged (all 8 present and non-empty): b34-tml-b (e05-engine/tml-b), b35-copy-a and b35-copy-b (e05-carry), b36-age (e05-age-sol), b37-age (e05-age-eng), b38-stack (e06-stack-build), b46-copy-a and b46-copy-b (e07-qlx-cert). Each figure below is tagged with the input it came from. Units: "replica edge" is Taylor's Python replica; "engine edge" is benedictbrady/amm-challenge@6b6921f8 run alone against the 30 bps VanillaStrategy. Neither is a leaderboard score. **Source-reliability warning (from the brief).** When their machines re-read sources, some citations did not hold: e05-carry/copy-a (1 source), e05-carry/copy-b (3 sources), e05-age-sol/age (1), e05-age-eng/age (1), e07-qlx-cert/copy-a (1), e07-qlx-cert/copy-b (1). The inputs do not say which URL failed. b35-copy-b reports `source_quotes_verified = 13` and b38-stack reports all 20 URLs re-fetched and found. Those are the items' own claims, and the copy-b claim conflicts with the brief's flag. Treat as unconfirmed any claim that rests only on an external page cited by those six items, such as upstream artifact contents or the AGE rule origin (artifact 326a3225…). The measurements those items made themselves (seed lists, means, SEs, hashes, gate counts) do not depend on those pages. Even so, nobody has re-run them. ## Headline findings 1. **AGE is the only new contract with a gate-E measurement, and it is small.** On 512 fresh engine seeds 10016072..10016583 (b37-age), the AGE contract measured: - +0.2240 se 0.0185 vs lb-4 (362/512 seeds positive) - +3.4461 se 0.0452 vs qt1 (512/512 positive) - +0.0322 se 0.0084 vs LEAN (302/512 positive). It did not beat LEAN by 0.05 (`beats_lean_by_0_05 = false`). In the same run, LEAN itself measured +0.1917 se 0.0169 vs lb-4. So almost all of AGE's gain over lb-4 is LEAN's gain. Gates P and Q were never run on AGE. 2. **Carrying rival state between q-lite split hits is strongly negative** on the replica: about −1.39 to −1.43 vs LEANBASE/QLITE on 1,024 report seeds. Both independent copies (b35-copy-a, b35-copy-b) agree, so it should not be advanced. The true-rival oracle ceiling over QLITE is only +0.105 se 0.008. 3. **TML equals LEAN bit-for-bit on the engine.** All 240 completed seeds were identical (b34-tml-b). 4. **QLX5 (source e183e5bc…) is certified P/T/F against a repaired reference** by two independent copies (b46-copy-a, b46-copy-b). The Solidity is unchanged. The original full-qm reference was the wrong comparator for gates T and F. As a result, **no earlier Q/E figure measured with the full-qm QLX reference carries over to the contract** (b46-copy-a). 5. **A QLX5+AGE stack contract was built and smoke-tested (b38-stack)** at 47,599 source characters and 22,525 deployed bytes. Gates Q, T, F, G and E were **not** run on it. It is the natural next candidate for gate E. None of these results reaches the goal of #1. No item claims a leaderboard score, and no item made a submission. --- ## 1. b34-tml-b: LEAN vs TML on the engine (gate E-style, partial) - Arms were used unedited: LEAN (artifact a79a3606…, source sha256 a6dfc3ba…) and TML (artifact fd2f147e…, source sha256 99d031f4…). Engine 6b6921f8, block driver artifact 764c9461…. - Seeds: range 10011792..10012559, but **only 240 of 768 completed**: 10011792..10011823, 10011888..10012015 and 10012080..10012159. - 192 seeds were burnt and must not be rerun: 10011824..10011887, 10012016..10012079, 10012208..10012239 and 10012400..10012431. - The rest were never run. Time ran out at about 0.26 seed-arm/s. - LEAN mean engine edge 538.8749, TML mean 538.8749. LEAN−TML = 0.0 se 0.0 (n=240). All 240 seeds were bit-equal. - The item notes that a replica loss at seed 10942 was not reproduced on these engine seeds. - Gas and size: | Arm | Peak gas | OOG | Runtime bytes | Source chars | |---|---|---|---|---| | LEAN | 197,967 | 0 | 21,368 | 43,563 | | TML | 209,166 | 0 | 21,055 | 40,615 | `pass_peak = true`. - Reading: TML gives no edge over LEAN on the engine, so it is only worth taking for its size (313 fewer bytes, 2,948 fewer characters). It costs about 11k more peak gas. ## 2. b35-copy-a and b35-copy-b: carrying rival state between split hits (replica only) Question: does carrying the rival estimate between q-lite split hits beat LEANBASE (artifact efb8e653…) and QLITE (cap24/gate6/order b, artifact f5cea5b2… per copy-a)? Both copies answered **no**. Neither copy produced Solidity, gas, or engine results. ### Agreements (identical figures in both copies) - Selection seeds 64000..64255 (n=256): - QLITE − LEANBASE = +0.0312 se 0.0100 - ORACLE-R − LEANBASE = +0.1272 se 0.0203 - ORACLE-R − QLITE = +0.0960 se 0.0169 - Report seeds 10000..11023 (n=1024): - QLITE − LEANBASE = +0.0378 se 0.0049 - ORACLE-R − LEANBASE = +0.1432 se 0.0095 - ORACLE-R − QLITE = +0.1054 se 0.0084 - ORACLE-R is LEANBASE's belief with the true current rival spot (synced=true). Both copies describe it as an empirical ceiling for this fee policy, not a proven bound. This is consistent with lever (1) in the brief: rival64 measured +0.145 se 0.015 over lb-4's policy. - Policy means on the report seeds (copy-a): LEANBASE 536.1283, QLITE 536.1661, CARRY-1 534.7387, ORACLE-R 536.2716 replica edge. - Gate P matched Taylor's gates.py to 6 digits (copy-a). ### Where they differ The two copies implemented the carry rule slightly differently and picked different widths. Both picks are deeply negative. | | copy-a | copy-b | |---|---|---| | Rule | Clip carried log spot to [m+log 0.997−β√v, m−log 0.997+β√v] at every callback. synced=True always. Legacy bound and 0.35 pull replaced. | Carried spot starts at 100 and is clipped every callback to [exp(m−w√v)·0.997, exp(m+w√v)/0.997]. A separate synced flag resets each step and is set on a hit. No bound or pull. | | Choose CARRY-0 vs QLITE | −1.4835 se 0.0489 | −1.4622 se 0.0437 | | Choose CARRY-1 vs QLITE | −1.4628 se 0.0476 | −1.4229 se 0.0461 | | Choose CARRY-2 vs QLITE | −1.5099 se 0.0499 | −1.3852 se 0.0453 | | Selected | CARRY-1 (β=1) | CARRY-2 (width 2) | | Report vs LEANBASE (n=1024) | −1.3896 se 0.0241 | −1.3836 se 0.0230 | | Report vs QLITE | −1.4274 se 0.0237 | −1.4214 se 0.0230 | | Advance (needs ≥ +0.02) | no; mean−2se −1.4747 | no; mean−2se −1.4674 | - Copy-b also stopped every width as "worse" with score.py after 128 seeds, at −1.37 to −1.48. - Neither copy ran a causal ablation. Both say these variants were **not tested**, so the negative result does not rule them out: - clipping only on new steps - keeping the base bound and pull on misses - other synced rules - Copy-a's static cost: one extra storage word. - Copy-b's static cost: 0 extra words vs QLITE in a minimal port. ### Split-detector audit (new finding: the claim of zero false hits does not hold) - copy-a, seeds 64000..64003, log error > 1e-9: - QLITE: 15 wrong of 21,114 hits, all retail, max error 14.39 bps - CARRY-0: 13 wrong; CARRY-1: 10 wrong; CARRY-2: 13 wrong - copy-b, seeds 64000..64007: - QLITE: 26 discrepancies of 45,499 hits (7 above 0.1 bps, max 14.39 bps) - CARRY-0: 19 of 44,264 (max 10.95 bps) - None of the mismatches was a true arbitrage. - Copy-b traced every discrepancy to the rival's allocated fill being either zero or positive but ≤1e-4, fills the replica skips: QLITE 7 zero and 19 small; CARRY-0 6 and 13. - Both copies conclude that the earlier "zero false hits" claim is not universal. **Source caveat:** both e05-carry copies are among the items with sources that did not hold (1 and 3). Their seed-level measurements are their own. Treat their descriptions of the supplied LEANBASE and QLITE artifacts as unconfirmed. ## 3. b36-age: AGE rule ported to Solidity on LEAN (gates T, F, G) - Rule source: e03-cheap-ref/age-thr, https://api.imd.fun/artifacts/326a32254eb393c65551c31311212b728155d59924f8474985260539b2a1335d. This source citation is in an item flagged for a source that did not hold. - Parameters: a0=0, ainf=0.7, tau=1, soft=1. Base: LEAN. - The rule, on a retail callback: - If the bound binds: r=c, synced, rt=timestamp. - Otherwise, if c≠r: weight = floor(7e17·age/(age+1)) and r = exp(ln r + w·(ln c − ln r)). LEAN used a constant 35e16 instead. rt sits in bits 224..252 of the existing slot 2 word, so there is no new storage word. - Size change: +1,053 source characters and +139 runtime bytes over LEAN. - Source sha256 8cb006fa6376b0f5b2ac1c80627ce55f6b52ceef19d22a80687a87247431b135. - **Gate T: pass.** Seeds 74200..74249, 549,505 callbacks. - Open loop: 352,817 first trades, 0 label mismatches. - Closed loop: 0 rule mismatches, 0 tell mismatches. Kind counts: binding 312,946, pull 45,042, arb 191,517, neither 0. - Max rival-estimate relative difference: 7.0e-15. - Contract-driven mean replica edge 537.678. This is context only and not gate Q. - **Gate F: pass.** 100,000 callbacks, worst 7.48e-11 bps, 0 guard shifts, peak pyrevm gas 172,257. - F used a q_u1.json that this item decoded itself (sha256 7068c7e5…). It is not LEAN's file (d5645b6d…), because the lookup-u1 qpl.py could not be fetched. - **Gate G: pass**, on only 8 engine seeds (10009056..10009063): | | AGE | LEAN | |---|---|---| | Runtime bytes | 21,507 | 21,368 | | Source chars | 44,616 | 43,563 | | Peak gas | 197,103 | 195,938 | | OOG | 0 | 0 | AGE − LEAN was +0.024 se 0.059 on n=8. That is a gas gate, not a score. - Not done: - Gates P, Q and E. - The character count is Python len(), not counted on paradigm.xyz. - rt is 29 bits and would wrap at 2^29. - Kind 3, the over-budget label and the fee-guard branches were never exercised. - A "peek" view build was dropped at 35,507 bytes, over the limit. - lookup-u1 gates.py/qpl.py (fd38823c…) and BASE (fd2f147e…) could not be fetched; only hash prefixes were given. ## 4. b37-age: AGE gate E on the engine - 512 fresh engine seeds 10016072..10016583; none burnt or missing. 8 workers, blocks of 32. Engine 6b6921f8, driver 764c9461… unchanged. | Arm | Mean engine edge | Peak gas | OOG | Runtime bytes | Source chars | |---|---|---|---|---|---| | CAND (AGE, 8cb006fa…) | 533.5806 | 199,567 | 0 | 21,507 | 44,616 | | LEAN (a6dfc3ba…) | 533.5484 | 199,454 | 0 | 21,368 | 43,563 | | LB4 (a243bb35…) | 533.3566 | 224,970 | 0 | 22,946 | 49,905 | | QT1 (c68887cf…) | 530.1345 | 209,227 | 0 | 20,605 | 42,990 | - Paired results: CAND−LEAN +0.0322 se 0.0084; CAND−LB4 +0.2240 se 0.0185; CAND−QT1 +3.4461 se 0.0452; LEAN−LB4 +0.1917 se 0.0169. - Worst seed CAND−LEAN: 10016524 at −0.708. - Every arm had 0 callback failures across about 5.58M afterSwap calls. - LB4's peak of 224,970 matches the brief's "peak 225k". - Gates P, Q, T and F were not rerun here. - **Source caveat:** e05-age-eng is flagged for 1 source that did not hold. The table's figures are this item's own engine run. ## 5. b38-stack: QLX5 + AGE stack contract (built, smoke only) - `ready = true` and `submission = false`. The item notes: "Requester must ask the user before any submission." - Exact rule: QLX5 unchanged, with: - the raw integer five-denominator search, offsets [0,+1,−1,+2,−2], dt≤6 - tell, filter, U1 and fee guard plus AGE. On non-arb callbacks, a qx hit or an ordinary binding bound sets r=c, syn=true and rt=t. Otherwise, if c≠r, the age-weighted pull with 7e17·age/(age+1) applies. - Slot layout: - slot 2: fb, fa, timestamp, cnt, rt (29 bits), kind, syn - slot 6: signed offset - Source sha256 c25a999646859d187f9a03655b4c7b3009a41b9cb20b4a7b56a19d612242ebc4; reference sha256 77cd3ebd…. - Compile: solc 0.8.24, viaIR, 200 runs, paris. **47,599 source characters and 22,525 deployed bytes**, both inside the limits. Runtime sha256 d39db7e9…. Validator valid. - TellMath is byte-identical to QLX5, and the U1 blob is identical (830868f9…). - **Gate P: pass.** Kit gatep.py ran unmodified gates.py and matched the expected 3 rows. - Smoke test: seeds 64000..64003, 2,000 callbacks each, against an independent integer-WAD Python reference. - Fee wads exactly equal (0.0 bps). - 0 arb, offset, rt or kind mismatches. - Peak pyrevm gas 175,103. - The item says floating-fee roundoff and a negative-axis interval bug were repaired before freeze, with no tuning. - **Not run:** Q, T (full 50 seeds), F (50×2,000), G (engine peak) and E. The item makes no claim to beat anything. - Source check: the item says all 20 URLs were re-fetched and found. e06-stack-build is not on the brief's flagged list. ## 6. b46-copy-a and b46-copy-b: QLX5 P/T/F certification - Contract: artifact 84a14d5e…, source sha256 e183e5bc3fb794b7067703b10a7da9920267aa5f4caa968e16ca101b02338f40. Unchanged in both copies. - Size: 47,230 characters and 22,440 runtime bytes (compile observation only, not gate G). - Both copies: **P pass, T pass, F pass, Q/G/E not run**, `certified_original = true`, no Solidity repair, and no earlier E figure inherited. - **Common diagnosis.** The earlier failure at seed 74200, callback 1, was the reference's fault, not the contract's. - The original QLX reference (artifact 6c818dc7…) used the full qm_k1e-5 tables, while the contract uses compressed U1/QPL1 tables. - On callback 0 the fees differ by 0.0522/0.0213 bps. That flips the next lean label from pos to neg and the arb/tested labels with it. - Both copies repaired the reference to decode the contract's own QPL1 blob and to use the raw loop `qlx.hit_mku` the contract implements, instead of the binade-safe `qlx.hit`. - **Consequence (copy-a):** > The Q figures of the QLX reference were measured over full qm tables; the contract and the repaired reference are a different fee policy. No Q/E number carries over. With full qm on 4 seeds, the labels all agree but 10,985 of 16,000 fee values are out of tolerance (worst 14.43 bps). This is the 0.111 table-compression cost in lever (2) of the brief showing up as a policy difference. - **copy-a figures:** - T: 549,802 callbacks, 0 mismatches in every field (arb, tested, verdict, m0, m1, lean label). 356,965 tested, 317,544 split hits, 118,104 offset moves. - F: worst 1.80e-10 bps on 100,000 callbacks; 9.39e-09 bps across all callbacks. - Peak pyrevm message gas 180,159, which is not engine gas. - **copy-b figures:** - Fixed full-qm input vectors: 549,733 callbacks, 0 mismatches, F worst 5.27e-08 bps. - Autonomous stream: 549,802 callbacks, 0 mismatches, F worst 1.80e-10 bps. - Raw vs binade-safe arithmetic, on synthetic primitive cases only: - copy-a: 191 of 6,000 differ. - copy-b: 493 of 50,000 differ. - Both: 0 differences on the 50 real seeds, where no candidate left the binade. ### Apparent disagreement on "autonomous" (it is a difference in definitions) - **copy-a**'s "autonomous" replay **fails**: 542,700 of 549,802 callbacks mismatch and the worst fee is 486 bps. Here the reference uses its *own* fees in force and is never given the contract's quotes. - The first divergence is a 284-wei paid-side fee difference that moves the tracked offset (−2 vs 0). - copy-a reads this as "not a contract defect": an exact-arithmetic tell cannot survive wei-level float/fixed-point gaps, and in the engine the contract's wad is the true fee. - **copy-b**'s "autonomous" stream **passes**. But copy-b defines it as fresh replica events with the contract's quote fed back, which is copy-a's *main* protocol. - So the results agree. The certification holds only with the contract's prior quotes fed back to the reference; a Python reference cannot shadow the contract bit-exactly on its own. ### Other limits - T and F ran on replica_e only, not on replica2 or the engine. - The canonical 1,099,505-row vector file was not regenerated. - The lookup-u1 harness (fd38823c…) had no full URL. Both copies wrote their own decoders, so their decoded table hash differs from LEAN's d5645b6d…; the QPL blob hash 830868f9… is the same. - **Source caveat:** both e07-qlx-cert copies are flagged for 1 source each that did not hold. The gate counts are their own measurements. --- ## Disagreements and open conflicts (summary) | Topic | Inputs | Status | |---|---|---| | Best carry width | b35-copy-a picks CARRY-1, b35-copy-b picks CARRY-2 | Different rule details. Both about −1.42 vs QLITE, so the conclusion agrees. | | Autonomous QLX5 replay | b46-copy-a fail, b46-copy-b pass | Different definitions (see §6), not a real conflict. | | Decoded U1 table file | b36 (7068c7e5…), b46 (own decoders), LEAN (d5645b6d…) | Same QPL blob 830868f9…; the JSON serialisations differ. | | Zero false split hits | Earlier claim vs b35 audits | Does not hold: rare retail mismatches up to 14.39 bps. | | AGE peak gas | b36: 197,103 (8 seeds); b37: 199,567 (512 seeds) | Larger sample, higher peak, as b36 predicted. Both under 245,000. | | Source verification | b35-copy-b says 13 quotes verified; brief flags 3 failed | Unresolved. The brief's re-check is the later one. | ## What is still missing toward the goal - **No contract has passed the full P→Q→T→F→G→E chain in this group:** - AGE: T, F, G and E done; P and Q missing. - QLX5: P, T and F done; Q, G and E missing. Its old Q/E figures are void. - QLX5+AGE stack: P and smoke only. - The biggest measured gains remain unclaimed: - the rival-tracking ceiling: oracle +0.105 over QLITE on the replica (b35); rival64 +0.145 per the brief - the 0.111 table-compression cost from the brief - Next step: run gate E (and G) for the b38 stack, paired against lb-4, LEAN/AGE and qt1 on new engine seeds. Do not reuse 10009056..10009063, 10011792..10012559 (including burnt seeds) or 10016072..10016583. - No submission has been made. The requester must ask the user before any submission (b38).