{
  "approach": "A single spread-3 clock gate suppresses ammunition bids at ticks >=2 above the estimated fair price while H>500 steps remain; H<=500 retains base behavior. The gate precedes the existing bridge logic, preserving cheaper bridge purchases and the tick-1 reserve. Early premium stock consumes edge immediately through adverse fills and may wait a long time for retail; defer that premium until the final 500 steps. Selection used the first 400 spread-3 tuning seeds for discovery and the next 600 for validation. The selected code then gained on the untouched final 954 tuning seeds. Trial windows in tried are zero-based offsets into the sorted tuning seed list, not simulator seeds. All seed configurations and simulations use runner.sample_config and SimulationEngine.run exactly as run_batch does, with default 2000 steps and no sandbox. The 4000-run CLI scorer check at seeds 4000..7999, workers=4, matched the supplied reference exactly, with zero failures. Other-spread checks use the first 300 matching seeds per spread 1,2,4 starting at 60000 and compare every result field. The trading rule was frozen before unseen scoring. An allocation-only runtime repair then materialized the previous belief-grid pairs once per spread-3 step, preserving their iteration order and all arithmetic. The repaired implementation was frozen and rerun over all 4889 checked seeds: every simulator result field was exactly identical to the initial policy implementation. All final candidate scores are from these repaired-code runs. seconds reports mean elapsed wall time per 200 runs over three balanced, interleaved base/candidate rounds in one process after parallel scoring workers finished. Arb values are signed simulator edges; a positive arb difference means less loss. Seed lists, enumerated before tuning: tuning=[8003,8004,8008,8011,8015,8027,8031,8038,8046,8049,8055,8056,8060,8063,8067,8072,8081,8082,8090,8099,8107,8115,8120,8125,8132,8135,8136,8143,8145,8146,8147,8150,8157,8158,8161,8163,8165,8170,8172,8173,8187,8192,8202,8205,8208,8209,8210,8212,8223,8224,8240,8253,8260,8269,8276,8278,8279,8285,8286,8287,8290,8292,8296,8297,8302,8304,8306,8312,8313,8314,8318,8324,8327,8336,8337,8342,8350,8353,8358,8360,8367,8369,8373,8376,8386,8391,8392,8394,8395,8396,8399,8401,8405,8412,8413,8417,8420,8423,8427,8432,8434,8440,8456,8462,8466,8476,8477,8481,8482,8484,8488,8493,8495,8504,8506,8509,8518,8520,8525,8527,8528,8530,8542,8545,8549,8551,8568,8569,8574,8576,8578,8582,8584,8586,8587,8589,8594,8597,8601,8607,8610,8618,8625,8630,8639,8643,8646,8657,8661,8662,8667,8669,8670,8674,8681,8690,8692,8698,8701,8726,8727,8731,8732,8733,8734,8738,8742,8751,8757,8764,8765,8766,8768,8772,8773,8777,8786,8789,8791,8794,8798,8803,8809,8811,8812,8814,8821,8829,8830,8834,8846,8847,8848,8852,8856,8868,8873,8878,8879,8880,8882,8884,8887,8896,8907,8920,8921,8925,8926,8931,8932,8938,8940,8943,8948,8960,8965,8966,8969,8970,8971,8975,8979,8980,8983,8985,8987,8990,8994,8998,8999,9000,9001,9005,9010,9011,9015,9019,9021,9024,9027,9032,9033,9035,9039,9042,9048,9050,9060,9062,9064,9065,9068,9069,9073,9078,9081,9088,9090,9104,9107,9112,9115,9116,9117,9129,9130,9131,9137,9139,9140,9141,9143,9148,9157,9161,9165,9171,9173,9182,9183,9187,9191,9192,9194,9197,9200,9201,9207,9211,9216,9223,9224,9227,9230,9231,9236,9240,9241,9245,9246,9247,9251,9253,9256,9257,9258,9263,9267,9268,9269,9271,9283,9293,9296,9302,9304,9311,9319,9320,9328,9331,9336,9337,9340,9345,9346,9349,9351,9358,9363,9367,9369,9374,9379,9380,9381,9385,9386,9391,9428,9432,9433,9434,9436,9438,9439,9443,9448,9452,9458,9463,9464,9470,9471,9473,9481,9489,9491,9492,9499,9502,9504,9505,9509,9510,9511,9517,9523,9524,9526,9527,9532,9533,9535,9537,9541,9543,9549,9550,9557,9560,9566,9569,9573,9585,9586,9587,9593,9597,9601,9602,9603,9604,9611,9620,9621,9625,9626,9631,9637,9640,9641,9645,9646,9647,9655,9666,9672,9674,9682,9687,9695,9704,9705,9707,9708,9713,9715,9717,9722,9727,9728,9730,9741,9743,9746,9747,9749,9750,9751,9754,9758,9767,9769,9771,9786,9788,9798,9800,9801,9802,9803,9819,9821,9823,9825,9828,9829,9835,9846,9857,9861,9881,9888,9893,9900,9905,9906,9910,9913,9921,9925,9935,9936,9939,9948,9957,9969,9971,9975,9978,9979,9980,9981,9989,9991,9992,9996,9998,9999,10001,10012,10019,10022,10024,10025,10026,10028,10033,10038,10044,10046,10047,10056,10058,10059,10079,10080,10082,10085,10087,10088,10092,10094,10100,10102,10104,10105,10110,10113,10118,10120,10124,10126,10128,10129,10130,10134,10143,10147,10148,10163,10164,10165,10167,10168,10169,10171,10173,10174,10175,10184,10187,10193,10196,10200,10203,10204,10209,10212,10217,10227,10229,10231,10239,10240,10247,10249,10256,10259,10261,10265,10266,10267,10272,10276,10277,10279,10280,10282,10287,10303,10308,10315,10318,10323,10325,10331,10333,10334,10340,10345,10354,10356,10365,10368,10369,10370,10383,10385,10395,10396,10403,10409,10410,10413,10415,10417,10419,10430,10433,10434,10436,10441,10443,10444,10447,10449,10456,10459,10462,10463,10467,10470,10471,10491,10500,10502,10505,10508,10514,10518,10527,10535,10540,10542,10545,10552,10559,10562,10563,10567,10570,10578,10587,10589,10594,10595,10598,10605,10606,10612,10613,10616,10620,10621,10625,10626,10627,10637,10643,10652,10657,10659,10664,10665,10669,10676,10679,10687,10688,10689,10697,10699,10703,10706,10708,10717,10723,10730,10731,10737,10745,10747,10754,10755,10759,10764,10785,10786,10787,10788,10791,10797,10801,10802,10803,10805,10816,10817,10829,10837,10843,10845,10848,10861,10872,10875,10877,10881,10890,10894,10895,10897,10899,10900,10905,10915,10921,10926,10929,10931,10934,10948,10953,10954,10959,10963,10964,10966,10971,10973,10979,10982,10984,10985,10987,10994,10998,10999,11002,11004,11006,11009,11013,11023,11024,11026,11028,11029,11032,11045,11049,11051,11061,11064,11070,11071,11072,11073,11075,11078,11080,11084,11094,11103,11104,11107,11109,11123,11124,11128,11129,11146,11153,11156,11167,11172,11182,11186,11187,11188,11191,11192,11199,11200,11205,11206,11207,11212,11216,11226,11235,11243,11247,11251,11256,11277,11278,11280,11283,11289,11290,11292,11303,11308,11319,11320,11327,11330,11335,11337,11340,11343,11354,11356,11359,11360,11367,11374,11377,11382,11385,11386,11387,11388,11396,11397,11398,11399,11400,11403,11410,11413,11414,11415,11416,11419,11424,11427,11430,11434,11435,11441,11442,11444,11449,11458,11462,11463,11475,11476,11477,11487,11490,11494,11496,11497,11501,11505,11511,11517,11524,11525,11526,11528,11530,11532,11533,11536,11538,11546,11549,11550,11571,11576,11579,11588,11590,11591,11595,11597,11603,11607,11608,11612,11614,11616,11622,11631,11632,11637,11640,11645,11652,11672,11675,11676,11693,11696,11697,11699,11700,11704,11706,11709,11710,11713,11719,11722,11724,11728,11730,11732,11733,11734,11738,11744,11745,11746,11750,11751,11752,11753,11754,11755,11756,11759,11764,11772,11774,11775,11777,11784,11789,11806,11808,11810,11811,11814,11816,11821,11825,11833,11834,11842,11843,11847,11851,11855,11856,11859,11866,11868,11870,11871,11879,11888,11893,11898,11902,11904,11912,11923,11925,11928,11930,11934,11935,11936,11938,11944,11947,11950,11953,11959,11961,11969,11971,11972,11980,11981,11990,11994,11995,11997,12004,12006,12007,12009,12010,12017,12021,12022,12025,12036,12037,12041,12042,12043,12044,12045,12052,12054,12055,12061,12073,12076,12077,12081,12088,12097,12101,12104,12107,12108,12115,12130,12136,12138,12141,12144,12151,12155,12156,12161,12164,12165,12168,12169,12171,12173,12178,12184,12188,12189,12195,12198,12204,12208,12209,12211,12214,12227,12239,12254,12258,12263,12264,12278,12280,12282,12297,12311,12319,12323,12335,12336,12346,12352,12355,12363,12366,12367,12370,12375,12379,12380,12381,12392,12394,12397,12398,12400,12404,12415,12417,12420,12426,12432,12433,12437,12440,12443,12450,12458,12473,12474,12484,12488,12489,12491,12500,12505,12519,12523,12524,12534,12535,12539,12540,12543,12544,12551,12552,12556,12559,12563,12564,12565,12571,12573,12574,12575,12579,12584,12587,12588,12591,12592,12595,12597,12603,12606,12608,12614,12619,12620,12621,12624,12629,12631,12636,12642,12643,12644,12650,12653,12654,12667,12668,12680,12681,12686,12689,12692,12695,12706,12707,12711,12715,12722,12723,12725,12728,12739,12740,12744,12746,12752,12756,12758,12760,12764,12765,12769,12770,12773,12774,12781,12787,12789,12801,12803,12804,12808,12809,12810,12811,12813,12814,12817,12822,12824,12827,12834,12836,12839,12842,12845,12850,12851,12852,12853,12862,12867,12868,12869,12873,12880,12882,12883,12885,12886,12893,12894,12896,12900,12902,12907,12908,12911,12913,12921,12929,12931,12940,12943,12944,12946,12949,12954,12959,12961,12966,12967,12969,12993,12996,12997,13014,13018,13024,13026,13027,13032,13033,13035,13041,13045,13051,13054,13057,13061,13062,13073,13080,13088,13091,13101,13108,13111,13119,13122,13123,13125,13126,13129,13133,13134,13135,13148,13155,13158,13167,13175,13185,13189,13190,13200,13202,13208,13209,13210,13214,13218,13219,13221,13225,13239,13240,13243,13248,13254,13258,13259,13262,13267,13273,13278,13279,13282,13283,13288,13289,13293,13295,13308,13309,13311,13316,13326,13332,13335,13337,13338,13349,13352,13361,13370,13379,13384,13385,13387,13391,13394,13397,13398,13399,13400,13402,13406,13417,13422,13430,13436,13445,13448,13450,13455,13458,13460,13467,13469,13470,13473,13475,13479,13481,13482,13490,13495,13496,13498,13499,13507,13508,13510,13514,13516,13517,13520,13526,13532,13533,13537,13539,13546,13547,13571,13573,13575,13580,13581,13585,13592,13601,13607,13612,13614,13619,13622,13623,13626,13627,13629,13638,13640,13642,13643,13644,13645,13651,13653,13655,13660,13662,13664,13669,13670,13671,13674,13679,13681,13685,13689,13692,13694,13703,13705,13706,13709,13712,13713,13716,13719,13726,13728,13732,13734,13736,13738,13741,13752,13755,13757,13760,13764,13771,13783,13790,13792,13801,13803,13805,13806,13812,13817,13824,13828,13833,13834,13835,13836,13837,13840,13843,13845,13848,13850,13851,13853,13866,13868,13869,13871,13873,13875,13889,13895,13896,13898,13902,13903,13906,13908,13912,13915,13919,13923,13926,13927,13932,13938,13947,13949,13961,13962,13966,13968,13970,13973,13976,13978,13979,13980,13983,13994,13997,14001,14002,14006,14007,14008,14011,14014,14015,14018,14019,14021,14023,14028,14031,14032,14034,14035,14038,14042,14047,14048,14052,14054,14055,14056,14059,14061,14065,14066,14069,14074,14080,14081,14087,14094,14114,14120,14126,14140,14141,14146,14150,14152,14153,14154,14157,14160,14162,14173,14186,14188,14194,14197,14200,14203,14205,14212,14216,14218,14225,14233,14241,14243,14247,14253,14255,14261,14264,14272,14278,14280,14283,14284,14285,14287,14288,14291,14292,14300,14302,14310,14311,14314,14322,14323,14326,14328,14332,14343,14349,14351,14354,14355,14359,14364,14365,14367,14372,14373,14377,14378,14380,14382,14388,14392,14393,14394,14395,14399,14400,14406,14407,14413,14421,14422,14423,14425,14426,14437,14441,14444,14445,14446,14450,14454,14460,14467,14475,14482,14491,14505,14507,14517,14528,14529,14531,14535,14538,14544,14551,14559,14563,14564,14565,14568,14573,14574,14579,14582,14588,14593,14596,14601,14603,14606,14610,14616,14620,14625,14627,14629,14631,14635,14640,14653,14655,14656,14657,14671,14672,14675,14686,14688,14689,14694,14695,14703,14705,14707,14709,14716,14721,14722,14723,14724,14725,14729,14733,14737,14742,14754,14756,14761,14772,14774,14782,14784,14789,14793,14796,14800,14804,14827,14829,14831,14833,14835,14840,14842,14845,14854,14856,14857,14860,14863,14864,14866,14869,14885,14890,14898,14901,14902,14906,14909,14910,14911,14912,14916,14919,14923,14933,14943,14948,14957,14960,14961,14964,14969,14974,14980,14989,14990,14998,14999,15000,15005,15008,15009,15010,15018,15021,15022,15023,15026,15037,15039,15040,15041,15044,15045,15051,15059,15062,15071,15073,15076,15078,15085,15091,15092,15096,15104,15109,15119,15120,15124,15127,15144,15146,15150,15156,15161,15172,15176,15177,15182,15185,15194,15201,15204,15206,15211,15215,15217,15218,15223,15230,15234,15244,15245,15247,15253,15259,15263,15264,15265,15266,15267,15270,15276,15278,15280,15281,15282,15283,15286,15289,15292,15295,15296,15301,15302,15311,15313,15315,15320,15323,15334,15340,15349,15352,15361,15370,15373,15378,15379,15380,15381,15383,15388,15393,15395,15401,15405,15409,15422,15428,15436,15449,15457,15458,15460,15461,15462,15464,15470,15478,15481,15483,15484,15485,15488,15490,15492,15498,15499,15502,15506,15509,15513,15517,15519,15521,15522,15537,15540,15548,15555,15560,15561,15567,15578,15581,15582,15584,15587,15595,15597,15601,15602,15603,15604,15609,15610,15611,15613,15614,15615,15619,15623,15626,15627,15628,15629,15632,15641,15647,15654,15655,15657,15660,15666,15668,15669,15670,15678,15679,15682,15686,15688,15691,15694,15695,15697,15700,15703,15712,15723,15725,15726,15728,15730,15731,15744,15747,15748,15751,15761,15763,15766,15773,15780,15792,15799,15804,15808,15817,15818,15819,15821,15822,15824,15825,15834,15835,15845,15846,15850,15853,15854,15856,15867,15880,15887,15888,15894,15897,15900,15912,15918,15923,15929,15930,15932,15934,15936,15937,15940,15946,15953,15954,15955,15956,15958,15964,15969,15973,15974,15978,15979,15983,15985,15999]; unseen=[60000,60002,60003,60010,60011,60020,60024,60025,60026,60031,60033,60036,60038,60042,60046,60049,60052,60055,60058,60060,60063,60077,60084,60088,60097,60108,60109,60110,60114,60121,60135,60138,60139,60142,60144,60146,60158,60160,60164,60168,60169,60173,60174,60185,60186,60190,60198,60199,60201,60203,60208,60211,60215,60222,60223,60227,60240,60241,60246,60254,60258,60260,60270,60272,60278,60280,60286,60293,60294,60299,60307,60308,60314,60324,60328,60331,60333,60335,60336,60337,60339,60340,60345,60346,60348,60350,60351,60352,60353,60357,60363,60364,60365,60367,60373,60380,60383,60385,60390,60392,60397,60399,60411,60422,60423,60425,60429,60435,60441,60445,60447,60452,60453,60459,60467,60468,60470,60474,60489,60491,60499,60502,60504,60506,60509,60510,60517,60518,60520,60523,60532,60534,60536,60537,60541,60545,60546,60549,60551,60552,60556,60557,60562,60563,60570,60572,60593,60596,60598,60601,60602,60606,60609,60635,60637,60639,60640,60644,60649,60653,60665,60666,60669,60670,60671,60675,60677,60683,60689,60694,60696,60700,60701,60716,60720,60730,60731,60733,60735,60739,60740,60742,60748,60752,60755,60761,60763,60764,60767,60768,60769,60771,60773,60774,60777,60785,60786,60790,60794,60795,60796,60797,60804,60810,60811,60814,60822,60826,60827,60833,60837,60838,60841,60844,60849,60850,60851,60854,60856,60857,60859,60866,60871,60879,60881,60885,60895,60897,60900,60904,60908,60909,60911,60912,60914,60916,60918,60921,60922,60924,60926,60931,60932,60935,60939,60943,60950,60955,60961,60963,60965,60967,60968,60970,60973,60974,60977,60978,60987,61001,61003,61005,61006,61012,61015,61017,61019,61031,61033,61034,61036,61039,61043,61050,61051,61056,61062,61073,61077,61081,61087,61090,61099,61103,61105,61112,61120,61126,61130,61133,61137,61139,61147,61148,61152,61153,61154,61155,61156,61158,61161,61162,61163,61164,61166,61179,61184,61185,61192,61210,61212,61215,61223,61226,61233,61242,61243,61244,61248,61249,61253,61261,61270,61271,61276,61277,61282,61290,61291,61294,61300,61307,61308,61309,61312,61323,61324,61326,61328,61329,61331,61337,61339,61345,61352,61357,61362,61366,61367,61371,61375,61377,61378,61379,61383,61386,61391,61395,61398,61400,61411,61413,61414,61415,61418,61421,61422,61424,61433,61434,61435,61438,61439,61443,61447,61450,61452,61454,61462,61464,61468,61469,61470,61471,61484,61495,61503,61504,61508,61509,61521,61527,61529,61531,61539,61543,61550,61551,61552,61558,61560,61567,61569,61571,61574,61581,61586,61589,61592,61594,61603,61607,61608,61610,61611,61616,61618,61628,61634,61639,61641,61643,61645,61649,61652,61660,61667,61670,61673,61676,61681,61687,61689,61695,61699,61700,61703,61707,61709,61710,61713,61714,61716,61718,61720,61722,61723,61731,61732,61733,61766,61771,61772,61773,61774,61778,61780,61783,61788,61793,61796,61799,61802,61809,61810,61815,61820,61821,61822,61824,61826,61831,61832,61836,61837,61842,61845,61847,61850,61851,61852,61858,61859,61862,61865,61866,61871,61875,61876,61877,61885,61892,61894,61902,61905,61911,61914,61920,61921,61922,61923,61925,61929,61930,61934,61943,61944,61945,61946,61956,61965,61966,61967,61973,61976,61979,61984,61986,61987,61989,61990,61991,61995,61996,62010,62011,62025,62031,62037,62045,62047,62050,62064,62071,62074,62076,62077,62079,62082,62085,62090,62091,62102,62103,62104,62107,62114,62116,62121,62125,62129,62130,62133,62136,62138,62140,62142,62146,62162,62164,62166,62167,62172,62177,62178,62182,62188,62193,62194,62197,62210,62213,62215,62224,62225,62231,62236,62240,62242,62261,62264,62273,62275,62278,62281,62290,62291,62293,62297,62298,62300,62303,62305,62308,62310,62323,62324,62327,62328,62333,62335,62336,62337,62339,62343,62346,62348,62351,62352,62353,62358,62361,62363,62367,62369,62380,62388,62393,62394,62401,62402,62409,62419,62421,62425,62429,62433,62435,62436,62437,62438,62467,62469,62471,62481,62483,62485,62489,62492,62501,62502,62503,62514,62517,62525,62529,62530,62532,62533,62535,62539,62541,62545,62547,62553,62557,62559,62569,62576,62579,62584,62593,62594,62601,62607,62614,62616,62618,62627,62629,62638,62641,62642,62644,62647,62648,62649,62651,62652,62656,62659,62660,62665,62666,62670,62680,62681,62690,62696,62697,62699,62702,62704,62712,62713,62714,62716,62720,62721,62725,62726,62729,62730,62733,62734,62737,62739,62740,62742,62746,62748,62754,62755,62760,62766,62772,62780,62784,62786,62796,62808,62810,62816,62823,62826,62844,62845,62851,62854,62855,62857,62858,62860,62861,62865,62866,62870,62879,62883,62884,62885,62894,62896,62902,62906,62908,62917,62918,62921,62922,62926,62928,62932,62933,62940,62941,62942,62943,62950,62951,62966,62967,62971,62977,62981,62982,62990,62991,63011,63016,63023,63028,63029,63031,63033,63037,63055,63056,63060,63061,63064,63065,63069,63071,63075,63085,63088,63091,63093,63099,63104,63114,63116,63118,63120,63127,63129,63130,63133,63134,63139,63156,63159,63160,63163,63164,63165,63169,63176,63178,63180,63181,63183,63187,63191,63199,63201,63202,63209,63224,63229,63230,63231,63232,63237,63244,63247,63249,63253,63256,63259,63268,63270,63272,63274,63281,63285,63291,63292,63298,63303,63305,63307,63309,63310,63313,63316,63317,63319,63321,63327,63333,63335,63338,63344,63346,63352,63355,63356,63364,63365,63366,63372,63374,63383,63388,63391,63393,63399,63405,63408,63410,63416,63417,63419,63422,63424,63428,63433,63441,63443,63449,63451,63452,63454,63455,63458,63460,63461,63468,63469,63472,63475,63478,63485,63486,63489,63493,63496,63498,63501,63502,63503,63506,63507,63509,63510,63511,63513,63514,63519,63521,63526,63529,63531,63533,63540,63542,63544,63547,63553,63555,63557,63558,63564,63565,63570,63584,63593,63604,63606,63609,63623,63625,63627,63630,63633,63636,63638,63639,63641,63645,63647,63648,63651,63656,63657,63658,63671,63674,63675,63678,63683,63694,63696,63697,63700,63704,63710,63711,63714,63716,63718,63719,63723,63727,63728,63729,63735,63737,63740,63743,63747,63749,63750,63753,63755,63757,63758,63760,63763,63774,63781,63793,63797,63801,63804,63805,63812,63815,63833,63834,63841,63842,63843,63846,63849,63853,63856,63866,63867,63869,63870,63878,63880,63884,63885,63892,63894,63903,63909,63914,63916,63919,63924,63928,63930,63936,63937,63938,63941,63942,63946,63952,63954,63959,63962,63968,63975,63976,63977,63980,63982,63984,63986,63992,63996,63998,64000,64001,64003,64012,64015,64016,64018,64019,64021,64022,64028,64029,64035,64040,64049,64051,64053,64054,64056,64067,64071,64077,64079,64094,64095,64097,64099,64112,64114,64118,64119,64123,64124,64135,64138,64141,64146,64155,64156,64157,64158,64160,64168,64170,64171,64172,64174,64175,64182,64185,64186,64199,64203,64205,64206,64211,64213,64214,64215,64217,64223,64227,64242,64246,64251,64253,64264,64266,64270,64272,64278,64279,64284,64286,64287,64291,64293,64296,64299,64303,64312,64318,64323,64324,64325,64328,64330,64333,64334,64342,64343,64344,64345,64348,64353,64362,64364,64366,64367,64371,64372,64373,64376,64386,64392,64399,64402,64403,64404,64405,64407,64411,64414,64415,64416,64418,64420,64422,64423,64424,64426,64434,64435,64438,64441,64442,64447,64449,64450,64451,64455,64461,64465,64471,64477,64480,64490,64491,64492,64497,64498,64499,64500,64503,64505,64514,64522,64524,64537,64540,64546,64553,64555,64571,64572,64573,64578,64579,64581,64589,64595,64608,64609,64610,64615,64619,64624,64625,64639,64645,64647,64649,64651,64654,64657,64670,64673,64680,64686,64690,64691,64692,64698,64701,64708,64711,64722,64725,64727,64738,64741,64744,64745,64753,64755,64759,64762,64766,64770,64781,64783,64786,64787,64791,64792,64794,64802,64806,64809,64813,64816,64824,64826,64831,64843,64846,64849,64854,64855,64856,64860,64866,64882,64884,64886,64890,64895,64896,64898,64905,64909,64910,64913,64921,64930,64939,64941,64942,64949,64953,64957,64969,64971,64986,64995,64997,65001,65007,65008,65012,65018,65019,65020,65023,65025,65037,65038,65040,65043,65046,65055,65062,65065,65069,65073,65076,65081,65084,65086,65096,65100,65101,65103,65104,65109,65113,65118,65121,65127,65132,65135,65136,65143,65144,65148,65154,65171,65176,65177,65187,65189,65192,65196,65198,65204,65209,65215,65218,65219,65223,65224,65230,65235,65237,65240,65244,65245,65250,65252,65266,65268,65269,65272,65274,65276,65277,65278,65281,65282,65289,65291,65292,65294,65296,65304,65316,65318,65323,65326,65332,65342,65345,65354,65355,65359,65361,65365,65368,65369,65370,65375,65378,65380,65382,65386,65393,65398,65403,65405,65406,65408,65410,65413,65419,65425,65430,65436,65451,65452,65453,65457,65458,65459,65462,65463,65470,65492,65499,65504,65509,65512,65517,65518,65525,65526,65527,65532,65535,65537,65541,65547,65551,65554,65558,65561,65564,65565,65572,65574,65575,65578,65585,65586,65587,65595,65598,65605,65606,65610,65616,65619,65629,65630,65632,65635,65636,65640,65641,65643,65649,65653,65655,65656,65658,65664,65680,65684,65690,65692,65693,65697,65702,65705,65706,65709,65710,65713,65719,65724,65737,65749,65751,65755,65758,65759,65771,65775,65779,65781,65786,65789,65790,65792,65793,65801,65808,65810,65813,65815,65819,65821,65824,65830,65835,65844,65847,65855,65857,65862,65871,65873,65877,65878,65879,65880,65886,65894,65901,65902,65903,65912,65914,65917,65918,65919,65921,65925,65928,65945,65950,65952,65953,65956,65960,65968,65972,65978,65980,65988,65994,65997,65999,66003,66011,66013,66014,66016,66017,66018,66020,66022,66035,66038,66039,66044,66050,66051,66052,66054,66055,66059,66061,66062,66064,66068,66069,66070,66071,66073,66081,66085,66090,66095,66097,66102,66104,66106,66115,66116,66120,66121,66122,66130,66131,66132,66135,66138,66147,66148,66151,66157,66162,66164,66173,66180,66182,66183,66184,66192,66194,66197,66198,66201,66210,66213,66214,66217,66224,66230,66232,66238,66242,66253,66257,66258,66259,66262,66266,66268,66270,66273,66274,66280,66281,66291,66295,66300,66302,66312,66314,66315,66317,66320,66327,66329,66330,66335,66337,66338,66340,66341,66344,66354,66355,66358,66359,66366,66370,66371,66378,66382,66386,66393,66398,66399,66403,66404,66405,66406,66408,66409,66411,66414,66420,66423,66424,66428,66434,66435,66436,66447,66450,66461,66466,66470,66474,66475,66477,66492,66493,66494,66495,66503,66506,66508,66515,66517,66519,66525,66539,66540,66542,66543,66547,66549,66553,66556,66559,66564,66570,66576,66578,66581,66582,66583,66588,66591,66594,66595,66601,66603,66604,66609,66612,66615,66619,66623,66628,66630,66639,66644,66648,66649,66652,66654,66657,66662,66668,66669,66674,66679,66680,66681,66684,66692,66700,66703,66708,66710,66711,66715,66717,66725,66727,66738,66742,66743,66744,66764,66765,66771,66773,66775,66781,66784,66792,66799,66803,66805,66807,66808,66813,66814,66818,66820,66826,66837,66850,66853,66854,66861,66864,66865,66873,66885,66887,66888,66891,66895,66897,66900,66901,66905,66906,66907,66908,66915,66925,66926,66931,66941,66949,66963,66970,66971,66974,66978,66979,66986,66988,66996,67001,67002,67004,67009,67010,67011,67015,67016,67025,67028,67029,67031,67032,67043,67044,67046,67047,67048,67050,67051,67052,67054,67058,67061,67067,67070,67073,67077,67078,67084,67085,67087,67090,67095,67096,67097,67101,67102,67103,67108,67112,67114,67117,67121,67134,67135,67138,67144,67146,67147,67153,67158,67162,67168,67172,67180,67183,67189,67194,67197,67205,67212,67213,67219,67221,67224,67225,67231,67232,67233,67234,67245,67246,67247,67264,67279,67282,67283,67288,67291,67300,67304,67308,67317,67322,67324,67325,67328,67330,67348,67353,67354,67362,67363,67369,67371,67379,67390,67393,67395,67397,67405,67406,67407,67410,67415,67417,67421,67422,67432,67435,67437,67441,67444,67446,67452,67457,67461,67470,67471,67474,67479,67483,67484,67486,67490,67491,67495,67498,67499,67500,67512,67527,67532,67533,67536,67543,67545,67548,67557,67558,67561,67563,67565,67568,67569,67570,67578,67584,67587,67591,67594,67603,67610,67615,67616,67622,67624,67628,67631,67638,67639,67641,67644,67646,67647,67648,67652,67655,67659,67660,67672,67681,67683,67685,67686,67691,67693,67694,67700,67707,67708,67714,67716,67717,67723,67733,67739,67742,67743,67753,67758,67762,67766,67768,67771,67772,67775,67776,67777,67778,67780,67781,67782,67788,67789,67799,67803,67806,67814,67819,67820,67822,67828,67829,67840,67846,67853,67855,67859,67860,67868,67871,67875,67884,67889,67890,67892,67909,67923,67929,67942,67960,67961,67966,67967,67968,67970,67971,67977,67978,67980,67983,67988,67992,67996]",
  "blocked": null,
  "python_version": "3.12.3",
  "spread": 3,
  "base_mean_edge": 98.4694596619638,
  "runs": {
    "tuning": 1954,
    "unseen": 2035
  },
  "base_unseen": {
    "mean_edge": 118.8166859338749,
    "retail_edge": 149.05823988395983,
    "arb_edge": -30.241553950072774
  },
  "holdout": {
    "mean_edge": 119.07508370705573,
    "retail_edge": 148.91930495516078,
    "arb_edge": -29.844221248092726,
    "failures": 0
  },
  "diff": {
    "mean": 0.258397773180835,
    "standard_error": 0.06715391658373343,
    "retail": -0.13893492879906663,
    "arb": 0.3973327019800491
  },
  "others_identical": {
    "runs": 900,
    "identical": true
  },
  "seconds": {
    "base": 131.22639974730555,
    "yours": 130.1308977860026
  },
  "code": "\"\"\"Spread-3 clock: avoid premium ammunition early; restore base late.\"\"\"\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\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        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 == 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 == 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 == 3:\n                previous_pairs = list(zip(self.bc, self.bw))\n                for c in cs:\n                    t = uni\n                    for ci, wi in previous_pairs:\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            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 == 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        if self.s == 3 and H > 500 and amt >= 2 and amt / 100.0 > phat:\n            amt, qam = 0, 0.0\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 == 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",
  "code_sha256": "3bc29169923ccceeb35c5d43df831a531d0da692979efaa3a7ec46cd0d7955f9",
  "tried": [
    "Base time profile over all 1954 tuning runs; [retail edge, arb edge] per run, successive H windows 2000..1751 through 250..1: [[7.017256945462027, -1.504969277725077], [8.169935938014586, -1.8555176622342373], [9.998462494562743, -2.39265349274391], [12.697754967450308, -3.0040882886887412], [16.84116298828178, -3.890442357018117], [22.462849853828917, -3.732256266899437], [30.68016701305174, -5.304781604884186], [45.855560308174155, -6.978268596923592]]",
    "bridge1000: bridge-stock cash fraction 0.3*min(1,1000/H); 0_400: n=400, mean=0.0016417614812499614, SE=0.0012409037247547339, retail=0.0038149168069999463, arb=-0.0021731553247499847, failures=0",
    "bridge200: bridge-stock cash fraction 0.3*min(1,200/H); 0_400: n=400, mean=-0.4258731297794991, SE=0.2562404442244906, retail=-0.23258996229124995, arb=-0.19328316748475, failures=0",
    "bridge500: bridge-stock cash fraction 0.3*min(1,500/H); 0_400: n=400, mean=-0.17091576958825008, SE=0.17367449171405858, retail=-0.13745313209499993, arb=-0.03346263749099997, failures=0",
    "clockA: linear sizing-loss multiplier 1.5 at H=2000 to 0.6 at H=0; 0_400: n=400, mean=-2.1812086769447507, SE=0.7655255512834074, retail=0.2462430145152491, arb=-2.42745169141925, failures=0",
    "clockB: linear sizing-loss multiplier 2.0 at H=2000 to 0.5 at H=0; 0_400: n=400, mean=-2.1984364400432503, SE=0.7353290492398575, retail=-0.8783378333905004, arb=-1.3200986066445006, failures=0",
    "clockC: linear sizing-loss multiplier 1.25 at H=2000 to 0.75 at H=0; 0_400: n=400, mean=-1.414188937329251, SE=0.5195313312187768, retail=0.1862012158372487, arb=-1.6003901531575002, failures=0",
    "clockD: linear sizing-loss multiplier 0.75 at H=2000 to 1.25 at H=0; 0_400: n=400, mean=0.8804966025719999, SE=0.45306605548898504, retail=0.047198280635999346, arb=0.83329832195525, failures=0; 400_1000: n=600, mean=0.14429905070650043, SE=0.23297656387266238, retail=-0.24278897582616632, arb=0.3870880265641668, failures=0",
    "clockE: linear sizing-loss multiplier 0.5 at H=2000 to 1.5 at H=0; 0_400: n=400, mean=0.62191147068525, SE=0.6253336609876373, retail=-0.040259532003000816, arb=0.6621710027384998, failures=0",
    "clockF: linear sizing-loss multiplier 0.75 at H=2000 to 1.0 at H=0; 0_400: n=400, mean=-0.4930457398930001, SE=0.2717101478764004, retail=1.2683989751592493, arb=-1.76144471504825, failures=0",
    "clockG: linear sizing-loss multiplier 1.0 at H=2000 to 0.5 at H=0; 0_400: n=400, mean=-2.1327062129709993, SE=0.8162476301306256, retail=4.37004582276, arb=-6.50275203571975, failures=0",
    "cross0: cap only crossing-stock demand horizon at 0; preserve tick-1 target; 0_400: n=400, mean=0.24287766528700047, SE=0.18362524948107822, retail=-0.041009604658000146, arb=0.28388726994125, failures=0",
    "cross100: cap only crossing-stock demand horizon at 100; preserve tick-1 target; 0_400: n=400, mean=0.2326624169515005, SE=0.18348455676593295, retail=-0.03930953572875012, arb=0.27197195267650004, failures=0",
    "cross1000: cap only crossing-stock demand horizon at 1000; preserve tick-1 target; 0_400: n=400, mean=-0.0018324589955003034, SE=0.013607049460439603, retail=-7.508647000378232e-06, arb=-0.0018249503490000408, failures=0",
    "cross200: cap only crossing-stock demand horizon at 200; preserve tick-1 target; 0_400: n=400, mean=0.3905371229825008, SE=0.1662619846023477, retail=0.08427817722849971, arb=0.3062589457525, failures=0; 400_1000: n=600, mean=0.34117855534400016, SE=0.1223947279856939, retail=-0.046823737034666614, arb=0.38800229237750006, failures=0",
    "cross50: cap only crossing-stock demand horizon at 50; preserve tick-1 target; 0_400: n=400, mean=0.2413738085120004, SE=0.1836202096715935, retail=-0.04101755496725012, arb=0.28239136347525, failures=0",
    "cross500: cap only crossing-stock demand horizon at 500; preserve tick-1 target; 0_400: n=400, mean=0.14921060850175016, SE=0.09103620404918132, retail=0.014922114581999608, arb=0.13428849391975015, failures=0",
    "crossEarly0: cap crossing-stock horizon at 0 only when H>500; restore base late; 0_400: n=400, mean=0.20671952328825027, SE=0.18309644713178425, retail=-0.03942668261350015, arb=0.24614620589850003, failures=0",
    "crossEarly200: cap crossing-stock horizon at 200 only when H>500; restore base late; 0_400: n=400, mean=0.3693016066607509, SE=0.1660292922334034, retail=0.0842803013154998, arb=0.28502130534349995, failures=0",
    "crossEarly50: cap crossing-stock horizon at 50 only when H>500; restore base late; 0_400: n=400, mean=0.20671952328825027, SE=0.18309644713178425, retail=-0.03942668261350015, arb=0.24614620589850003, failures=0",
    "crossHigh200: cap crossing-stock horizon at 200 only when estimated p>1 cent; 0_1000: n=1000, mean=0.35470355375210044, SE=0.09787910508719859, retail=0.005646617414599881, arb=0.34905693633600005, failures=0",
    "earlypush: loss multiplier rises from 0.5 at H=2000 to 1 at expiry; 0_400: n=400, mean=-1.4198382866652504, SE=0.38912917159269866, retail=3.2353889889, arb=-4.65522727553175, failures=0",
    "guard15: late sizing-loss multiplier rises from 1 at H=1000 to 1.5 at H=0; 0_400: n=400, mean=1.0815266286710001, SE=0.5902674634206486, retail=-1.5427971869385004, arb=2.6243238156272497, failures=0; 400_1000: n=600, mean=-0.234909880628667, SE=0.37222527507404035, retail=-1.9057577407830002, arb=1.6708478601724999, failures=0",
    "guard20: late sizing-loss multiplier rises from 1 at H=1000 to 2 at H=0; 0_400: n=400, mean=0.9058920495810002, SE=0.8796840594374051, retail=-3.0657244712457516, arb=3.9716165208467498, failures=0",
    "guard30: late sizing-loss multiplier rises from 1 at H=1000 to 3 at H=0; 0_400: n=400, mean=0.5963787801592507, SE=1.203780086626018, retail=-5.104116909783001, arb=5.7004956899552495, failures=0",
    "guard500: late loss multiplier rises from 1 at H=500 to 2 at expiry; 0_400: n=400, mean=1.1238570813305, SE=0.7767027156022753, retail=-1.7381062212492504, arb=2.86196330258075, failures=0",
    "guardhigh: late loss multiplier rises to 2 only at estimated p>=5 cents; 0_400: n=400, mean=-0.015358001945749225, SE=0.2381937731843793, retail=-1.8452262736112517, arb=1.8298682716775003, failures=0",
    "late100: uncovered cheap-ask collateral ramp starts at H=100, replacing H=300; 0_400: n=400, mean=-0.04972108091274979, SE=0.0546511566144127, retail=-0.11529892922300011, arb=0.0655778483107497, failures=0",
    "late1000: uncovered cheap-ask collateral ramp starts at H=1000, replacing H=300; 0_400: n=400, mean=-0.3021306228442493, SE=0.24269965444684924, retail=-0.06170616533475078, arb=-0.24042445751274996, failures=0",
    "late2000: uncovered cheap-ask collateral ramp starts at H=2000, replacing H=300; 0_400: n=400, mean=-1.1873691964515, SE=0.5923610925727958, retail=0.14667918336074864, arb=-1.3340483798054998, failures=0",
    "late600: uncovered cheap-ask collateral ramp starts at H=600, replacing H=300; 0_400: n=400, mean=0.020007125607000163, SE=0.047680167995070036, retail=0.032904957388249605, arb=-0.012897831782999952, failures=0",
    "premium1000: when H>1000, suppress above-estimate ammunition bids at ticks >=2; preserve bridge; 0_400: n=400, mean=0.11742080537375013, SE=0.1169593257891323, retail=-0.050992125435500475, arb=0.16841293080925, failures=0",
    "refill100: below 1 cent replenish tick-1 stock for min(H-5,100) steps at notional rate 0.6; stop H<=5; 0_400: n=400, mean=0.008787235829500037, SE=0.03703852826641037, retail=0.03649887442175018, arb=-0.027711638592749985, failures=0",
    "refill20: below 1 cent replenish tick-1 stock for min(H-5,20) steps at notional rate 0.6; stop H<=5; 0_400: n=400, mean=0.012622597156249995, SE=0.019764228053603488, retail=0.010067537235749775, arb=0.002555059920250029, failures=0",
    "refill200: below 1 cent replenish tick-1 stock for min(H-5,200) steps at notional rate 0.6; stop H<=5; 0_400: n=400, mean=-0.12821885936199978, SE=0.0853804453018254, retail=0.03218239741050016, arb=-0.16040125677350006, failures=0",
    "refill50: below 1 cent replenish tick-1 stock for min(H-5,50) steps at notional rate 0.6; stop H<=5; 0_400: n=400, mean=0.02354940477474967, SE=0.03410655298285409, retail=0.03674691914374957, arb=-0.013197514369749941, failures=0",
    "stock1000: cap both crossing-stock and tick-1 stock demand horizons at 1000; 0_400: n=400, mean=-0.04550768404724991, SE=0.12356069293041543, retail=-0.039753418884499896, arb=-0.0057542651634999945, failures=0",
    "stock300: cap both crossing-stock and tick-1 stock demand horizons at 300; 0_400: n=400, mean=-3.4811783351124994, SE=0.9509536891228892, retail=-0.16219973080574987, arb=-3.3189786043105, failures=0",
    "stock600: cap both crossing-stock and tick-1 stock demand horizons at 600; 0_400: n=400, mean=-0.8936369036502492, SE=0.4990551520522727, retail=-0.08291090959450002, arb=-0.8107259940575, failures=0",
    "premium500: when H>500, suppress above-estimate ammunition bids at ticks >=2; preserve bridge; 1000_1954: n=954, mean=0.27613693834874115, SE=0.10651436298802473, retail=-0.13936369372127846, arb=0.4155006320684486, failures=0; 0_1954: n=1954, mean=0.32934907659616125, SE=0.06734113904023842, retail=-0.11008765785685773, arb=0.43943673445138176, failures=0; 0_400: n=400, mean=0.37354589307925046, SE=0.13039917989782543, retail=-0.11171996767800053, arb=0.4852658607577499, failures=0; 400_1000: n=600, mean=0.3844918320874999, SE=0.10902232823380084, retail=-0.06245055428500024, arb=0.44694238636933337, failures=0; allocation-only reuse of previous belief-grid pairs: all 4889 simulator results identical to the first policy implementation; original implementation mean 200-run wall seconds={'base': 131.78081806170908, 'yours': 132.0597464533057}; repaired implementation mean 200-run wall seconds={'base': 131.22639974730555, 'yours': 130.1308977860026}"
  ],
  "next": "Use a fresh unseen seed range: 60000..67999 has now been evaluated. Investigate a time-dependent premium budget based on remaining retail turnover rather than a sharp 500-step gate, preserving tick-1 replenishment and below-estimate bridge orders. The 1000-step cutoff was weaker; broad late quote caution failed validation, and plain stock caps harmed edge. Keep any change gated to spread 3 and verify runtime."
}