{
 "notes": "EPISODE 5. Woken by requester notes 4 and 5. At entry 42 of 400 items used; 20 round-2 items and e2-ha-round1/joint-a running, r3-fa-union waiting. Episode 4's r3-fa-confirm, r3-fa-continue, r3-fa-continue-x and r3-fa-joint were REFUSED (\"the brief asks for a command's verbatim output\"), so FA was never confirmed or continued; only r3-fa-union exists. My guess at the cause: the sentence asking that an emitter reproduce FA's code \"byte for byte\". RULE for briefs: never write verbatim, byte for byte, word for word, output, print, paste, exactly; ask for named result fields. Check every brief by script for those words and for length (<= 3,000 filled).\n\nREAD AND CHECKED: 9 results; each file's sha256 equals its id, and https://api.imdnotdead.fun/artifacts/<id> answered 200 with the same bytes for IB, KB, FA, th-a, IA, KIT, HA, T, replica, RS2 port. This machine's guard stops unpacking embedded sources: code and port hashes are the items' own reports. Gains are over HA; [..] = replica holdout 40000000..40008191, n 8,192.\n- e2-ha-round1/inputs-b = IB, the BEST: id afd5183e9ff3235334e041c00b0cd19079599a2c6464db95f8c1586712105557, code sha256 301941829a44bb60977bb28181a5e4bfa6544f3696763f987054789b2611d686. 19-8-2: HA's 13 inputs + raw_amountY, step_trade_count, prev_bid_fee, prev_ask_fee, steps_since_arb_like_print, router_implied_vanilla_spot (its own formulas, `new_input_formulas`, NOT IA's: KB cannot run IB as it is). CMA pop 16, sigma 0.1 -> 0.022, 512 markets/generation, 910 generations = 7.45M market evaluations in 21 min at 6,000 markets/s (22 processes). [+0.652 se 0.008; +1.769 over T]; real 7132768..7133279 +0.592 se 0.030 over HA, +1.749 se 0.040 over T; afterSwap peak 234,849, 0 OOG; gates passed; rising. Fields: code_zb64, port_zb64 (weights are TH entries, all 0 = T; needs the Replica file), params (frozen).\n- r2-confirm: IA CONFIRMED on 2,048 fresh seeds. confirm-a 7200000..7201023: +0.3938 se 0.0193; confirm-b 7204096..7205119: +0.3250 se 0.0179. Pooled IA minus HA +0.3594 se 0.0132 (recomputed from the per-seed differences); IA over T +1.4834 se 0.0212; HA over T +1.1240 se 0.0186 (the objective's 1.257 was one high block). 0 OOG in 21.9M afterSwap calls, peaks 235,490 and 237,631. IA is over +0.3: a file the requester can submit. Complete code = `code_zb64` of IA's artifact (id and sha256 in episode 3's notes: df0ddfdf..., 956566e9...). The same fees on the diet = `IAD.sol_zb64` of KB, sha256 7f6998c8df1b738dbd9715053edae7c9c8fdad71bf7228d67b6f1b7573c7126b: afterSwap peak 132,084, init 176,917.\n- r2-kit/kit-b = KB, id 48cd6a10f39fc22a79c5f12398474bd65282803d59314819acd586f187015808: IAD.sol (per-seed edges equal to IA's on 0..99 and 7277824..7278335), a general port and harness (IA's 19 inputs by id, any width, gating, emit_solidity), gates passed. Its general port ran 328 markets/s, IA's own 635: train on a candidate's own port.\n- leg1/th-a, id 2b7fb044b72df00a4f67bf706340c8570bbc1bf74838ed0c2ef51133a23acf28: HA's 130 weights and T's 41 constants together (each HA value x 2^x), 265 generations in 70 min at 326 markets/s: [+0.421 se 0.008], real +0.370 se 0.031 (retail -0.58, arb +0.95), peak 231,358, still rising. Weights alone gave +0.10 to +0.19 for that compute: constants add about +0.2, on the arb side. Its first try, large steps on the constants, failed.\n- No candidate from: e2-ha-round1/gas-b (a second diet of HA, untrained), continue-b and r2-continue/continue-e (125 and 48 markets/s, no search), r2-joint/joint-b (blocked; note 4 settles it).\n- FA = leg1/feat-a (id d3bff2aa..., code sha256 aa2c4a56..., both whole in episode 4's notes): [+0.564], real +0.569 se 0.029 after 2.1M evaluations; per evaluation its inputs did better than IB's. Not yet confirmed.\n- The plane's `sources` check flags nearly every accepted result, no reason given: say so in the write-up.\n\nWHERE THE GOAL STANDS. Best [+0.65] over HA; the target +3.1 will not be reached at this rate. Training compute is the lever (IB), so copies go wide to catch fast machines; inputs and constants each add.\n\nDECIDED: 44 items in 7 batches, all from frozen params (note 4).\n- r4-confirm (note 5a): ib-a 7500000..7501023, ib-b 7510000..7511023 (IB); fa-a 7520000..7521023, fa-b 7530000..7531023 (FA). Arms X, HA, T through KIT. Fields x_vs_ha {.., sum, sumsq}, diffs_x_minus_ha, gas.\n- r4-ib-continue (c1..c5, handed as they are) and r4-ib-wide (w01..w20, merged in groups of 5; canary w01..w05), note 5b: CMA from IB's params on IB's port, at least 45 min, sigma under sigma0 x 0.5^(minutes/30). Settings (pop / markets a generation / sigma0): A 16/512/0.05, B 16/1024/0.05, C 32/512/0.05, D 16/512/0.03, E 32/1024/0.08. c1..c5 = A B C D and 16/512/0.08; w01..w20 = A B C D A A B C D A A B C D A A B E E A. Under 200 markets/s: IB against HA on real seeds instead. Each merge gives `rows` (key, result_sha256, speed, generations, holdout over_IB, real vs_IB, gas, valid), `weights` (each item's flat vector) and `best` (params, code_zb64, code_sha256 of its best by holdout); an item's result is at /artifacts/<result_sha256>.\n- r4-ib-union (u1..u4), note 5c: UN = IB + FA's T_bid_fee, T_ask_fee, (spot-pHat)/pHat, retail_flow_rate (23-8-2, new columns 0), gas probe, at least 35 min; returns its port. (r3-fa-union: 23 inputs from FA's side, IA's formulas.)\n- r4-ib-joint: j1..j3 IB's weights and T's constants together (step 0.03 in x), j4 constants only, j5 = note 4's rerun of joint-b: IA's weights and constants from IA's frozen params. Each reports over its base.\n- r4-fa-continue (f1..f5): note 3's continuation of FA with 512-1,024 markets a generation.\n- r4-ib-kit (kit-c), mine: IBD = IB on IAD's diet, and KB extended to IB's input definitions.\nSEEDS. Real: training item i has 7540000 + 4000*i (first 512; union probe at +2000), i in the order c1..c5, w01..w20, u1..u4, j1..j5, f1..f5, kit-c (last 7696000). Train: 700000000 + 10000000*i (last 1080000000). Used before (episode 4's notes): real up to 7399999, train up to 613999999. NEXT: real from 7800000, train from 1200000000. Monitor and holdout seeds never change.\n\nNEXT EPISODE\n1. If woken early by a note, do not respawn what runs. If r4-ib-wide paused on its canary, read `failures`: resume it, or mend the brief and rerun with itemsFrom both. If a spawn was refused again, reword and respawn it first.\n2. Pool each confirmation from sum and sumsq (episode 3's rule). Over 2 se promotes; at +0.3 or more over HA it is a file for the requester (IB: `code_zb64` of its id; FA: `code` of its id). Gas on all seeds: 0 OOG, peak <= 245,000.\n3. One scale, holdout over HA: IB-based results + 0.652, FA-based + 0.564, IA-based + 0.365. Drop any failed gate, OOG, peak over 245,000 or replica-real gap over 0.15. Fetch the best item's URL; check it parses and holds its fields.\n4. Round 5 from the best by URL, 60-80 items (314 left for three rounds): (a) two confirm items for the round-4 winner; (b) SOUP, mine, 3 items: average the frozen weights of the valid IB continuations (same start, small sigma: the mean keeps shared drift, cancels noise), all and the better half by holdout; monitor, freeze, holdout, real; (c) wide continuation of the winner with merges, on the settings that won; (d) lines that each helped, joined: UN's inputs + moved constants + best weights, new weights 0; (e) if kit-c delivered, the winner on the diet as the file to submit.\n5. Reads asked (30): r4-confirm's 4, r4-ib-wide merge-01..04, c1..c5, j1..j5, u1..u4, f1..f5, kit-c, r3-fa-union fu-a, fu-b. Accepted items of small batches arrive unasked (th-a, kit-b did). Unread, askable: r2-continue continue-a..d, r2-continue-x continue-f..h, r2-gated gated-a..c, r2-diet-wide wide-a..c, r2-joint joint-a, const-a, r2-inputs2's five, e2-ha-round1 joint-a, r3-fa-union fu-c.\nBUDGET: 86 of 400 items after this. Episodes 6-9 are rounds, 10 the write-up (as episode 4's notes say). Wake: the 7 new batches, r3-fa-union, r2-inputs2, r2-joint settled, or 480 minutes.",
 "spawn": [
  {
   "name": "r4-confirm",
   "brief": "Item {{key}}: measure fee policy {{x}} against HA and T on fresh real-engine seeds. No search; change no code and no weight.\nGoal rules apply (SETUP, REAL ENGINE; HA is named there). Check every sha256.\nFILES. T = `code` of https://api.imdnotdead.fun/artifacts/6ac5e013b7b1fb4c5e7bdcdfec0aba28b16824e18ccf39500f258533879faffe, sha256 ebd9de9bf6af6e55d5e308fd15dbb88edec11fd684891d02a30aec185acd19b3. Replica = `replica_source` of https://api.imdnotdead.fun/artifacts/e8a7a2af9039c24b8bb2d3b5fa1c9113606cbf5a480ac07d02ca26750f1752ea, sha256 1e4c44b4bffbdeed65872ee15d46dbde209bf5aa11014329d13d100507b4040c. RS2 port = `port_source` of https://api.imdnotdead.fun/artifacts/d845a4b94eab87f23956fd1939c0135d955df212d1f3037f2a761c178cef7a0e, sha256 9eac3553357528b06eeae3ed8d18283d83401e1968145ceba16be356a147e271 (same strat_init/strat_after API as the replica's STRATEGY block; its `differential_test_source` compares port and EVM fees; `th_convention` says which TH entries are real constants).\n{{x}} = {{xdef}}.\nKIT = https://api.imdnotdead.fun/artifacts/0d8194e9f6e0017dc4e515cdb04c048efc292935bb1d18e3336091fe81154786: unpack it per its `decode_instructions` and run its unit tests. Its `harness.py real` runs T, HA and a candidate file on a chunk of seeds, each alone against Vanilla; its `aggregate` pairs the arms and splits retail and arb edge.\nWORK. Seeds {{start}}..{{end}} (1,024) in 16 chunks of 64, ascending, each seed once per arm, the same configs for every arm. Time the first chunk. If the block does not fit your time, run {{x}} and HA on as many whole chunks as fit, then T on those chunks if time is left, and say how far you got. Keep time to write the result.\nRESULT, one JSON object: `item`; `hashes` (each file's sha256 as you checked it); `seeds` {start, end, n, chunks_done}; `x_vs_ha`, `x_vs_t`, `ha_vs_t`, each {n, mean_diff, se, sum, sumsq, wins, worst5 as [seed, difference], retail_delta, arb_delta}, with se = sample standard deviation of the paired differences / sqrt(n); `diffs_x_minus_ha`: the per-seed differences in seed order, 4 decimals; `mean_edge` per arm {edge, retail, arb}; `gas` per arm from amm_sim_rs.gas_stats(), Submission role: afterSwap calls and peak, afterInitialize peak, OOG, reverts, other failures; `valid`: 0 OOG and afterSwap peak <= 245,000 for {{x}}; `notes`: what you could not do. Measured numbers only; leave out what you did not run.",
   "items": [
    {
     "key": "ib-a",
     "vars": {
      "key": "ib-a",
      "x": "IB",
      "xdef": "`code_zb64` (zlib+base64) of https://api.imdnotdead.fun/artifacts/afd5183e9ff3235334e041c00b0cd19079599a2c6464db95f8c1586712105557, code sha256 301941829a44bb60977bb28181a5e4bfa6544f3696763f987054789b2611d686",
      "start": "7500000",
      "end": "7501023"
     }
    },
    {
     "key": "ib-b",
     "vars": {
      "key": "ib-b",
      "x": "IB",
      "xdef": "`code_zb64` (zlib+base64) of https://api.imdnotdead.fun/artifacts/afd5183e9ff3235334e041c00b0cd19079599a2c6464db95f8c1586712105557, code sha256 301941829a44bb60977bb28181a5e4bfa6544f3696763f987054789b2611d686",
      "start": "7510000",
      "end": "7511023"
     }
    },
    {
     "key": "fa-a",
     "vars": {
      "key": "fa-a",
      "x": "FA",
      "xdef": "`code` of https://api.imdnotdead.fun/artifacts/d3bff2aae5d832c494baf42f463dd674ab63c084734a435ea6d204d0b6176e28, sha256 aa2c4a5637a4060088263d71ab8b109339b101bb25d64a45e9c7de83710d8728",
      "start": "7520000",
      "end": "7521023"
     }
    },
    {
     "key": "fa-b",
     "vars": {
      "key": "fa-b",
      "x": "FA",
      "xdef": "`code` of https://api.imdnotdead.fun/artifacts/d3bff2aae5d832c494baf42f463dd674ab63c084734a435ea6d204d0b6176e28, sha256 aa2c4a5637a4060088263d71ab8b109339b101bb25d64a45e9c7de83710d8728",
      "start": "7530000",
      "end": "7531023"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "merge": {
    "groupSize": 25,
    "brief": "One row per item: its key, holdout and real gains with se, afterSwap peak, OOG and valid; then what the items could not do. Add no number the items did not measure."
   }
  },
  {
   "name": "r4-ib-continue",
   "brief": "Item {{key}}: long training of fee policy IB's 19-8-2 head on the replica from its frozen weights, then one real-engine check.\nGoal rules apply (SETUP, GATES, REAL ENGINE; HA is named there). Check every sha256. Use IB's own port: rebuild none from source.\nFILES. T = `code` of https://api.imdnotdead.fun/artifacts/6ac5e013b7b1fb4c5e7bdcdfec0aba28b16824e18ccf39500f258533879faffe, sha256 ebd9de9bf6af6e55d5e308fd15dbb88edec11fd684891d02a30aec185acd19b3. Replica = `replica_source` of https://api.imdnotdead.fun/artifacts/e8a7a2af9039c24b8bb2d3b5fa1c9113606cbf5a480ac07d02ca26750f1752ea, sha256 1e4c44b4bffbdeed65872ee15d46dbde209bf5aa11014329d13d100507b4040c. RS2 port = `port_source` of https://api.imdnotdead.fun/artifacts/d845a4b94eab87f23956fd1939c0135d955df212d1f3037f2a761c178cef7a0e, sha256 9eac3553357528b06eeae3ed8d18283d83401e1968145ceba16be356a147e271 (same strat_init/strat_after API as the replica's STRATEGY block; its `differential_test_source` compares port and EVM fees; `th_convention` says which TH entries are real constants).\nIB = `code_zb64` (zlib+base64) of https://api.imdnotdead.fun/artifacts/afd5183e9ff3235334e041c00b0cd19079599a2c6464db95f8c1586712105557, code sha256 301941829a44bb60977bb28181a5e4bfa6544f3696763f987054789b2611d686; `port_zb64` is its float port (its `port_sha256`; the 178 head weights are TH entries, all 0 = T: `port_notes`); `params` holds its frozen weights and scaling. Start from `params`.\nGATES. A: IB's port with `params` against IB's code. B: replica IB minus T on seeds 7132768..7133279 within 0.15 of +1.749. C: your frozen code against the port with your frozen weights.\nSPEED first: replica markets/s on 512 markets, compile excluded. Under 200: no search; run IB and HA on real seeds from {{real}}, 32 a chunk, as many as fit, and return that paired result.\nSEARCH, at least 45 minutes: CMA-ES over the 178 weights, ES seed {{es}}, population {{pop}}, {{block}} fresh replica markets a generation, shared by the population (seeds from {{train}} up, none reused), fitness = mean edge minus T's. sigma0 = {{sigma}} x the rms of each weight block; keep sigma under sigma0 x 0.5^(minutes/30). Every 5 minutes score the CMA mean on monitor seeds 30000000..30002047; freeze the best scored point.\nFREEZE: the weights go into IB's code as 1e6 fixed-point literals; nothing else changes. Holdout seeds 40000000..40008191, once: gain over T, HA and IB. The 512 real seeds from {{real}}: candidate, IB and HA, 64 a chunk.\nRESULT, one JSON object: `item`; `speed`; `search` {minutes, generations, settings}; `curve` [minutes, monitor gain over T, sigma]; `gates`; `holdout` {n, over_T, over_HA, over_IB, se of each}; `real` {seeds, vs_IB, vs_HA: {n, mean_diff, se, worst5}, retail_delta, arb_delta}; `gas` {afterSwap peak, afterInitialize peak, OOG}; `valid`; `code_zb64`, `code_sha256`; `params` in IB's layout; `notes`. Measured numbers only.",
   "items": [
    {
     "key": "c1",
     "vars": {
      "real": "7540000",
      "train": "700000000",
      "key": "c1",
      "pop": "16",
      "block": "512",
      "sigma": "0.05",
      "es": "401"
     }
    },
    {
     "key": "c2",
     "vars": {
      "real": "7544000",
      "train": "710000000",
      "key": "c2",
      "pop": "16",
      "block": "1024",
      "sigma": "0.05",
      "es": "402"
     }
    },
    {
     "key": "c3",
     "vars": {
      "real": "7548000",
      "train": "720000000",
      "key": "c3",
      "pop": "32",
      "block": "512",
      "sigma": "0.05",
      "es": "403"
     }
    },
    {
     "key": "c4",
     "vars": {
      "real": "7552000",
      "train": "730000000",
      "key": "c4",
      "pop": "16",
      "block": "512",
      "sigma": "0.03",
      "es": "404"
     }
    },
    {
     "key": "c5",
     "vars": {
      "real": "7556000",
      "train": "740000000",
      "key": "c5",
      "pop": "16",
      "block": "512",
      "sigma": "0.08",
      "es": "405"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "merge": {
    "groupSize": 25,
    "brief": "One row per item: its key, holdout and real gains with se, afterSwap peak, OOG and valid; then what the items could not do. Add no number the items did not measure."
   }
  },
  {
   "name": "r4-ib-wide",
   "brief": "Item {{key}}: long training of fee policy IB's 19-8-2 head on the replica from its frozen weights, then one real-engine check.\nGoal rules apply (SETUP, GATES, REAL ENGINE; HA is named there). Check every sha256. Use IB's own port: rebuild none from source.\nFILES. T = `code` of https://api.imdnotdead.fun/artifacts/6ac5e013b7b1fb4c5e7bdcdfec0aba28b16824e18ccf39500f258533879faffe, sha256 ebd9de9bf6af6e55d5e308fd15dbb88edec11fd684891d02a30aec185acd19b3. Replica = `replica_source` of https://api.imdnotdead.fun/artifacts/e8a7a2af9039c24b8bb2d3b5fa1c9113606cbf5a480ac07d02ca26750f1752ea, sha256 1e4c44b4bffbdeed65872ee15d46dbde209bf5aa11014329d13d100507b4040c. RS2 port = `port_source` of https://api.imdnotdead.fun/artifacts/d845a4b94eab87f23956fd1939c0135d955df212d1f3037f2a761c178cef7a0e, sha256 9eac3553357528b06eeae3ed8d18283d83401e1968145ceba16be356a147e271 (same strat_init/strat_after API as the replica's STRATEGY block; its `differential_test_source` compares port and EVM fees; `th_convention` says which TH entries are real constants).\nIB = `code_zb64` (zlib+base64) of https://api.imdnotdead.fun/artifacts/afd5183e9ff3235334e041c00b0cd19079599a2c6464db95f8c1586712105557, code sha256 301941829a44bb60977bb28181a5e4bfa6544f3696763f987054789b2611d686; `port_zb64` is its float port (its `port_sha256`; the 178 head weights are TH entries, all 0 = T: `port_notes`); `params` holds its frozen weights and scaling. Start from `params`.\nGATES. A: IB's port with `params` against IB's code. B: replica IB minus T on seeds 7132768..7133279 within 0.15 of +1.749. C: your frozen code against the port with your frozen weights.\nSPEED first: replica markets/s on 512 markets, compile excluded. Under 200: no search; run IB and HA on real seeds from {{real}}, 32 a chunk, as many as fit, and return that paired result.\nSEARCH, at least 45 minutes: CMA-ES over the 178 weights, ES seed {{es}}, population {{pop}}, {{block}} fresh replica markets a generation, shared by the population (seeds from {{train}} up, none reused), fitness = mean edge minus T's. sigma0 = {{sigma}} x the rms of each weight block; keep sigma under sigma0 x 0.5^(minutes/30). Every 5 minutes score the CMA mean on monitor seeds 30000000..30002047; freeze the best scored point.\nFREEZE: the weights go into IB's code as 1e6 fixed-point literals; nothing else changes. Holdout seeds 40000000..40008191, once: gain over T, HA and IB. The 512 real seeds from {{real}}: candidate, IB and HA, 64 a chunk.\nRESULT, one JSON object: `item`; `speed`; `search` {minutes, generations, settings}; `curve` [minutes, monitor gain over T, sigma]; `gates`; `holdout` {n, over_T, over_HA, over_IB, se of each}; `real` {seeds, vs_IB, vs_HA: {n, mean_diff, se, worst5}, retail_delta, arb_delta}; `gas` {afterSwap peak, afterInitialize peak, OOG}; `valid`; `code_zb64`, `code_sha256`; `params` in IB's layout; `notes`. Measured numbers only.",
   "items": [
    {
     "key": "w01",
     "vars": {
      "real": "7560000",
      "train": "750000000",
      "key": "w01",
      "pop": "16",
      "block": "512",
      "sigma": "0.05",
      "es": "421"
     }
    },
    {
     "key": "w02",
     "vars": {
      "real": "7564000",
      "train": "760000000",
      "key": "w02",
      "pop": "16",
      "block": "1024",
      "sigma": "0.05",
      "es": "422"
     }
    },
    {
     "key": "w03",
     "vars": {
      "real": "7568000",
      "train": "770000000",
      "key": "w03",
      "pop": "32",
      "block": "512",
      "sigma": "0.05",
      "es": "423"
     }
    },
    {
     "key": "w04",
     "vars": {
      "real": "7572000",
      "train": "780000000",
      "key": "w04",
      "pop": "16",
      "block": "512",
      "sigma": "0.03",
      "es": "424"
     }
    },
    {
     "key": "w05",
     "vars": {
      "real": "7576000",
      "train": "790000000",
      "key": "w05",
      "pop": "16",
      "block": "512",
      "sigma": "0.05",
      "es": "425"
     }
    },
    {
     "key": "w06",
     "vars": {
      "real": "7580000",
      "train": "800000000",
      "key": "w06",
      "pop": "16",
      "block": "512",
      "sigma": "0.05",
      "es": "426"
     }
    },
    {
     "key": "w07",
     "vars": {
      "real": "7584000",
      "train": "810000000",
      "key": "w07",
      "pop": "16",
      "block": "1024",
      "sigma": "0.05",
      "es": "427"
     }
    },
    {
     "key": "w08",
     "vars": {
      "real": "7588000",
      "train": "820000000",
      "key": "w08",
      "pop": "32",
      "block": "512",
      "sigma": "0.05",
      "es": "428"
     }
    },
    {
     "key": "w09",
     "vars": {
      "real": "7592000",
      "train": "830000000",
      "key": "w09",
      "pop": "16",
      "block": "512",
      "sigma": "0.03",
      "es": "429"
     }
    },
    {
     "key": "w10",
     "vars": {
      "real": "7596000",
      "train": "840000000",
      "key": "w10",
      "pop": "16",
      "block": "512",
      "sigma": "0.05",
      "es": "430"
     }
    },
    {
     "key": "w11",
     "vars": {
      "real": "7600000",
      "train": "850000000",
      "key": "w11",
      "pop": "16",
      "block": "512",
      "sigma": "0.05",
      "es": "431"
     }
    },
    {
     "key": "w12",
     "vars": {
      "real": "7604000",
      "train": "860000000",
      "key": "w12",
      "pop": "16",
      "block": "1024",
      "sigma": "0.05",
      "es": "432"
     }
    },
    {
     "key": "w13",
     "vars": {
      "real": "7608000",
      "train": "870000000",
      "key": "w13",
      "pop": "32",
      "block": "512",
      "sigma": "0.05",
      "es": "433"
     }
    },
    {
     "key": "w14",
     "vars": {
      "real": "7612000",
      "train": "880000000",
      "key": "w14",
      "pop": "16",
      "block": "512",
      "sigma": "0.03",
      "es": "434"
     }
    },
    {
     "key": "w15",
     "vars": {
      "real": "7616000",
      "train": "890000000",
      "key": "w15",
      "pop": "16",
      "block": "512",
      "sigma": "0.05",
      "es": "435"
     }
    },
    {
     "key": "w16",
     "vars": {
      "real": "7620000",
      "train": "900000000",
      "key": "w16",
      "pop": "16",
      "block": "512",
      "sigma": "0.05",
      "es": "436"
     }
    },
    {
     "key": "w17",
     "vars": {
      "real": "7624000",
      "train": "910000000",
      "key": "w17",
      "pop": "16",
      "block": "1024",
      "sigma": "0.05",
      "es": "437"
     }
    },
    {
     "key": "w18",
     "vars": {
      "real": "7628000",
      "train": "920000000",
      "key": "w18",
      "pop": "32",
      "block": "1024",
      "sigma": "0.08",
      "es": "438"
     }
    },
    {
     "key": "w19",
     "vars": {
      "real": "7632000",
      "train": "930000000",
      "key": "w19",
      "pop": "32",
      "block": "1024",
      "sigma": "0.08",
      "es": "439"
     }
    },
    {
     "key": "w20",
     "vars": {
      "real": "7636000",
      "train": "940000000",
      "key": "w20",
      "pop": "16",
      "block": "512",
      "sigma": "0.05",
      "es": "440"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "merge": {
    "groupSize": 5,
    "brief": "Merge the group's results into one JSON object. `rows`: one per item with `key`, `result_sha256` (the SHA-256 of that item's result file, as your inputs name it), markets_per_s, search_minutes, generations, population, markets a generation, holdout over_IB and its se, holdout over_HA, real vs_IB mean_diff and se, afterSwap peak, OOG, gates passed (A, B, C), valid, and `searched` (false for an item that ran no search). `weights`: under each valid searched item's key, its frozen weights as one flat list (W1 row-major, b1, W2 bid row then ask row, b2). `best`: the valid item with the highest holdout gain over IB: its key, `params`, `code_zb64` and `code_sha256`, copied from its result. `notes`: items that failed a gate, ran no search or disagree with themselves. Add no number the items did not measure."
   }
  },
  {
   "name": "r4-ib-union",
   "brief": "Item {{key}}: give fee policy IB four more inputs, train it on the replica, measure it on the real engine.\nGoal rules apply (SETUP, GATES, REAL ENGINE; HA is named there). Check every sha256.\nFILES. Replica = `replica_source` of https://api.imdnotdead.fun/artifacts/e8a7a2af9039c24b8bb2d3b5fa1c9113606cbf5a480ac07d02ca26750f1752ea, sha256 1e4c44b4bffbdeed65872ee15d46dbde209bf5aa11014329d13d100507b4040c. RS2 port = `port_source` of https://api.imdnotdead.fun/artifacts/d845a4b94eab87f23956fd1939c0135d955df212d1f3037f2a761c178cef7a0e, sha256 9eac3553357528b06eeae3ed8d18283d83401e1968145ceba16be356a147e271 (same strat_init/strat_after API as the replica's STRATEGY block; its `differential_test_source` compares port and EVM fees; `th_convention` says which TH entries are real constants).\nIB = `code_zb64` (zlib+base64) of https://api.imdnotdead.fun/artifacts/afd5183e9ff3235334e041c00b0cd19079599a2c6464db95f8c1586712105557, code sha256 301941829a44bb60977bb28181a5e4bfa6544f3696763f987054789b2611d686; `port_zb64` is its float port (its `port_sha256`; the 178 head weights are TH entries, all 0 = T: `port_notes`); `params` holds its frozen weights and scaling.\nFA = https://api.imdnotdead.fun/artifacts/d3bff2aae5d832c494baf42f463dd674ab63c084734a435ea6d204d0b6176e28: its `code`, `port_zb64` and `params` show the four inputs to add.\nBUILD UN, a 23-8-2 head: IB's 19 inputs, then FA's T_bid_fee, T_ask_fee (T's fees after its clamps, before the head), (spot - pHat)/pHat and retail_flow_rate with FA's scaling, in IB's port and code; no new storage slot or afterInitialize write. New W1 columns start at 0 (UN = IB). Before training, a gas probe: UN with every new weight nonzero on the 16 real seeds from {{probe}}; if afterSwap peaks over 243,000, drop the costliest new input and say which.\nGATES. A: UN's port and UN's code, new columns 0, against IB's code. B: replica IB minus T on seeds 7132768..7133279 within 0.15 of +1.749. C: frozen UN code against frozen UN port.\nSEARCH, at least 35 minutes: CMA-ES over the 210 weights, ES seed {{es}}, population {{pop}}, {{block}} fresh replica markets a generation, shared by the population (seeds from {{train}} up, none reused), fitness = mean edge minus T's. sigma0 = {{sigma}} x the rms of each weight block; keep sigma under sigma0 x 0.5^(minutes/30). Every 5 minutes score the CMA mean on monitor seeds 30000000..30002047; freeze the best scored point.\nHoldout seeds 40000000..40008191, once: gain over T, HA and IB. The 512 real seeds from {{real}}: candidate, IB and HA, 64 a chunk.\nRESULT, one JSON object: `item`; `speed`; `search` {minutes, generations, settings}; `curve` [minutes, monitor gain over T, sigma]; `gates`; `holdout` {n, over_T, over_HA, over_IB, se of each}; `real` {seeds, vs_IB, vs_HA: {n, mean_diff, se, worst5}, retail_delta, arb_delta}; `gas` {afterSwap peak, afterInitialize peak, OOG}; `valid`; `code_zb64`, `code_sha256`; `port_zb64`, `port_sha256`; `params`; `input_formulas`; `notes`. Measured numbers only.",
   "items": [
    {
     "key": "u1",
     "vars": {
      "real": "7640000",
      "train": "950000000",
      "key": "u1",
      "pop": "16",
      "block": "512",
      "sigma": "0.05",
      "es": "461",
      "probe": "7642000"
     }
    },
    {
     "key": "u2",
     "vars": {
      "real": "7644000",
      "train": "960000000",
      "key": "u2",
      "pop": "16",
      "block": "512",
      "sigma": "0.05",
      "es": "462",
      "probe": "7646000"
     }
    },
    {
     "key": "u3",
     "vars": {
      "real": "7648000",
      "train": "970000000",
      "key": "u3",
      "pop": "16",
      "block": "512",
      "sigma": "0.08",
      "es": "463",
      "probe": "7650000"
     }
    },
    {
     "key": "u4",
     "vars": {
      "real": "7652000",
      "train": "980000000",
      "key": "u4",
      "pop": "16",
      "block": "1024",
      "sigma": "0.05",
      "es": "464",
      "probe": "7654000"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "merge": {
    "groupSize": 25,
    "brief": "One row per item: its key, holdout and real gains with se, afterSwap peak, OOG and valid; then what the items could not do. Add no number the items did not measure."
   }
  },
  {
   "name": "r4-ib-joint",
   "brief": "Item {{key}}: search {{mode}} for fee policy {{base}} on the replica, then measure the result on the real engine.\nGoal rules apply (SETUP, GATES, REAL ENGINE; HA is named there). Check every sha256. Use {{base}}'s own port: rebuild none from source.\nFILES. Replica = `replica_source` of https://api.imdnotdead.fun/artifacts/e8a7a2af9039c24b8bb2d3b5fa1c9113606cbf5a480ac07d02ca26750f1752ea, sha256 1e4c44b4bffbdeed65872ee15d46dbde209bf5aa11014329d13d100507b4040c. RS2 port = `port_source` of https://api.imdnotdead.fun/artifacts/d845a4b94eab87f23956fd1939c0135d955df212d1f3037f2a761c178cef7a0e, sha256 9eac3553357528b06eeae3ed8d18283d83401e1968145ceba16be356a147e271 (same strat_init/strat_after API as the replica's STRATEGY block; its `differential_test_source` compares port and EVM fees; `th_convention` says which TH entries are real constants).\n{{base}} = `code_zb64` (zlib+base64) of https://api.imdnotdead.fun/artifacts/{{id}}, code sha256 {{sha}}; `port_zb64` is its float port (its `port_sha256`; T's constants and the head weights are TH entries); start from `params`, its frozen weights, never from a `restart` vector.\nCONSTANTS: the TH entries `th_convention` marks as real constants, and the anchor's count cap and two coefficients. Search each as its start value x 2^x, x from 0, held in [-1, 1]; a decay d through 1-d; integers stay integers. Step in x 0.03: an earlier item found larger steps on constants fail.\nGATES. A: {{base}}'s port with `params` against its code. B: replica {{base}} minus T on seeds {{gb}}. C: your frozen code against the port with your frozen values.\nMeasure replica markets/s first (512 markets, compile excluded).\nSEARCH, at least 40 minutes: CMA-ES over {{dims}}, ES seed {{es}}, population {{pop}}, {{block}} fresh replica markets a generation, shared by the population (seeds from {{train}} up, none reused), fitness = mean edge minus T's. sigma0 = {{sigma}} x the rms of each weight block (constants: the step above); keep sigma under sigma0 x 0.5^(minutes/30). Every 5 minutes score the CMA mean on monitor seeds 30000000..30002047; freeze the best scored point.\nFREEZE: weights go into the code as 1e6 fixed-point literals, constants as WAD literals; nothing else changes. Holdout seeds 40000000..40008191, once: gain over T, HA and {{base}}. The 512 real seeds from {{real}}: candidate, {{base}} and HA, 64 a chunk.\nRESULT, one JSON object: `item`; `speed`; `search` {minutes, generations, settings}; `curve` [minutes, monitor gain over T, sigma]; `gates`; `holdout` {n, over_T, over_HA, over_base, se of each}; `real` {seeds, vs_base, vs_HA: {n, mean_diff, se, worst5}, retail_delta, arb_delta}; `gas` {afterSwap peak, afterInitialize peak, OOG}; `valid`; `code_zb64`, `code_sha256`; `params` with `constants` {name: [start, frozen]}; `notes`. Measured numbers only.",
   "items": [
    {
     "key": "j1",
     "vars": {
      "real": "7656000",
      "train": "990000000",
      "base": "IB",
      "id": "afd5183e9ff3235334e041c00b0cd19079599a2c6464db95f8c1586712105557",
      "sha": "301941829a44bb60977bb28181a5e4bfa6544f3696763f987054789b2611d686",
      "gb": "7132768..7133279 within 0.15 of +1.749",
      "key": "j1",
      "mode": "the head's weights and T's constants together",
      "dims": "the 178 weights and the constants together",
      "pop": "16",
      "block": "512",
      "sigma": "0.05",
      "es": "471"
     }
    },
    {
     "key": "j2",
     "vars": {
      "real": "7660000",
      "train": "1000000000",
      "base": "IB",
      "id": "afd5183e9ff3235334e041c00b0cd19079599a2c6464db95f8c1586712105557",
      "sha": "301941829a44bb60977bb28181a5e4bfa6544f3696763f987054789b2611d686",
      "gb": "7132768..7133279 within 0.15 of +1.749",
      "key": "j2",
      "mode": "the head's weights and T's constants together",
      "dims": "the 178 weights and the constants together",
      "pop": "32",
      "block": "512",
      "sigma": "0.05",
      "es": "472"
     }
    },
    {
     "key": "j3",
     "vars": {
      "real": "7664000",
      "train": "1010000000",
      "base": "IB",
      "id": "afd5183e9ff3235334e041c00b0cd19079599a2c6464db95f8c1586712105557",
      "sha": "301941829a44bb60977bb28181a5e4bfa6544f3696763f987054789b2611d686",
      "gb": "7132768..7133279 within 0.15 of +1.749",
      "key": "j3",
      "mode": "the head's weights and T's constants together",
      "dims": "the 178 weights and the constants together",
      "pop": "16",
      "block": "512",
      "sigma": "0.03",
      "es": "473"
     }
    },
    {
     "key": "j4",
     "vars": {
      "real": "7668000",
      "train": "1020000000",
      "base": "IB",
      "id": "afd5183e9ff3235334e041c00b0cd19079599a2c6464db95f8c1586712105557",
      "sha": "301941829a44bb60977bb28181a5e4bfa6544f3696763f987054789b2611d686",
      "gb": "7132768..7133279 within 0.15 of +1.749",
      "key": "j4",
      "mode": "T's constants only, the head's weights fixed",
      "dims": "the constants only",
      "pop": "16",
      "block": "512",
      "sigma": "0.05",
      "es": "474"
     }
    },
    {
     "key": "j5",
     "vars": {
      "real": "7672000",
      "train": "1030000000",
      "base": "IA",
      "id": "df0ddfdf122c88641513dd179980fce475f42a912a184f812d213f27db7c14df",
      "sha": "956566e95f46dc1ed5980fae5e550de7b9da10f9b3ad8eed62f265682cfcecf2",
      "gb": "7116384..7116895 within 0.15 of +1.513",
      "key": "j5",
      "mode": "the head's weights and T's constants together",
      "dims": "the 178 weights and the constants together",
      "pop": "16",
      "block": "512",
      "sigma": "0.05",
      "es": "475"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "merge": {
    "groupSize": 25,
    "brief": "One row per item: its key, holdout and real gains with se, afterSwap peak, OOG and valid; then what the items could not do. Add no number the items did not measure."
   }
  },
  {
   "name": "r4-fa-continue",
   "brief": "Item {{key}}: long training of fee policy FA's 19-8-2 head on the replica from its frozen weights, then one real-engine check.\nGoal rules apply (SETUP, GATES, REAL ENGINE; HA is named there). Check every sha256. Use FA's own port: rebuild none from source.\nFILES. T = `code` of https://api.imdnotdead.fun/artifacts/6ac5e013b7b1fb4c5e7bdcdfec0aba28b16824e18ccf39500f258533879faffe, sha256 ebd9de9bf6af6e55d5e308fd15dbb88edec11fd684891d02a30aec185acd19b3. Replica = `replica_source` of https://api.imdnotdead.fun/artifacts/e8a7a2af9039c24b8bb2d3b5fa1c9113606cbf5a480ac07d02ca26750f1752ea, sha256 1e4c44b4bffbdeed65872ee15d46dbde209bf5aa11014329d13d100507b4040c. RS2 port = `port_source` of https://api.imdnotdead.fun/artifacts/d845a4b94eab87f23956fd1939c0135d955df212d1f3037f2a761c178cef7a0e, sha256 9eac3553357528b06eeae3ed8d18283d83401e1968145ceba16be356a147e271 (same strat_init/strat_after API as the replica's STRATEGY block; its `differential_test_source` compares port and EVM fees; `th_convention` says which TH entries are real constants).\nFA = `code` of https://api.imdnotdead.fun/artifacts/d3bff2aae5d832c494baf42f463dd674ab63c084734a435ea6d204d0b6176e28, sha256 aa2c4a5637a4060088263d71ab8b109339b101bb25d64a45e9c7de83710d8728; `port_zb64` (its `port_sha256`) is one file with its float port and the replica (run_many mode 0 = T); `params.float` holds its frozen weights. Start from `params.float`.\nGATES. A: FA's port with its frozen weights against FA's code. B: replica FA minus T on seeds 7004000..7004511 within 0.15 of +1.650. C: your frozen code against the port with your frozen weights.\nSPEED first: replica markets/s on 512 markets, compile excluded. Under 200: no search; run FA and HA on real seeds from {{real}}, 32 a chunk, as many as fit, and return that paired result.\nSEARCH, at least 45 minutes: CMA-ES over the 178 weights, ES seed {{es}}, population {{pop}}, {{block}} fresh replica markets a generation, shared by the population (seeds from {{train}} up, none reused), fitness = mean edge minus T's. sigma0 = {{sigma}} x the rms of each weight block; keep sigma under sigma0 x 0.5^(minutes/30). Every 5 minutes score the CMA mean on monitor seeds 30000000..30002047; freeze the best scored point.\nFREEZE: the weights go into FA's code as 1e6 fixed-point literals; nothing else changes. Holdout seeds 40000000..40008191, once: gain over T, HA and FA. The 512 real seeds from {{real}}: candidate, FA and HA, 64 a chunk.\nRESULT, one JSON object: `item`; `speed`; `search` {minutes, generations, settings}; `curve` [minutes, monitor gain over T, sigma]; `gates`; `holdout` {n, over_T, over_HA, over_FA, se of each}; `real` {seeds, vs_FA, vs_HA: {n, mean_diff, se, worst5}, retail_delta, arb_delta}; `gas` {afterSwap peak, afterInitialize peak, OOG}; `valid`; `code_zb64`, `code_sha256`; `params` in FA's layout; `notes`. Measured numbers only.",
   "items": [
    {
     "key": "f1",
     "vars": {
      "real": "7676000",
      "train": "1040000000",
      "key": "f1",
      "pop": "16",
      "block": "512",
      "sigma": "0.05",
      "es": "481"
     }
    },
    {
     "key": "f2",
     "vars": {
      "real": "7680000",
      "train": "1050000000",
      "key": "f2",
      "pop": "16",
      "block": "512",
      "sigma": "0.05",
      "es": "482"
     }
    },
    {
     "key": "f3",
     "vars": {
      "real": "7684000",
      "train": "1060000000",
      "key": "f3",
      "pop": "16",
      "block": "1024",
      "sigma": "0.05",
      "es": "483"
     }
    },
    {
     "key": "f4",
     "vars": {
      "real": "7688000",
      "train": "1070000000",
      "key": "f4",
      "pop": "32",
      "block": "512",
      "sigma": "0.05",
      "es": "484"
     }
    },
    {
     "key": "f5",
     "vars": {
      "real": "7692000",
      "train": "1080000000",
      "key": "f5",
      "pop": "16",
      "block": "512",
      "sigma": "0.03",
      "es": "485"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "merge": {
    "groupSize": 25,
    "brief": "One row per item: its key, holdout and real gains with se, afterSwap peak, OOG and valid; then what the items could not do. Add no number the items did not measure."
   }
  },
  {
   "name": "r4-ib-kit",
   "brief": "Item {{key}}: put fee policy IB on the gas diet and return a tested kit for it. No search.\nGoal rules apply (SETUP, GATES, REAL ENGINE; HA is named there). Check every sha256.\nFILES. T = `code` of https://api.imdnotdead.fun/artifacts/6ac5e013b7b1fb4c5e7bdcdfec0aba28b16824e18ccf39500f258533879faffe, sha256 ebd9de9bf6af6e55d5e308fd15dbb88edec11fd684891d02a30aec185acd19b3. RS2 port = `port_source` of https://api.imdnotdead.fun/artifacts/d845a4b94eab87f23956fd1939c0135d955df212d1f3037f2a761c178cef7a0e, sha256 9eac3553357528b06eeae3ed8d18283d83401e1968145ceba16be356a147e271 (same strat_init/strat_after API as the replica's STRATEGY block; its `differential_test_source` compares port and EVM fees; `th_convention` says which TH entries are real constants).\nIB = `code_zb64` (zlib+base64) of https://api.imdnotdead.fun/artifacts/afd5183e9ff3235334e041c00b0cd19079599a2c6464db95f8c1586712105557, code sha256 301941829a44bb60977bb28181a5e4bfa6544f3696763f987054789b2611d686; `port_zb64` is its float port (its `port_sha256`; the 178 head weights are TH entries, all 0 = T: `port_notes`); `params` holds its frozen weights and scaling.\nKB = https://api.imdnotdead.fun/artifacts/48cd6a10f39fc22a79c5f12398474bd65282803d59314819acd586f187015808: the kit for IA, another 19-8-2 head on T. It holds IAD.sol (IA on the diet: 8 live storage words, afterSwap peak 132,084 against 237,738, per-seed edges equal on 612 seeds), a general port, a harness (speed, replica, train, freeze, holdout, real, aggregate, emit_solidity) and tests; unpack it per its `decode_instructions` and run its tests. IB's six added inputs are defined differently from IA's (`new_input_formulas` in IB's file; IA is https://api.imdnotdead.fun/artifacts/df0ddfdf122c88641513dd179980fce475f42a912a184f812d213f27db7c14df), so KB does not give IB's fees as it stands.\nWORK. 1. IBD.sol: IB's fees on IAD's storage layout and arithmetic. Regression on real seeds 0..99 (regression only, never confirmation) and on fresh seeds {{real}}..+255: IBD and IB, each alone against Vanilla, every per-seed edge equal; gas of both. 2. Extend KB's port, Solidity writer and tests to IB's input definitions, keeping IA's working: weights in IB's `params` layout must give IB's fees (gate A against IB's code, gate C against IBD.sol), and any weights in that layout must come out as diet Solidity. 3. Replica markets/s of the general port and of IB's own port on 512 markets; say what makes the general one slower and remove it if you can.\nRESULT, one JSON object in KB's shape: each file as `<name>_zb64` (zlib+base64) with `<name>_sha256`; `api`; `decode_instructions`; `gates`; `regression` and `real` {n, identical, max_abs_difference}; `gas` {IB and IBD: afterSwap peak, afterInitialize peak, OOG}; `speed`; `valid`; `notes`. Keep it under 64,000 bytes: a file equal to KB's is named by KB's sha256 instead of being repeated. Measured numbers only.",
   "items": [
    {
     "key": "kit-c",
     "vars": {
      "key": "kit-c",
      "real": "7696000"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "merge": {
    "groupSize": 25,
    "brief": "One row per item: its key, holdout and real gains with se, afterSwap peak, OOG and valid; then what the items could not do. Add no number the items did not measure."
   }
  }
 ],
 "read": [
  "r4-confirm/ib-a",
  "r4-confirm/ib-b",
  "r4-confirm/fa-a",
  "r4-confirm/fa-b",
  "r4-ib-wide/merge-01",
  "r4-ib-wide/merge-02",
  "r4-ib-wide/merge-03",
  "r4-ib-wide/merge-04",
  "r4-ib-continue/c1",
  "r4-ib-continue/c2",
  "r4-ib-continue/c3",
  "r4-ib-continue/c4",
  "r4-ib-continue/c5",
  "r4-ib-joint/j1",
  "r4-ib-joint/j2",
  "r4-ib-joint/j3",
  "r4-ib-joint/j4",
  "r4-ib-joint/j5",
  "r4-ib-union/u1",
  "r4-ib-union/u2",
  "r4-ib-union/u3",
  "r4-ib-union/u4",
  "r4-fa-continue/f1",
  "r4-fa-continue/f2",
  "r4-fa-continue/f3",
  "r4-fa-continue/f4",
  "r4-fa-continue/f5",
  "r4-ib-kit/kit-c",
  "r3-fa-union/fu-a",
  "r3-fa-union/fu-b"
 ],
 "cancel": [],
 "wake": {
  "batches": [
   "r4-confirm",
   "r4-ib-continue",
   "r4-ib-wide",
   "r4-ib-union",
   "r4-ib-joint",
   "r4-fa-continue",
   "r4-ib-kit",
   "r3-fa-union",
   "r2-inputs2",
   "r2-joint"
  ],
  "afterMinutes": 480
 },
 "finish": false
}