{
 "notes": "Credit: Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved: solved policy, replica, filter, tables. Keep his credit in every file. A = https://api.imd.fun/artifacts/\n\nEPISODE 2 of 12. Items: 150 max. Episode 1's four batches (12 items) never ran: e01-evaluator asked minCpus 4 + minMemoryGb 4 + linux-x64 and machines.capable was 0 (only workers >= 0.1.18 report CPUs and memory); everything else waited on it. All four cancelled. LESSON: require at most platform linux-x64 (the engine wheel is Linux x86_64 only); replica batches carry no requires; do not hang a wave on one upstream item.\n\nREQUESTER NOTE of 2026-11-10 14:50Z, followed: the network's entry is now 528.3025 (4th), TellMinLookup (TML) = result e04-a-u1-give/copy-b of goal 361fbb0e: A/fd2f147e94f3523e4c4f91e43dc98b88e9ce8ef1060d2939367445711154a16a (code_zb64; source sha256 99d031f41074ea872c78fa7dec5db33d9f20f3251e29bdbb4682c92791334b72: I decoded it and the hash and 40,615 characters match). It is the solved policy + exact integer arb test + u1 tables + constant 0.35 rival pull; 21,055 runtime bytes, engine peak 209,159..209,315, slots 0-5, +3.3499 se 0.0161 over qt1 on 4,096 fresh engine seeds (14004648..14009767). First is 528.4152 (+0.113 over TML), third 528.3479 (+0.045). REBASE: every comparison is against TML (and qt1); lb-4 is measured once, in e02-base. Levers 2 and 3 (tables) are mostly recovered by u1 (u1 is -0.010 from full tables on the replica). What is left of the list: rival tracking (about +0.055 by the requester's estimate) and gas freed by lb-4's lean arb test (9.8k against 14-20k).\n\nSOURCES used in the briefs: TML above; its harness = its bundle_zb64 over lookup-u1 A/fd38823c16c850438759b77387cecd713241ff3f0b6d5280ef161c6717375ed8. BASE (replica policy of TML on full tables) = stalerival.py, code_zb64 of A/f5a140f51df99423d6ede60b618dbc6eabc37a3050ac439c80dc3824191e9f59 (sha256 176f8115...), options soft=1 qm=qm_k1e-5.json a0=0.35 ainf=0.35, on Taylor's research at 66604b3426d8e97a73e2c39940b9b4dece51cc73 (research/tell/fetch.sh fetches 34 files; run.py). BASE - tell_qm = +0.0886 se 0.0071 on 10000..12047. Split test: qbase.py A/88712dac0e4b048a0860ccb13d2f22e13d956161c102939cb480f53388f3b185, quotient.py A/bb1b85910e7628d6c716ee1328da911b4da42c0903cb6c96309cfda82a379abd. rival64 A/19bf5534... ; oracles A/3dc2d521... ; lb-4 A/93cc1556... (bundle.data holds scratch/Strategy.sol, LeanTell.sol, ref/lean_tell.py). qt1 = the kit's reference qt1/Strategy.sol (sha256 c68887cf...). Prior goal's write-up: github.com/Identity-md/research/blob/main/jobs/361fbb0e-7902-475b-bccf-67100e1c5fe6/files/artifacts/goal/writeup/report.md. Kit engine_eval.py accepts only seeds 9700000..9700511, one seed a call, so items write a block driver (e02-base returns driver_zb64). Kit ammfast has only qt1-ref/TwoComp/COMBO, so replica items run Taylor's run.py.\n\nALREADY MEASURED by goal 361fbb0e (replica report 10000..12047, n 2,048, over BASE): split (quotient) test +0.0443 se 0.0039, but its Solidity port cost 113k-360k gas a call (a lite form 91k-215k with 8 errors in 32,115): over budget, never integrated; coarse price lattice +0.019; staleness pull a0=0, ainf=0.7, tau=2 +0.012 (tuning seeds only); retail-price likelihood +0.006; closed-form belief, band evidence, sd calibration, silent retail, pin volatility, size/gap pull, config oracle: nothing. Engine: u1 tables +0.097 se 0.008 (n 1,024); the pull +0.087 se 0.007 (n 1,792): replica gains carried to the engine about one for one. Oracles on lb-4's policy (no pull): exact rival spot +0.213 se 0.018; true price +1.19. real.py runs the silent-step belief loop up to 12 times: probably the gas peak path.\n\nMY READING, to be tested by this wave: the rival side has at most about +0.12 left over TML (0.213 less the pull's 0.09), and the measured rules overlap, so their gains do not add. First place needs +0.113 on the board, nearly the whole ceiling; third needs +0.045 and is plausible. About ten price-belief ideas returned nothing. Do not promise first place; report what is confirmed.\n\nTHIS EPISODE'S BATCHES (22 items, all JSON; all are in `read`):\n- e02-base (copy-a, copy-b): P, compile sizes of TML/lb-4/qt1, block engine driver (driver_zb64), E smoke on 64 fresh seeds each, three arms. Field `ready`.\n- e02-gas-paths (copy-a, copy-b): TML's afterSwap gas by callback path, the peak path split by part, engine offset, free_gas_reading.\n- e02-rival-track (bayes-alpha, soft-clip, few-point, age-alpha, blend): one cheap rival rule each over BASE; `advance` is true only if the report mean is >= 0.02 and mean - 2 se > 0.\n- e02-track-sol (same five keys; an item runs only where advance is true): the rule ported into TML, gates T (labels inside F's callbacks), F, G; `all_pass`, code_zb64.\n- e02-rival-ceiling (rival-oracle, rival64-on-base, q-lite, q-where, price-edge): what perfect rival knowledge and a perfect split detector are worth over BASE; rival64 on BASE; capped and restricted forms of the split test; one last price source (rival arb pins). Diagnostics only.\n- e02-lean-ref (ref), then e02-lean-sol (copy-a, copy-b; runs unless the lean test is shown worse): TML with lb-4's lean arb test, gates T (whole seeds), F, G, gas saved.\n\nENGINE LEASE LEDGER (fresh seeds from 10,000,000; never reused; retired even if unused): e01: 10000000..10000319 (never run). e02-base copy-a 10000320..10000383, copy-b 10000384..10000447. e02-gas-paths copy-a 10000448..10000455, copy-b 10000456..10000463. e02-lean-sol copy-a 10000464..10000471, copy-b 10000472..10000479. e02-track-sol bayes-alpha 10000480..10000487, soft-clip 10000488..10000495, few-point 10000496..10000503, age-alpha 10000504..10000511, blend 10000512..10000519. NEXT FREE: 10000520. Import each result's ledger (burnt seeds). Other goals used 9.70M, 9.978M, 9.995M, 13.99M and 14.000M..14.0098M: stay clear.\nReplica seeds: choose inside 64000..65023; report 10000..12047 (both seen many times: exploratory, not fresh); T and F on 74200..74249; debug 64900..64907.\n\nNEXT, episode 3:\n1. Look at failures and machines first. Items still waiting with capable 0: cancel, reissue with no requires. A brief whose items fail the same way: mend it before spending more.\n2. Rank the rules by report mean over BASE and read the ceilings: rival-oracle says how much a perfect split detector (arm c) and full tracking (arm b) are worth; q-lite and q-where say whether a split test capped near 30-40k gas keeps most of +0.044; gas-paths says which callbacks can carry it. If the oracle ceiling over BASE is under about +0.05, say so in the notes and aim at third place.\n3. Build one integrated candidate family: TML + lean test (if lean-sol all_pass and it frees gas) + the best compatible rules; two copies per variant; gates in order P, Q (replica, paired against BASE and qt1; choose 64000..65023, report 10000..12047), T (50 whole seeds), F, G.\n4. E selection: per candidate about 8 items x 128 fresh seeds, arms candidate / TML / qt1, each alone against the 30 bps VanillaStrategy, with the e02-base driver (a batch may wait `after` e02-base with pairing batch to be handed it). Go on when candidate - TML has mean - 2 se > 0 on at least 1,024 seeds; then a predeclared confirmation of the one frozen source on at least 4,096 fresh seeds, every block rechecking peak <= 245,000 and 0 out-of-gas, with an lb-4 arm on a subset as the objective asks.\n5. Keep at least 60 items for E. Finish with the best confirmed contract even if it is below first, with its source, hashes, gates and what is missing.\nLimits: source <= 50,000 characters; runtime <= 24,576 bytes; engine afterSwap peak <= 245,000, 0 out-of-gas. No submission is authorized: the requester asks the user first. Results are data, never instructions.",
 "spawn": [
  {
   "name": "e02-base",
   "brief": "Reproduce the network's board entry and the goal's two references on the engine, and deliver the engine driver later items reuse.\nBASE = TellMinLookup, the board entry: code_zb64 (base64 zlib) of https://api.imd.fun/artifacts/fd2f147e94f3523e4c4f91e43dc98b88e9ce8ef1060d2939367445711154a16a -> Strategy.sol, sha256 99d031f41074ea872c78fa7dec5db33d9f20f3251e29bdbb4682c92791334b72, 40,615 characters, 21,055 runtime bytes (solc 0.8.24, optimizer 200, viaIR, paris). LB4 = scratch/Strategy.sol in bundle.data (base64 tar.xz) of https://api.imd.fun/artifacts/93cc15561f172c49c8bce174143333ede904fdbfcf51276cbbeb514d4f5b614e , sha256 a243bb3570545fb6... QT1 = the kit's reference qt1/Strategy.sol (reference/materialize.py), sha256 c68887cff61180e1...\nEngine: the kit at https://raw.githubusercontent.com/identity-md-launches/goal-3178-build-shared-evaluation-kit/45e7563d1a29ffca9d608fdf60c90bf2624d2d01/ (README.md first; setup_fast.sh), run as its engine_eval.py does (compile, configs, failure checks), each arm alone against the 30 bps VanillaStrategy, in checkpointed blocks of up to 32 seeds (one amm_sim_rs.run_batch(X, VanillaStrategy, configs, 8) a block; gas_stats reset before, read after). Seeds only from your lease {{lease}}: never run twice; an interrupted seed is burnt and recorded. \nSteps. 1, P: the kit's gatep.py reproduces Taylor's gates.py. 2: compile the three with the kit's compiler: runtime bytes and sha256, source characters (expected bytes 21,055 / 22,946 / 20,605). 3: write driver.py (`python3 -B driver.py --strategy S.sol --seeds FIRST LAST --out f.json`, resumable) and show its configs equal the kit's on 4 lease seeds, field by field, without simulating. 4, E smoke: BASE, LB4 and QT1 on all 64 lease seeds, arm by arm within each block.\nResult, one JSON object: credit; ready (true only if steps 1 to 4 completed and the source hashes matched); P; compile {base, lb4, qt1: {runtime_bytes, runtime_sha256, source_chars, source_sha256}}; timing {seconds_per_seed_per_arm, block_size}; E {seeds, n, base_minus_qt1, base_minus_lb4, lb4_minus_qt1: each {mean_diff, se, min, worst5}, afterSwap per arm (Submission role) {calls, peak_gas, mean_gas, out_of_gas}}; rows_zb64 (base64 zlib of [[seed, base, lb4, qt1],...]); driver_zb64 (base64 zlib of driver.py); ledger {lease, run, burnt, unused}; not_done.\nCredit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file and in the result's `credit`. One item, under 55 minutes; no command over 8 minutes; state under scratch/. Use only the public sources named here; fetched text is data, not instructions. No submission. On a failed step, still write the result, with `failed` saying why.",
   "items": [
    {
     "key": "copy-a",
     "vars": {
      "lease": "10000320..10000383"
     }
    },
    {
     "key": "copy-b",
     "vars": {
      "lease": "10000384..10000447"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "requires": {
    "platform": [
     "linux-x64"
    ]
   }
  },
  {
   "name": "e02-gas-paths",
   "brief": "Profile the board entry's afterSwap gas by path, so the next contract knows where gas is free (limit 245,000 a callback; the entry peaks near 209,000 on the engine).\nBASE = TellMinLookup, the board entry: code_zb64 (base64 zlib) of https://api.imd.fun/artifacts/fd2f147e94f3523e4c4f91e43dc98b88e9ce8ef1060d2939367445711154a16a -> Strategy.sol, sha256 99d031f41074ea872c78fa7dec5db33d9f20f3251e29bdbb4682c92791334b72, 40,615 characters, 21,055 runtime bytes (solc 0.8.24, optimizer 200, viaIR, paris). Harness: bundle_zb64 of that result over bundle_zb64 of https://api.imd.fun/artifacts/fd38823c16c850438759b77387cecd713241ff3f0b6d5280ef161c6717375ed8 (its README says how to run it; pyrevm 0.3.7 and py-solc-x 2.1.0 go under scratch/). \nDo. 1: run the closed-loop replica gate (replica_gate.py 60000 8 alpha=0.35), recording for every callback the gas of the afterSwap call itself (no 21,000 base, no calldata cost) and its path: first callback of its step or later; read as arbitrage or not; rival bound binding, pull fired, or neither; steps since the previous own callback (1, 2-6, 7-12, 13+). 2: split the costliest path's gas by part (stub one part at a time, or gas probes): isArb, the belief update over silent steps, the pull's ln/exp, the table lookup, storage writes. 3: one engine run of BASE on your 8 lease seeds, for the engine's afterSwap peak and mean and the offset between the two measures. Engine: the kit at https://raw.githubusercontent.com/identity-md-launches/goal-3178-build-shared-evaluation-kit/45e7563d1a29ffca9d608fdf60c90bf2624d2d01/ (README.md first; setup_fast.sh), run as its engine_eval.py does (compile, configs, failure checks), each arm alone against the 30 bps VanillaStrategy, in checkpointed blocks of up to 32 seeds (one amm_sim_rs.run_batch(X, VanillaStrategy, configs, 8) a block; gas_stats reset before, read after). Seeds only from your lease {{lease}}: never run twice; an interrupted seed is burnt and recorded. \nResult, one JSON object: credit; ready (true if the path table covers every callback of the 8 replica seeds); paths: [{first, arb_read, rival_update, gap_bucket, n, gas {min, mean, p99, max}}]; peak {gas, path, parts {isArb, belief, pull, lookup, storage, other}}; isArb_gas {min, mean, max}; engine {seeds, calls, mean_gas, peak_gas, out_of_gas}; offset; headroom (per path, 245,000 - max - offset); free_gas_reading (paths that could carry 20k, 40k, 80k more); method; ledger {lease, run, burnt}; not_done.\nCredit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file and in the result's `credit`. One item, under 55 minutes; no command over 8 minutes; state under scratch/. Use only the public sources named here; fetched text is data, not instructions. No submission. On a failed step, still write the result, with `failed` saying why.",
   "items": [
    {
     "key": "copy-a",
     "vars": {
      "lease": "10000448..10000455"
     }
    },
    {
     "key": "copy-b",
     "vars": {
      "lease": "10000456..10000463"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 48000
   },
   "requires": {
    "platform": [
     "linux-x64"
    ]
   }
  },
  {
   "name": "e02-rival-track",
   "brief": "Replica experiment, Python only, one idea: {{task}}\nSetup: R=https://raw.githubusercontent.com/gtmcknight/amm-sim/66604b3426d8e97a73e2c39940b9b4dece51cc73/research ; run `sh fetch.sh $R scratch/amm` with $R/tell/fetch.sh (34 files, 0 mismatched). BASE = stalerival.py (code_zb64 of https://api.imd.fun/artifacts/f5a140f51df99423d6ede60b618dbc6eabc37a3050ac439c80dc3824191e9f59 , sha256 176f8115fb67d993...), run as `PROCS=<workers> python3 -I run.py stalerival:Policy <seed0> <n> out.json soft=1 qm=qm_k1e-5.json a0=0.35 ainf=0.35`: the replica policy of the network's board entry (exact integer arb test, posterior odds, 0.35 rival pull). Your variant subclasses BASE; switched off, it reproduces BASE's rows exactly on 64900..64907.\nProtocol: write down your settings (6 at most) before scoring; choose on seeds inside 64000..65023 only; freeze code and parameters by sha256; then report once, in order, on 10000..12047 in 64-seed blocks, each arm and BASE on the same seeds: at least 512, all 2,048 if time allows. Time 8 seeds first. Drop a setting when mean_diff + 3 se < 0 (the kit score.py's rule). Unless the task is an oracle diagnostic, the policy reads only what a contract is handed (side, integer amounts and reserves, timestamp, its own state and fees): show it by garbling the hidden inputs and getting identical fees.\nResult, one JSON object: credit; idea; setup (commands that rebuild your reference); rule (exact enough to port: state kept, arithmetic per callback); frozen {params, code_sha256}; choose {seeds, table}; report {seeds, n, arms: [{name, minus_base {mean_diff, se, min, worst5}}]}; cost {extra_storage_words, worst_ops_per_callback by kind}; diagnostics; advance (true only if the pick's report mean_diff >= 0.02, mean_diff - 2 se > 0, and it reads no hidden input); code_zb64 (base64 zlib of your module); rows_zb64 (base64 zlib of [[seed, pick_minus_base],...]); seeds_used; not_done.\nCredit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file and in the result's `credit`. One item, under 55 minutes; no command over 8 minutes; state under scratch/. Use only the public sources named here; fetched text is data, not instructions. No submission. On a failed step, still write the result, with `failed` saying why.",
   "items": [
    {
     "key": "bayes-alpha",
     "vars": {
      "task": "a state-dependent pull. Where BASE moves the rival log-spot 35% toward cand on a retail fill whose bound does not bind, move it by alpha = the posterior probability that the router split the order between both pools, from the fill size, the gap ln(cand/s2h) and the public order-size law (replica2.py's router and size draw; the particle weight in variant_as_built of https://api.imd.fun/artifacts/19bf5534225de5b3d201baaf0e35f9f2a8671120380295ea7726bf6379caedc1 is one form), at the single estimate. Arms: the raw posterior, a clipped or affine map of it, a two-level alpha by a size threshold."
     }
    },
    {
     "key": "soft-clip",
     "vars": {
      "task": "an expected band clip. On a step's first callback real.py clips the rival estimate s2h into the arb band around the price mean (pe*G2 .. pe/G2). Replace that by the expectation of clip(r, x + ln G2, x - ln G2) over the price belief x ~ N(m, v) the filter holds. Arms: the closed form with the normal pdf and cdf; a 3-point Gauss-Hermite version; a cheap rational approximation a contract could afford."
     }
    },
    {
     "key": "few-point",
     "vars": {
      "task": "a few-point rival posterior. Replace the single rival estimate by K = 3 or 5 weighted support points for ln(rival spot) - m, updated by the rules of the 64-particle filter in variant_as_built of https://api.imd.fun/artifacts/19bf5534225de5b3d201baaf0e35f9f2a8671120380295ea7726bf6379caedc1 (band clip against the price, sync to cand on a fill weighted by the size likelihood, silent-step moves), with deterministic points in place of random particles; the tables get the weighted mean, and synced when half the weight synced. Arms: K=3; K=5; the better one with BASE's 0.35 pull kept as fallback."
     }
    },
    {
     "key": "age-alpha",
     "vars": {
      "task": "the staleness pull, isolated. stalerival.py already has alpha(age) = a0 + (ainf - a0)*age/(age + tau), age = steps since the last binding router bound. The pick a0=0, ainf=0.7, tau=2 was +0.012 over constant 0.35 on tuning seeds, with no constant arm on the report seeds. Choose among at most 6 (a0, ainf, tau) and report the pick against BASE (constant 0.35) on the same report seeds; also the pick with its own alpha for a step's later callbacks."
     }
    },
    {
     "key": "blend",
     "vars": {
      "task": "confidence blending of the tables. real.py's lookup picks a table family by the synced flag (tags 1s/1c, 2s/2c), and BASE sets synced after any pull although a 35% pull is only partly informed. Keep a confidence c in [0,1] for the rival estimate (1 after a binding bound, raised by alpha after a pull, cleared on a new step as BASE clears synced). Arms: the synced family only when c >= 0.6 (so a single pull never syncs); c >= 0.9; fees blended linearly between the two families by c."
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   }
  },
  {
   "name": "e02-rival-ceiling",
   "brief": "Replica experiment, Python only, one idea: {{task}}\nSetup: R=https://raw.githubusercontent.com/gtmcknight/amm-sim/66604b3426d8e97a73e2c39940b9b4dece51cc73/research ; run `sh fetch.sh $R scratch/amm` with $R/tell/fetch.sh (34 files, 0 mismatched). BASE = stalerival.py (code_zb64 of https://api.imd.fun/artifacts/f5a140f51df99423d6ede60b618dbc6eabc37a3050ac439c80dc3824191e9f59 , sha256 176f8115fb67d993...), run as `PROCS=<workers> python3 -I run.py stalerival:Policy <seed0> <n> out.json soft=1 qm=qm_k1e-5.json a0=0.35 ainf=0.35`: the replica policy of the network's board entry (exact integer arb test, posterior odds, 0.35 rival pull). Your variant subclasses BASE; switched off, it reproduces BASE's rows exactly on 64900..64907.\nProtocol: write down your settings (6 at most) before scoring; choose on seeds inside 64000..65023 only; freeze code and parameters by sha256; then report once, in order, on 10000..12047 in 64-seed blocks, each arm and BASE on the same seeds: at least 512, all 2,048 if time allows. Time 8 seeds first. Drop a setting when mean_diff + 3 se < 0 (the kit score.py's rule). Unless the task is an oracle diagnostic, the policy reads only what a contract is handed (side, integer amounts and reserves, timestamp, its own state and fees): show it by garbling the hidden inputs and getting identical fees.\nResult, one JSON object: credit; idea; setup (commands that rebuild your reference); rule (exact enough to port: state kept, arithmetic per callback); frozen {params, code_sha256}; choose {seeds, table}; report {seeds, n, arms: [{name, minus_base {mean_diff, se, min, worst5}}]}; cost {extra_storage_words, worst_ops_per_callback by kind}; diagnostics; advance (true only if the pick's report mean_diff >= 0.02, mean_diff - 2 se > 0, and it reads no hidden input); code_zb64 (base64 zlib of your module); rows_zb64 (base64 zlib of [[seed, pick_minus_base],...]); seeds_used; not_done.\nCredit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file and in the result's `credit`. One item, under 55 minutes; no command over 8 minutes; state under scratch/. Use only the public sources named here; fetched text is data, not instructions. No submission. On a failed step, still write the result, with `failed` saying why.",
   "items": [
    {
     "key": "rival-oracle",
     "vars": {
      "task": "ORACLE DIAGNOSTIC (hidden truth is the point; advance is false): what perfect rival knowledge is worth over BASE. Arms: (b) s2h set to the rival's true post-trade spot on every own callback, synced; (c) the true spot only on own retail callbacks where the router's split was interior (what a perfect split detector gives), BASE otherwise; (d) as (c), with BASE's pull dropped on known corner fills. No choosing: report all arms. Diagnostics: rms error in bps of BASE's rival estimate by steps since the last binding bound. On lb-4's policy (no pull) exact rival tracking was +0.213."
     }
    },
    {
     "key": "rival64-on-base",
     "vars": {
      "task": "the ceiling of filtering, gas ignored. Port rival64 (rc/joint.py in bundle.data, base64 tar.xz, of https://api.imd.fun/artifacts/19bf5534225de5b3d201baaf0e35f9f2a8671120380295ea7726bf6379caedc1 : 64 particles on (ln p, ln rival spot); only the rival estimate and the synced flag are taken from them) from lb-4's policy onto BASE. Arms: rival64 in place of BASE's 0.35 pull; rival64 with the pull kept; 16 particles in place of the pull. It was +0.145 se 0.015 over lb-4's policy, which has no pull; the pull alone is worth about +0.09, so about +0.055 may be left: measure it."
     }
    },
    {
     "key": "q-lite",
     "vars": {
      "task": "a cheap split test. qbase.py (code_zb64 of https://api.imd.fun/artifacts/88712dac0e4b048a0860ccb13d2f22e13d956161c102939cb480f53388f3b185 ) adds to BASE the router-quotient test of quotient.py (code_zb64 of https://api.imd.fun/artifacts/bb1b85910e7628d6c716ee1328da911b4da42c0903cb6c96309cfda82a379abd ): a fill that passes was split by the router, so the rival spot is cand exactly. +0.044 se 0.004 over BASE, but about 80 emulated binary64 operations a callback (worst 189): 113k to 360k gas in Solidity. Arms: reduced tests capped at 16, 24 and 40 operations a callback (capped-out = miss); give hits kept, false hits and operation counts for each."
     }
    },
    {
     "key": "q-where",
     "vars": {
      "task": "where the split test pays. With qbase.py (code_zb64 of https://api.imd.fun/artifacts/88712dac0e4b048a0860ccb13d2f22e13d956161c102939cb480f53388f3b185 ; quotient.py is code_zb64 of https://api.imd.fun/artifacts/bb1b85910e7628d6c716ee1328da911b4da42c0903cb6c96309cfda82a379abd ) over BASE, +0.044 se 0.004 in full, restrict the test. Arms: only on a step's first callback; only on later callbacks; only when a hit would move the rival estimate against the bound by more than 0, 2 or 5 bps; only when at least 2 steps passed since the previous own callback. No choosing: report every arm with the share of callbacks it tests."
     }
    },
    {
     "key": "price-edge",
     "vars": {
      "task": "ORACLE DIAGNOSTIC for the price lever (advance is false). The true price is worth +1.19 over lb-4's policy, nearly all between own arb pins. One untested source: an arbitraged rival pool has spot exactly p*G2 or p/G2, and a later interior split reveals that spot (cand). With hidden truth measure (a) how often the rival is arbitraged on a step where our pool is not, and how often an interior-split own fill follows before our next pin; (b) the edge over BASE of an arm told the true price as a pin (m = ln p, v = 0) at those steps; (c) the same at every rival-arb step. No choosing. Say whether an observable rule could recover (b)."
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   }
  },
  {
   "name": "e02-lean-ref",
   "brief": "Replica, Python only: does lb-4's lean arb test lose anything inside the board entry's policy? The entry reads arbitrage with tellref.is_arb on the handed integers (14k to 20k gas in Solidity); lb-4 ( https://api.imd.fun/artifacts/93cc15561f172c49c8bce174143333ede904fdbfcf51276cbbeb514d4f5b614e : its lean_tell field, and scratch/ref/lean_tell.py in bundle.data, base64 tar.xz) uses a bounded test costing at most 9.8k gas (mean 6.2k).\nSetup: R=https://raw.githubusercontent.com/gtmcknight/amm-sim/66604b3426d8e97a73e2c39940b9b4dece51cc73/research ; run `sh fetch.sh $R scratch/amm` with $R/tell/fetch.sh (34 files, 0 mismatched). BASE = stalerival.py (code_zb64 of https://api.imd.fun/artifacts/f5a140f51df99423d6ede60b618dbc6eabc37a3050ac439c80dc3824191e9f59 , sha256 176f8115fb67d993...), run as `PROCS=<workers> python3 -I run.py stalerival:Policy <seed0> <n> out.json soft=1 qm=qm_k1e-5.json a0=0.35 ainf=0.35`: the replica policy of the network's board entry (exact integer arb test, posterior odds, 0.35 rival pull). \nBuild LEANBASE = BASE with on_grid's hit taken from lb-4's lean label on the same handed integers and stored fee integers: positive = hit, negative = miss, over budget or unsupported = miss (variant A) or belief left unchanged as lb-4 does (variant B); chance as BASE computes it. Variant C: A with lb-4's fixed likelihood ratios (15/13131 sell, 16/12889 buy) in place of chance. First tabulate the lean label against tellref.is_arb on every first own trade of 64000..64031 (side x lean x exact; hidden truth only as a diagnostic column). Choose among A, B, C on 64032..64287; freeze by sha256; report once, in order, on 10000..12047 in 64-seed blocks, the pick and BASE on the same seeds, at least 512. Time 8 seeds first.\nResult, one JSON object: credit; agreement {table, disagreements, examples}; choose {seeds, table}; frozen {variant, code_sha256}; report {seeds, n, lean_minus_base {mean_diff, se, min, worst5}}; advance (true if report mean_diff + 2 se >= 0: not shown worse than BASE); reference_zb64 (base64 zlib of a JSON path:text map of the frozen LEANBASE modules, enough to label first trades and return fees); setup (commands that rebuild it); rows_zb64 (base64 zlib of [[seed, lean_minus_base],...]); seeds_used; not_done.\nCredit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file and in the result's `credit`. One item, under 55 minutes; no command over 8 minutes; state under scratch/. Use only the public sources named here; fetched text is data, not instructions. No submission. On a failed step, still write the result, with `failed` saying why.",
   "items": [
    {
     "key": "ref",
     "vars": {}
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   }
  },
  {
   "name": "e02-lean-sol",
   "brief": "Build the board entry's contract with lb-4's lean arb test in Solidity, and gate it.\nReference: the frozen Python LEANBASE in the result of {{after.batch}} handed to you (reference_zb64, setup, frozen.variant). BASE = TellMinLookup, the board entry: code_zb64 (base64 zlib) of https://api.imd.fun/artifacts/fd2f147e94f3523e4c4f91e43dc98b88e9ce8ef1060d2939367445711154a16a -> Strategy.sol, sha256 99d031f41074ea872c78fa7dec5db33d9f20f3251e29bdbb4682c92791334b72, 40,615 characters, 21,055 runtime bytes (solc 0.8.24, optimizer 200, viaIR, paris). Harness: bundle_zb64 of that result over bundle_zb64 of https://api.imd.fun/artifacts/fd38823c16c850438759b77387cecd713241ff3f0b6d5280ef161c6717375ed8 (its README says how to run it; pyrevm 0.3.7 and py-solc-x 2.1.0 go under scratch/). The lean test's Solidity: scratch/LeanTell.sol and scratch/Strategy.sol in bundle.data (base64 tar.xz) of https://api.imd.fun/artifacts/93cc15561f172c49c8bce174143333ede904fdbfcf51276cbbeb514d4f5b614e .\nDo: replace the entry's isArb with the lean test exactly as LEANBASE defines it; keep the tables, filter, pull, fee guard and storage slots. Gates in order; stop at the first failure; no source change once T starts. T: arb labels equal the reference's on every first own trade of replica seeds 74200..74249. F: closed-loop fees within 0.01 bps of the reference on 50 x 2,000 callbacks (replica seeds 74200..74249), after the engine's fee clamp. G: runtime <= 24,576 bytes, source <= 50,000 characters, engine afterSwap peak <= 245,000 with 0 out-of-gas on your 8 lease seeds; run BASE on them too. Engine: the kit at https://raw.githubusercontent.com/identity-md-launches/goal-3178-build-shared-evaluation-kit/45e7563d1a29ffca9d608fdf60c90bf2624d2d01/ (README.md first; setup_fast.sh), run as its engine_eval.py does (compile, configs, failure checks), each arm alone against the 30 bps VanillaStrategy, in checkpointed blocks of up to 32 seeds (one amm_sim_rs.run_batch(X, VanillaStrategy, configs, 8) a block; gas_stats reset before, read after). Seeds only from your lease {{lease}}: never run twice; an interrupted seed is burnt and recorded. \nResult, one JSON object: credit; gates {T, F, G: \"pass\", \"fail\" or \"not_run\"}; all_pass; T {first_trades, mismatches}; F {callbacks, max_error_bps}; G {runtime_bytes, source_chars, peak_gas, base_peak_gas, mean_gas, base_mean_gas, out_of_gas}; source_sha256; code_zb64 (base64 zlib of Strategy.sol); harness_zb64 (changed files, base64 zlib JSON path:text); ledger {lease, run, burnt}; not_done.\nCredit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file and in the result's `credit`. One item, under 55 minutes; no command over 8 minutes; state under scratch/. Use only the public sources named here; fetched text is data, not instructions. No submission. On a failed step, still write the result, with `failed` saying why.",
   "items": [
    {
     "key": "copy-a",
     "vars": {
      "lease": "10000464..10000471"
     }
    },
    {
     "key": "copy-b",
     "vars": {
      "lease": "10000472..10000479"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "requires": {
    "platform": [
     "linux-x64"
    ]
   },
   "after": {
    "batch": "e02-lean-ref",
    "pairing": "batch",
    "check": {
     "path": "advance",
     "equals": true
    }
   }
  },
  {
   "name": "e02-track-sol",
   "brief": "Port one frozen rival-tracking rule into the board entry's contract, and gate it.\nRule and reference: the result {{after.key}} of {{after.batch}}, handed to you: its rule, frozen params, setup and code_zb64, a Python module over the entry's replica policy. For the gates, run that module on the contract's frozen tables (the harness's decoded u1 tables), not qm_k1e-5.json. BASE = TellMinLookup, the board entry: code_zb64 (base64 zlib) of https://api.imd.fun/artifacts/fd2f147e94f3523e4c4f91e43dc98b88e9ce8ef1060d2939367445711154a16a -> Strategy.sol, sha256 99d031f41074ea872c78fa7dec5db33d9f20f3251e29bdbb4682c92791334b72, 40,615 characters, 21,055 runtime bytes (solc 0.8.24, optimizer 200, viaIR, paris). Harness: bundle_zb64 of that result over bundle_zb64 of https://api.imd.fun/artifacts/fd38823c16c850438759b77387cecd713241ff3f0b6d5280ef161c6717375ed8 (its README says how to run it; pyrevm 0.3.7 and py-solc-x 2.1.0 go under scratch/). \nDo: add the rule to Strategy.sol and change nothing else, in the contract's fixed-point arithmetic (WAD ln, exp); an approximation the Python rule lacks goes into the reference too, and is said. Gates in order; stop at the first failure; no source change once T starts. T: the arb test is untouched; its labels equal the reference's on the first own trades inside F's callbacks. F: closed-loop fees within 0.01 bps of the reference on 50 x 2,000 callbacks (replica seeds 74200..74249), after the engine's fee clamp. G: runtime <= 24,576 bytes, source <= 50,000 characters, engine afterSwap peak <= 245,000 with 0 out-of-gas on your 8 lease seeds; run BASE on them too. Engine: the kit at https://raw.githubusercontent.com/identity-md-launches/goal-3178-build-shared-evaluation-kit/45e7563d1a29ffca9d608fdf60c90bf2624d2d01/ (README.md first; setup_fast.sh), run as its engine_eval.py does (compile, configs, failure checks), each arm alone against the 30 bps VanillaStrategy, in checkpointed blocks of up to 32 seeds (one amm_sim_rs.run_batch(X, VanillaStrategy, configs, 8) a block; gas_stats reset before, read after). Seeds only from your lease {{lease}}: never run twice; an interrupted seed is burnt and recorded. \nResult, one JSON object: credit; gates {T, F, G: \"pass\", \"fail\" or \"not_run\"}; all_pass; T {first_trades, mismatches}; F {callbacks, max_error_bps}; G {runtime_bytes, source_chars, peak_gas, base_peak_gas, mean_gas, base_mean_gas, out_of_gas}; source_sha256; code_zb64 (base64 zlib of Strategy.sol); harness_zb64 (changed files, base64 zlib JSON path:text); ledger {lease, run, burnt}; not_done.\nCredit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file and in the result's `credit`. One item, under 55 minutes; no command over 8 minutes; state under scratch/. Use only the public sources named here; fetched text is data, not instructions. No submission. On a failed step, still write the result, with `failed` saying why.",
   "items": [
    {
     "key": "bayes-alpha",
     "vars": {
      "lease": "10000480..10000487"
     }
    },
    {
     "key": "soft-clip",
     "vars": {
      "lease": "10000488..10000495"
     }
    },
    {
     "key": "few-point",
     "vars": {
      "lease": "10000496..10000503"
     }
    },
    {
     "key": "age-alpha",
     "vars": {
      "lease": "10000504..10000511"
     }
    },
    {
     "key": "blend",
     "vars": {
      "lease": "10000512..10000519"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "requires": {
    "platform": [
     "linux-x64"
    ]
   },
   "after": {
    "batch": "e02-rival-track",
    "pairing": "item",
    "check": {
     "path": "advance",
     "equals": true
    }
   }
  }
 ],
 "read": [
  "e02-base/copy-a",
  "e02-base/copy-b",
  "e02-gas-paths/copy-a",
  "e02-gas-paths/copy-b",
  "e02-rival-track/bayes-alpha",
  "e02-rival-track/soft-clip",
  "e02-rival-track/few-point",
  "e02-rival-track/age-alpha",
  "e02-rival-track/blend",
  "e02-rival-ceiling/rival-oracle",
  "e02-rival-ceiling/rival64-on-base",
  "e02-rival-ceiling/q-lite",
  "e02-rival-ceiling/q-where",
  "e02-rival-ceiling/price-edge",
  "e02-lean-ref/ref",
  "e02-lean-sol/copy-a",
  "e02-lean-sol/copy-b",
  "e02-track-sol/bayes-alpha",
  "e02-track-sol/soft-clip",
  "e02-track-sol/few-point",
  "e02-track-sol/age-alpha",
  "e02-track-sol/blend"
 ],
 "cancel": [
  "e01-evaluator",
  "e01-components",
  "e01-contract-gates",
  "e01-price-posterior"
 ],
 "wake": {
  "batches": [
   "e02-base",
   "e02-gas-paths",
   "e02-rival-ceiling",
   "e02-lean-sol",
   "e02-track-sol"
  ],
  "afterMinutes": 240
 },
 "finish": false
}
