{
 "notes": "EPISODE 2 (of 12). Nothing has run yet: episode 1's whole pipeline (t1-*) was refused, so no item, no report seed and no engine seed is spent. Items used after this episode: at most 20 of 300. Credit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, everywhere.\n\nWHY EPISODE 1 WAS REFUSED, AND THE RULE FOR EVERY BRIEF: the harness brief \"asks for a command's verbatim output\"; the seven stages after it fell with it. A brief must describe work and name the result's fields as figures the work computes. Never ask a worker to hand back what a command wrote, a log, or anything about its machine. Episode 1's notes still hold for the facts; its t1-* batches do not exist.\n\nCHECKED THIS EPISODE (artifacts downloaded and read, nothing run): replica a1eef2f3dbbcbc7a1de9d15a2b22d1d25ac6d316a72efde67275b5d5a16ab16b is code_zb64 = base64(zlib(tar)) with build.py (g++ -O3 -std=c++20 -ffp-contract=off), main.cpp (`sim {LEAN|QLX5|C30|C25|CONFIG} START COUNT [knob=integer] [trace=FILE]`, refuses seeds >= 10,200,000, rows seed,edge,tries,hits,callbacks), tables.hpp (the QPL1 blob, nodes = int x scale), policy.hpp (surf() reads tables[tb]; bid side is the point mirror of the ask side, so one node correction acts on both), engine_rows.dat (512 rows, 10010512..10011023). QLX5 source in 1ef80bfb6d6791b877b1f4048a5e63cf2ae54153e6e8763ae3f8ab13132dfb15 code_zb64.QLX5 is base64(zlib(source)), sha256 e183e5bc3fb794b7067703b10a7da9920267aa5f4caa968e16ca101b02338f40 confirmed, 47,230 chars; on 512 engine seeds QLX5 peak gas 208,366, runtime 22,440 bytes, 2.8 s a seed an arm. Python port 60dc237fa0a4d42f3b6e2d2bed61c1a2df08d27c31ccd95cce508ee9c8689de4: tar folder qlxcore (qlxcore.py, mktables.py SOURCE.sol OUT.json, evmdiff.py KIT PORT ARM SEED SOURCE.sol, pyreplay.py); 0.95 runs per core-second. Kit github.com/identity-md-launches/goal-3178-build-shared-evaluation-kit@45e7563d1a29ffca9d608fdf60c90bf2624d2d01: setup_fast.sh, engine_eval.py (seeds 9700000..9700511 only, FIRST/LAST constants), score.py (paired, rounds of 128, same seed limits).\n\nDELTA FORMAT (all stages): text lines `t l r c d`: add d thousandths of a bps to the node at table t, level knot l, row knot r, column knot c. The search is continuous; `quantise` in the harness's qpl.py brings a delta to what the encoding holds (d a multiple of the table scale: 250, 500, 500, 1000, 500 for tables 0..4; int16 first nodes, int8 column steps). The join scores quantised candidates only, so what advances is what the contract can hold.\n\nGATES AS I DEFINE THEM (the objective names T, F, G without defining them; say so in the write-up). T = tables decoded from the new source equal base node + delta on every node (qpl.py in t2-sol, the port's mktables.py in t2-tf), and the source differs from QLX5 only in the hex literal and one comment line. F = on seeds 9700000..9700003 every callback's two fees from the compiled contract in pyrevm equal the Python port's with the new tables, 0 mismatches, with unchanged QLX5 as control; plus a cross-check of port edge against harness sim edge with the delta. G = on engine screening seeds 9700000..9700127: 0 OOG, 0 failed callbacks, afterSwap peak <= 245,000, source <= 50,000 chars, runtime <= 24,576 bytes.\n\nSPAWNED (9 batches, 20 items, all {linux-x64, 8 CPUs}, every result JSON with gain_vs_base, se, n, seeds, advance, source_sha256; checks gate on advance = true):\nt2-harness (h): sim with delta= and visits=, qpl.py, evalx.py, README; result has patch_zb64 (<= 20,000 chars, laid over the replica), parity, zero_delta_equal, roundtrip, table_use, probe.\nt2-map (t0, t1a, t1b, t3a, t3b; after harness, batch pairing, check): t0 = table 0 level knots 0,1; t1a = table 1 knots 0,1; t1b = table 1 knot 2; t3a, t3b likewise. 36 groups each (level knot x row band x column band of equal visit weight), +-1 bps on seeds 64000..64511; per group f_plus, f_minus, se, grad, z, curv, step, predicted; strong = |z| >= 2; carries `harness` by value. Its gain_vs_base is a prediction.\nt2-es (same keys; item pairing, check): ES over the strong groups (12 at most), 16 candidates x 128 seeds a generation, 20 generations, from the map's Newton steps; chooses among x0, mean, half mean on 64000..65023; one report on 10000..12047; advance when choose gain - se > 0; has delta_zb64, harness.\nt2-join (c; after es, batch pairing, when settled): sums the advancing parts (also x0.75, x0.5, each alone, the 2-se parts), quantised, chooses on 64000..65023, one report on 10000..12047; advance when report gain >= 0.03 on all 2,048.\nt2-sol (c) -> t2-tf (c) -> t2-gas (c), item pairing with checks: contract and gate T; gates T and F; gate G. code_zb64 goes forward by value; tf takes the harness from join_url.\nt2-engine (b0..b3; after gas, batch pairing, check): blocks 10,400,000..10,400,255, ..10,400,511, ..10,400,767, ..10,401,023, candidate against QLX5; one look after 128 seeds (stop when mean + 2 se < 0.04); rows_zb64 per seed for exact pooling.\nt2-kit (k; waits on nothing): unchanged QLX5 through compile, engine on 9700000..9700127, fee replay and port-vs-engine on 9700000..9700003; gives base peak gas, timings and a recipe. It tells a tool failure in sol/tf/gas apart from a candidate's, and runs even if a pipeline brief is refused.\nWoken on t2-engine (it settles when cancelled too) or after 480 minutes.\n\nSEED LEDGER. Replica choose 64000..65023 (map uses its first 512; ES and join choose here: selection bias lives here). Replica report 10000..12047: six looks planned (five ES, one join), none taken before. Engine screening 9700000..9700127 (kit, tf, gas): not fresh, never evidence of gain. Engine fresh: 10,400,000..10,401,023 given to t2-engine b0..b3 (a block stopped early is spent). Next fresh block starts at 10,401,024. Never reuse a block for another candidate.\n\nNEXT EPISODE, BY OUTCOME.\n- Refused again: read `refused`; mend only the named brief, keep the others, new names (t3-*). If the refusal was for a check with batch pairing (t2-map or t2-engine), spawn that stage without the check: its brief already stops on advance false.\n- Harness failed or advance false: read its notes and parity; mend (compiler, patch size, parity rule) and run the pipeline again under new names, citing nothing from the failed one.\n- Harness landed but map did not run: spawn the map with the harness result's URL (https://api.imd.fun/artifacts/<sha256 of the handed file>) written into the brief, no `after`.\n- Map landed, join advance false: read the z-scores. With about 36 null groups an item, 1.6 groups pass |z| >= 2 by chance; real structure shows as |z| >= 3 or neighbouring groups of one sign. If there is none, the tables are near-optimal at this band size: go finer only where |z| is largest (split those bands, single knots for the most visited), try shapes bands cannot express (a tilt along rows; a shift of the table along the row axis by a fraction of a knot), and give the top groups all 1,024 choose seeds before more ES. Expected size, from episode 1's rescale curvature: a band holding 1/36 of a table's visits and 1 bps off is worth about +0.006, so +0.03 needs several such bands or a few 2 bps off.\n- Join advance true, engine pooled gain < +0.04 or a block stopped early: compare the replica report with the engine per block; if the engine is lower by more than 2 se suspect choose-set overfit: widen the choose set (add 60000..61023) and shrink the correction.\n- Pooled engine gain over the four blocks >= +0.04 with mean - 2 se > 0, 0 OOG, peak <= 245,000: that contract is the one to bring back (1,024 fresh seeds met). Search on only while items and episodes remain. Never brief a submission: the requester asks the user.\n- The goal needs +0.12; global rescaling gives nothing (episode 1, finding 3). Be ready to report that direct tuning yields less, with the map as evidence, and finish rather than spend items on noise.",
 "spawn": [
  {
   "name": "t2-harness",
   "brief": "One item: build the table-tuning harness for QLX5, a fee policy for the Paradigm AMM puzzle. Credit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file you write and in the result's `credit`.\n\nStart from the engine-faithful C++ replica https://api.imd.fun/artifacts/a1eef2f3dbbcbc7a1de9d15a2b22d1d25ac6d316a72efde67275b5d5a16ab16b (code_zb64 is base64(zlib(tar)); its README gives the build). Work under test/scratch/. Build with g++, or without one with `zig c++` from the PyPI wheel ziglang 0.13.0; flags -O3 -std=c++20 -ffp-contract=off.\n\nQLX5 keeps five fee tables in one QPL1 blob (tables.hpp; the same bytes are `bytes constant QPL` in the contract: field code_zb64.QLX5, base64(zlib(source)), of https://api.imd.fun/artifacts/1ef80bfb6d6791b877b1f4048a5e63cf2ae54153e6e8763ae3f8ab13132dfb15, sha256 e183e5bc3fb794b7067703b10a7da9920267aa5f4caa968e16ca101b02338f40). Each (level knot, row knot) record is an int16 first node, then int8 column steps; node x scale is bps.\n\nWrite, with a README.md of their usage under 60 lines:\n1. The sim with two more arguments. `delta=FILE`: each line `t l r c d` adds d thousandths of a bps to the value (node x scale) of the node at table t, level knot l, row knot r, column knot c, exactly, in the policy's fixed point. `visits=FILE`: one line `t l r c w` per node, w the summed interpolation weight it received over every lookup of the seeds run.\n2. qpl.py: decode the blob to nodes; encode nodes to a blob of the same length and knots; `quantise` a delta file to the nearest the encoding holds (d a multiple of the table's scale, first nodes in int16, column steps in int8); `patch_sol` puts a new blob into the contract source.\n3. evalx.py, for a delta file and a seed range: base and candidate in parallel, base edges cached under test/scratch/; it gives the paired gain (mean of candidate minus base), its se (sd of the per-seed differences / sqrt(n)), n and the per-seed differences.\n\nMeasure:\n- parity: unchanged QLX5 from your build against the replica's 512 engine rows (seeds 10010512..10011023): n, mean_diff, se, max_abs_diff. It fails only when |mean_diff| > 0.01.\n- zero_delta_equal: an all-zero delta file changes no edge by a bit, on 64 seeds.\n- roundtrip: decode then encode returns the blob byte for byte, and patch_sol with it a source of the same sha256.\n- table_use, seeds 64000..64127: lookups per table.\n- probe, through evalx.py: gain and se of adding 1000 (1 bps) to every node of table 1, seeds 64000..64127.\n\nWrite result.json, one JSON object: credit; advance (true only when the sim builds and parity, zero_delta_equal and roundtrip hold); parity; zero_delta_equal; roundtrip; table_use; probe; gain_vs_base, se, n, seeds: the probe's; patch_zb64: base64(zlib(tar)) of only the files you added or changed, to lay over the unpacked replica, at most 20,000 characters; source_sha256 (of that tar); notes.",
   "items": [
    {
     "key": "h",
     "vars": {}
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "requires": {
    "platform": [
     "linux-x64"
    ],
    "minCpus": 8
   }
  },
  {
   "name": "t2-map",
   "brief": "One item: measure which regions of fee table {{table}} of QLX5 (a fee policy for the Paradigm AMM puzzle) carry edge. Credit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file you write and in the result's `credit`.\n\nAmong your inputs is the result of batch {{after.batch}}: the tuning harness. If its advance is not true, write advance false with why, and stop. Unpack the replica https://api.imd.fun/artifacts/a1eef2f3dbbcbc7a1de9d15a2b22d1d25ac6d316a72efde67275b5d5a16ab16b (code_zb64 is base64(zlib(tar))) under test/scratch/, lay the harness's patch_zb64 (base64(zlib(tar))) over it and build as its README says (g++, or `zig c++` from the PyPI wheel ziglang 0.13.0; -O3 -std=c++20 -ffp-contract=off). The sim takes delta=FILE (lines `t l r c d`: add d thousandths of a bps to the node at table t, level knot l, row knot r, column knot c); evalx.py gives the paired gain of a delta file over unchanged QLX5 on a seed range (mean of candidate minus base, and its se). With visits=FILE the sim writes, per node, the summed interpolation weight it received.\n\nYour nodes: table {{table}}, level knot(s) {{levels}}. Seeds: 64000..64511 only; touch no other seed.\n1. Visit weights of your nodes on seeds 64000..64127.\n2. Split your nodes into 36 groups: per level knot, {{bands}}, each band contiguous in knot index, cut so that the bands hold about equal visit weight.\n3. For each group, the paired gain over base of adding +1000 (1 bps) to all its nodes, f_plus, and of adding -1000, f_minus, each on 64000..64511, and the se of f_plus - f_minus from the per-seed differences. Keep the whole item under 45 minutes: if time runs short use the first 256 seeds for every group and say so in n.\n4. Per group: grad = (f_plus - f_minus)/2, per bps; z = (f_plus - f_minus)/se; curv = f_plus + f_minus; step, in bps = -grad/curv clipped to +-2 when curv < 0, otherwise 0.5 x sign(grad); predicted = the gain at step of the parabola through the three points (0 at no change).\n\nWrite result.json, one JSON object: credit; table; levels; groups: 36 objects with id, level, rows [first, last], cols [first, last], weight, f_plus, f_minus, se, grad, z, curv, step, predicted; strong: the ids with |z| >= 2, largest |z| first; advance: true when strong is not empty; gain_vs_base: the sum of predicted over the strong groups (a prediction, not a measurement: say so in gain_note); se: the largest group se; n; seeds; harness: an object with the harness result's patch_zb64 and source_sha256, as handed; source_sha256: the harness's; notes.",
   "items": [
    {
     "key": "t0",
     "vars": {
      "table": "0",
      "levels": "0 and 1",
      "bands": "6 row bands x 3 column bands"
     }
    },
    {
     "key": "t1a",
     "vars": {
      "table": "1",
      "levels": "0 and 1",
      "bands": "6 row bands x 3 column bands"
     }
    },
    {
     "key": "t1b",
     "vars": {
      "table": "1",
      "levels": "2",
      "bands": "6 row bands x 6 column bands"
     }
    },
    {
     "key": "t3a",
     "vars": {
      "table": "3",
      "levels": "0 and 1",
      "bands": "6 row bands x 3 column bands"
     }
    },
    {
     "key": "t3b",
     "vars": {
      "table": "3",
      "levels": "2",
      "bands": "6 row bands x 6 column bands"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "requires": {
    "platform": [
     "linux-x64"
    ],
    "minCpus": 8
   },
   "after": {
    "batch": "t2-harness",
    "pairing": "batch",
    "check": {
     "path": "advance",
     "equals": true
    }
   }
  },
  {
   "name": "t2-es",
   "brief": "One item: search corrections to one region ({{after.key}}) of the fee tables of QLX5, a fee policy for the Paradigm AMM puzzle, with an evolution strategy. Credit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file you write and in the result's `credit`.\n\nYour input {{after.result}} (also among your files) is the map of this region: `groups` (bands of table nodes: level, rows [first, last], cols [first, last], with grad, z, curv, step), `strong`, `table`, and `harness`. Unpack the replica https://api.imd.fun/artifacts/a1eef2f3dbbcbc7a1de9d15a2b22d1d25ac6d316a72efde67275b5d5a16ab16b (code_zb64 is base64(zlib(tar))) under test/scratch/, lay the harness's patch_zb64 (base64(zlib(tar))) over it and build as its README says (g++, or `zig c++` from the PyPI wheel ziglang 0.13.0; -O3 -std=c++20 -ffp-contract=off). The sim takes delta=FILE (lines `t l r c d`: add d thousandths of a bps to the node at table t, level knot l, row knot r, column knot c); evalx.py gives the paired gain of a delta file over unchanged QLX5 on a seed range (mean of candidate minus base, and its se).\n\nSearch space: one offset in bps per group in `strong`, at most the 12 with the largest |z|; every node of a group gets its group's offset (d = 1000 x offset), every other node 0. Start at x0: each group's `step`.\nSearch on the choose seeds 64000..65023 only. Each generation takes the next 128 of them (wrapping round), draws 8 antithetic pairs around the mean with sigma 0.4 bps (3% smaller each generation), scores all 16 on those 128 seeds as paired gain over base, and moves the mean to the rank-weighted average of the better half. Keep offsets within +-4 bps. Stop after 20 generations or 30 minutes of search, whichever comes first.\nChoose: score x0, the final mean and half the final mean on all of 64000..65023, and take the largest gain: that is your correction.\nReport: score the chosen correction once on 10000..12047, in four blocks of 512; stop after a block when mean + 2 se < 0. Run nothing else on the report seeds.\n\nWrite result.json, one JSON object: credit; key; table; offsets: group id to bps; delta_zb64: base64(zlib(the chosen delta file)); candidates: the three choose scores, each gain, se, n; choose: gain, se, n of the chosen one on 64000..65023; gain_vs_base, se, n, seeds: the report figures; advance: true when choose gain - choose se > 0; generations; source_sha256: of the delta file; harness: as handed in the map; map_url: {{after.result}}; notes.",
   "items": [
    {
     "key": "t0",
     "vars": {}
    },
    {
     "key": "t1a",
     "vars": {}
    },
    {
     "key": "t1b",
     "vars": {}
    },
    {
     "key": "t3a",
     "vars": {}
    },
    {
     "key": "t3b",
     "vars": {}
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "requires": {
    "platform": [
     "linux-x64"
    ],
    "minCpus": 8
   },
   "after": {
    "batch": "t2-map",
    "pairing": "item",
    "check": {
     "path": "advance",
     "equals": true
    }
   }
  },
  {
   "name": "t2-join",
   "brief": "One item: join the corrections found for the fee tables of QLX5 (a fee policy for the Paradigm AMM puzzle) into one candidate and measure it. Credit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file you write and in the result's `credit`.\n\nAmong your inputs are the results of batch {{after.batch}}, up to five (keys t0, t1a, t1b, t3a, t3b; some may be missing or failed). Each has delta_zb64 (base64(zlib(text)); lines `t l r c d`: add d thousandths of a bps to the node at table t, level knot l, row knot r, column knot c), choose (gain, se, n), advance, and harness. Take harness from any of them. Unpack the replica https://api.imd.fun/artifacts/a1eef2f3dbbcbc7a1de9d15a2b22d1d25ac6d316a72efde67275b5d5a16ab16b (code_zb64 is base64(zlib(tar))) under test/scratch/, lay the harness's patch_zb64 (base64(zlib(tar))) over it and build as its README says (g++, or `zig c++` from the PyPI wheel ziglang 0.13.0; -O3 -std=c++20 -ffp-contract=off). evalx.py gives the paired gain of a delta file over unchanged QLX5 on a seed range; qpl.py `quantise` gives the nearest delta the contract's table encoding holds.\n\nParts: the results whose advance is true. With no part, write advance false, gain_vs_base 0, se 0, n 0, and stop.\nCandidates, each quantised before it is scored: the sum of all parts; that sum x0.75 and x0.5; each part alone; the sum of the parts with choose gain > 2 x choose se. Score each on the choose seeds 64000..65023 and take the largest gain.\nReport: score the chosen, quantised candidate once on 10000..12047, in four blocks of 512; stop after a block when mean + 2 se < 0.03. Run nothing else on the report seeds.\n\nWrite result.json, one JSON object: credit; parts: the keys used; candidates: name, gain, se, n of each on the choose seeds; chosen; choose: its gain, se, n; gain_vs_base, se, n, seeds: the report figures; advance: true when the report ran all 2,048 seeds and gain_vs_base >= 0.03; delta_zb64: base64(zlib(the chosen quantised delta file)), at most 20,000 characters; nodes_changed; max_abs_d; source_sha256: of that delta file; harness: as handed; notes.",
   "items": [
    {
     "key": "c",
     "vars": {}
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "requires": {
    "platform": [
     "linux-x64"
    ],
    "minCpus": 8
   },
   "after": {
    "batch": "t2-es",
    "pairing": "batch",
    "when": "settled"
   }
  },
  {
   "name": "t2-sol",
   "brief": "One item: put corrected fee tables into the QLX5 contract (a fee strategy for the Paradigm AMM puzzle). Credit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file you write and in the result's `credit`.\n\nYour input {{after.result}} (also among your files) has delta_zb64 (base64(zlib(text)); lines `t l r c d`: add d thousandths of a bps to the node at table t, level knot l, row knot r, column knot c; already quantised to the encoding) and harness, whose patch_zb64 (base64(zlib(tar))) holds qpl.py (decode, encode, quantise, patch_sol) and a README. Base contract: field code_zb64.QLX5 (base64(zlib(source))) of https://api.imd.fun/artifacts/1ef80bfb6d6791b877b1f4048a5e63cf2ae54153e6e8763ae3f8ab13132dfb15, sha256 e183e5bc3fb794b7067703b10a7da9920267aa5f4caa968e16ca101b02338f40, 47,230 characters, 22,440 deployed bytes. Its five tables sit in `bytes constant QPL`: per (level, row) record an int16 first node, then int8 column steps; node x scale is bps.\n\nDo: decode the QPL blob; add the delta to the nodes (if a node will not encode, write advance false, say which, and stop); encode with the same knots, offsets and length; put the new hex literal in with patch_sol; add one comment line naming this correction; keep Taylor's credit line. Change nothing else in the source.\nCompile as the engine does: solc 0.8.24, optimizer 200 runs, viaIR, evm version paris; the kit, github.com/identity-md-launches/goal-3178-build-shared-evaluation-kit at commit 45e7563d1a29ffca9d608fdf60c90bf2624d2d01 (setup_fast.sh --platform linux-x86_64, with --cache and --scratch under test/scratch/; engine_eval.py compiles a strategy with solc 0.8.24, optimizer 200 runs, viaIR, paris, and runs it on the pinned engine against the 30 bps VanillaStrategy, giving edge and afterSwap peak gas per seed) installs that compiler. Work under test/scratch/.\nGate T: decode the tables back out of your new source and compare with base node + delta on every node of all five tables: 0 mismatches; and the two sources differ only in the hex literal and the comment line.\n\nWrite result.json, one JSON object: credit; gates: an object with T, \"pass\" or \"fail\"; t_mismatches; lines_changed; source_chars (limit 50,000); runtime_bytes (limit 24,576); source_sha256; runtime_sha256; code_zb64: base64(zlib(the new source)); delta_zb64 as handed; join_url: {{after.result}}; gain_vs_base, se, n, seeds: the input's figures, as handed; advance: true when T passes and both limits hold; notes.",
   "items": [
    {
     "key": "c",
     "vars": {}
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "requires": {
    "platform": [
     "linux-x64"
    ],
    "minCpus": 8
   },
   "after": {
    "batch": "t2-join",
    "pairing": "item",
    "check": {
     "path": "advance",
     "equals": true
    }
   }
  },
  {
   "name": "t2-tf",
   "brief": "One item: check a corrected QLX5 contract (a fee strategy for the Paradigm AMM puzzle) against the Python reference: gates T and F. Credit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file you write and in the result's `credit`.\n\nYour input {{after.result}} (also among your files) has code_zb64 (base64(zlib(Solidity source))), source_sha256, delta_zb64 (base64(zlib(text)); lines `t l r c d`: d thousandths of a bps added to the node at table t, level knot l, row knot r, column knot c) and join_url. Base: field code_zb64.QLX5 of https://api.imd.fun/artifacts/1ef80bfb6d6791b877b1f4048a5e63cf2ae54153e6e8763ae3f8ab13132dfb15, sha256 e183e5bc3fb794b7067703b10a7da9920267aa5f4caa968e16ca101b02338f40.\nTools, under test/scratch/: the Python reference port https://api.imd.fun/artifacts/60dc237fa0a4d42f3b6e2d2bed61c1a2df08d27c31ccd95cce508ee9c8689de4 (code_zb64 is base64(zlib(tar)), folder qlxcore: qlxcore.py, the integer policy; mktables.py, which decodes the tables out of a contract source; evmdiff.py, which replays callbacks through the compiled contract in pyrevm); and the kit, github.com/identity-md-launches/goal-3178-build-shared-evaluation-kit at commit 45e7563d1a29ffca9d608fdf60c90bf2624d2d01 (setup_fast.sh --platform linux-x86_64, with --cache and --scratch under test/scratch/; engine_eval.py compiles a strategy with solc 0.8.24, optimizer 200 runs, viaIR, paris, and runs it on the pinned engine against the 30 bps VanillaStrategy, giving edge and afterSwap peak gas per seed).\n\nGate T: the tables mktables.py decodes from the new source equal those it decodes from QLX5 plus the delta, on every node of the five tables, and everything else it decodes is equal.\nGate F: on seeds 9700000..9700003 run the port with the new tables and replay every callback it makes through the compiled new contract; both fee values must be equal on every callback: 0 mismatches. Control: the same for unchanged QLX5 with its own tables, also 0.\nCross-check: on those four seeds the port's edge with the new tables against the edge of the harness sim run with the delta (the `harness` field of join_url holds patch_zb64, base64(zlib(tar)), to lay over the replica https://api.imd.fun/artifacts/a1eef2f3dbbcbc7a1de9d15a2b22d1d25ac6d316a72efde67275b5d5a16ab16b): largest absolute difference.\n\nWrite result.json, one JSON object: credit; gates: an object with T and F, each \"pass\" or \"fail\"; t_mismatches; f: per seed, callbacks and fee_mismatches; f_control: the same for QLX5; sim_vs_port_max_abs_diff; code_zb64, source_sha256, join_url as handed; gain_vs_base, se, n, seeds: the input's figures, as handed; advance: true when T and F pass and the control is clean; notes: the first mismatch if any (seed, callback index, both values).",
   "items": [
    {
     "key": "c",
     "vars": {}
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "requires": {
    "platform": [
     "linux-x64"
    ],
    "minCpus": 8
   },
   "after": {
    "batch": "t2-sol",
    "pairing": "item",
    "check": {
     "path": "advance",
     "equals": true
    }
   }
  },
  {
   "name": "t2-gas",
   "brief": "One item: gate G for a corrected QLX5 contract (a fee strategy for the Paradigm AMM puzzle): gas and size on the real engine. Credit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file you write and in the result's `credit`.\n\nYour input {{after.result}} (also among your files) has code_zb64 (base64(zlib(Solidity source))) and source_sha256; check the source against that hash. Base: field code_zb64.QLX5 (base64(zlib(source))) of https://api.imd.fun/artifacts/1ef80bfb6d6791b877b1f4048a5e63cf2ae54153e6e8763ae3f8ab13132dfb15, sha256 e183e5bc3fb794b7067703b10a7da9920267aa5f4caa968e16ca101b02338f40. Engine: the kit, github.com/identity-md-launches/goal-3178-build-shared-evaluation-kit at commit 45e7563d1a29ffca9d608fdf60c90bf2624d2d01 (setup_fast.sh --platform linux-x86_64, with --cache and --scratch under test/scratch/; engine_eval.py compiles a strategy with solc 0.8.24, optimizer 200 runs, viaIR, paris, and runs it on the pinned engine against the 30 bps VanillaStrategy, giving edge and afterSwap peak gas per seed). Work under test/scratch/.\n\nRun the new contract and unchanged QLX5 on the kit's screening seeds 9700000..9700127, and no other engine seed.\nGate G passes when the new contract has 0 out-of-gas, 0 reverted or failed callbacks, afterSwap peak gas <= 245,000, source <= 50,000 characters and deployed runtime <= 24,576 bytes.\n\nWrite result.json, one JSON object: credit; gates: an object with G, \"pass\" or \"fail\"; peak_gas; oog; failed; source_chars; runtime_bytes; base_peak_gas; gain_vs_base: mean over these seeds of new edge minus QLX5 edge; se; n; seeds; code_zb64 and source_sha256 as handed; advance: true when G passes; notes.",
   "items": [
    {
     "key": "c",
     "vars": {}
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "requires": {
    "platform": [
     "linux-x64"
    ],
    "minCpus": 8
   },
   "after": {
    "batch": "t2-tf",
    "pairing": "item",
    "check": {
     "path": "advance",
     "equals": true
    }
   }
  },
  {
   "name": "t2-engine",
   "brief": "One item: run the real engine on fresh seeds {{first}}..{{last}}: a corrected QLX5 contract against QLX5 (fee strategies for the Paradigm AMM puzzle). Credit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file you write and in the result's `credit`.\n\nAmong your inputs is the result of batch {{after.batch}}: code_zb64 (base64(zlib(Solidity source)), the candidate), source_sha256, advance. If advance is not true, write advance false and stop without running a seed. Base: field code_zb64.QLX5 (base64(zlib(source))) of https://api.imd.fun/artifacts/1ef80bfb6d6791b877b1f4048a5e63cf2ae54153e6e8763ae3f8ab13132dfb15, sha256 e183e5bc3fb794b7067703b10a7da9920267aa5f4caa968e16ca101b02338f40. Engine: the kit, github.com/identity-md-launches/goal-3178-build-shared-evaluation-kit at commit 45e7563d1a29ffca9d608fdf60c90bf2624d2d01 (setup_fast.sh --platform linux-x86_64, with --cache and --scratch under test/scratch/; engine_eval.py compiles a strategy with solc 0.8.24, optimizer 200 runs, viaIR, paris, and runs it on the pinned engine against the 30 bps VanillaStrategy, giving edge and afterSwap peak gas per seed). engine_eval.py admits only seeds 9700000..9700511: work from a copy under test/scratch/ whose seed check admits exactly {{first}}..{{last}}, and change nothing else in it (configs as the kit builds them).\n\nRun both contracts on each seed, in seed order; per seed d = candidate edge - QLX5 edge. After the first 128 seeds compute the mean and se (sd of d / sqrt(n)): when mean + 2 se < 0.04, stop there. Otherwise run all 256. Run no seed outside the block, and these seeds for nothing else.\n\nWrite result.json, one JSON object: credit; block: [{{first}}, {{last}}]; seeds: first and last seed run; n; gain_vs_base: mean of d; se; stopped_early; peak_gas: the candidate's largest afterSwap gas; oog: its out-of-gas count; failed: reverted or failed callbacks; base_peak_gas; base_mean_edge; candidate_mean_edge; rows_zb64: base64(zlib(csv)) with header seed,QLX5,candidate and unrounded edges; source_sha256: the candidate's; advance: true when all 256 seeds ran, oog and failed are 0, peak_gas <= 245,000 and gain_vs_base > 0; notes.",
   "items": [
    {
     "key": "b0",
     "vars": {
      "first": "10400000",
      "last": "10400255"
     }
    },
    {
     "key": "b1",
     "vars": {
      "first": "10400256",
      "last": "10400511"
     }
    },
    {
     "key": "b2",
     "vars": {
      "first": "10400512",
      "last": "10400767"
     }
    },
    {
     "key": "b3",
     "vars": {
      "first": "10400768",
      "last": "10401023"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "requires": {
    "platform": [
     "linux-x64"
    ],
    "minCpus": 8
   },
   "after": {
    "batch": "t2-gas",
    "pairing": "batch",
    "check": {
     "path": "advance",
     "equals": true
    }
   }
  },
  {
   "name": "t2-kit",
   "brief": "One item: prove the checking tools on unchanged QLX5 (a fee strategy for the Paradigm AMM puzzle) before a corrected contract exists. Credit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file you write and in the result's `credit`.\n\nQLX5 source: field code_zb64.QLX5 (base64(zlib(source))) of https://api.imd.fun/artifacts/1ef80bfb6d6791b877b1f4048a5e63cf2ae54153e6e8763ae3f8ab13132dfb15, sha256 e183e5bc3fb794b7067703b10a7da9920267aa5f4caa968e16ca101b02338f40. Engine and compiler: the kit, github.com/identity-md-launches/goal-3178-build-shared-evaluation-kit at commit 45e7563d1a29ffca9d608fdf60c90bf2624d2d01 (setup_fast.sh --platform linux-x86_64, with --cache and --scratch under test/scratch/; engine_eval.py compiles a strategy with solc 0.8.24, optimizer 200 runs, viaIR, paris, and runs it on the pinned engine against the 30 bps VanillaStrategy, giving edge and afterSwap peak gas per seed). Python reference port: https://api.imd.fun/artifacts/60dc237fa0a4d42f3b6e2d2bed61c1a2df08d27c31ccd95cce508ee9c8689de4 (code_zb64 is base64(zlib(tar)), folder qlxcore: qlxcore.py, the integer policy; mktables.py, which decodes the tables out of a contract source; evmdiff.py, which replays callbacks through the compiled contract in pyrevm). Work under test/scratch/.\n\nDo:\n1. Compile QLX5: source characters, deployed runtime bytes and runtime sha256 (expected 47,230; 22,440; 903a0cf860910022916e7c16aa1ffcfb94b0db9e25074665947d786615a44ae8).\n2. Engine on the kit's screening seeds 9700000..9700127, and no other engine seed: mean edge, afterSwap peak gas, out-of-gas count, reverted or failed callbacks.\n3. Fee replay: on seeds 9700000..9700003 run the port (tables from mktables.py on the QLX5 source) and replay every callback it makes through the compiled contract; per seed the callbacks and the fee mismatches (0 expected).\n4. Port against engine: on those four seeds, the largest absolute difference between the port's edge and the engine's.\n5. The seconds each of setup, compile, engine and replay took, and what a later item must do differently to make these tools work.\n\nWrite result.json, one JSON object: credit; compile: source_chars, runtime_bytes, runtime_sha256; engine: n, seeds, mean_edge, peak_gas, oog, failed; replay: per seed, callbacks and fee_mismatches; port_vs_engine_max_abs_diff; seconds; gain_vs_base 0 and se 0 (QLX5 against itself: nothing is compared), n 128, seeds [9700000, 9700127]; peak_gas; oog; source_sha256: of the source you compiled; advance: true when the sizes match, oog and failed are 0 and the replay has 0 mismatches; recipe: the steps a later item should follow, in your words, at most 1,500 characters; notes.",
   "items": [
    {
     "key": "k",
     "vars": {}
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 32000
   },
   "requires": {
    "platform": [
     "linux-x64"
    ],
    "minCpus": 8
   }
  }
 ],
 "read": [
  "t2-harness/h",
  "t2-map/t0",
  "t2-map/t1a",
  "t2-map/t1b",
  "t2-map/t3a",
  "t2-map/t3b",
  "t2-es/t0",
  "t2-es/t1a",
  "t2-es/t1b",
  "t2-es/t3a",
  "t2-es/t3b",
  "t2-join/c",
  "t2-sol/c",
  "t2-tf/c",
  "t2-gas/c",
  "t2-engine/b0",
  "t2-engine/b1",
  "t2-engine/b2",
  "t2-engine/b3",
  "t2-kit/k"
 ],
 "cancel": [],
 "wake": {
  "batches": [
   "t2-engine"
  ],
  "afterMinutes": 480
 },
 "finish": false
}
