{
 "notes": "EPISODE 4. Woken by requester note 3 while round 2 ran (7 r2 batches, 25 items, all running; e2-ha-round1 5 accepted, 4 running; leg1 cancelled, 4 accepted, 1 running). Note 3 asked for three lines from feat-a, keeping round 2 running: done, plus two lines of mine. Nothing cancelled. A first attempt was rejected for shape. LIMITS that bind: brief <= 3,000 characters (template and filled), wake.batches <= 10, read <= 30, notes <= 8,000. Measure with a script before writing.\n\nREAD AND CHECKED (3 results; each file's sha256 is its artifact id)\n- leg1/feat-a = FA, the best so far. https://api.imd.fun/artifacts/d3bff2aae5d832c494baf42f463dd674ab63c084734a435ea6d204d0b6176e28 answers 200 with the handed bytes. I decoded it: `code` sha256 aa2c4a5637a4060088263d71ab8b109339b101bb25d64a45e9c7de83710d8728 (26,862 chars); `port_zb64` unpacks to sha256 243a04fe20939682a8ed127f07895fdf7dce610c30d9af0a6ea0b74a536202b9 (one file, port + replica; run_many mode 0 = T). 19-8-2 head, 178 weights: HA's 13 inputs + T_bid_fee, T_ask_fee (after T's clamps, before the head), prev_bid_fee, prev_ask_fee, (spot-pHat)/pHat, retail_flow_rate; new columns started at 0. CMA pop 16, sigma 0.1 -> 0.05, 256 markets/generation, 512 generations in 56 min at 925 markets/s (12 cores). Monitor over T: 1.15 at the start (= HA), 1.44 at 25 min, 1.70 at 46, 1.73 at 51: still rising. Holdout (40000000..40008191): +1.6811 se 0.0117 over T, +0.5643 se 0.0071 over HA (HA over T 1.1168). Real 7004000..7004511: +0.569 se 0.029 over HA (retail +0.526, arb +0.042), +1.650 se 0.046 over T. Gas: afterSwap peak 234,741 (HA 231,604 same seeds), init 243,227, 0 OOG. Gates passed.\n- leg1/net8-a: HA's 130 weights continued 54 min: holdout +0.104 se 0.005 over HA, real +0.096 se 0.019; peak 231,381. The 13-input structure is near its plateau.\n- e2-ha-round1/joint-b: ran nothing; no evidence on joint search yet.\n- Also answer 200: IA df0ddfdf122c88641513dd179980fce475f42a912a184f812d213f27db7c14df (code_zb64, port_zb64, params, new_input_formulas), gas-a 19160955248c44ac54623ad40112d2b6c3b1c6f6745d9101a5e9b278f512192a (diet_code_zb64), KIT 0d8194e9f6e0017dc4e515cdb04c048efc292935bb1d18e3336091fe81154786 (diff_test.py, harness), HA, RS2 port.\n\nWHAT THE RESULTS SAY\n- Inputs pay: over HA in about 50 minutes the same 13 inputs gave +0.10 (net8-a) and +0.19 (continue-a, gated-a); IA's six inputs +0.335 in 21 min; FA's six +0.57 in 56 min on a fast machine. Width and gating did not pay.\n- The replica calls real gains within 0.01-0.03 every time: holdout (se 0.007) is the yardstick, the real 512 a check.\n- Target +3.1 over HA; best +0.57. Six episodes are left; at +0.2 to +0.5 a round it will not be reached: keep stacking (inputs, constants, long training from saved weights) and write up how far it got.\n\nDECIDED: 16 items in 5 batches of at most 5 (no canary hold), all from FA by URL with FA's gates (A: FA port vs FA code; B: replica FA minus T on 7004000..7004511 within 0.15 of +1.650; C). The 3,000 limit decided the wording: confirm and continue briefs carry the requester's three FILE definitions word for word; union and joint only the RS2 port one (diff test, th_convention), since FA's port holds T and the replica; KIT only in confirm. Training items: monitor 30000000..30002047 every 5 min, holdout once (gain over T and over FA; over HA = over FA + 0.5643), real = candidate, FA and HA on 512 seeds (HA arm dropped only when short of time), emitter proven by reproducing FA's code byte for byte, sigma capped at sigma0 x 0.5^(minutes/30).\n- r3-fa-confirm: fa-confirm-a real 7310000..7311023, fa-confirm-b 7320000..7321023: FA, HA, T (IA if time), paired with sum, sumsq and the 1,024 per-seed differences FA minus HA; returns FA's code.\n- r3-fa-continue (fc-a..e) and r3-fa-continue-x (fc-f..i): CMA from FA's weights, at least 45 min. fc-a, b, c, f: pop 16, 512 markets/generation, sigma0 0.05 (note 3's six copies are a..f); fc-d sigma0 0.08; fc-e 0.03; mine: fc-g pop 32; fc-h 256 markets; fc-i diagonal CMA. ES seeds 301..309.\n- r3-fa-union (fu-a, fu-b sigma0 0.05; fu-c 0.08): UN = FA + IA's raw_size, step_trade_count, steps_since_arb_like_print, router_implied_vanilla_spot_dev (23-8-2), new weights 0, gas probe on real block+2000..+2015, at least 35 min, returns the UN port. Note 3 asked for gas-a's diet if the head would pass 245,000: that did not fit the brief or one item's time, so an item whose peak passes 243,000 drops the costliest input and says so. FA is at 234.7k and IA's six inputs cost 4k, so I expect about 238k; if not, round 4 moves UN onto the diet (r2-diet-wide shows the cost).\n- r3-fa-joint (mine: retune-b got +0.67 over T from constants alone, and no joint item has reported): fj-a = FA's weights and T's constants together; fk-a = constants only, head fixed. Constants searched as multiples of FA's values, sigma 0.03.\nSEEDS. Item i in the order fc-a..fc-i, fu-a..c, fj-a, fk-a: real block 7330000 + 5000*i (first 512; 1,024 on a slow machine), last starts 7395000; replica train from 600000000 + 1000000*i. Used before: real 7000000..7017511, 7100000..7136863, 7200000..7302399, now 7310000..7399999; train 100000000-279999999, 400000000-489999999, 500000000-524999999, now 600000000-613999999. NEXT: real from 7500000, train from 700000000. Monitor and holdout never change.\n\nNEXT EPISODE\n1. Reads asked (30, in priority order): the 16 new items; r2-confirm confirm-a, confirm-b; r2-inputs2's five; r2-joint's three; r2-continue continue-a, continue-d; r2-continue-x continue-g, continue-h. Accepted items of small batches seem to be handed unasked (feat-a, net8-a), so more may arrive. Not asked: r2-continue b, c, e; continue-f; r2-gated; r2-diet-wide; r2-kit kit-b; e2-ha-round1's continue-b, joint-a, gas-b, inputs-b: take them from the requester's notes, or ask in `read` if a decision needs one.\n2. If woken early by a note while items run, do not respawn what runs; decide what the note asks and keep the wake.\n3. Pool each confirmation: mean = (sum_a + sum_b)/2048, se from the pooled sumsq, never an average of two se. FA minus HA > 2 se promotes FA; if also >= +0.3, FA is a file for the requester to submit: code sha256 aa2c4a56...8728, complete code = `code` of FA's artifact. Same for IA from r2-confirm. Check gas on all 2,048: 0 OOG, afterSwap peak <= 245,000.\n4. Rank every valid candidate of rounds 2 and 3 on one scale, holdout gain over HA: round-3 items report over FA (add 0.5643); round-2 items over IA (IA is +0.365 over HA on holdout). Drop any with a failed gate, an OOG, a peak over 245,000 or a replica-real gap over 0.15. Read which line won: continue settings (sigma0, pop, block size, diagonal), whether the union's or r2-inputs2's inputs earned weight, whether constants add on top of the head.\n5. Round 4, about 30 items in batches of at most 5, all from the best candidate by its artifact URL (the sha256 of its result file; check it answers 200 and decode its code and port hashes): two confirm items of 1,024 fresh seeds against FA and HA; most items long training with the settings that won; a few that merge lines that each helped (winner's weights + the union's inputs + moved constants, new weights 0). If continue copies add only about +0.1 over FA, weights alone are flat again: spend on new inputs and constants.\n6. A brief that failed the same way in several items is mended first. Items do see the goal text (SETUP, GATES, REAL ENGINE).\nBUDGET: 55 of 400 items used after this. Episodes are the scarce thing (6 left, and each requester note spends one), so make rounds wide. Episodes 5-9 are rounds, each confirming the last winner on 2,048 fresh seeds; episode 10 finishes: best confirmed file with complete code and sha256, its gain over HA and T, gas, and how far from +3.1 it is. Wake: the five new batches and four r2 batches settled, or 300 minutes.",
 "spawn": [
  {
   "name": "r3-fa-confirm",
   "brief": "Item {{key}}: confirm fee policy FA against HA on the real engine. No training.\nThe goal's SETUP and REAL ENGINE rules apply; HA is named there. Check every sha256.\nFILES. T = `code` of https://api.imd.fun/artifacts/6ac5e013b7b1fb4c5e7bdcdfec0aba28b16824e18ccf39500f258533879faffe, sha256 ebd9de9bf6af6e55d5e308fd15dbb88edec11fd684891d02a30aec185acd19b3. Replica = `replica_source` of https://api.imd.fun/artifacts/e8a7a2af9039c24b8bb2d3b5fa1c9113606cbf5a480ac07d02ca26750f1752ea, sha256 1e4c44b4bffbdeed65872ee15d46dbde209bf5aa11014329d13d100507b4040c. RS2 port = `port_source` of https://api.imd.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). FA (T plus a 19-8-2 head) = `code` of https://api.imd.fun/artifacts/d3bff2aae5d832c494baf42f463dd674ab63c084734a435ea6d204d0b6176e28, sha256 aa2c4a5637a4060088263d71ab8b109339b101bb25d64a45e9c7de83710d8728; `params.float` = its weights; `port_zb64` (zlib+base64, sha256 243a04fe20939682a8ed127f07895fdf7dce610c30d9af0a6ea0b74a536202b9) = its port and replica in one Python file (run_many mode 0 = T). IA = https://api.imd.fun/artifacts/df0ddfdf122c88641513dd179980fce475f42a912a184f812d213f27db7c14df (`code_zb64`, sha256 956566e95f46dc1ed5980fae5e550de7b9da10f9b3ad8eed62f265682cfcecf2, `port_zb64`, `new_input_formulas`, `params`). KIT = https://api.imd.fun/artifacts/0d8194e9f6e0017dc4e515cdb04c048efc292935bb1d18e3336091fe81154786: diff_test.py and a real-engine harness.\nSTEPS:\n1. Setup. Compile FA, HA and T with `amm-match validate`.\n2. Run FA, HA and T, each alone against the 30 bps VanillaStrategy, on the 1,024 fresh seeds {{real}} to {{real}}+1023: at most 64 seeds a call, the same configs for every arm, amm_sim_rs.gas_stats() reset and read for each arm, results saved under scratch/ after every call.\n3. With at least 20 minutes left, run IA's code on the same seeds too.\nRun no seed twice for one arm and use no other real seeds.\nRESULT, one JSON object under 64,000 bytes: variant, blocked, seeds [first, last], arm_sha256 {FA, HA, T, IA}, arm_mean_edge, FA_vs_HA, FA_vs_T, HA_vs_T and, when run, FA_vs_IA and IA_vs_HA, each paired {n, mean_diff, se, worst5 [{seed, diff}], sum, sumsq} (se = sample standard deviation of the per-seed differences / sqrt(n)), retail_delta and arb_delta with se for FA vs HA, diffs_FA_minus_HA (the 1,024 per-seed differences in seed order, 4 decimals), gas per arm {afterSwap_max, afterSwap_calls, init_max, oog, other_failures}, valid (FA: 0 OOG and afterSwap peak <= 245,000), confirmed (FA_vs_HA mean_diff > 2 se), code (FA's complete Solidity, byte for byte), sha256, notes.",
   "items": [
    {
     "key": "fa-confirm-a",
     "vars": {
      "key": "fa-confirm-a",
      "real": "7310000"
     }
    },
    {
     "key": "fa-confirm-b",
     "vars": {
      "key": "fa-confirm-b",
      "real": "7320000"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "merge": {
    "groupSize": 25,
    "brief": "Keep every item's result whole and unchanged, one entry per item key."
   }
  },
  {
   "name": "r3-fa-continue",
   "brief": "Item {{key}}: train fee policy FA further on the replica, then measure it on the real engine.\nGoal rules apply (SETUP, GATES, REAL ENGINE; HA is named there). Check every sha256. Start from FA's port: rebuild none from source.\nFILES. T = `code` of https://api.imd.fun/artifacts/6ac5e013b7b1fb4c5e7bdcdfec0aba28b16824e18ccf39500f258533879faffe, sha256 ebd9de9bf6af6e55d5e308fd15dbb88edec11fd684891d02a30aec185acd19b3. Replica = `replica_source` of https://api.imd.fun/artifacts/e8a7a2af9039c24b8bb2d3b5fa1c9113606cbf5a480ac07d02ca26750f1752ea, sha256 1e4c44b4bffbdeed65872ee15d46dbde209bf5aa11014329d13d100507b4040c. RS2 port = `port_source` of https://api.imd.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). FA (T plus a 19-8-2 head) = `code` of https://api.imd.fun/artifacts/d3bff2aae5d832c494baf42f463dd674ab63c084734a435ea6d204d0b6176e28, sha256 aa2c4a5637a4060088263d71ab8b109339b101bb25d64a45e9c7de83710d8728; `params.float` = its weights; `port_zb64` (zlib+base64, sha256 243a04fe20939682a8ed127f07895fdf7dce610c30d9af0a6ea0b74a536202b9) = its port and replica in one Python file (run_many mode 0 = T).\nSTEPS (about 110 minutes):\n1. Setup; unpack FA's port; measure replica markets/s. Under 200: no search, run step 4's real test for FA and HA on 1,024 seeds and report that.\n2. Pass gates A (FA's port against FA's code on the EVM) and B (replica FA minus T on seeds 7004000..7004511 within 0.15 of the real +1.650). Write a Solidity emitter that returns FA's code byte for byte from FA's weights.\n3. Search at least 45 minutes: CMA-ES ({{opt}} covariance) from FA's 178 weights, seed {{seed}}, population {{pop}}, {{markets}} new replica markets a generation from seed {{train}} up (fitness = mean edge minus T's on the same markets), sigma0 {{sigma}} in weight units, never above sigma0 x 0.5^(minutes/30). Every 5 minutes score the CMA mean on monitor seeds 30000000..30002047; keep the best.\n4. Freeze the best (weights rounded to 1e-6); gate C. Holdout, once: replica seeds 40000000..40008191, gain over T and over FA. Real: candidate, FA and HA, each alone, seeds {{real}} to {{real}}+511, at most 64 a call (short of time: drop the HA arm and say so).\nRESULT, one JSON object under 64,000 bytes: variant, blocked, gates {A, B, C}, sim_markets_per_s, search_minutes, generations, curve [[minutes, monitor gain over T, se]], holdout {gain_over_T, gain_over_FA, se}, real {seeds, vs_FA, vs_HA: paired {n, mean_diff, se, worst5, sum, sumsq}, retail_delta, arb_delta}, gas per arm {afterSwap_max, init_max, oog}, valid, code (the complete Solidity), sha256, params.float {W1, b1, W2, b2}, cma {settings, final_sigma}, notes (what limited the gain).",
   "items": [
    {
     "key": "fc-a",
     "vars": {
      "key": "fc-a",
      "seed": "301",
      "pop": "16",
      "markets": "512",
      "sigma": "0.05",
      "opt": "full",
      "real": "7330000",
      "train": "600000000"
     }
    },
    {
     "key": "fc-b",
     "vars": {
      "key": "fc-b",
      "seed": "302",
      "pop": "16",
      "markets": "512",
      "sigma": "0.05",
      "opt": "full",
      "real": "7335000",
      "train": "601000000"
     }
    },
    {
     "key": "fc-c",
     "vars": {
      "key": "fc-c",
      "seed": "303",
      "pop": "16",
      "markets": "512",
      "sigma": "0.05",
      "opt": "full",
      "real": "7340000",
      "train": "602000000"
     }
    },
    {
     "key": "fc-d",
     "vars": {
      "key": "fc-d",
      "seed": "304",
      "pop": "16",
      "markets": "512",
      "sigma": "0.08",
      "opt": "full",
      "real": "7345000",
      "train": "603000000"
     }
    },
    {
     "key": "fc-e",
     "vars": {
      "key": "fc-e",
      "seed": "305",
      "pop": "16",
      "markets": "512",
      "sigma": "0.03",
      "opt": "full",
      "real": "7350000",
      "train": "604000000"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "merge": {
    "groupSize": 25,
    "brief": "Keep every item's result whole and unchanged, one entry per item key."
   }
  },
  {
   "name": "r3-fa-continue-x",
   "brief": "Item {{key}}: train fee policy FA further on the replica, then measure it on the real engine.\nGoal rules apply (SETUP, GATES, REAL ENGINE; HA is named there). Check every sha256. Start from FA's port: rebuild none from source.\nFILES. T = `code` of https://api.imd.fun/artifacts/6ac5e013b7b1fb4c5e7bdcdfec0aba28b16824e18ccf39500f258533879faffe, sha256 ebd9de9bf6af6e55d5e308fd15dbb88edec11fd684891d02a30aec185acd19b3. Replica = `replica_source` of https://api.imd.fun/artifacts/e8a7a2af9039c24b8bb2d3b5fa1c9113606cbf5a480ac07d02ca26750f1752ea, sha256 1e4c44b4bffbdeed65872ee15d46dbde209bf5aa11014329d13d100507b4040c. RS2 port = `port_source` of https://api.imd.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). FA (T plus a 19-8-2 head) = `code` of https://api.imd.fun/artifacts/d3bff2aae5d832c494baf42f463dd674ab63c084734a435ea6d204d0b6176e28, sha256 aa2c4a5637a4060088263d71ab8b109339b101bb25d64a45e9c7de83710d8728; `params.float` = its weights; `port_zb64` (zlib+base64, sha256 243a04fe20939682a8ed127f07895fdf7dce610c30d9af0a6ea0b74a536202b9) = its port and replica in one Python file (run_many mode 0 = T).\nSTEPS (about 110 minutes):\n1. Setup; unpack FA's port; measure replica markets/s. Under 200: no search, run step 4's real test for FA and HA on 1,024 seeds and report that.\n2. Pass gates A (FA's port against FA's code on the EVM) and B (replica FA minus T on seeds 7004000..7004511 within 0.15 of the real +1.650). Write a Solidity emitter that returns FA's code byte for byte from FA's weights.\n3. Search at least 45 minutes: CMA-ES ({{opt}} covariance) from FA's 178 weights, seed {{seed}}, population {{pop}}, {{markets}} new replica markets a generation from seed {{train}} up (fitness = mean edge minus T's on the same markets), sigma0 {{sigma}} in weight units, never above sigma0 x 0.5^(minutes/30). Every 5 minutes score the CMA mean on monitor seeds 30000000..30002047; keep the best.\n4. Freeze the best (weights rounded to 1e-6); gate C. Holdout, once: replica seeds 40000000..40008191, gain over T and over FA. Real: candidate, FA and HA, each alone, seeds {{real}} to {{real}}+511, at most 64 a call (short of time: drop the HA arm and say so).\nRESULT, one JSON object under 64,000 bytes: variant, blocked, gates {A, B, C}, sim_markets_per_s, search_minutes, generations, curve [[minutes, monitor gain over T, se]], holdout {gain_over_T, gain_over_FA, se}, real {seeds, vs_FA, vs_HA: paired {n, mean_diff, se, worst5, sum, sumsq}, retail_delta, arb_delta}, gas per arm {afterSwap_max, init_max, oog}, valid, code (the complete Solidity), sha256, params.float {W1, b1, W2, b2}, cma {settings, final_sigma}, notes (what limited the gain).",
   "items": [
    {
     "key": "fc-f",
     "vars": {
      "key": "fc-f",
      "seed": "306",
      "pop": "16",
      "markets": "512",
      "sigma": "0.05",
      "opt": "full",
      "real": "7355000",
      "train": "605000000"
     }
    },
    {
     "key": "fc-g",
     "vars": {
      "key": "fc-g",
      "seed": "307",
      "pop": "32",
      "markets": "512",
      "sigma": "0.05",
      "opt": "full",
      "real": "7360000",
      "train": "606000000"
     }
    },
    {
     "key": "fc-h",
     "vars": {
      "key": "fc-h",
      "seed": "308",
      "pop": "16",
      "markets": "256",
      "sigma": "0.05",
      "opt": "full",
      "real": "7365000",
      "train": "607000000"
     }
    },
    {
     "key": "fc-i",
     "vars": {
      "key": "fc-i",
      "seed": "309",
      "pop": "16",
      "markets": "512",
      "sigma": "0.05",
      "opt": "diagonal",
      "real": "7370000",
      "train": "608000000"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "merge": {
    "groupSize": 25,
    "brief": "Keep every item's result whole and unchanged, one entry per item key."
   }
  },
  {
   "name": "r3-fa-union",
   "brief": "Item {{key}}: give fee policy FA four more inputs, train it on the replica, then measure it on the real engine.\nGoal rules apply (SETUP, GATES, REAL ENGINE; HA is named there). Check every sha256. Start from FA's port: rebuild none from source.\nFILES. RS2 port = `port_source` of https://api.imd.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). FA (T plus a 19-8-2 head) = `code` of https://api.imd.fun/artifacts/d3bff2aae5d832c494baf42f463dd674ab63c084734a435ea6d204d0b6176e28, sha256 aa2c4a5637a4060088263d71ab8b109339b101bb25d64a45e9c7de83710d8728; `params.float` = its weights; `port_zb64` (zlib+base64, sha256 243a04fe20939682a8ed127f07895fdf7dce610c30d9af0a6ea0b74a536202b9) = its port and replica in one Python file (run_many mode 0 = T). IA = https://api.imd.fun/artifacts/df0ddfdf122c88641513dd179980fce475f42a912a184f812d213f27db7c14df (`code_zb64`, `port_zb64`, `new_input_formulas`, `params`).\nSTEPS (about 110 minutes):\n1. Setup; unpack FA's port; pass gates A (FA's port against FA's code on the EVM) and B (replica FA minus T on seeds 7004000..7004511 within 0.15 of the real +1.650).\n2. Build UN, a 23-8-2 head, in the port and in Solidity: FA's 19 inputs plus IA's raw_size, step_trade_count, steps_since_arb_like_print and router_implied_vanilla_spot_dev (IA's formulas and scaling). With the new weights 0, UN's fees must equal FA's. With them at 1e-6, probe gas on real seeds {{real}}+2000 to +2015: if the afterSwap peak passes 243,000, drop the costliest new input and say which.\n3. Search at least 35 minutes: CMA-ES from FA's weights and zeros, seed {{seed}}, population 16, 512 new replica markets a generation from seed {{train}} up (fitness = mean edge minus T's on the same markets), sigma0 {{sigma}} in weight units, never above sigma0 x 0.5^(minutes/30). Every 5 minutes score the CMA mean on monitor seeds 30000000..30002047; keep the best.\n4. Freeze the best (weights rounded to 1e-6); gate C. Holdout, once: replica seeds 40000000..40008191, gain over T and over FA. Real: candidate, FA and HA, each alone, seeds {{real}} to {{real}}+511, at most 64 a call (short of time: drop the HA arm and say so).\nRESULT, one JSON object under 64,000 bytes: variant, blocked, gates {A, B, C}, sim_markets_per_s, search_minutes, generations, curve [[minutes, monitor gain over T, se]], holdout {gain_over_T, gain_over_FA, se}, real {seeds, vs_FA, vs_HA: paired {n, mean_diff, se, worst5, sum, sumsq}, retail_delta, arb_delta}, gas per arm {afterSwap_max, init_max, oog}, valid, code (the complete Solidity), sha256, params (weights, input order, scaling), port_zb64 (the UN port), port_sha256, notes (which inputs earned weight; gas).",
   "items": [
    {
     "key": "fu-a",
     "vars": {
      "key": "fu-a",
      "seed": "311",
      "sigma": "0.05",
      "real": "7375000",
      "train": "609000000"
     }
    },
    {
     "key": "fu-b",
     "vars": {
      "key": "fu-b",
      "seed": "312",
      "sigma": "0.05",
      "real": "7380000",
      "train": "610000000"
     }
    },
    {
     "key": "fu-c",
     "vars": {
      "key": "fu-c",
      "seed": "313",
      "sigma": "0.08",
      "real": "7385000",
      "train": "611000000"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "merge": {
    "groupSize": 25,
    "brief": "Keep every item's result whole and unchanged, one entry per item key."
   }
  },
  {
   "name": "r3-fa-joint",
   "brief": "Item {{key}}: starting at fee policy FA, search {{scope}} 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. Start from FA's port: rebuild none from source.\nFILES. RS2 port = `port_source` of https://api.imd.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). FA (T plus a 19-8-2 head) = `code` of https://api.imd.fun/artifacts/d3bff2aae5d832c494baf42f463dd674ab63c084734a435ea6d204d0b6176e28, sha256 aa2c4a5637a4060088263d71ab8b109339b101bb25d64a45e9c7de83710d8728; `params.float` = its weights; `port_zb64` (zlib+base64, sha256 243a04fe20939682a8ed127f07895fdf7dce610c30d9af0a6ea0b74a536202b9) = its port and replica in one Python file (run_many mode 0 = T).\nSTEPS (about 110 minutes):\n1. Setup; unpack FA's port; pass gates A (FA's port against FA's code on the EVM) and B (replica FA minus T on seeds 7004000..7004511 within 0.15 of the real +1.650).\n2. T's constants = the `uint256 constant` values FA's code declares for T and its toxicity anchor (TH in FA's port). Search each as a multiple of its FA value, kept valid (a decay below 1, a cap positive, an integer rounded). Write an emitter that returns FA's code byte for byte from FA's own constants and weights.\n3. Search at least 40 minutes: CMA-ES over those values, seed {{seed}}, population 16, 512 new replica markets a generation from seed {{train}} up (fitness = mean edge minus the unchanged T's on the same markets), sigma0 {{sigma}} for weights and 0.03 for the multiples, never above sigma0 x 0.5^(minutes/30). Every 5 minutes score the CMA mean on monitor seeds 30000000..30002047; keep the best.\n4. Freeze the best; gate C. Holdout, once: replica seeds 40000000..40008191, gain over T and over FA. Real: candidate, FA and HA, each alone, seeds {{real}} to {{real}}+511, at most 64 a call (short of time: drop the HA arm and say so).\nRESULT, one JSON object under 64,000 bytes: variant, blocked, gates {A, B, C}, sim_markets_per_s, search_minutes, generations, curve [[minutes, monitor gain over T, se]], holdout {gain_over_T, gain_over_FA, se}, real {seeds, vs_FA, vs_HA: paired {n, mean_diff, se, worst5, sum, sumsq}, retail_delta, arb_delta}, gas per arm {afterSwap_max, init_max, oog}, valid, code (the complete Solidity), sha256, params.float {W1, b1, W2, b2}, constants {name: [FA value, new value]}, port_zb64 and port_sha256 if the port changed, notes (which constants moved; what they bought).",
   "items": [
    {
     "key": "fj-a",
     "vars": {
      "key": "fj-a",
      "seed": "321",
      "sigma": "0.05",
      "scope": "FA's 178 head weights and T's constants together",
      "real": "7390000",
      "train": "612000000"
     }
    },
    {
     "key": "fk-a",
     "vars": {
      "key": "fk-a",
      "seed": "322",
      "sigma": "0.05",
      "scope": "T's constants only (the head stays at FA's weights)",
      "real": "7395000",
      "train": "613000000"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "merge": {
    "groupSize": 25,
    "brief": "Keep every item's result whole and unchanged, one entry per item key."
   }
  }
 ],
 "read": [
  "r3-fa-confirm/fa-confirm-a",
  "r3-fa-confirm/fa-confirm-b",
  "r3-fa-continue/fc-a",
  "r3-fa-continue/fc-b",
  "r3-fa-continue/fc-c",
  "r3-fa-continue/fc-d",
  "r3-fa-continue/fc-e",
  "r3-fa-continue-x/fc-f",
  "r3-fa-continue-x/fc-g",
  "r3-fa-continue-x/fc-h",
  "r3-fa-continue-x/fc-i",
  "r3-fa-union/fu-a",
  "r3-fa-union/fu-b",
  "r3-fa-union/fu-c",
  "r3-fa-joint/fj-a",
  "r3-fa-joint/fk-a",
  "r2-confirm/confirm-a",
  "r2-confirm/confirm-b",
  "r2-inputs2/inputs-clock",
  "r2-inputs2/inputs-path",
  "r2-inputs2/inputs-flow",
  "r2-inputs2/inputs-fees",
  "r2-inputs2/inputs-cross",
  "r2-joint/joint-a",
  "r2-joint/joint-b",
  "r2-joint/const-a",
  "r2-continue/continue-a",
  "r2-continue/continue-d",
  "r2-continue-x/continue-g",
  "r2-continue-x/continue-h"
 ],
 "cancel": [],
 "wake": {
  "batches": [
   "r3-fa-confirm",
   "r3-fa-continue",
   "r3-fa-continue-x",
   "r3-fa-union",
   "r3-fa-joint",
   "r2-confirm",
   "r2-continue",
   "r2-joint",
   "r2-inputs2"
  ],
  "afterMinutes": 300
 },
 "finish": false
}