# pb2: port-2 confirmation on the real engine Candidate minus t03: **+1.243568224 edge**, SE **0.137356640**, n=256. Candidate minus IB: **+2.019434259 edge**, SE **0.135048537**, n=256. ## Candidate and provenance The candidate is the single `solidity` fenced block under `### Strategy.sol` in the [port-2 result](https://api.imd.fun/artifacts/e8c967d6358da0fd53117891357f19a1d684225bd71a5e302b6e299c85f1286c); it is the complete block beginning `// SPDX-License-Identifier: MIT` and ending with the contract's closing brace, including its final LF. No edits or whitespace normalization were made. It was saved byte-for-byte to `contracts/src/Strategy.sol` in the scratch checkout. - Source SHA-256: `7e2d9c157a7725c2875eea31e5741938fb9eafef5a3442710573f1b1a87faf17`. - `amm-match validate contracts/src/Strategy.sol`: **PASS**, exit 0, `Strategy 'TaylorGaussianPlain2' validated successfully!`. - Executed `getName()`: `TaylorGaussianPlain2`. - Compiled runtime: **18,484 bytes**; limit 24,576. - Policy credit: **Taylor (gtmcknight)**, `amm-sim` commit `4812a6382311624e1506aca131ca35c378f930d9`, `research/solved/real.py`; the candidate header preserves this credit. Comparators were zlib-decompressed from base64 `code_zb64`: [t03](https://api.imd.fun/artifacts/2333ecf28d4356bd232b85c1e55842e94e1ada05e1cd067830b5625dfdbc5336) SHA-256 `cb6d945511e1e10af78baa64c2a6cb25806f0998403ce6440654bfc3c70092d9`, and [IB](https://api.imd.fun/artifacts/afd5183e9ff3235334e041c00b0cd19079599a2c6464db95f8c1586712105557) SHA-256 `301941829a44bb60977bb28181a5e4bfa6544f3696763f987054789b2611d686`. Both matched the hashes specified in the assignment. ## Measurement method Local measurements below were produced by this worker, rather than copied from prior reports. Platform check returned `Linux x86_64`. The challenge checkout was pinned to `6b6921f8d463314aa7c96234e1be25a25245f704`. The exact eight-line setup script from [port-3 Setup](https://api.imd.fun/artifacts/0dbcc10af41b3c3467ff0d9b9cb64c81328fcf18295f9be06b2d81bb98874067) was saved to `scratch/setup.sh` and run once from that checkout: exit 0; wheel checksum passed; starter validation passed. Later execution commands sourced `scratch/env.sh`. Compilation used the pinned [SolidityCompiler](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/evm/compiler.py): solc 0.8.24, optimizer enabled with 200 runs, viaIR, Paris EVM. Every arm ran alone against the pinned [30 bps VanillaStrategy](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/contracts/src/VanillaStrategy.sol), using `amm_sim_rs.run_batch(X, VanillaStrategy, configs, 8)` from the checksum-verified `amm_sim_rs-0.1.0.post1` wheel. Config generation directly transcribed [MatchRunner._build_configs](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/competition/match.py) using the pinned [baseline settings](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/competition/config.py). For seed i, `np.random.default_rng(i)` drew retail mean size uniformly from [19,21], then arrival rate from [0.6,1.0], then sigma from [0.000882,0.001008]; simulation seed was i. Other values: 10,000 steps, initial price 100, reserves X=100/Y=10,000, GBM mu=0 and dt=1, retail size sigma=1.2, buy probability=0.5. All assigned seeds 9610496..9610751 were executed exactly once **per arm**, in eight disjoint 32-seed chunks per arm. Order was all candidate chunks, all t03 chunks, then all IB chunks. Each chunk was reserved on disk before invocation; no chunk was rerun. Commands had a 470-second timeout. Every chunk completed below that timeout. Per-seed raw edges and gas snapshots were retained under `test/scratch/amm-challenge/scratch/` during execution. Score is `result.edges['submission']`. Paired differences are candidate edge minus comparator edge on the same seed/config; standard error is the sample standard deviation of differences (ddof=1) divided by sqrt(n). Statistics use unrounded edges; CSV values are rounded to nine decimals. These are sample measurements, not a claim about untested seeds. ## Paired scores | Pair | n | mean_diff | se | Candidate mean | Comparator mean | |---|---:|---:|---:|---:|---:| | Candidate − t03 | 256 | 1.243568224 | 0.137356640 | 528.872438816 | 527.628870592 | | Candidate − IB | 256 | 2.019434259 | 0.135048537 | 528.872438816 | 526.853004556 | Candidate − t03: | Rank | Worst (seed, diff) | Best (seed, diff) | |---:|---|---| | 1 | (9610732, -2.563646496) | (9610561, 28.032542105) | | 2 | (9610622, -2.012068806) | (9610684, 5.182176343) | | 3 | (9610633, -1.871396420) | (9610715, 4.842776591) | | 4 | (9610722, -1.756881210) | (9610575, 4.727131619) | | 5 | (9610618, -1.523515251) | (9610638, 4.542092219) | Candidate − IB: | Rank | Worst (seed, diff) | Best (seed, diff) | |---:|---|---| | 1 | (9610732, -2.305052459) | (9610561, 27.132271960) | | 2 | (9610701, -1.642944739) | (9610677, 6.182409272) | | 3 | (9610593, -1.051324896) | (9610684, 5.873600737) | | 4 | (9610722, -1.049180613) | (9610575, 5.777347379) | | 5 | (9610618, -0.946340084) | (9610638, 5.528871933) | ## afterSwap gas Only `role=Submission, callback=afterSwap` entries from `gas_stats()` are aggregated below. `gas_stats_reset()` was called immediately before every chunk and `gas_stats()` immediately after it. Mean gas is sum of `sum_ok_gas` divided by sum of `ok`, weighted across chunks. Peak is the maximum `max_ok_gas` across chunks. | Arm | Calls | Successful | OutOfGas | Reverts | Peak gas | Mean successful gas | |---|---:|---:|---:|---:|---:|---:| | candidate | 2758920 | 2758920 | 0 | 0 | 226059 | 126655.656803024 | | t03 | 2777786 | 2777786 | 0 | 0 | 238235 | 135563.449946108 | | IB | 2755846 | 2755846 | 0 | 0 | 237651 | 135233.182994260 | | Seed range (inclusive) | Candidate peak | t03 peak | IB peak | |---|---:|---:|---:| | 9610496..9610527 | 226059 | 235406 | 234692 | | 9610528..9610559 | 225046 | 235247 | 231962 | | 9610560..9610591 | 225058 | 235259 | 231969 | | 9610592..9610623 | 226059 | 235330 | 234743 | | 9610624..9610655 | 224656 | 232518 | 231925 | | 9610656..9610687 | 223083 | 212154 | 211577 | | 9610688..9610719 | 223398 | 213929 | 213372 | | 9610720..9610751 | 224676 | 238235 | 237651 | All afterSwap OutOfGas, revert, other_halt, tx_error, and bad_return counters were zero in every arm/chunk. Candidate peak stayed below 245,000 gas. ## Timing and coverage Wall time is measured around each `run_batch` call only, excluding setup, compilation and Python process startup. Seconds per seed = summed engine wall time / completed seeds; eight workers run concurrently. | Arm | Seeds completed | Engine seconds | Seconds per seed | Minimum chunk seconds | Maximum chunk seconds | |---|---:|---:|---:|---:|---:| | candidate | 256 | 132.460287 | 0.517422995 | 16.245049 | 17.124210 | | t03 | 256 | 94.524294 | 0.369235524 | 11.353690 | 12.777290 | | IB | 256 | 92.452210 | 0.361141446 | 11.083161 | 12.628665 | Seeds not run (candidate): **none** (0). Seeds not run (t03): **none** (0). Seeds not run (IB): **none** (0). ## Per-seed submission edge ```csv seed,candidate,t03,IB 9610496,547.413596621,547.518464656,545.888975421 9610497,412.193871976,411.025740465,410.094633032 9610498,538.966976564,537.837750978,537.275512901 9610499,543.905518566,542.955056563,542.665794596 9610500,379.443727329,379.933400528,379.483524481 9610501,474.647553235,473.729441308,473.016284489 9610502,557.062586725,555.523155279,555.282915727 9610503,520.362401805,519.715161993,517.995174829 9610504,478.204627045,477.949737335,477.585497881 9610505,438.521277533,438.947657904,438.455314413 9610506,572.942462811,571.732344482,572.354201933 9610507,684.828320397,681.470071282,680.873297419 9610508,362.236530134,363.084357668,362.241192889 9610509,616.742614274,616.232347143,614.950715723 9610510,444.069879147,442.025796972,441.491583929 9610511,669.080809329,667.825946045,665.118758113 9610512,412.057030527,412.464538635,411.135360707 9610513,428.370297847,428.698232420,426.698155271 9610514,467.762302756,466.252554352,466.760816867 9610515,523.575298567,521.541511004,520.533273646 9610516,418.870029288,418.243375457,417.951950909 9610517,537.042024214,537.458377805,537.207394011 9610518,626.231479612,624.172146606,623.091250967 9610519,535.254275634,533.128553241,532.060098954 9610520,426.310517285,426.521985376,426.410024255 9610521,610.614613625,608.220958800,606.951403136 9610522,586.287361307,587.519434906,585.559383427 9610523,624.741562700,622.976385904,620.127576325 9610524,418.397555219,417.872630407,417.158453084 9610525,532.806978839,531.312453017,528.081157325 9610526,628.937500416,628.375139142,626.175116343 9610527,722.774569058,720.751368417,720.232387089 9610528,588.606744044,588.108503881,586.472509493 9610529,435.355856648,436.057583591,435.463362818 9610530,528.445705754,529.460415570,528.925684805 9610531,397.960903954,398.278055389,397.854677794 9610532,565.681836424,562.306380773,562.578835938 9610533,589.677099090,590.105769582,588.090070242 9610534,650.899580397,647.220307897,647.104788177 9610535,509.600895223,507.402867637,506.296247280 9610536,376.345262531,375.808395356,375.508675732 9610537,482.646387831,483.381092249,482.806329318 9610538,421.390252853,421.178900685,419.960113980 9610539,645.164677567,643.307776321,641.881027329 9610540,400.038716016,400.304253394,398.956067334 9610541,545.373179397,543.625822505,542.987356096 9610542,544.526302010,544.139764076,543.228111415 9610543,461.895368806,461.181079212,459.835844957 9610544,339.783182083,339.115782458,338.675316722 9610545,528.949019130,525.539484349,525.491963364 9610546,557.783255114,557.307352187,556.123497637 9610547,457.060598642,456.586294142,454.609147332 9610548,631.084672351,630.083451409,629.720217671 9610549,430.580331115,430.917721352,429.970466181 9610550,610.073954052,607.234975367,607.195664912 9610551,486.634269932,485.383938811,484.313191044 9610552,400.625077446,400.854406367,400.861472614 9610553,450.810574872,449.731243131,449.986696266 9610554,519.914356797,518.854311791,518.985830216 9610555,586.796873407,586.613937843,585.426071257 9610556,665.270832646,663.124905999,662.773328157 9610557,403.589457059,404.409860974,404.055411281 9610558,542.918064746,540.335084852,540.277745729 9610559,536.167883994,535.819439416,533.241963377 9610560,655.963416299,652.385185641,651.711374861 9610561,574.700909765,546.668367661,547.568637806 9610562,421.911627532,421.431120558,419.213735980 9610563,519.118292062,517.469475306,515.888257098 9610564,567.857347160,564.921775426,564.019877231 9610565,502.243457245,501.549683247,501.627614362 9610566,463.841949640,461.478429952,461.612490003 9610567,654.590972948,653.207876100,653.092714074 9610568,468.818597600,467.194717843,466.644093270 9610569,514.240679707,509.816657032,508.801830651 9610570,621.615046010,620.211969996,621.028536124 9610571,530.525334352,528.240999279,526.888409783 9610572,553.049987149,550.338332812,549.445225629 9610573,662.937565996,663.718783369,661.181638745 9610574,409.624833043,410.112279821,409.332259456 9610575,636.962239728,632.235108108,631.184892349 9610576,522.396874787,521.821324588,520.264138455 9610577,590.256060138,589.765637927,588.964490603 9610578,496.838309071,497.457319033,496.374220600 9610579,426.208445900,423.711362790,422.567409050 9610580,702.425451310,700.166566005,698.092499141 9610581,567.635792541,565.862708855,566.008056716 9610582,452.560167815,451.288048731,450.905779416 9610583,521.255867955,519.850131691,519.924657198 9610584,537.027121888,538.060063137,536.500423426 9610585,629.580466446,627.711125420,626.149403882 9610586,422.737640287,420.483707435,420.105249914 9610587,498.879888475,498.085928521,496.590598288 9610588,433.404329669,434.493072183,433.212889740 9610589,607.191805051,604.879227246,605.901463863 9610590,741.126612718,738.173141419,736.631302091 9610591,435.823229957,433.372574390,432.558492633 9610592,591.757232028,590.108235819,588.818727271 9610593,411.153853666,412.529212853,412.205178562 9610594,637.280589075,633.835467291,633.440944048 9610595,589.433302111,585.282059196,584.559596497 9610596,555.560303091,554.780257409,554.218576300 9610597,709.949676833,706.944719092,705.786071075 9610598,514.504535353,514.416591801,513.286725389 9610599,496.877104243,496.390703272,495.707890990 9610600,506.481925773,505.339795504,505.801247434 9610601,578.510401269,575.165709746,575.038623071 9610602,566.788004196,566.421897606,564.483517515 9610603,396.690298721,395.860978798,395.374060041 9610604,520.089410089,520.554988220,519.479694284 9610605,522.873078311,522.350203631,522.333527187 9610606,444.228935069,442.769227330,441.857251202 9610607,554.964289197,555.297889775,554.702700629 9610608,643.711223427,641.583956621,641.069201389 9610609,509.064222583,508.079331421,507.514398642 9610610,607.709314805,604.872970294,604.844578271 9610611,658.873519488,657.793857159,656.270931499 9610612,460.428160534,461.389610324,460.998578401 9610613,581.397489668,578.379212047,577.707601997 9610614,410.514513661,410.547013202,410.086850038 9610615,467.913550294,468.098024720,467.126270501 9610616,385.706310223,384.223264925,383.478422181 9610617,519.504424718,517.133828676,516.681018111 9610618,362.867676276,364.391191527,363.814016361 9610619,475.470275623,475.459986295,474.657991060 9610620,382.057995022,383.470238781,382.494596897 9610621,513.720030067,514.037064361,513.762262628 9610622,383.411717299,385.423786105,382.134910635 9610623,613.262907915,613.117919647,612.148674516 9610624,488.490013903,486.906180241,487.202213597 9610625,420.500578140,420.501666344,419.264849021 9610626,626.532496027,626.820328327,624.903903399 9610627,616.299592080,614.634040779,613.872765008 9610628,442.745796855,441.831469707,440.623147738 9610629,393.815555629,392.359884624,393.061618607 9610630,704.722325149,701.082572224,700.460044091 9610631,574.421494288,571.773176196,570.445173059 9610632,597.044901944,595.604622467,594.759791086 9610633,432.582852177,434.454248597,432.952652641 9610634,743.357816920,741.394864565,741.033935500 9610635,432.811459119,432.653722497,432.204703064 9610636,723.184206753,720.088416847,719.554597831 9610637,621.098823275,620.663138983,619.319219521 9610638,609.608405211,605.066312992,604.079533278 9610639,603.577469160,601.008504659,600.093199150 9610640,536.206519650,533.104422912,532.645572087 9610641,426.631981369,426.401951490,425.651759733 9610642,532.765444337,531.342542366,530.890547534 9610643,625.809542818,623.303029284,622.624190359 9610644,464.470135725,464.578051151,463.395995915 9610645,654.551301610,652.389392921,651.557265799 9610646,512.467847600,513.789289448,512.406019773 9610647,604.317816052,602.698944467,602.420978205 9610648,626.925765218,624.732814203,624.867200969 9610649,575.388089203,573.696733871,572.053049183 9610650,489.512694473,488.292085139,486.417613107 9610651,415.126355517,415.411495252,413.470888751 9610652,639.290789856,636.379230433,636.756896591 9610653,638.936488782,637.437887396,636.226005032 9610654,417.091608967,416.373125217,416.221095347 9610655,457.914290496,457.740893368,456.965391697 9610656,646.749443719,643.600848444,642.626789528 9610657,477.425763242,477.724579546,477.103827893 9610658,466.688879685,466.514794567,466.060009963 9610659,434.397871079,434.449789330,433.890041439 9610660,616.018773825,612.995871556,611.224975348 9610661,639.836491482,639.652803095,639.700831132 9610662,446.652347622,445.847751527,446.464086447 9610663,508.758428386,509.850553581,507.706491457 9610664,586.493226107,584.311046615,583.073547386 9610665,526.504374831,525.202520984,524.806973144 9610666,556.040684367,555.643864239,554.175740459 9610667,363.569585475,363.433568681,362.244465967 9610668,607.278152687,605.341648501,604.757378991 9610669,562.433111344,561.826197390,561.116397845 9610670,427.365197751,425.644408546,424.661044226 9610671,623.777213979,621.049872032,621.573393801 9610672,396.570556376,396.389201151,396.328062469 9610673,581.228760203,579.723305911,579.268146951 9610674,519.879006647,520.251028440,520.581384272 9610675,397.881210463,396.733774466,396.852290143 9610676,609.672174717,608.399017532,607.557552820 9610677,454.201192535,452.656977180,448.018783262 9610678,443.480470363,441.960121582,441.490134761 9610679,389.910874955,389.184101808,388.497638410 9610680,628.477403716,628.072384091,627.290013465 9610681,555.852801924,553.967699137,553.417936644 9610682,584.204673699,581.802282682,580.976190871 9610683,560.990655089,560.824700648,560.224243987 9610684,640.992519538,635.810343196,635.118918801 9610685,358.332961638,358.959184836,358.500207722 9610686,594.800421309,592.398327997,591.285220395 9610687,484.993863188,482.592583716,482.615989209 9610688,403.398992803,403.025084547,402.167866111 9610689,626.649591483,623.657535404,623.170852743 9610690,703.950732368,700.100809101,701.072451184 9610691,585.385055606,585.532764838,584.590121180 9610692,442.801526643,442.291592813,442.040480083 9610693,574.456775989,570.877808268,569.762108618 9610694,455.020398646,454.724490602,454.055763509 9610695,469.143932500,467.221603835,467.995504678 9610696,630.700956519,627.286871552,625.719335878 9610697,532.206129513,530.111281930,529.329676953 9610698,623.000994133,621.237383267,620.666332791 9610699,609.994850126,608.989303449,607.744233836 9610700,825.654028992,822.357713040,821.031436799 9610701,393.810585047,394.775981099,395.453529786 9610702,531.153982451,529.782043658,529.166307431 9610703,491.554348286,491.850719658,490.929963350 9610704,574.848796431,572.835620856,572.787897169 9610705,519.674580441,519.085108076,518.160503806 9610706,546.744884420,546.805935622,545.807547894 9610707,571.337600302,570.240052091,570.026332654 9610708,493.276918265,492.981261858,491.877882917 9610709,454.880258220,454.039591999,453.271854353 9610710,410.986468625,410.856615780,409.989228924 9610711,423.602245394,423.203055680,422.103211261 9610712,566.599752744,563.981616294,563.571196874 9610713,494.675634587,495.095946383,494.749698543 9610714,572.092054832,570.338117238,569.399191628 9610715,605.015075103,600.172298512,601.087808743 9610716,410.836799065,411.925561326,410.911167899 9610717,497.613496372,498.064941625,497.298708674 9610718,706.593869163,703.485942735,704.159005088 9610719,466.741692376,464.815802911,463.697725820 9610720,535.016794986,532.862213691,532.990678758 9610721,568.233197160,566.138295348,565.782626963 9610722,372.009866707,373.766747917,373.059047320 9610723,750.985078130,748.628577800,747.577728801 9610724,699.897746420,697.532374704,696.932247032 9610725,577.383353831,575.940876639,575.815677297 9610726,412.441686190,411.145075433,410.568135919 9610727,490.541305182,489.866776202,488.984630404 9610728,468.322221703,466.705554140,465.989884377 9610729,564.543659239,562.899432025,562.019593567 9610730,418.934407037,418.419802376,417.621252146 9610731,549.088326457,548.507981705,548.821485710 9610732,377.348074047,379.911720543,379.653126507 9610733,395.202323217,396.016953669,395.370319901 9610734,711.512594345,708.064509532,707.411785200 9610735,735.145829951,732.691565365,730.566564773 9610736,482.787239935,482.948161540,481.560471604 9610737,577.179477657,576.400080759,575.103267702 9610738,371.720610929,372.116917352,370.481696551 9610739,736.924685589,732.523218930,731.683604267 9610740,435.071218595,434.979448039,434.894354952 9610741,519.914131251,519.558603375,519.537891861 9610742,483.526717738,483.768314959,482.045793454 9610743,513.969944210,512.359887715,511.656183887 9610744,452.026820683,450.934514522,449.993893282 9610745,611.268258269,611.194402101,610.070381144 9610746,547.307335982,546.715071647,546.230626975 9610747,587.155058453,584.526622140,582.431889165 9610748,473.114147497,473.371428635,471.907157810 9610749,484.846650875,481.563768672,481.511082868 9610750,545.288705331,542.866478157,542.779373179 9610751,440.160398349,439.977718260,439.469096352 ```