{
 "notes": "Credit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file.\nEPISODE 2 of 3. Episode 3 is the last: read, judge, set finish true. Items: 6 used + 3 spawned now = 9 of 24.\n\nROUND 1 AS READ (4 of 6 results; own edge per 10,000-step run, paired by seed with QLX5 e183e5bc3fb794b7067703b10a7da9920267aa5f4caa968e16ca101b02338f40, replica only, no engine runs):\n- fair-price (r1-oracle-ceilings/fair-price; also served at https://api.imd.fun/artifacts/c9ac833b4a6837bf0bd56fc2c4b931ef58d34dc98a000278ee4cec091fb216ee, fetched, sha256 equal): true current price at every own callback (m := ln P, v := 0 before the rival clipping): +1.4566139111 se 0.0133062, n 2048 (10000..12047), mean - 2 se 1.4300, advance TRUE. Choose 64000..65023: +1.4929 se 0.0193. It reports oracle-off bit-equal on 3,072 runs and exogenous draws unchanged. I did not recompute its per-seed deltas myself. It is a fixed-QLX5 sensitivity, not a universal bound: the best policy given the price is unknown and could be higher.\n- next-trade: next retail order's side and size, searched 3-coefficient fee adapter (+5+17z bps on the predicted side, -11 bps opposite): +55.742 se 0.240, n 2048, advance true by the gate. It is foresight of a future draw; the requester rules it not usable. No round 2 for it.\n- retail-law: true lambda, mu, tau put in QLX5's retail likelihood: +0.00057 se 0.00719, n 128 (10000..10127), early stop (mean + 2 se 0.0150 < 0.08), advance false. Closed: excludes this substitution, not every use of the law.\n- engine-behaviours (r1-routing-audit; engine source read at github.com/benedictbrady/amm-challenge@6b6921f8d463314aa7c96234e1be25a25245f704 amm_sim_rs): terminal-step fee oracle +0.003894 se 0.001105, n 128, early stop; relaxed analytic cap on any terminal-step policy 0.0264 (se 0.0070, upper 0.040); terminal pnl is not scored (0); rounding and fixed-path dust small, a dynamic dust policy unmeasured. advance false. Closed.\n- NOT YET IN: two items of r1-oracle-ceilings were still running (true run volatility; the full-information bound). Their results are handed when accepted. Report them in the write-up; spawn nothing for them (requester's note). A full-information number is an achieved lower bound of a future-knowing policy, not usable headroom, unless its information is callback-visible. If either never lands, say unmeasured, not zero.\n- goal.json flags the sources of fair-price, retail-law and engine-behaviours (sources.flagged) and does not say why. Their figures are local replica runs with self-reported passing controls, not cited claims; round 2 reproduces the fair-price ceiling as a control. Say this in the write-up.\n- The 0.1187 standings gap (528.452 - 528.3333) is context, not a paired-seed gain: no item's gain is an estimate of leaderboard gain; do not add sources.\n\nREQUESTER NOTE 1 (2026-11-11, followed): the lead is the fair price. One deciding measurement, nothing else until it lands: how much of +1.4566 is inferable from what a strategy observes, by an exact posterior (particle filter or exact grid) fed to QLX5 in place of its Gaussian filter, plus the filter gap (RMSE in bps of QLX5's estimate and of the posterior against the true price, at arb and retail callbacks). Only if the exact posterior gains >= +0.15 on report seeds: one item sketching the cheapest approximation within the contract limits (<= 50,000 characters, afterSwap peak gas <= 245,000) with its capture. Otherwise state that the fair-price headroom is irreducible and close the goal.\n\nDECIDED THIS EPISODE:\n1. r2-exact-posterior, 2 items, the one deciding measurement made twice, by the two methods the requester named (keys particle, grid). Twice because episode 3 is the last and a single failed item would leave the goal's question open; two methods also check each other. Each reports arm A (headline: the filter knows only the engine's laws and infers the run's parameters), arm B (sensitivity: the run's true volatility and retail parameters given to the filter; this covers the other reading of the requester's words 'the true price process and its parameters as the engine draws them'), the filter gap, fraction_of_ceiling = gain / 1.4566139111071181, and gates.posterior_ge_015 ('pass' only with all 2,048 report seeds, controls passing and gain >= 0.15).\n2. r2-contract-sketch, 1 item (key particle), staged after r2-exact-posterior by item with check gates.posterior_ge_015 == 'pass'. It runs only if the particle item is accepted and passes; otherwise it is cancelled not_run and costs nothing. This is the requester's step 3, staged because no episode remains between the measurement and the end. If the plane refused the stage, the sketch was never run: say so.\nNo Solidity, no engine runs, no submissions anywhere. All items require linux-x64, minCpus 8 (in each batch's requires). To fit 3,000 characters the briefs name base, replica, harness and the fair-price ceiling by full hash and leave out core, the faster build and the two older probe examples: the ceiling result embeds the whole replica with the belief hook.\n\nEPISODE 3, IN ORDER:\na. Validate each r2-exact-posterior result before believing it: hook-off equals QLX5 exactly; the truth-fed control reproduces the ceiling (mean 1.472416081754699 on 10000..10127, 1.4566139111 on all 2,048); the filter used no seed, RNG state, true price, true labels, rival reserves or drawn parameters in arm A; calibration reported; tuned on 64000..65023 only; n and stop history honest (an early stop at mean + 2 se < 0.08 is a valid 'below 0.15' answer with its actual n). Compare particle and grid: they should agree within about 2 se; if not, the one with the weaker approximation of the rival state or of the arb inversion is the less exact, and the disagreement is a finding.\nb. If the valid exact-posterior gain is < 0.15: conclude as the requester asks: the fair-price headroom is irreducible for a strategy (the +1.46 is price information its callbacks do not carry), give the fraction captured, the filter gap by callback type, and arm B to show whether knowing the run's parameters would change that. Close.\nc. If >= 0.15 and the sketch landed: report its gain, fraction of the exact posterior and of the ceiling, estimated gas and characters, fits_limits, as the candidate to build in a later goal; an estimate from operation counts is not a measured gas figure.\nd. If >= 0.15 on grid only, or the sketch failed or was not run: report the measurement, say the sketch is missing and why; recommend it as the next step, without guessing its capture.\ne. If both r2 items failed: the question is unanswered; say so plainly, report round 1, do not call the headroom zero or irreducible.\nThen finish true. The write-up ranks the sources of the gap with their ceilings: fair price (+1.4566 with truth; the inferable part from round 2), next trade (+55.7, foresight, unusable), volatility and full information (as landed), retail law (+0.0006, closed), engine behaviours (+0.004, closed), with n, se and the limits of each (replica sensitivities, restricted adapters, early-stopped n, mean +/- 2 se is a screen and not a sequential confidence interval). Settled topics in the objective are not repeated.\n",
 "spawn": [
  {
   "name": "r2-exact-posterior",
   "brief": "Credit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file.\nOne research item, under 1h, replica only, caches under test/scratch/. No Solidity, engine runs or submissions; no gas or size limit.\nArtifacts, https://api.imd.fun/artifacts/<id>: base 1ef80bfb6d6791b877b1f4048a5e63cf2ae54153e6e8763ae3f8ab13132dfb15 (code_zb64.QLX5, sha256 e183e5bc3fb794b7067703b10a7da9920267aa5f4caa968e16ca101b02338f40); replica a1eef2f3dbbcbc7a1de9d15a2b22d1d25ac6d316a72efde67275b5d5a16ab16b; harness (score.py) 9ad960e6c7e11509b81f2852f7f34d395425adc226141b0bc828ed6f5f344663; ceiling c9ac833b4a6837bf0bd56fc2c4b931ef58d34dc98a000278ee4cec091fb216ee (QLX5 fed the true fair price at each own callback: +1.4566139111071181, se 0.0133, n 2048; its reproduce.source_lzma_b85 is the replica with a hook setting QLX5's belief m, v).\nDo: measure how much of that gain a strategy can infer. Compute the exact Bayesian posterior of the fair price at each own callback, as {{method}}. Inputs: only what QLX5's callbacks receive (side, amounts, own reserves, timestamps, own fees) and the engine's laws as the replica codes them: the price process and the law of its parameters, exact arbitrage sizing (an arb fill pins the price, a step without one bounds it), the retail law, the router split, the 30 bps rival. Never the seed, RNG state, true price, true labels, rival reserves, the run's drawn parameters or the future.\nArms, paired by seed with unchanged QLX5. A: QLX5 with m := posterior mean of ln price and v := posterior variance replacing its Gaussian filter, all else unchanged. B: A with the run's true volatility and retail parameters given to the filter.\nFilter gap, on unchanged QLX5's trajectory with the posterior run passively: RMSE in bps against the true price of QLX5's m and of the posterior mean, over all, arb and retail own callbacks.\nSeeds: tune on 64000..65023, freeze; report 10000..12047 with score.py --bar 0.08 at n = 128, 256, 512, 1024, 2048, stopping when mean + 2 se < 0.08.\nControls: hook off equals QLX5 exactly; true price with v = 0 through your hook gives the ceiling's 1.472416081754699 on 10000..10127; exogenous draws unchanged; posterior coverage of the true price.\nResult: one JSON object: gain_vs_base, se, n, seeds, source_sha256, base_source_sha256, advance (true only when n = 2048 and mean - 2 se >= 0.08), fraction_of_ceiling (gain_vs_base / 1.4566139111071181), arm_b {gain_vs_base, se, n}, filter_gap {qlx5_rmse_bps, posterior_rmse_bps, each {all, arb, retail}}, gates {posterior_ge_015: \"pass\" only when arm A ran all 2,048 report seeds, controls pass and gain_vs_base >= 0.15, else \"fail\"}, approximations, stop history, controls, limitations, per-seed deltas, source to reproduce offline.",
   "items": [
    {
     "key": "particle",
     "vars": {
      "method": "a particle filter over the fair price, the run's unknown parameters and the rival's reserves, inverting arb fills exactly"
     }
    },
    {
     "key": "grid",
     "vars": {
      "method": "a grid (forward filter) posterior over log fair price and the run's unknown parameters, the rival's reserves marginalised, refined until stable"
     }
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "requires": {
    "platform": [
     "linux-x64"
    ],
    "minCpus": 8
   }
  },
  {
   "name": "r2-contract-sketch",
   "brief": "Credit Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved, in every file.\nOne research item, under 1h, replica only, caches under test/scratch/. No Solidity, engine runs or submissions.\nArtifacts, https://api.imd.fun/artifacts/<id>: base 1ef80bfb6d6791b877b1f4048a5e63cf2ae54153e6e8763ae3f8ab13132dfb15 (code_zb64.QLX5, sha256 e183e5bc3fb794b7067703b10a7da9920267aa5f4caa968e16ca101b02338f40); replica a1eef2f3dbbcbc7a1de9d15a2b22d1d25ac6d316a72efde67275b5d5a16ab16b; harness (score.py) 9ad960e6c7e11509b81f2852f7f34d395425adc226141b0bc828ed6f5f344663; ceiling c9ac833b4a6837bf0bd56fc2c4b931ef58d34dc98a000278ee4cec091fb216ee (QLX5 fed the true fair price at each own callback: +1.4566139111071181, se 0.0133, n 2048).\nParent: {{after.result}} (item {{after.key}} of {{after.batch}}): the exact posterior of the fair price from callback-visible data, fed to QLX5 in place of its Gaussian filter, gained at least +0.15 over QLX5 on the report seeds. Read its gain_vs_base, filter_gap, approximations and source.\nDo: sketch the cheapest approximation of that posterior a contract could run, and estimate how much of the parent's gain it keeps. Contract limits: source at most 50,000 characters (QLX5 is 47,230: say what the sketch replaces), afterSwap peak gas at most 245,000. Write it as replica policy code in QLX5's integer WAD arithmetic, fixed-size state, callback-visible inputs only (no seed, true price, true labels, rival reserves, run parameters or future draws). Estimate gas from operation counts (storage reads and writes, mul/div, ln/exp calls, loop lengths) with the unit costs you assume, and characters from the code's size.\nMeasure, paired by seed with unchanged QLX5: tune on 64000..65023, freeze; report 10000..12047 with score.py --bar 0.08 at n = 128, 256, 512, 1024, 2048, stopping when mean + 2 se < 0.08. Controls: sketch off equals QLX5 exactly; exogenous draws unchanged.\nResult: one JSON object: gain_vs_base, se, n, seeds, source_sha256, base_source_sha256, advance (true only when n = 2048 and mean - 2 se >= 0.08), parent {url, gain_vs_base, se}, fraction_of_exact_posterior (gain_vs_base / parent gain), fraction_of_ceiling (gain_vs_base / 1.4566139111071181), sketch_rmse_bps {all, arb, retail}, estimated_gas {afterSwap_peak, operation counts, unit costs}, estimated_characters, fits_limits (true, false or \"unknown\", and why), the approximation described so a builder could implement it, what of the parent it drops, stop history, controls, limitations, per-seed deltas, source to reproduce offline.",
   "items": [
    {
     "key": "particle",
     "vars": {}
    }
   ],
   "output": {
    "format": "json",
    "maxBytes": 64000
   },
   "requires": {
    "platform": [
     "linux-x64"
    ],
    "minCpus": 8
   },
   "after": {
    "batch": "r2-exact-posterior",
    "pairing": "item",
    "when": "accepted",
    "check": {
     "path": "gates.posterior_ge_015",
     "equals": "pass"
    }
   }
  }
 ],
 "read": [
  "r2-exact-posterior/particle",
  "r2-exact-posterior/grid",
  "r2-contract-sketch/particle"
 ],
 "cancel": [],
 "wake": {
  "batches": [
   "r1-oracle-ceilings",
   "r2-exact-posterior",
   "r2-contract-sketch"
  ],
  "afterMinutes": 600
 },
 "finish": false
}
