{"approach": "Spread 2 only: reuse the base's guarded, clipped-fill-corrected sell-flow estimator to increase the reserve in busy runs and reduce it in quiet runs. Only the one-cent stock target is scaled. The aim is to acquire busy-run supply near the one-cent crossing and need fewer later purchases above estimated fair value. The prior is 200 exposure steps at 0.6 notional per step; full strength. An equivalent spread-2 handler uses local enum/math constants, reuses prior probability/weight pairs, caches immutable probe actions, and accounts for the fresh ask directly. This performance revision matched every result field across all 1967 tuning, 1987 unseen, and 900 other-spread runs. The trading policy stayed frozen throughout; the revised implementation was pinned before its own replay. FIFO tracing distinguishes unused acquisition cost from edge; broad inventory cuts and expensive-buffer caps were rejected. Discovery uses the first 1000 spread-2 seeds in 8000-15999, validation the remaining 967. Code hashes were pinned before validation was inspected and before unseen scoring. Metrics are local SimulationEngine results. Other-spread equality compares every SimulationResult field. Timing uses the first 200 spread-2 tuning seeds, one process, one warmup per file, alternating execution order; configuration sampling and module loading are excluded.", "blocked": null, "python_version": "3.12.3", "spread": 2, "base_mean_edge": 98.4694596619638, "runs": {"tuning": 1967, "unseen": 1987}, "base_unseen": {"mean_edge": 75.37891657984132, "retail_edge": 102.41461084785999, "arb_edge": -27.035694268030902}, "holdout": {"mean_edge": 75.98643068921318, "retail_edge": 102.70454059778218, "arb_edge": -26.718109908582537, "failures": 0}, "diff": {"mean": 0.6075141093718673, "standard_error": 0.18318063780805277, "retail": 0.28992974992219434, "arb": 0.31758435944836433}, "others_identical": {"runs": 900, "identical": true}, "seconds": {"base": 147.270588504005, "yours": 146.74982495169388}, "code": "\"\"\"Crossing-cover base with isolated, untuned spread overrides.\"\"\"\nimport math\nfrom orderbook_pm_challenge.strategy import BaseStrategy\nfrom orderbook_pm_challenge.types import CancelOrder, PlaceOrder, Side\n\nP = dict(lam_r=0.25, m=5.0, sig_n=1.2, lam_j=0.0019, sig_j=0.35, sig=0.02,\n         qmax=3000.0, rmin=2, kA=0.7, kL=0.15, pL=0.05,\n         ammo=1.0, ydem=0.4, W=200.0, fy=0.6, ammo_q=60.0, ammo_pmax=0.05, ammo_maxpay=0.02,\n         fb=0.9, fu=0.7, xu=0.1, sticky=1.0, min_ahead=2.0, keep_hi=1.5, keep_lo=0.7, Hu=300.0, bins=8.0, filt=1.0, uni=0.01, jumpinfo=1.0, dmin=0.0, kLb=0.08, kLf=0.08, pinf=1.0, pre=0.0, H1=100.0,\n         ydf=0.6, Wf=2000.0, g_hi=0.15, g_lo=0.15, qf=400.0, pmaxf=0.05, pre_gap=1.0,\n         ydf1=0.6, g1=5.0, f1=0.6, a1=100.0, nb1=0.0, gs=1.0, p1t=1.0, m1=1.0, zd=1.0, pfl=0.0005)\nSQ2 = math.sqrt(2.0)\nSQ2PI = math.sqrt(2.0 * math.pi)\ndef cdf(x): return 0.5 * (1.0 + math.erf(x / SQ2))\ndef pdf(x): return math.exp(-0.5 * x * x) / SQ2PI\ndef inv(p):\n    p = min(max(p, 1e-9), 1 - 1e-9)\n    t = math.sqrt(-2.0 * math.log(min(p, 1 - p)))\n    x = t - (2.515517 + 0.802853 * t + 0.010328 * t * t) / (1 + 1.432788 * t + 0.189269 * t * t + 0.001308 * t ** 3)\n    x = -x if p < 0.5 else x\n    for _ in range(2):\n        d = pdf(x)\n        if d < 1e-12:\n            break\n        x -= (cdf(x) - p) / d\n    return x\ndef lpm(k):\n    return pdf(k) + k * cdf(k)\ndef fl(q):\n    return math.floor(q * 100 + 1e-9) / 100\n\nNODES = [(-2.2, .06), (-1.3, .17), (-0.6, .27), (0.6, .27), (1.3, .17), (2.2, .06)]\nPROBE = 0.01\n\n\n_S2_PROBES = None\n\nclass Strategy(BaseStrategy):\n    def __init__(self):\n        self.n = 0\n        self.ahead = set()     # main orders placed strictly ahead of any competitor order at their tick\n        self.res = {}          # order id -> uncovered quantity at placement\n        self.bc = None         # belief: sub-tick grid centres (ticks)\n        self.bw = None         # belief: weights\n        self.st = 0.5          # last one-step sd in ticks\n        self.pcb = self.pca = None\n        self.pb = set()\n        self.pa = set()\n        self.tb = 0\n        self.s = None          # competitor spread parameter\n        self.flow_notional = 0.0\n        self.flow_exposure = 0\n        self.last_ask_tick = None\n        self.last_quote_exposed = False\n        self.last_flow_ca = None\n        self.last_flow_cap = 0.0\n        self.last_flow_correction = 1.0\n        self.params = P.copy()\n\n    def _oid(self, tag):\n        self.n += 1\n        return tag + str(self.n)\n\n    def on_step(self, state):\n        if self.s == 2:\n            return self._s2_step(state)\n        return self._legacy_step(state)\n\n    def _legacy_step(self, state):\n        H = max(1, state.steps_remaining)\n        cb = state.competitor_best_bid_ticks or 0\n        ca = state.competitor_best_ask_ticks or 100\n        if self.s is None:\n            self.s = max(1, (ca - cb + 1) // 2)\n            if self.s == 2:\n                self.params.update(dict(flow_prior=200, flow_level=0.6, flow_strength=1.0, flow_safety=2.0, flow_exposure_min=5.0))\n            if self.s == 1:\n                self.params.update({'dmin': 0.3, 'pfl': 1e-06})\n            if self.s == 3:\n                self.params.update({'flow_prior': 200, 'flow_level': 0.6, 'flow_strength': 1.0, 'flow_safety': 2.0, 'flow_exposure_min': 5.0})\n        P = self.params\n        if self.s in (2, 3) and self.last_quote_exposed and ca <= self.last_flow_ca + 1:\n            self.flow_exposure += 1\n            self.flow_notional += min(self.last_flow_cap, state.sell_filled_quantity * self.last_ask_tick / 100.0) * self.last_flow_correction\n        lo, hi = cb, ca\n        for o in state.own_orders:\n            if o.side is Side.BUY:\n                lo = max(lo, o.price_ticks)\n            else:\n                hi = min(hi, o.price_ticks)\n        if P['pinf'] > 0:\n            sb = {o.price_ticks for o in state.own_orders if o.side is Side.BUY and o.remaining_quantity <= PROBE + 1e-9}\n            sa = {o.price_ticks for o in state.own_orders if o.side is Side.SELL and o.remaining_quantity <= PROBE + 1e-9}\n            ea = self.pa - sa\n            eb = self.pb - sb\n            if sa and ea:\n                lo = max(lo, min(max(ea), hi))\n            if eb and (sb or min(eb) <= P['p1t']):\n                hi = min(hi, max(min(eb), lo))\n        if P['jumpinfo'] > 0 and self.pcb is not None:\n            if ca > self.pca + 1:\n                lo = max(lo, ca - 1)\n            if cb < self.pcb - 1:\n                hi = min(hi, cb + 1)\n        self.pcb, self.pca = cb, ca\n        if lo > hi:\n            lo, hi = hi, lo\n        # sub-tick belief over p_(t-1): predict with one-step noise, truncate to [lo, hi]\n        wid = max(hi - lo, 1e-6)\n        nb = max(2, min(48, int(round(wid * P['bins']))))\n        cs = [lo + (i + 0.5) * wid / nb for i in range(nb)]\n        if self.bc is None or P['filt'] <= 0:\n            ws = [1.0 / nb] * nb\n        else:\n            sg = max(self.st, 0.6 * wid / nb)\n            k = -0.5 / (sg * sg)\n            ws = []\n            uni = P['uni'] * sg\n            if self.s == 2:\n                prior_pairs = tuple(zip(self.bc, self.bw))\n                exp = math.exp\n                for c in cs:\n                    t = uni\n                    for ci, wi in prior_pairs:\n                        d = c - ci\n                        d2 = d * d * k\n                        if d2 > -12.5:\n                            t += wi * exp(d2)\n                    ws.append(t)\n            else:\n                for c in cs:\n                    t = uni\n                    for ci, wi in zip(self.bc, self.bw):\n                        d = c - ci\n                        d2 = d * d * k\n                        if d2 > -12.5:\n                            t += wi * math.exp(d2)\n                    ws.append(t)\n            tot = sum(ws)\n            ws = [w / tot for w in ws]\n        self.bc, self.bw = cs, ws\n        mean_t = sum(c * w for c, w in zip(cs, ws))\n        var_t = max(sum(c * c * w for c, w in zip(cs, ws)) - mean_t * mean_t, 0.0)\n        phat = min(max(mean_t / 100.0, 0.002), 0.998)\n        var = P['sig'] ** 2 + P['lam_j'] * P['sig_j'] ** 2\n        sd = math.sqrt(H * var)\n        self.tb = self.tb + 1 if hi <= 1 else 0\n        if self.tb > 0 and P['zd'] > 0:\n            # below the last tick there is no probe: the score keeps walking away from it\n            phat = min(phat, max(P['pfl'], cdf(inv(0.01) - P['zd'] * 0.02 * math.sqrt(self.tb) / sd)))\n        z = inv(phat)\n        Z = z * sd\n        sp = pdf(z) / sd * P['sig']\n        self.st = sp * 100.0\n        s = math.sqrt(sp * sp + var_t / 1e4 + 1e-8)\n        sd1 = math.sqrt(max(1.0, H - 1.0) * var)\n        jp = [(cdf((Z + n * P['sig_j']) / sd1), w) for n, w in NODES]\n        lj = P['lam_j']\n\n        def AB(x):\n            k = (x - phat) / s\n            a = s * lpm(k)\n            b = a - (x - phat)\n            ja = sum(w * max(0.0, x - p) for p, w in jp)\n            jb = sum(w * max(0.0, p - x) for p, w in jp)\n            return (1 - lj) * a + lj * ja, (1 - lj) * b + lj * jb\n\n        if H == 1:\n            def AB(x):\n                return (1 - phat) * x, phat * (1 - x)\n        rho = P['lam_r'] * 0.5\n        mu = math.log(P['m']) - 0.5 * P['sig_n'] ** 2\n        kA = P['kL'] if phat < P['pL'] else P['kA']\n\n        def qsize(loss, gain, px):\n            loss *= kA\n            if gain <= 0:\n                return 0.0\n            tail = loss / (rho * gain)\n            if tail >= 1.0:\n                return 0.0\n            return min(P['qmax'], math.exp(mu + P['sig_n'] * inv(1 - max(tail, 1e-6))) / px)\n\n        ptk = phat * 100\n        def qbid(t):\n            if not 1 <= t <= 99:\n                return 0.0\n            a, b = AB(t / 100.0)\n            if phat * 100 - t < P['dmin']:\n                return 0.0\n            if P['nb1'] > 0 and self.s == 1 and t == 1 and ptk < 1.0:\n                return 0.0\n            if phat < P['pL']:\n                ytg = P['ydem'] * min(H, P['W']) / max(ca - 1, ptk + 1) * 100.0\n                a *= (P['kLb'] if state.yes_inventory < ytg else P['kLf']) / P['kL']\n            return qsize(a, b, max(phat, 0.05))\n\n        def qask(t):\n            if not 1 <= t <= 99:\n                return 0.0\n            a, b = AB(t / 100.0)\n            if t - phat * 100 < P['dmin']:\n                return 0.0\n            return qsize(b, a, t / 100.0)\n\n        bids = [o for o in state.own_orders if o.side is Side.BUY and o.remaining_quantity > PROBE + 1e-9]\n        asks = [o for o in state.own_orders if o.side is Side.SELL and o.remaining_quantity > PROBE + 1e-9]\n        sticky = P['sticky'] > 0\n        def top(orders, comp, step):\n            if sticky and sum(o.remaining_quantity for o in orders if o.price_ticks == comp and o.order_id in self.ahead) >= P['min_ahead']:\n                return comp\n            return comp + step\n        bid_t = top(bids, cb, 1)\n        ask_t = top(asks, ca, -1)\n        qb = qbid(bid_t)\n        qa = qask(ask_t)\n\n        Y = state.yes_inventory\n        if ask_t == 1 and H > P['H1'] and P['pre'] > 0:\n            qa = qa if Y >= P['a1'] > 0 else 0.0          # let the competitor's 2-tick ask erode instead of fronting it for nothing\n        # ammunition: hold YES so that low asks are covered\n        ptick = phat * 100\n        amt = 0\n        qam = 0.0\n        if P['ammo'] > 0 and ask_t >= 2 and phat < max(P['ammo_pmax'], P['pmaxf']):\n            wealth = state.cash + Y * phat\n            x = max(ask_t, ptick + 1) / 100.0\n            capw = P['fy'] * wealth / max(phat, 0.005)\n            target = min(P['ydem'] * min(H, P['W']) / x, capw)\n            full = min(P['ydf'] * min(H, P['Wf']) / x, capw) if phat < P['pmaxf'] else 0.0\n            t = max(1, min(99, int(math.ceil(ptick + 1e-9))))\n            g = t - ptick\n            if Y < full and g <= P['g_hi'] and bid_t <= t < ask_t:\n                amt, qam = t, min(P['qf'], full - Y)     # a tick p has just crossed: nearly free\n            elif Y < target and phat < P['ammo_pmax'] and bid_t <= t < ask_t and t / 100.0 - phat < P['ammo_maxpay']:\n                amt, qam = t, min(P['ammo_q'], target - Y)\n            elif Y < full and t >= 2 and 1.0 - g <= P['g_lo']:\n                amt, qam = t - 1, min(P['qf'], full - Y)  # rest just under p: filled only on the crossing, or by retail\n\n        if P['pre'] > 0 and ca == 2 and phat < 0.01 and H > P['H1'] and Y < P['pre'] and not qam and 1.0 - ptick < P['pre_gap']:\n            amt, qam = 1, min(P['ammo_q'], P['pre'] - Y)\n        q1 = 0.0\n        if P['ydf1'] > 0 and P['m1'] < ptick < P['g1'] + 1.0 and amt != 1:\n            stock_rate = P['ydf1']\n            if self.s in (2, 3):\n                flow = (self.flow_notional + P['flow_prior'] * P['flow_level']) / (P['flow_prior'] + self.flow_exposure)\n                scale = max(0.5, min(2.0, flow / P['flow_level']))\n                stock_rate *= 1.0 + P['flow_strength'] * (scale - 1.0)\n            q1 = max(0.0, stock_rate * min(H, P['Wf']) / (self.s / 100.0) - Y)\n\n        # Bridge expected retail demand until another tick crossing is available.\n        if 0.02 < phat < 0.1:\n            ct = max(2, min(99, int(math.floor(ptick))))\n            wealth = state.cash + Y * phat\n            goal = min(1 * qa, 0.3 * max(wealth, 0.0) / phat)\n            if Y < goal and ct < ask_t:\n                amt, qam = ct, min(3000.0, goal - Y)\n        # order management\n        actions = []\n        free = state.free_cash - 2.0\n        keep_ask = 0.0\n        new_b = []\n        new_a = []\n        def cancel(o):\n            nonlocal free\n            actions.append(CancelOrder(o.order_id))\n            x = o.price_ticks / 100.0\n            if o.side is Side.BUY:\n                free += x * o.remaining_quantity\n            else:\n                free += (1 - x) * min(self.res.get(o.order_id, 0.0), o.remaining_quantity)\n            self.ahead.discard(o.order_id)\n            self.res.pop(o.order_id, None)\n        for o in state.own_orders:\n            if o.remaining_quantity <= PROBE + 1e-9:\n                cancel(o)\n        kept_ids = set()\n        def manage(orders, t, q, comp):\n            kept = 0.0\n            for o in orders:\n                if o.price_ticks == t and q > 0 and kept + o.remaining_quantity <= max(q * P['keep_hi'], 1.0):\n                    kept += o.remaining_quantity\n                    kept_ids.add(o.order_id)\n                else:\n                    cancel(o)\n            return kept\n        kb = manage(bids, bid_t, qb, cb)\n        ka = manage(asks, ask_t, qa, ca)\n        add_b = (qb - kb) if (kb < qb * P['keep_lo'] and bid_t != cb) else 0.0\n        add_a = (qa - ka) if (ka < qa * P['keep_lo'] and ask_t != ca) else 0.0\n\n        budget = P['fb'] * max(free, 0.0)\n        cost = add_b * bid_t / 100.0 + qam * amt / 100.0\n        if cost > budget:\n            f = budget / cost\n            add_b *= f\n            qam *= f\n            cost = budget\n        out = []\n        q1 = min(q1, P['f1'] * max(budget - cost, 0.0) * 100.0)\n        if q1 >= 0.01:\n            out.append(PlaceOrder(side=Side.BUY, price_ticks=1, quantity=fl(q1)))\n            free -= fl(q1) / 100.0 + 1e-6\n        if amt and qam >= 0.01:\n            q = fl(qam)\n            out.append(PlaceOrder(side=Side.BUY, price_ticks=amt, quantity=q))\n            free -= q * amt / 100.0 + 1e-6\n        if bid_t >= 1 and add_b >= 0.01:\n            q = fl(add_b)\n            oid = self._oid('b')\n            out.append(PlaceOrder(side=Side.BUY, price_ticks=bid_t, quantity=q, client_order_id=oid))\n            free -= q * bid_t / 100.0 + 1e-6\n            if bid_t > cb:\n                self.ahead.add(oid)\n        if ask_t <= 99 and add_a >= 0.01:\n            x = ask_t / 100.0\n            covk = sum(o.remaining_quantity - min(self.res.get(o.order_id, 0.0), o.remaining_quantity)\n                       for o in asks if o.order_id in kept_ids)\n            cov = max(0.0, Y - covk - 0.1)\n            unc = max(0.0, add_a - cov)\n            if unc > 0:\n                ub = max(0.0, free - (1 - P['fu']) * max(state.cash, 0.0)) if x >= P['xu'] else 0.0\n                if H < P['Hu'] and phat < 0.05:\n                    ub = max(0.0, free * (1 - H / P['Hu']))\n                unc = min(unc, ub / (1 - x))\n            q = fl(min(add_a, cov + unc))\n            if q >= 0.01:\n                oid = self._oid('a')\n                out.append(PlaceOrder(side=Side.SELL, price_ticks=ask_t, quantity=q, client_order_id=oid))\n                r = max(0.0, q - cov)\n                self.res[oid] = r\n                free -= r * (1 - x) + 1e-6\n                if ask_t < ca:\n                    self.ahead.add(oid)\n\n        # probes: tiny orders that the arbitrageur removes when p crosses them\n        f = int(math.floor(ptick + 1e-9))\n        r = max(int(P['rmin']), int(math.ceil(2.0 * s * 100)))\n        self.pb = set()\n        self.pa = set()\n        if free > 1.0:\n            for t in range(f, f + r + 1):\n                if cb < t < ca and 1 <= t <= 99:\n                    out.append(PlaceOrder(side=Side.BUY, price_ticks=t, quantity=PROBE))\n                    self.pb.add(t)\n            for t in range(f + 1 - r, f + 2):\n                if cb < t < ca and 1 <= t <= 99:\n                    out.append(PlaceOrder(side=Side.SELL, price_ticks=t, quantity=PROBE))\n                    self.pa.add(t)\n        if self.s in (2, 3):\n            self.last_ask_tick = ask_t\n            self.last_flow_ca = ca\n            exposed_qty = ka + sum(o.quantity for o in out if o.side is Side.SELL and o.price_ticks == ask_t and o.quantity > PROBE)\n            self.last_flow_cap = exposed_qty * ask_t / 100.0\n            self.last_quote_exposed = ask_t / 100.0 > phat + max(0.005, P['flow_safety'] * self.st / 100.0) and self.last_flow_cap >= P['flow_exposure_min']\n            if self.last_quote_exposed:\n                logcap = math.log(self.last_flow_cap)\n                mu_flow = math.log(P['m']) - 0.5 * P['sig_n'] ** 2\n                clipped = P['m'] * cdf((logcap - mu_flow - P['sig_n'] ** 2) / P['sig_n']) + self.last_flow_cap * (1.0 - cdf((logcap - mu_flow) / P['sig_n']))\n                self.last_flow_correction = min(3.0, P['m'] / max(clipped, 0.01))\n        return actions + out\n\n    def _s2_step(self, state):\n        BUY, SELL = Side.BUY, Side.SELL\n        m_sqrt, m_log, m_exp, m_ceil, m_floor = math.sqrt, math.log, math.exp, math.ceil, math.floor\n        f_cdf, f_pdf, f_inv, f_lpm, f_fl = cdf, pdf, inv, lpm, fl\n        global _S2_PROBES\n        if _S2_PROBES is None:\n            _S2_PROBES = (\n                (None,) + tuple(PlaceOrder(side=BUY, price_ticks=t, quantity=PROBE) for t in range(1, 100)),\n                (None,) + tuple(PlaceOrder(side=SELL, price_ticks=t, quantity=PROBE) for t in range(1, 100)),\n            )\n        probe_b, probe_a = _S2_PROBES\n        H = max(1, state.steps_remaining)\n        cb = state.competitor_best_bid_ticks or 0\n        ca = state.competitor_best_ask_ticks or 100\n        if self.s is None:\n            self.s = max(1, (ca - cb + 1) // 2)\n            if self.s == 2:\n                self.params.update(dict(flow_prior=200, flow_level=0.6, flow_strength=1.0, flow_safety=2.0, flow_exposure_min=5.0))\n            if self.s == 1:\n                self.params.update({'dmin': 0.3, 'pfl': 1e-06})\n            if self.s == 3:\n                self.params.update({'flow_prior': 200, 'flow_level': 0.6, 'flow_strength': 1.0, 'flow_safety': 2.0, 'flow_exposure_min': 5.0})\n        P = self.params\n        if self.s in (2, 3) and self.last_quote_exposed and ca <= self.last_flow_ca + 1:\n            self.flow_exposure += 1\n            self.flow_notional += min(self.last_flow_cap, state.sell_filled_quantity * self.last_ask_tick / 100.0) * self.last_flow_correction\n        lo, hi = cb, ca\n        for o in state.own_orders:\n            if o.side is BUY:\n                lo = max(lo, o.price_ticks)\n            else:\n                hi = min(hi, o.price_ticks)\n        if P['pinf'] > 0:\n            sb = {o.price_ticks for o in state.own_orders if o.side is BUY and o.remaining_quantity <= PROBE + 1e-9}\n            sa = {o.price_ticks for o in state.own_orders if o.side is SELL and o.remaining_quantity <= PROBE + 1e-9}\n            ea = self.pa - sa\n            eb = self.pb - sb\n            if sa and ea:\n                lo = max(lo, min(max(ea), hi))\n            if eb and (sb or min(eb) <= P['p1t']):\n                hi = min(hi, max(min(eb), lo))\n        if P['jumpinfo'] > 0 and self.pcb is not None:\n            if ca > self.pca + 1:\n                lo = max(lo, ca - 1)\n            if cb < self.pcb - 1:\n                hi = min(hi, cb + 1)\n        self.pcb, self.pca = cb, ca\n        if lo > hi:\n            lo, hi = hi, lo\n        # sub-tick belief over p_(t-1): predict with one-step noise, truncate to [lo, hi]\n        wid = max(hi - lo, 1e-6)\n        nb = max(2, min(48, int(round(wid * P['bins']))))\n        cs = [lo + (i + 0.5) * wid / nb for i in range(nb)]\n        if self.bc is None or P['filt'] <= 0:\n            ws = [1.0 / nb] * nb\n        else:\n            sg = max(self.st, 0.6 * wid / nb)\n            k = -0.5 / (sg * sg)\n            ws = []\n            uni = P['uni'] * sg\n            if self.s == 2:\n                prior_pairs = tuple(zip(self.bc, self.bw))\n                exp = m_exp\n                for c in cs:\n                    t = uni\n                    for ci, wi in prior_pairs:\n                        d = c - ci\n                        d2 = d * d * k\n                        if d2 > -12.5:\n                            t += wi * exp(d2)\n                    ws.append(t)\n            else:\n                for c in cs:\n                    t = uni\n                    for ci, wi in zip(self.bc, self.bw):\n                        d = c - ci\n                        d2 = d * d * k\n                        if d2 > -12.5:\n                            t += wi * m_exp(d2)\n                    ws.append(t)\n            tot = sum(ws)\n            ws = [w / tot for w in ws]\n        self.bc, self.bw = cs, ws\n        mean_t = sum(c * w for c, w in zip(cs, ws))\n        var_t = max(sum(c * c * w for c, w in zip(cs, ws)) - mean_t * mean_t, 0.0)\n        phat = min(max(mean_t / 100.0, 0.002), 0.998)\n        var = P['sig'] ** 2 + P['lam_j'] * P['sig_j'] ** 2\n        sd = m_sqrt(H * var)\n        self.tb = self.tb + 1 if hi <= 1 else 0\n        if self.tb > 0 and P['zd'] > 0:\n            # below the last tick there is no probe: the score keeps walking away from it\n            phat = min(phat, max(P['pfl'], f_cdf(f_inv(0.01) - P['zd'] * 0.02 * m_sqrt(self.tb) / sd)))\n        z = f_inv(phat)\n        Z = z * sd\n        sp = f_pdf(z) / sd * P['sig']\n        self.st = sp * 100.0\n        s = m_sqrt(sp * sp + var_t / 1e4 + 1e-8)\n        sd1 = m_sqrt(max(1.0, H - 1.0) * var)\n        jp = [(f_cdf((Z + n * P['sig_j']) / sd1), w) for n, w in NODES]\n        lj = P['lam_j']\n\n        def AB(x):\n            k = (x - phat) / s\n            a = s * f_lpm(k)\n            b = a - (x - phat)\n            ja = sum(w * max(0.0, x - p) for p, w in jp)\n            jb = sum(w * max(0.0, p - x) for p, w in jp)\n            return (1 - lj) * a + lj * ja, (1 - lj) * b + lj * jb\n\n        if H == 1:\n            def AB(x):\n                return (1 - phat) * x, phat * (1 - x)\n        rho = P['lam_r'] * 0.5\n        mu = m_log(P['m']) - 0.5 * P['sig_n'] ** 2\n        kA = P['kL'] if phat < P['pL'] else P['kA']\n\n        def qsize(loss, gain, px):\n            loss *= kA\n            if gain <= 0:\n                return 0.0\n            tail = loss / (rho * gain)\n            if tail >= 1.0:\n                return 0.0\n            return min(P['qmax'], m_exp(mu + P['sig_n'] * f_inv(1 - max(tail, 1e-6))) / px)\n\n        ptk = phat * 100\n        def qbid(t):\n            if not 1 <= t <= 99:\n                return 0.0\n            a, b = AB(t / 100.0)\n            if phat * 100 - t < P['dmin']:\n                return 0.0\n            if P['nb1'] > 0 and self.s == 1 and t == 1 and ptk < 1.0:\n                return 0.0\n            if phat < P['pL']:\n                ytg = P['ydem'] * min(H, P['W']) / max(ca - 1, ptk + 1) * 100.0\n                a *= (P['kLb'] if state.yes_inventory < ytg else P['kLf']) / P['kL']\n            return qsize(a, b, max(phat, 0.05))\n\n        def qask(t):\n            if not 1 <= t <= 99:\n                return 0.0\n            a, b = AB(t / 100.0)\n            if t - phat * 100 < P['dmin']:\n                return 0.0\n            return qsize(b, a, t / 100.0)\n\n        bids = [o for o in state.own_orders if o.side is BUY and o.remaining_quantity > PROBE + 1e-9]\n        asks = [o for o in state.own_orders if o.side is SELL and o.remaining_quantity > PROBE + 1e-9]\n        sticky = P['sticky'] > 0\n        def top(orders, comp, step):\n            if sticky and sum(o.remaining_quantity for o in orders if o.price_ticks == comp and o.order_id in self.ahead) >= P['min_ahead']:\n                return comp\n            return comp + step\n        bid_t = top(bids, cb, 1)\n        ask_t = top(asks, ca, -1)\n        qb = qbid(bid_t)\n        qa = qask(ask_t)\n\n        Y = state.yes_inventory\n        if ask_t == 1 and H > P['H1'] and P['pre'] > 0:\n            qa = qa if Y >= P['a1'] > 0 else 0.0          # let the competitor's 2-tick ask erode instead of fronting it for nothing\n        # ammunition: hold YES so that low asks are covered\n        ptick = phat * 100\n        amt = 0\n        qam = 0.0\n        if P['ammo'] > 0 and ask_t >= 2 and phat < max(P['ammo_pmax'], P['pmaxf']):\n            wealth = state.cash + Y * phat\n            x = max(ask_t, ptick + 1) / 100.0\n            capw = P['fy'] * wealth / max(phat, 0.005)\n            target = min(P['ydem'] * min(H, P['W']) / x, capw)\n            full = min(P['ydf'] * min(H, P['Wf']) / x, capw) if phat < P['pmaxf'] else 0.0\n            t = max(1, min(99, int(m_ceil(ptick + 1e-9))))\n            g = t - ptick\n            if Y < full and g <= P['g_hi'] and bid_t <= t < ask_t:\n                amt, qam = t, min(P['qf'], full - Y)     # a tick p has just crossed: nearly free\n            elif Y < target and phat < P['ammo_pmax'] and bid_t <= t < ask_t and t / 100.0 - phat < P['ammo_maxpay']:\n                amt, qam = t, min(P['ammo_q'], target - Y)\n            elif Y < full and t >= 2 and 1.0 - g <= P['g_lo']:\n                amt, qam = t - 1, min(P['qf'], full - Y)  # rest just under p: filled only on the crossing, or by retail\n\n        if P['pre'] > 0 and ca == 2 and phat < 0.01 and H > P['H1'] and Y < P['pre'] and not qam and 1.0 - ptick < P['pre_gap']:\n            amt, qam = 1, min(P['ammo_q'], P['pre'] - Y)\n        q1 = 0.0\n        if P['ydf1'] > 0 and P['m1'] < ptick < P['g1'] + 1.0 and amt != 1:\n            stock_rate = P['ydf1']\n            if self.s in (2, 3):\n                flow = (self.flow_notional + P['flow_prior'] * P['flow_level']) / (P['flow_prior'] + self.flow_exposure)\n                scale = max(0.5, min(2.0, flow / P['flow_level']))\n                stock_rate *= 1.0 + P['flow_strength'] * (scale - 1.0)\n            q1 = max(0.0, stock_rate * min(H, P['Wf']) / (self.s / 100.0) - Y)\n\n        # Bridge expected retail demand until another tick crossing is available.\n        if 0.02 < phat < 0.1:\n            ct = max(2, min(99, int(m_floor(ptick))))\n            wealth = state.cash + Y * phat\n            goal = min(1 * qa, 0.3 * max(wealth, 0.0) / phat)\n            if Y < goal and ct < ask_t:\n                amt, qam = ct, min(3000.0, goal - Y)\n        # order management\n        actions = []\n        free = state.free_cash - 2.0\n        keep_ask = 0.0\n        new_b = []\n        new_a = []\n        def cancel(o):\n            nonlocal free\n            actions.append(CancelOrder(o.order_id))\n            x = o.price_ticks / 100.0\n            if o.side is BUY:\n                free += x * o.remaining_quantity\n            else:\n                free += (1 - x) * min(self.res.get(o.order_id, 0.0), o.remaining_quantity)\n            self.ahead.discard(o.order_id)\n            self.res.pop(o.order_id, None)\n        for o in state.own_orders:\n            if o.remaining_quantity <= PROBE + 1e-9:\n                cancel(o)\n        kept_ids = set()\n        def manage(orders, t, q, comp):\n            kept = 0.0\n            for o in orders:\n                if o.price_ticks == t and q > 0 and kept + o.remaining_quantity <= max(q * P['keep_hi'], 1.0):\n                    kept += o.remaining_quantity\n                    kept_ids.add(o.order_id)\n                else:\n                    cancel(o)\n            return kept\n        kb = manage(bids, bid_t, qb, cb)\n        ka = manage(asks, ask_t, qa, ca)\n        add_b = (qb - kb) if (kb < qb * P['keep_lo'] and bid_t != cb) else 0.0\n        add_a = (qa - ka) if (ka < qa * P['keep_lo'] and ask_t != ca) else 0.0\n\n        budget = P['fb'] * max(free, 0.0)\n        cost = add_b * bid_t / 100.0 + qam * amt / 100.0\n        if cost > budget:\n            f = budget / cost\n            add_b *= f\n            qam *= f\n            cost = budget\n        out = []\n        q1 = min(q1, P['f1'] * max(budget - cost, 0.0) * 100.0)\n        if q1 >= 0.01:\n            out.append(PlaceOrder(side=BUY, price_ticks=1, quantity=f_fl(q1)))\n            free -= f_fl(q1) / 100.0 + 1e-6\n        if amt and qam >= 0.01:\n            q = f_fl(qam)\n            out.append(PlaceOrder(side=BUY, price_ticks=amt, quantity=q))\n            free -= q * amt / 100.0 + 1e-6\n        if bid_t >= 1 and add_b >= 0.01:\n            q = f_fl(add_b)\n            oid = self._oid('b')\n            out.append(PlaceOrder(side=BUY, price_ticks=bid_t, quantity=q, client_order_id=oid))\n            free -= q * bid_t / 100.0 + 1e-6\n            if bid_t > cb:\n                self.ahead.add(oid)\n        if self.s == 2:\n            fresh_ask_qty = 0.0\n        if ask_t <= 99 and add_a >= 0.01:\n            x = ask_t / 100.0\n            covk = sum(o.remaining_quantity - min(self.res.get(o.order_id, 0.0), o.remaining_quantity)\n                       for o in asks if o.order_id in kept_ids)\n            cov = max(0.0, Y - covk - 0.1)\n            unc = max(0.0, add_a - cov)\n            if unc > 0:\n                ub = max(0.0, free - (1 - P['fu']) * max(state.cash, 0.0)) if x >= P['xu'] else 0.0\n                if H < P['Hu'] and phat < 0.05:\n                    ub = max(0.0, free * (1 - H / P['Hu']))\n                unc = min(unc, ub / (1 - x))\n            q = f_fl(min(add_a, cov + unc))\n            if q >= 0.01:\n                oid = self._oid('a')\n                out.append(PlaceOrder(side=SELL, price_ticks=ask_t, quantity=q, client_order_id=oid))\n                if self.s == 2 and q > PROBE:\n                    fresh_ask_qty = q\n                r = max(0.0, q - cov)\n                self.res[oid] = r\n                free -= r * (1 - x) + 1e-6\n                if ask_t < ca:\n                    self.ahead.add(oid)\n\n        # probes: tiny orders that the arbitrageur removes when p crosses them\n        f = int(m_floor(ptick + 1e-9))\n        r = max(int(P['rmin']), int(m_ceil(2.0 * s * 100)))\n        self.pb = set()\n        self.pa = set()\n        if free > 1.0:\n            for t in range(f, f + r + 1):\n                if cb < t < ca and 1 <= t <= 99:\n                    out.append(probe_b[t])\n                    self.pb.add(t)\n            for t in range(f + 1 - r, f + 2):\n                if cb < t < ca and 1 <= t <= 99:\n                    out.append(probe_a[t])\n                    self.pa.add(t)\n        if self.s in (2, 3):\n            self.last_ask_tick = ask_t\n            self.last_flow_ca = ca\n            exposed_qty = ka + fresh_ask_qty if self.s == 2 else ka + sum(o.quantity for o in out if o.side is SELL and o.price_ticks == ask_t and o.quantity > PROBE)\n            self.last_flow_cap = exposed_qty * ask_t / 100.0\n            self.last_quote_exposed = ask_t / 100.0 > phat + max(0.005, P['flow_safety'] * self.st / 100.0) and self.last_flow_cap >= P['flow_exposure_min']\n            if self.last_quote_exposed:\n                logcap = m_log(self.last_flow_cap)\n                mu_flow = m_log(P['m']) - 0.5 * P['sig_n'] ** 2\n                clipped = P['m'] * f_cdf((logcap - mu_flow - P['sig_n'] ** 2) / P['sig_n']) + self.last_flow_cap * (1.0 - f_cdf((logcap - mu_flow) / P['sig_n']))\n                self.last_flow_correction = min(3.0, P['m'] / max(clipped, 0.01))\n        return actions + out\n", "code_sha256": "29d4a3f99dd734eedb4eafb3949de3ab8d66011e1ce69778f52a8d0910c289b6", "tried": ["Cap bridge stock by rate * max(H-lag,0) / ask_price: [{\"variant\":\"bridgeH_25_0\",\"runs\":200,\"mean\":0.1757382290574995,\"standard_error\":0.07525829151080674,\"failures\":0},{\"variant\":\"bridgeH_25_10\",\"runs\":1000,\"mean\":0.2985044397446001,\"standard_error\":0.03982164765696486,\"failures\":0,\"validation\":{\"mean\":0.325542905884178,\"standard_error\":0.033827583617325845,\"retail\":0.010388685274250326,\"arb\":0.3151542206091004}},{\"variant\":\"bridgeH_40_0\",\"runs\":200,\"mean\":0.02979050678699984,\"standard_error\":0.04947005721829811,\"failures\":0},{\"variant\":\"bridgeH_40_10\",\"runs\":200,\"mean\":0.07823886798149982,\"standard_error\":0.05190491538316565,\"failures\":0},{\"variant\":\"bridgeH_60_0\",\"runs\":200,\"mean\":0.006827234592,\"standard_error\":0.0036481982841459187,\"failures\":0},{\"variant\":\"bridgeH_60_10\",\"runs\":200,\"mean\":0.044036043874000036,\"standard_error\":0.021843889177687544,\"failures\":0},{\"variant\":\"bridgeH_80_0\",\"runs\":200,\"mean\":0.003158915019999986,\"standard_error\":0.0029873607977033557,\"failures\":0},{\"variant\":\"bridgeH_80_10\",\"runs\":200,\"mean\":0.021480233861999997,\"standard_error\":0.011634869749529585,\"failures\":0}]", "Fractional ask-sized bridge stock: [{\"variant\":\"bridge_025\",\"runs\":200,\"mean\":-0.08637117927150027,\"standard_error\":0.3550228058929498,\"failures\":0},{\"variant\":\"bridge_05\",\"runs\":1000,\"mean\":0.5028988908621004,\"standard_error\":0.19326766669499135,\"failures\":0}]", "Cap expensive ammunition stock by quantity and premium: [{\"variant\":\"buffer_1000_30\",\"runs\":200,\"mean\":-1.4350757507924994,\"standard_error\":1.7634350464101367,\"failures\":0},{\"variant\":\"buffer_1000_60\",\"runs\":200,\"mean\":-0.0986624778399998,\"standard_error\":0.09194211678713572,\"failures\":0},{\"variant\":\"buffer_1500_30\",\"runs\":200,\"mean\":-1.8058648507099997,\"standard_error\":1.7598043699890538,\"failures\":0},{\"variant\":\"buffer_2000_30\",\"runs\":200,\"mean\":-1.6561764036009998,\"standard_error\":1.733239483181989,\"failures\":0},{\"variant\":\"buffer_2000_60\",\"runs\":200,\"mean\":-0.11799528863649983,\"standard_error\":0.09614629760380439,\"failures\":0},{\"variant\":\"buffer_3000_30\",\"runs\":200,\"mean\":-0.050021612429499956,\"standard_error\":0.054860273893595976,\"failures\":0},{\"variant\":\"buffer_500_30\",\"runs\":200,\"mean\":-1.4752871365055003,\"standard_error\":1.7711534889215181,\"failures\":0},{\"variant\":\"buffer_500_60\",\"runs\":200,\"mean\":-0.1610036225614996,\"standard_error\":0.17055119653744355,\"failures\":0}]", "Bulk purchases near cheap tick crossings: [{\"variant\":\"cross_10_10000\",\"runs\":200,\"mean\":-0.0829103209734997,\"standard_error\":0.06757110580025154,\"failures\":0},{\"variant\":\"cross_10_30000\",\"runs\":200,\"mean\":-0.0829103209734997,\"standard_error\":0.06757110580025154,\"failures\":0},{\"variant\":\"cross_10_3000\",\"runs\":200,\"mean\":-0.04141650709700009,\"standard_error\":0.0286549255830811,\"failures\":0},{\"variant\":\"cross_25_10000\",\"runs\":200,\"mean\":-0.3841421064320008,\"standard_error\":0.3337889529787096,\"failures\":0},{\"variant\":\"cross_25_30000\",\"runs\":200,\"mean\":-0.4051288138140006,\"standard_error\":0.33601424410862973,\"failures\":0},{\"variant\":\"cross_25_3000\",\"runs\":200,\"mean\":-0.24727083296649965,\"standard_error\":0.27428322397048027,\"failures\":0},{\"variant\":\"cross_50_10000\",\"runs\":200,\"mean\":-1.1696566779845003,\"standard_error\":0.5089899699191072,\"failures\":0},{\"variant\":\"cross_50_30000\",\"runs\":200,\"mean\":-1.1622167586695002,\"standard_error\":0.5082864122961889,\"failures\":0},{\"variant\":\"cross_50_3000\",\"runs\":200,\"mean\":-0.7793427147459987,\"standard_error\":0.3943257467903899,\"failures\":0}]", "Cap one-cent ammunition only far below one cent: [{\"variant\":\"deep_1000_50\",\"runs\":200,\"mean\":-0.12293166236949986,\"standard_error\":0.09116558762247577,\"failures\":0},{\"variant\":\"deep_1000_80\",\"runs\":200,\"mean\":-0.12317030648699984,\"standard_error\":0.09142600928612976,\"failures\":0},{\"variant\":\"deep_1500_50\",\"runs\":200,\"mean\":-0.1797249164074998,\"standard_error\":0.13439102239607167,\"failures\":0},{\"variant\":\"deep_1500_80\",\"runs\":200,\"mean\":-0.1797249164074998,\"standard_error\":0.13439102239607167,\"failures\":0},{\"variant\":\"deep_2000_50\",\"runs\":200,\"mean\":-0.11799528863649983,\"standard_error\":0.09614629760380439,\"failures\":0},{\"variant\":\"deep_2000_80\",\"runs\":200,\"mean\":-0.11799528863649983,\"standard_error\":0.09614629760380439,\"failures\":0},{\"variant\":\"deep_500_50\",\"runs\":200,\"mean\":-0.21960647222749968,\"standard_error\":0.17053386375858448,\"failures\":0},{\"variant\":\"deep_500_80\",\"runs\":200,\"mean\":-0.2878810872234995,\"standard_error\":0.19211885592960337,\"failures\":0}]", "Guarded censored-flow scaling of one-cent reserve, varying prior/strength/direction: [{\"variant\":\"flow_200_10\",\"runs\":1000,\"mean\":0.7808116799658996,\"standard_error\":0.3248533429735589,\"failures\":0,\"validation\":{\"mean\":0.6184111937843846,\"standard_error\":0.32249704885669567,\"retail\":0.25719368987807645,\"arb\":0.3612175039078594}},{\"variant\":\"flow_200_15\",\"runs\":200,\"mean\":1.0016376676615006,\"standard_error\":1.0907916164278706,\"failures\":0},{\"variant\":\"flow_200_5\",\"runs\":1000,\"mean\":0.6307178221497,\"standard_error\":0.2151072308144163,\"failures\":0,\"validation\":{\"mean\":0.5459897056282318,\"standard_error\":0.21894514395752793,\"retail\":0.12931975546835558,\"arb\":0.41666995016101344}},{\"variant\":\"flow_50_10\",\"runs\":1000,\"mean\":0.7459413075426,\"standard_error\":0.34969489111701624,\"failures\":0},{\"variant\":\"flow_down_200\",\"runs\":200,\"mean\":0.17028664476950006,\"standard_error\":0.15562053702020315,\"failures\":0},{\"variant\":\"flow_down_50\",\"runs\":200,\"mean\":0.20711481530450004,\"standard_error\":0.2048794881955199,\"failures\":0},{\"variant\":\"flow_up_200\",\"runs\":1000,\"mean\":0.7190507590373998,\"standard_error\":0.3221275740703785,\"failures\":0,\"validation\":{\"mean\":0.4709789314104447,\"standard_error\":0.3112220614255908,\"retail\":0.2569012796316441,\"arb\":0.21407765178035157}},{\"variant\":\"flow_up_50\",\"runs\":200,\"mean\":0.8819846274124995,\"standard_error\":1.0160886585815196,\"failures\":0}]", "Cap all cheap stock by H-minus-lag demand: [{\"variant\":\"horizon_100\",\"runs\":200,\"mean\":-3.1552703683800005,\"standard_error\":2.244053129839677,\"failures\":0},{\"variant\":\"horizon_300\",\"runs\":200,\"mean\":-19.167739104963502,\"standard_error\":4.181225444899251,\"failures\":0},{\"variant\":\"horizon_600\",\"runs\":200,\"mean\":-40.7977019385765,\"standard_error\":6.759273062028904,\"failures\":0}]", "Higher ordinary-bid loss weight with adequate stock: [{\"variant\":\"klf_02\",\"runs\":200,\"mean\":-0.08366464978950053,\"standard_error\":0.2990510271666917,\"failures\":0},{\"variant\":\"klf_04\",\"runs\":200,\"mean\":-0.5093692277805003,\"standard_error\":0.4875846270314159,\"failures\":0},{\"variant\":\"klf_07\",\"runs\":200,\"mean\":-0.6990530407315007,\"standard_error\":0.4835749532449244,\"failures\":0},{\"variant\":\"klf_15\",\"runs\":200,\"mean\":-1.1857447628375004,\"standard_error\":0.5999186468089798,\"failures\":0},{\"variant\":\"klf_50\",\"runs\":200,\"mean\":-1.7323076864845004,\"standard_error\":0.6448940682437911,\"failures\":0}]", "Expiry cap on expensive ammunition: [{\"variant\":\"late_10_4\",\"runs\":1000,\"mean\":0.049207096333600105,\"standard_error\":0.01533199493637801,\"failures\":0,\"validation\":{\"mean\":0.04590196202699015,\"standard_error\":0.01836675216115927,\"retail\":-0.05370576413485047,\"arb\":0.09960772616297833}},{\"variant\":\"late_20_4\",\"runs\":200,\"mean\":0.054766486281000185,\"standard_error\":0.036692334808426215,\"failures\":0},{\"variant\":\"late_40_4\",\"runs\":200,\"mean\":0.06422943211649985,\"standard_error\":0.07612183627111554,\"failures\":0},{\"variant\":\"late_5_4\",\"runs\":200,\"mean\":0.035533757436500245,\"standard_error\":0.024079685781968643,\"failures\":0},{\"variant\":\"late_80_4\",\"runs\":200,\"mean\":-0.07144636662699992,\"standard_error\":0.18471957791595134,\"failures\":0}]", "Net pending ordinary bids against stock replenishment: [{\"variant\":\"net_all_10\",\"runs\":200,\"mean\":0.08839858693549987,\"standard_error\":0.08070839961091074,\"failures\":0},{\"variant\":\"net_all_5\",\"runs\":200,\"mean\":0.10119559438049937,\"standard_error\":0.0660997654262698,\"failures\":0},{\"variant\":\"net_ge2_10\",\"runs\":1000,\"mean\":-0.01663398632859999,\"standard_error\":0.02967802946119789,\"failures\":0},{\"variant\":\"net_ge2_5\",\"runs\":200,\"mean\":0.1085523360429993,\"standard_error\":0.06601597787336559,\"failures\":0},{\"variant\":\"net_same_10\",\"runs\":200,\"mean\":0.08839858693549987,\"standard_error\":0.08070839961091074,\"failures\":0},{\"variant\":\"net_same_5\",\"runs\":200,\"mean\":0.10119559438049937,\"standard_error\":0.0660997654262698,\"failures\":0}]", "Disable the 2-10 cent bridge: [{\"variant\":\"no_bridge\",\"runs\":200,\"mean\":-0.18066797428300113,\"standard_error\":0.3911139773700014,\"failures\":0}]", "Probability-dependent one-cent reserve reductions: [{\"variant\":\"occupation_05\",\"runs\":200,\"mean\":-0.6706301837364994,\"standard_error\":0.2790236976314279,\"failures\":0},{\"variant\":\"occupation_10\",\"runs\":200,\"mean\":-1.4112677099960005,\"standard_error\":0.5534379891067486,\"failures\":0}]", "Suppress ammunition above an estimated-fair premium: [{\"variant\":\"pay_0001\",\"runs\":200,\"mean\":-2.0025635713765007,\"standard_error\":1.9184270214550512,\"failures\":0},{\"variant\":\"pay_0003\",\"runs\":200,\"mean\":-1.8962782806045002,\"standard_error\":1.817910477744614,\"failures\":0},{\"variant\":\"pay_0005\",\"runs\":200,\"mean\":-0.25523481242799967,\"standard_error\":0.26521795128326353,\"failures\":0}]", "Smaller one-cent reserve: [{\"variant\":\"q1_025\",\"runs\":200,\"mean\":-6.863309945844001,\"standard_error\":1.644542109745652,\"failures\":0},{\"variant\":\"q1_05\",\"runs\":200,\"mean\":-3.9074847901995,\"standard_error\":1.1164753845205673,\"failures\":0},{\"variant\":\"q1_075\",\"runs\":200,\"mean\":-1.2599186803295006,\"standard_error\":0.4931309271512389,\"failures\":0}]", "Larger nearly-free crossing purchase chunks: [{\"variant\":\"qf_3000\",\"runs\":200,\"mean\":-0.9131232364970007,\"standard_error\":0.3825736942110658,\"failures\":0}]", "Compound-retail demand quantile cap on expensive ammunition: [{\"variant\":\"quantile_100_1\",\"runs\":200,\"mean\":-1.096574350043001,\"standard_error\":1.4122851234685165,\"failures\":0},{\"variant\":\"quantile_2000_1\",\"runs\":200,\"mean\":0.0012521336984998221,\"standard_error\":0.005703360672218002,\"failures\":0},{\"variant\":\"quantile_2000_2\",\"runs\":200,\"mean\":0.00037528208750049253,\"standard_error\":0.05436951576088517,\"failures\":0},{\"variant\":\"quantile_200_1\",\"runs\":1000,\"mean\":0.14551820642949984,\"standard_error\":0.039289531967161194,\"failures\":0},{\"variant\":\"quantile_200_2\",\"runs\":200,\"mean\":0.08555725070699886,\"standard_error\":0.08906935759329135,\"failures\":0},{\"variant\":\"quantile_50_1\",\"runs\":200,\"mean\":-1.1090027879605011,\"standard_error\":1.7568335334047704,\"failures\":0}]", "Bulk fixed-tick cheap reserve: [{\"variant\":\"reserve_3_10000\",\"runs\":200,\"mean\":-0.41965284665400054,\"standard_error\":0.21221616976371585,\"failures\":0},{\"variant\":\"reserve_5_10000\",\"runs\":200,\"mean\":-1.7286239378565,\"standard_error\":0.6152916601617336,\"failures\":0},{\"variant\":\"reserve_5_30000\",\"runs\":200,\"mean\":-1.7164955531054997,\"standard_error\":0.6141239110789145,\"failures\":0}]", "Keep one-cent reserve FIFO position with size tolerance: [{\"variant\":\"stickyStock_105_0\",\"runs\":200,\"mean\":-0.054102638132499506,\"standard_error\":0.07215533405364,\"failures\":0},{\"variant\":\"stickyStock_105_1\",\"runs\":200,\"mean\":-0.054102638132499506,\"standard_error\":0.07215533405364,\"failures\":0},{\"variant\":\"stickyStock_120_0\",\"runs\":200,\"mean\":-0.055607259254000514,\"standard_error\":0.14567669351330642,\"failures\":0},{\"variant\":\"stickyStock_120_1\",\"runs\":200,\"mean\":-0.055607259254000514,\"standard_error\":0.14567669351330642,\"failures\":0},{\"variant\":\"stickyStock_150_0\",\"runs\":200,\"mean\":-0.08735454604800054,\"standard_error\":0.3107932654781157,\"failures\":0},{\"variant\":\"stickyStock_150_1\",\"runs\":200,\"mean\":-0.08735454604800054,\"standard_error\":0.3107932654781157,\"failures\":0},{\"variant\":\"stickyStock_300_0\",\"runs\":200,\"mean\":-0.2915830176010003,\"standard_error\":0.9543091989792007,\"failures\":0},{\"variant\":\"stickyStock_300_1\",\"runs\":200,\"mean\":-0.2915830176010003,\"standard_error\":0.9543091989792007,\"failures\":0}]", "Larger constant one-cent reserve rate: [{\"variant\":\"stockrate_08\",\"runs\":200,\"mean\":0.01113806713599943,\"standard_error\":0.5203719670833648,\"failures\":0},{\"variant\":\"stockrate_10\",\"runs\":200,\"mean\":-0.49864035583450056,\"standard_error\":1.0739926587096427,\"failures\":0},{\"variant\":\"stockrate_15\",\"runs\":200,\"mean\":-2.871939096989,\"standard_error\":1.7357352361145688,\"failures\":0}]", "Register stock bids with existing ahead-queue tracking: [{\"variant\":\"tag_ammo\",\"runs\":1000,\"mean\":0.0008867142776999585,\"standard_error\":0.008663179338135412,\"failures\":0},{\"variant\":\"tag_both\",\"runs\":200,\"mean\":0.030020053748500287,\"standard_error\":0.02451361439252425,\"failures\":0},{\"variant\":\"tag_q1\",\"runs\":200,\"mean\":0.0,\"standard_error\":0.0,\"failures\":0}]", "Base FIFO purchase trace over 1967 tuning runs, excluding quantities <= 0.011: {\"fills\":60236.0,\"quantity\":13750410.459999973,\"resold_quantity\":9905167.85999987,\"resold_to_retail_quantity\":8395947.979999892,\"purchase_cost\":262751.8323000168,\"purchase_edge\":-12760.825568018869,\"unsold_cost\":51584.67269999954,\"unsold_purchase_edge\":-2163.9381335053117,\"never_resold_fills\":15702.0,\"purchase_edge_per_run\":-6.487455804788444,\"unsold_cost_per_run\":26.2250496695473,\"resold_fraction\":0.7203543406077996}", "First equivalent implementation failed speed gate: {\"base\":143.1740145639924,\"frozen\":144.42422664377955} over 200 runs. Local constants, immutable probe caching, and direct fresh-ask accounting preserved every full result in 1967 tuning, 1987 unseen, and 900 other-spread replays.", "Unseen base tracing instrumentation: all 1987 full SimulationResults matched a separate uninstrumented base run; FIFO covered-sale attribution retained for every purchase at ticks 1-5.", "Final selected perf: {\"discovery\":{\"mean\":0.7808116799658996,\"standard_error\":0.3248533429735589,\"retail\":0.30936299544220036,\"arb\":0.4714486845210999},\"validation\":{\"mean\":0.6184111937843846,\"standard_error\":0.32249704885669567,\"retail\":0.25719368987807645,\"arb\":0.3612175039078594},\"unseen\":{\"mean\":0.6075141093718673,\"standard_error\":0.18318063780805277,\"retail\":0.28992974992219434,\"arb\":0.31758435944836433},\"frozen_sha256\":\"29d4a3f99dd734eedb4eafb3949de3ab8d66011e1ce69778f52a8d0910c289b6\",\"frozen_utc\":\"2026-11-06T07:42:29.723307+00:00\",\"timing_runs_per_code\":200}"], "next": "Model uncertainty in remaining retail demand around the one-cent stock target. Preserve near-fair crossing purchases and test any FIFO change against endogenous competitor replenishments. Seeds 60000-67999 are now evaluation data; use a fresh unseen range for further selection."}