{
 "notes": "EPISODE 9 (2026-11-07). STATE: round 4 (31 items, r4-d1/d2/d3/f1/f2/s1/m1, NP deltas vs NP on 800000..801999) has NOT STARTED: all waiting, none running; r4-trunk (code, best/** = NP) waiting. Round 3: 18 still running (r3-d1 x3, r3-d2 x4, r3-d3 x4, r3-f1/post-arb-pair, r3-f2/th-pia, r3-m1 ch-replicate/ch-calib/ch-repo-scan). Handed 2: r3-m1/pub-scan, r3-d2/tune-tox (below). Nothing measured vs NP yet: NO PROMOTION 4, round 4 unscored (round 3 promoted: stop rule untouched). BEST = NP. Ep9's first attempt was rejected invalid_output (brief over 3000 chars, notes over 8000); this one spawns ONE batch of 4 items (vars key+task, brief ~2950 filled).\n\nDECIDED (4 items, 124 of 600 used): r5-pri = the requester's 04:55Z priority, scheduled nowhere else at 4000 seeds: NP2 = CH + edit A (norm-phat) + edit B (two-print re-specified exactly: slot 11 = previous print's direction in the step; later-print alpha 0.12 when the direction repeats, else 0.06), both edits pasted verbatim. combo-fresh-a/b: NP2 vs NP and vs CH on 1000000..1001999 and 1002000..1003999 (ep9 fresh block; pool to n 4000 only if both code_sha256 agree: mean of means, se = sqrt(se_a^2+se_b^2)/2). combo-calib-a/b: NP2 on 900000..904999 and 905000..909999 (pool: mean = (sum_a+sum_b)/10000, se from pooled sumsq). Each item also scores NP on 0..999 (must be 526.0337302497852) and NP2 on 0..999. r4-d2/np-two (original two-print code 6f23c204, 800000..801999) is an independent estimate. Wake: r5-pri and r4-m1 settle, or 600 min. Read = 30: r5-pri x4, r4-m1 x3, r3-m1 x3, r4-d2 x5, r4-d1 x5, r4-d3 x4, r4-f1 x4, r4-f2 th-killed + edge-base.\n\nSCOREBOARD (paired, n 2000 unless said; runs are bit-reproducible across machines):\n- BEST, promotion 3 (ep8): NP = CH + 9 lines inserted right before `uint256 tradeRatio = ...`: `if(!firstInStep&&feeUsed>30*BPS&&gamma>0){uint256 nS=trade.isBuy?wdiv(wmul(spot,gamma),WAD-30*BPS):wdiv(wmul(spot,WAD-30*BPS),gamma);pHat=wmul(pHat,9*WAD/10)+wmul(nS,WAD/10);}` (a later-in-step print reveals the 30 bps pool's spot through the router's equal marginal prices; blend 0.1 into pHat). sha256 f1ea5b95c853ef28399a0b22ec222773525dba18c92282c04993170c97b57c83 (r3-f1/norm-phat). vs CH on 600000..601999: +0.4645 se 0.0159 (worst -4.58 seed 601271). 0..999 = 526.0337302497852 (se 2.79). Calibration pending (r4-m1/calib-a+b). Slots 0-10 used.\n- Promotion 2 (ep6): CH = github.com/ChengHua926/amm-challenge commit d34a5199c59a4c44d5336a25f1436b4ae1f21104 contracts/src/Strategy.sol (raw.githubusercontent.com path), sha256 6dd68f77a70900319460215374143dbd5d924198450a46d9f5f91f6b1e3d35c3; vs YQ on 400000..401999 +0.962 se 0.021 (worst -4.28 seed 401412); 0..999 = 525.525882178 (se 2.789); direct vs StarterStrategy on 600000..601999 +155.80 se 0.909 (tune-tox; starter 368.82 there). Calibration pending (r3-m1/ch-calib).\n- Promotion 1 (ep4): YQ = github.com/jiayaoqijia/amm-challenge-yq commit 3e9dc7d5a6192c88b562a0f8d9c172ca566ec94d contracts/src/Strategy.sol, sha256 00fae418c49cd681ad0879c6f96ebed0163fab5a660b38030f11e6947a39afd4; vs StarterStrategy (50 bps, sha 8f2cea33) on 100000..101999 +154.69 se 0.95 (worst +74.78 seed 101573), on 500000..501999 +154.95 se 0.94; 0..999 = 524.6271111458843; calibration 522.520303864629 se 0.917.\n- Chain NP over starter = 154.69 + 0.962 + 0.4645 = +156.12, se 0.95 (root of summed squares); prefer r4-m1/replicate's direct number if it lands.\n- Positive, unpromoted: two-print (CH + same-direction second print alpha 0.12, sha 6f23c204) +0.248 se 0.013 vs CH on 600000..601999, 0..999 525.777; combined with NP in r5-pri and r4-d2/np-two.\n- NEW ep9. r3-m1/pub-scan (13 public files, each vs CH): none beats CH. houseofjiao/amm-challenge 4f41eb91 (sha 07d5510d) -0.006 se 0.024 on 600000..601999 (a CH twin); 0xniki 56ca9d16 -1.317 se 0.033; The-CTra1n cd1bf7bc -2.913 se 0.043; eliizabethzhang 7156ff03 -17.73 se 0.37; eight others from -5.8 (atvinicius) to -207 (giorgoschionas 25 bps), n 200. New write-up: Algebra Finance, LinkedIn pulse \"amm-fee-challenge-notes-from-our-run-optimization-arena-qe3ff\" (2026-03-27): long-term sigma/flow/arb-probability/normalizer estimates plus short-term pool signals, asymmetric fees, probabilistic within-step ordering; no code. r3-d2/tune-tox (six toxicity constants at +-10/25 %, 500 seeds per cell): nothing clears 2 se; CH's toxicity block is a local optimum (TOX_QUAD -25 % -0.17, TOX_DECAY +25 % -1.0); gas max 185532 of 250000.\n- Earlier: vs CH ablate +0.0014, gate-grid -0.014, kalman-gate -0.211; vs YQ kalman +0.196, tune-decay +0.182 (n 1200), ablate +0.019, tune-asym -0.010, losers to -305; round 1 vs starter router-optimal +149.46, flow-estimate +124.42, fixed 75/75 +10.61 se 0.16, r1x edge-max +147.19; public shl0k28 -0.177 se 0.298 vs YQ, dipankar -232.88 and -5.05.\n- CALIBRATION (900000..909999, report-only): vanilla 342.26191722896806 se 0.5176; starter 367.91606344584477 se 0.5900; YQ 522.520303864629 se 0.917; CH, NP, NP2 pending (expect ~523.5 / ~524; 0..999 runs ~2.1 above). None of 525/527/528 reached.\n- BOARD MAP (official API, 743 entries): board = local 0..999 minus 0.7-3.7 (30 bps 338.60 / 342.26; Starter 367.18 / 367.92; Fixed75 378.94 / 380.1; YQ 523.21 / 524.63). 1st 528.40 needs ~529.5-530 local = +3.5 over NP: out of this goal's reach. Requester submits at +0.8 over CH on 4000 fresh seeds (NP +0.46; NP2 maybe ~+0.7 if additive) or +2 over YQ with a change of ours (NP +1.43).\n\nNEXT EPISODE (10, THE LAST): set finish = true and write up; spawn nothing. 1) Read everything handed; drop any item with paired.n 0 or under 500 (unmeasured). PROMOTION 4 = largest mean_diff >= 2 se with n >= 2000 vs NP: NP2 (r5-pri, pooled only if shas agree, else each item alone), np-two, or any r4 delta on 800000..801999; if two different deltas clear, the best file is one that was measured, never an untested union; if nothing landed, the best stays NP. 2) Write-up: the best Strategy.sol in full (rebuild from CH's URL + the edits; a rebuilt NP matches by its 0..999 score 526.0337302497852, by sha only if formatted identically: say so); paired gain over the starter (direct from r4-m1/replicate, else the chain) and over the previous best, with se, n, worst; ranked promotions table (YQ +154.69 se 0.95 vs starter; CH +0.962 se 0.021 vs YQ; NP +0.4645 se 0.0159 vs CH; a 4th if promoted); calibration numbers and the board map with the 525/527/528 statement; the candidate scoreboard (pub-scan table, tune-tox's null); methods (seeds, pairing, 2 se rule, tuning vs fresh blocks, calibration never used to choose); the setup-script deviation (briefs carried a compressed same-step version of the requester's 04:44Z script, Linux x86_64 only, uv venv --python 3.12; r5-pri's uses the requester's ziglang fallback as cc instead of micromamba gcc); what is missing (round 4 if still unmeasured; 1st not reached); citations: YQ, ChengHua, houseofjiao, shl0k28, dipankar, eliizabethzhang, 0xniki, The-CTra1n repos; Algebra medium post and LinkedIn pulse; Bruno I. LinkedIn; HackMD note; paradigm.xyz/puzzles/amm + leaderboard API; benedictbrady/amm-challenge 6b6921f8.\n\nCARRIED FORWARD: `amm-match run --simulations N` = seeds 0..N-1 (numpy default_rng(seed) draws size, rate, sigma; Rust price seed = seed, retail seed+1); other ranges via amm_sim_rs.run_batch. Tune only on 0..99999; promote only at >= 2 se, n >= 2000, on a fresh block. Rules: `contract Strategy is AMMStrategyBase`, imports ./AMMStrategyBase.sol + ./IAMMStrategy.sol only, slots 0..31, 250000 gas, solc 0.8.24 viaIR, max fee 10 %, no loops over history. Simulator: 10000 steps; GBM sigma U(0.000882,0.001008); an arb each step leaves spot at the band edge; Poisson(U(0.6,1.0)) retail split by the router between us and the fixed 30 bps pool. Never ask a worker about its machine (ep2 refusal); every placeholder needs a var in every item (ep7); brief <= 3000 chars filled, notes <= 8000 (ep9). Trunk: github.com/identity-md-launches/goal-3094-take-network-1st-paradigm-s (r1 merged 5527a7f0).",
 "spawn": [
  {
   "name": "r5-pri",
   "brief": "R5 {{key}}: measure NP2 = CH + norm-phat + two-print; no tuning. Clone github.com/benedictbrady/amm-challenge at 6b6921f8d463314aa7c96234e1be25a25245f704 (never /tmp); save this as scratch/setup.sh, run `sh scratch/setup.sh` once at the checkout root, and prefix each later command with `. scratch/env.sh && `:\nset -eu;R=$PWD/scratch;mkdir -p $R/tmp $R/bin $R/solcx\necho \"export TMPDIR=$R/tmp UV_CACHE_DIR=$R/uvc UV_PYTHON_INSTALL_DIR=$R/uvpy RUSTUP_HOME=$R/rustup CARGO_HOME=$R/cargo SOLCX_BINARY_PATH=$R/solcx VIRTUAL_ENV=$PWD/.venv PATH=$PWD/.venv/bin:$R/bin:$R/cargo/bin:\\$PATH\">$R/env.sh;. $R/env.sh\n[ \"$(uname -sm)\" = \"Linux x86_64\" ] && [ -e /proc/self/exe ] || { echo BLOCKED;exit 3; }\nT=x86_64-unknown-linux-gnu\ncommand -v uv >/dev/null || { curl -LsSf https://github.com/astral-sh/uv/releases/latest/download/uv-$T.tar.gz|tar -xz -C $R/tmp;cp $R/tmp/uv-$T/uv $R/bin; }\nuv venv --python 3.12 .venv;uv pip install -e . maturin\ncc --version >/dev/null 2>&1 || { uv pip install ziglang;printf '#!/bin/sh\\nexec python -m ziglang cc \"$@\"\\n'>$R/bin/cc;chmod +x $R/bin/cc; }\ncommand -v cargo >/dev/null || curl -sSf https://sh.rustup.rs|sh -s -- -y --profile minimal --no-modify-path\nmaturin develop --release --uv --manifest-path amm_sim_rs/Cargo.toml\namm-match validate contracts/src/StarterStrategy.sol&&echo TOOLCHAIN OK\nIf it prints BLOCKED or fails, return {\"blocked\":\"<line and output>\"}, every n 0.\nCH = raw.githubusercontent.com/ChengHua926/amm-challenge/d34a5199c59a4c44d5336a25f1436b4ae1f21104/contracts/src/Strategy.sol (sha256 starts 6dd68f77a7090031). NP = CH + A. NP2 = CH + A + B. Verbatim, nothing else. A, before the line `uint256 tradeRatio = ...`: `if(!firstInStep&&feeUsed>30*BPS&&gamma>0){uint256 nS=trade.isBuy?wdiv(wmul(spot,gamma),WAD-30*BPS):wdiv(wmul(spot,WAD-30*BPS),gamma);pHat=wmul(pHat,9*WAD/10)+wmul(nS,WAD/10);}`. B: `uint256 alpha = firstInStep ? PHAT_ALPHA : PHAT_ALPHA_RETAIL;` becomes `uint256 alpha = firstInStep ? PHAT_ALPHA : (slots[11] == (trade.isBuy ? 1 : 2) ? 120000000000000000 : PHAT_ALPHA_RETAIL);` plus `slots[11] = trade.isBuy ? 1 : 2;` before `return (bidFee, askFee);`. Validate both; NP on seeds 0..999 must average 526.0337302497852 (say if not).\nTASK: {{task}}\nMEASURE: amm_sim_rs.run_batch with explicit seeds (configs as MatchRunner._build_configs, default config), each file separately vs the unchanged 30 bps VanillaStrategy, chunks <= 100; paired diff = candidate minus reference per seed, se = sd(ddof=1)/sqrt(n), worst = 5 smallest diffs with seeds; 40 min cap per run, n = covered prefix.\nRESULT JSON: {approach, tried, next, code (NP2 .sol), code_sha256, np_sha256, np_score_0_999, score{seed_start,n,mean_edge,se}, paired[{reference,seed_start,n,mean_diff,se,worst}], calibration{seed_start,n,mean,se,sum,sumsq,first10}|null, seconds_per_simulation, blocked, citations}.",
   "items": [
    {
     "key": "combo-fresh-a",
     "vars": {
      "key": "combo-fresh-a",
      "task": "NP2 vs NP and NP2 vs CH paired on seeds 1000000..1001999 (n 2000, same NP2 edges), and NP2 on 0..999. calibration null."
     }
    },
    {
     "key": "combo-fresh-b",
     "vars": {
      "key": "combo-fresh-b",
      "task": "NP2 vs NP and NP2 vs CH paired on seeds 1002000..1003999 (n 2000, same NP2 edges), and NP2 on 0..999. calibration null."
     }
    },
    {
     "key": "combo-calib-a",
     "vars": {
      "key": "combo-calib-a",
      "task": "NP2 calibration on seeds 900000..904999 (n 5000): mean, se, sum, sumsq, first10; and NP2 on 0..999. paired []."
     }
    },
    {
     "key": "combo-calib-b",
     "vars": {
      "key": "combo-calib-b",
      "task": "NP2 calibration on seeds 905000..909999 (n 5000): mean, se, sum, sumsq, first10; and NP2 on 0..999. paired []."
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "merge": {
    "groupSize": 20,
    "brief": "Merge into one table: one row per item with key, task, np2 code_sha256, np_sha256, np_score_0_999, score, each paired comparison (reference, seed_start, n, mean_diff, se, worst), calibration (seed_start, n, mean, se, sum, sumsq), seconds_per_simulation, blocked. Say whether every item's NP2 code_sha256 agrees; if the two fresh items agree, also give the pooled NP2 vs NP and NP2 vs CH mean_diff over 4000 seeds (mean of the two means, se = sqrt(se_a^2+se_b^2)/2) and whether each clears twice its se; if the two calibration items agree, the pooled calibration mean over 10000 seeds = (sum_a+sum_b)/10000 and se from the pooled sumsq. Keep every number as reported."
   }
  }
 ],
 "read": [
  "r5-pri/combo-fresh-a",
  "r5-pri/combo-fresh-b",
  "r5-pri/combo-calib-a",
  "r5-pri/combo-calib-b",
  "r4-m1/replicate",
  "r4-m1/calib-a",
  "r4-m1/calib-b",
  "r3-m1/ch-calib",
  "r3-m1/ch-replicate",
  "r3-m1/ch-repo-scan",
  "r4-d2/np-two",
  "r4-d2/np-sigma",
  "r4-d2/np-alpha",
  "r4-d2/np-lambda",
  "r4-d2/np-move",
  "r4-d1/np-weight",
  "r4-d1/np-size",
  "r4-d1/np-first",
  "r4-d1/np-lowfee",
  "r4-d1/np-nhat",
  "r4-d3/np-attract",
  "r4-d3/np-silence",
  "r4-d3/np-arbreset",
  "r4-d3/np-clip",
  "r4-f1/fill-rate",
  "r4-f1/side-asym",
  "r4-f1/exact-stale",
  "r4-f1/uncensor",
  "r4-f2/th-killed",
  "r4-f2/edge-base"
 ],
 "cancel": [],
 "wake": {
  "batches": [
   "r5-pri",
   "r4-m1"
  ],
  "afterMinutes": 600
 },
 "finish": false
}
