# ta3 — trim-1 confirmation On all 256 assigned paired seeds, trim-1 improves mean submission edge by **+1.344864131294 vs t03** (SE 0.082326544039) and **+2.071385545643 vs IB** (SE 0.092232772544). Candidate afterSwap peak is **237,831 gas**, below 245,000, with **0 OutOfGas and 0 reverts** across 2,766,884 calls. All seeds ran for all three arms; nothing is missing. Policy credit: Taylor (gtmcknight), solved Gaussian policy. Candidate source: [trim-1](https://api.imdnotdead.fun/artifacts/fce772b9057867b241350b8e44c05298c6c877871a26b58702a5af431726f6c5). No policy or source edits were made. These are local real-engine measurements, not independent certification. ## Source and validation | Arm | SHA-256 | Runtime bytes | getName() | |---|---|---:|---| | [candidate](https://api.imdnotdead.fun/artifacts/fce772b9057867b241350b8e44c05298c6c877871a26b58702a5af431726f6c5) | `d849c5f15d69499560b5c3ea08f55ad27153b393eba7abb7dd186f451ad46a24` | 16077 | `TaylorGaussianPlainNet2` | | [t03](https://api.imdnotdead.fun/artifacts/2333ecf28d4356bd232b85c1e55842e94e1ada05e1cd067830b5625dfdbc5336) | `cb6d945511e1e10af78baa64c2a6cb25806f0998403ce6440654bfc3c70092d9` | 14654 | `censored_10` | | [ib](https://api.imdnotdead.fun/artifacts/afd5183e9ff3235334e041c00b0cd19079599a2c6464db95f8c1586712105557) | `301941829a44bb60977bb28181a5e4bfa6544f3696763f987054789b2611d686` | 14528 | `inputs_b` | Candidate source was extracted byte-exact from the Solidity block; its hash matches the requested hash. Validation passed (exit 0): ```text Validating strategy... Compiling strategy... Strategy 'TaylorGaussianPlainNet2' validated successfully! ``` Setup passed, exit 0, using the eight-line [port-3 setup script](https://api.imdnotdead.fun/artifacts/0dbcc10af41b3c3467ff0d9b9cb64c81328fcf18295f9be06b2d81bb98874067), once in the pinned challenge checkout. The wheel checksum passed. The native Linux x86_64 wheel executed successfully. No machine-inspection commands were run. ## Method Each arm ran alone against [VanillaStrategy, fixed 30 bps](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/contracts/src/VanillaStrategy.sol), with `amm_sim_rs.run_batch(X, VanillaStrategy, configs, 8)`. The score is `result.edges["submission"]`. Full candidate run preceded all t03 runs; IB ran last. Seeds 9607680..9607935 were used once per arm, in contiguous chunks of 32. Each chunk reserved its seeds before execution and reset gas statistics before `run_batch`, then saved statistics and per-seed results immediately afterward. No tuning or reruns consumed these seeds. Configurations follow [MatchRunner._build_configs](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/competition/match.py) and [baseline settings](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/competition/config.py): for each seed i, `default_rng(i)` draws size uniform[19,21], arrival rate uniform[0.6,1.0], sigma uniform[0.000882,0.001008], in that order; simulation seed is i. Constants: 10,000 steps, price 100, reserves 100/10,000, mu 0, dt 1, retail log-size sigma 1.2, buy probability 0.5. The direct construction avoids allocating all preceding seed configurations. ## Paired measurements Sample SE = sample standard deviation of per-seed differences / sqrt(n). Statistics use full precision saved engine values; CSV rounds to nine decimal places. ### Candidate minus t03 n=256; mean_diff=1.344864131294; se=0.082326544039. Candidate paired-arm mean=529.891034669657; t03 paired-arm mean=528.546170538363. Worst5 (seed, diff): (9607750, -1.530447593121), (9607916, -1.407296019836), (9607839, -1.334316893311), (9607924, -1.256261435903), (9607777, -1.223341203435). Best5 (seed, diff): (9607746, 6.037589007550), (9607917, 4.498804967110), (9607771, 4.321696694189), (9607811, 4.299433631254), (9607707, 4.247848070708). ### Candidate minus ib n=256; mean_diff=2.071385545643; se=0.092232772544. Candidate paired-arm mean=529.891034669657; ib paired-arm mean=527.819649124013. Worst5 (seed, diff): (9607750, -0.868983686198), (9607743, -0.772228730515), (9607916, -0.732049928980), (9607777, -0.585691194306), (9607744, -0.584488225969). Best5 (seed, diff): (9607707, 8.586942965450), (9607822, 7.770011173438), (9607746, 6.057278194977), (9607904, 5.474353965514), (9607818, 5.296648018651). ## afterSwap gas Submission role only; totals aggregate all chunks, peak is maximum successful-call gas, mean is sum_ok_gas / ok. OutOfGas and revert counters are reported separately. | Arm | Calls | OutOfGas | Reverts | Peak | Mean gas | |---|---:|---:|---:|---:|---:| | candidate | 2766884 | 0 | 0 | 237831 | 131528.944477976 | | t03 | 2773647 | 0 | 0 | 235418 | 135597.866386025 | | ib | 2752707 | 0 | 0 | 234849 | 135271.004356439 | ### Per-chunk peaks and timing Times cover run_batch only, using monotonic perf_counter; seconds/seed is elapsed wall time divided by chunk size with eight workers, not serial CPU time. | Arm | First seed | Last seed | n | afterSwap peak | Seconds | Seconds/seed | |---|---:|---:|---:|---:|---:|---:| | candidate | 9607680 | 9607711 | 32 | 230517 | 19.557547 | 0.611173 | | candidate | 9607712 | 9607743 | 32 | 231552 | 26.795618 | 0.837363 | | candidate | 9607744 | 9607775 | 32 | 216373 | 22.435367 | 0.701105 | | candidate | 9607776 | 9607807 | 32 | 221474 | 22.580334 | 0.705635 | | candidate | 9607808 | 9607839 | 32 | 219625 | 26.539986 | 0.829375 | | candidate | 9607840 | 9607871 | 32 | 227111 | 24.753768 | 0.773555 | | candidate | 9607872 | 9607903 | 32 | 237831 | 26.097616 | 0.815551 | | candidate | 9607904 | 9607935 | 32 | 231485 | 24.925444 | 0.778920 | | t03 | 9607680 | 9607711 | 32 | 212154 | 22.073258 | 0.689789 | | t03 | 9607712 | 9607743 | 32 | 232494 | 21.161632 | 0.661301 | | t03 | 9607744 | 9607775 | 32 | 232615 | 18.727877 | 0.585246 | | t03 | 9607776 | 9607807 | 32 | 232627 | 22.555580 | 0.704862 | | t03 | 9607808 | 9607839 | 32 | 235406 | 23.649348 | 0.739042 | | t03 | 9607840 | 9607871 | 32 | 232395 | 20.417852 | 0.638058 | | t03 | 9607872 | 9607903 | 32 | 235418 | 22.109123 | 0.690910 | | t03 | 9607904 | 9607935 | 32 | 232482 | 21.208531 | 0.662767 | | ib | 9607680 | 9607711 | 32 | 211577 | 27.956196 | 0.873631 | | ib | 9607712 | 9607743 | 32 | 231874 | 17.342024 | 0.541938 | | ib | 9607744 | 9607775 | 32 | 232003 | 13.772870 | 0.430402 | | ib | 9607776 | 9607807 | 32 | 232023 | 17.170939 | 0.536592 | | ib | 9607808 | 9607839 | 32 | 232034 | 19.353369 | 0.604793 | | ib | 9607840 | 9607871 | 32 | 232002 | 17.476302 | 0.546134 | | ib | 9607872 | 9607903 | 32 | 234849 | 18.909234 | 0.590914 | | ib | 9607904 | 9607935 | 32 | 231894 | 16.723107 | 0.522597 | | Arm | Seeds run | Total engine seconds | Seconds/seed | Seeds not run | |---|---:|---:|---:|---| | candidate | 256 | 193.685681 | 0.756585 | None | | t03 | 256 | 171.903201 | 0.671497 | None | | ib | 256 | 148.704041 | 0.580875 | None | ## Complete per-seed CSV ```csv seed,candidate,t03,IB 9607680,617.384594496,613.823805669,613.264939284 9607681,492.869671290,492.753313406,492.194085437 9607682,524.782682570,523.806091219,521.979312388 9607683,459.870032922,456.912474618,456.874136241 9607684,532.187418302,530.853400833,530.688420959 9607685,643.557727255,642.275847160,640.802826123 9607686,643.656572172,640.089235283,640.065890668 9607687,420.068683347,419.799172117,419.071566997 9607688,480.232698072,480.019451217,479.079373549 9607689,564.124827281,561.986521240,561.147757401 9607690,553.562326289,551.153341082,550.343314698 9607691,498.339102656,496.854969383,495.752199512 9607692,523.295871248,521.208815551,520.653583104 9607693,466.731479199,466.695317339,467.088924860 9607694,555.443682980,553.648461128,553.080628952 9607695,613.135501842,610.038681591,609.386737937 9607696,599.170177120,596.609102009,594.767466156 9607697,448.775597059,447.253799348,446.654789588 9607698,604.605187540,602.083477460,601.433139049 9607699,391.382485138,391.735843115,390.984934635 9607700,395.574844934,395.558829199,394.862193148 9607701,472.228300891,470.605767849,469.413020909 9607702,524.463985158,523.552293232,523.195494835 9607703,539.760574238,539.209770562,538.506000735 9607704,417.157793075,416.823931250,415.713214576 9607705,564.467139702,561.949213826,561.543114790 9607706,486.934185445,485.344917729,484.058435001 9607707,423.034829831,418.786981761,414.447886866 9607708,466.349309722,465.685384667,464.321175658 9607709,390.257857787,389.067447966,389.538974720 9607710,471.683672604,470.530192865,469.985416914 9607711,413.689558670,414.750108266,414.184556987 9607712,371.067992790,371.028264301,370.472323520 9607713,560.190949647,559.165196240,558.860417901 9607714,479.446242237,476.911638772,476.243341083 9607715,476.501186529,474.679365644,473.780223571 9607716,648.998808959,649.072624403,648.125027777 9607717,538.155040518,538.869229643,537.945984935 9607718,507.081747733,505.691859827,503.611982964 9607719,555.345000892,555.290026215,553.049092775 9607720,526.454085971,524.730456398,523.870554043 9607721,580.961193608,580.034676881,579.136147731 9607722,565.069163478,562.410966247,561.899885632 9607723,534.598995854,535.015115067,532.608355857 9607724,454.129895507,454.596148596,453.053134596 9607725,603.521811818,601.480119640,600.073661787 9607726,557.240002287,555.574337184,554.463289566 9607727,577.753806242,574.824054022,574.423184755 9607728,496.690337844,494.696524376,494.638677419 9607729,467.725452828,468.543962293,468.280423016 9607730,552.712520992,552.273883592,552.137981909 9607731,514.633155927,514.583554011,514.288987678 9607732,488.665320868,486.508311138,487.420412892 9607733,685.553929193,684.412482966,683.133976857 9607734,578.743390613,576.464817253,575.642600185 9607735,460.507946822,459.342001182,459.608438128 9607736,443.893850880,442.239801463,442.193370259 9607737,575.318989491,572.193078279,571.015167689 9607738,653.403526109,651.647972622,650.677137648 9607739,606.166085023,604.838595266,604.074945248 9607740,460.909471524,459.811838983,458.243578148 9607741,489.908744698,488.172831316,487.874115776 9607742,591.322547519,587.367905016,586.376024151 9607743,336.916797565,337.578862809,337.689026295 9607744,403.696930156,404.683755345,404.281418382 9607745,582.827522321,580.763055437,580.247056539 9607746,595.408769905,589.371180898,589.351491710 9607747,436.764808445,436.414798035,435.843645514 9607748,644.103566204,640.595577147,640.858699021 9607749,479.867571075,479.990384079,479.545669036 9607750,354.522021824,356.052469417,355.391005510 9607751,473.474259265,472.750710235,472.393549139 9607752,620.430676435,616.839594061,615.306081431 9607753,559.949007541,560.432363797,558.962561103 9607754,594.393891362,594.991912161,593.823496361 9607755,604.507722969,602.063459175,601.793432254 9607756,454.165861517,454.170240063,453.952044376 9607757,727.113481452,724.430083307,724.387272840 9607758,640.367709621,639.197490970,638.793809979 9607759,730.999183824,728.321398852,727.530473799 9607760,418.834556021,418.587376346,418.771775320 9607761,693.173311755,690.029486185,689.310220874 9607762,661.842137718,658.689279604,659.102575431 9607763,433.212319245,431.752289041,429.892152943 9607764,475.819491586,474.921301993,474.829003194 9607765,542.539166793,541.967228699,541.167036102 9607766,432.040964273,431.074723403,429.974757397 9607767,525.609702737,523.200795317,523.272911431 9607768,469.894763276,468.967537509,468.632067220 9607769,682.553493400,679.274088981,678.562329119 9607770,395.904229159,394.824291288,394.504568533 9607771,571.852885090,567.531188396,567.559787365 9607772,591.436159456,588.944168503,587.922430102 9607773,436.886719320,436.566283232,435.920347998 9607774,641.001666650,637.109549649,636.019194505 9607775,570.864144763,569.521878554,566.797961135 9607776,569.666508291,565.934913829,565.879164344 9607777,444.174476153,445.397817357,444.760167347 9607778,398.594133460,399.020967547,398.643572755 9607779,383.078393727,383.174545719,382.033631038 9607780,618.917666367,618.897726382,618.080289285 9607781,419.765446792,419.586320654,418.448680501 9607782,577.875655653,577.409982268,576.034083815 9607783,538.045180989,537.532716607,537.423673591 9607784,511.591396636,510.629150981,511.256521396 9607785,597.019489926,596.470596377,595.508256015 9607786,418.535769268,417.067418996,417.670123239 9607787,433.990913617,432.898575719,432.354744519 9607788,605.755688289,603.810491020,602.289655804 9607789,517.185947707,516.498943085,516.600776531 9607790,483.537536430,482.528621432,481.192757125 9607791,371.468870001,371.714447774,371.217634639 9607792,418.618751587,418.302952616,417.033752673 9607793,817.940628975,816.347124053,814.122533258 9607794,395.474262757,394.874343295,393.946044267 9607795,432.615641406,433.038632224,432.789689304 9607796,452.810946144,450.725673663,449.878429932 9607797,527.300509237,526.052615993,526.828700985 9607798,420.215571109,419.370040614,418.024456399 9607799,631.593852574,628.398562814,627.495159699 9607800,442.815626138,442.671908542,442.323949524 9607801,435.994904704,435.413914616,434.063201663 9607802,486.490993016,485.061330592,484.372309496 9607803,537.063340708,536.549532780,536.447487342 9607804,446.483510455,445.684295884,444.071502819 9607805,463.947149450,463.221793947,463.250488353 9607806,534.571626689,533.488227617,532.940988375 9607807,557.064383372,555.388116850,553.847710155 9607808,484.108092424,484.040931420,483.590509157 9607809,716.070022583,711.924829769,712.626048924 9607810,442.125143356,439.665563857,439.222846859 9607811,694.830517008,690.531083376,690.737948513 9607812,764.097362477,760.789578874,759.878545433 9607813,494.489729501,493.262103456,492.315350310 9607814,526.560263329,525.987435644,525.122850443 9607815,658.380150208,657.236135052,657.033258088 9607816,731.535156318,729.101256227,727.878013653 9607817,550.183113180,549.206357175,548.661017373 9607818,514.241504164,510.771444844,508.944856145 9607819,439.593566427,439.220395636,437.760384521 9607820,356.093507977,355.328647637,354.779165959 9607821,550.018673899,546.015111387,545.880479656 9607822,623.313284871,620.455632504,615.543273697 9607823,489.124820576,489.210339733,488.732870705 9607824,663.326605391,663.006962937,660.524071842 9607825,448.071029062,448.134871029,447.508855018 9607826,536.220547382,536.572134024,536.050935726 9607827,484.622872323,482.064108830,481.880393880 9607828,486.413719975,486.802924230,485.608054839 9607829,631.359541905,629.062771542,628.118012610 9607830,614.176803373,613.211640196,612.203849304 9607831,539.128970489,537.998466261,537.276351588 9607832,692.474377877,688.767066602,687.903540749 9607833,477.551013017,477.403335032,476.762863371 9607834,636.337467212,633.639723577,634.182106299 9607835,480.921905562,480.291850473,478.226675316 9607836,669.265170808,665.375027744,663.991820280 9607837,661.527982207,658.822582308,657.539344023 9607838,360.853916521,360.738226243,359.831694384 9607839,382.249041313,383.583358206,382.397371184 9607840,467.652917694,465.948417447,465.367206788 9607841,508.929390789,507.332583669,506.266976051 9607842,467.562927973,466.691918913,466.414945286 9607843,504.168270637,500.759222077,499.839161603 9607844,448.910924430,448.642661190,447.619756727 9607845,635.793727042,632.649536261,632.966524512 9607846,437.766002709,437.278766842,436.355883699 9607847,627.585076726,628.514658263,626.637349459 9607848,641.325725616,639.793342409,638.162428431 9607849,560.733931091,559.944184480,559.757187966 9607850,666.483890024,665.531274760,665.642520501 9607851,583.218419706,583.372063042,583.794893662 9607852,486.408231381,486.231828227,485.139015106 9607853,433.448152921,431.683548218,431.445375928 9607854,630.205738777,627.440356113,626.690523541 9607855,511.638681102,510.219332084,509.869727467 9607856,568.033156897,566.390409117,566.296991278 9607857,704.737290605,704.348902838,702.867967907 9607858,580.877301881,578.980705230,577.634905198 9607859,597.177515585,596.502326576,595.971399538 9607860,517.281698684,517.745193292,516.336441909 9607861,620.681328249,618.436332612,617.870966282 9607862,528.116021529,527.193806112,527.912049406 9607863,544.737483413,541.692356756,541.916208410 9607864,419.517117463,418.546171154,418.017701243 9607865,542.847890187,540.200293383,538.717662921 9607866,714.106188504,711.165383994,711.015738011 9607867,434.163161236,432.708738199,432.753590090 9607868,427.305658683,425.096638563,425.310433026 9607869,662.509877062,660.204203346,660.249487266 9607870,414.039019682,412.782242749,411.813777957 9607871,570.007369856,569.986104754,569.373537178 9607872,550.890510403,550.315444685,549.510969808 9607873,473.816620989,472.926487126,472.621503016 9607874,428.087795457,428.375284694,428.027866792 9607875,540.262416940,539.209092167,539.086006954 9607876,465.514100072,464.839367359,464.215867616 9607877,592.857868076,591.976273864,591.726977928 9607878,505.358375647,504.608287425,504.302036695 9607879,658.653302643,657.966383989,655.931323683 9607880,617.049545871,616.441180751,615.829149915 9607881,583.517818444,582.187517607,582.128515764 9607882,565.164100269,564.366927330,562.723745839 9607883,731.050200498,726.905484430,726.090542896 9607884,394.669736972,395.106745527,394.077804040 9607885,573.941568910,572.096765082,570.737597387 9607886,489.067890743,488.018318343,486.741365446 9607887,443.299631565,442.688136826,441.145846846 9607888,468.437017893,466.695371151,465.981223436 9607889,414.007450368,412.096454611,411.501861693 9607890,578.640927968,575.306712279,574.748194024 9607891,557.802664099,555.512754095,555.806262131 9607892,623.353115635,622.264248876,620.805410916 9607893,395.021056247,394.513694899,395.139766783 9607894,668.662219537,665.266504273,664.646326854 9607895,560.670263896,557.916462863,557.895896422 9607896,576.249113089,575.785010755,573.999402654 9607897,648.373049887,647.098336631,646.925097729 9607898,581.333530856,578.771338433,577.949650206 9607899,459.836873151,458.350365870,458.604313352 9607900,616.120805569,613.146653028,612.164367756 9607901,519.591205595,518.317262466,517.769109184 9607902,581.716948312,579.465005283,577.972921747 9607903,412.940779795,412.587693746,411.739940511 9607904,614.085993310,610.406447766,608.611639345 9607905,475.722252249,475.226075104,473.628335260 9607906,488.885010857,488.011384029,487.703958765 9607907,504.018029396,502.212473533,501.139124327 9607908,462.458442871,462.335142092,461.898353537 9607909,410.906536903,410.204753116,409.450867264 9607910,588.121013593,584.730002935,583.037020338 9607911,392.371721123,391.175544602,390.519151958 9607912,417.163266689,416.524525860,415.556801654 9607913,534.344042418,533.884345490,533.781026869 9607914,510.868454024,508.347058051,508.574379503 9607915,502.116145396,501.254229751,500.476627772 9607916,444.757090173,446.164386193,445.489140102 9607917,714.501003785,710.002198818,712.653936043 9607918,473.520172691,471.967865581,472.369905067 9607919,521.427003557,520.569007054,520.485057766 9607920,469.235188793,469.698002965,469.575639251 9607921,551.230058690,551.974192304,550.604150803 9607922,601.531305572,599.769392813,599.216512276 9607923,550.420893243,549.660566716,549.138734040 9607924,567.431706946,568.687968382,567.467387145 9607925,561.061662222,560.246247801,559.660180114 9607926,590.983302383,589.749723216,588.927841348 9607927,489.041891018,486.768429508,483.965168707 9607928,382.985632037,380.775226228,379.415518268 9607929,685.012625282,683.988278833,683.564468783 9607930,440.033495829,440.014776869,438.780703616 9607931,598.084268668,595.792960674,595.884162343 9607932,666.928400131,666.664301800,664.850133292 9607933,527.949922927,525.838998366,525.506661282 9607934,455.245098664,452.275534000,451.017360491 9607935,451.838948163,450.833949307,450.065721879 ``` ## Reproduction harness The harness below records chunk-level gas and full precision per-seed results under scratch. Run its compile mode once, then one invocation per contiguous 32-seed chunk: candidate first over the entire range, then t03, then ib. Prefix commands with `. scratch/env.sh && timeout 470 python scratch/bench.py ...`. Sources are obtained from the linked artifacts and their required SHA-256 values verified above. Setup and installed dependencies are measurement inputs, not a shipped offline executable distribution. ```python import sys,json,time,hashlib from pathlib import Path import numpy as np import amm_sim_rs from amm_competition.competition.config import BASELINE_VARIANCE,build_base_config from amm_competition.evm.compiler import SolidityCompiler from amm_competition.evm.adapter import EVMStrategyAdapter P=Path('scratch') def compile_one(kind): paths={'candidate':'contracts/src/Strategy.sol','t03':'scratch/t03.sol','ib':'scratch/ib.sol','vanilla':'contracts/src/VanillaStrategy.sol'} s=Path(paths[kind]).read_text();c=SolidityCompiler().compile(s,contract_name='VanillaStrategy' if kind=='vanilla' else 'Strategy');assert c.success,c.errors d={'sha256':hashlib.sha256(s.encode()).hexdigest(),'creation':c.bytecode.hex(),'runtime_bytes':len(c.deployed_bytecode),'name':EVMStrategyAdapter(c.bytecode,c.abi).get_name()} (P/f'compiled_{kind}.json').write_text(json.dumps(d));print(kind,d['sha256'],d['runtime_bytes'],d['name'],flush=True) def configs(start,end): base=build_base_config(seed=None);v=BASELINE_VARIANCE;out=[] for seed in range(start,end): rng=np.random.default_rng(seed);size=rng.uniform(v.retail_mean_size_min,v.retail_mean_size_max);rate=rng.uniform(v.retail_arrival_rate_min,v.retail_arrival_rate_max);sig=rng.uniform(v.gbm_sigma_min,v.gbm_sigma_max) out.append(amm_sim_rs.SimulationConfig(n_steps=base.n_steps,initial_price=base.initial_price,initial_x=base.initial_x,initial_y=base.initial_y,gbm_mu=base.gbm_mu,gbm_sigma=sig,gbm_dt=base.gbm_dt,retail_arrival_rate=rate,retail_mean_size=size,retail_size_sigma=base.retail_size_sigma,retail_buy_prob=base.retail_buy_prob,seed=seed)) return out if sys.argv[1]=='compile': for k in ['candidate','t03','ib','vanilla']:compile_one(k) else: kind=sys.argv[1];start,end=map(int,sys.argv[2:]);assert 9607680<=start