# p3-b3: port-3 on fresh real-engine seeds 9601536..9601791 Policy credit: the candidate ports Taylor's (gtmcknight) solved Gaussian + plain-table AMM policy (github.com/gtmcknight/amm-sim @ 4812a638, research/solved). The contract header says so: `// Gaussian solved policy by Taylor (gtmcknight), amm-sim 4812a638.` **Headline (n=256, all seeds run once each, every arm):** candidate − t03 = **+0.634034204** edge (se 0.091375516). Candidate − IB = **+1.365716587** (se 0.093565726). Candidate afterSwap: **0 OutOfGas**, 0 reverts, peak **205,385** gas (limit 245,000). ## 1. Candidate | Field | Value | |---|---| | Source | Solidity block "contracts/src/Strategy.sol" of artifact 0dbcc10a…8067, saved byte-exact as contracts/src/Strategy.sol | | sha256 | `62930b8e68277c69fc1acfba18de781e684d7fc6daac8dc562b8210dc3932ac1` (matches expected) | | amm-match validate | **pass**: `Strategy 'TaylorGaussianPlainCoarse' validated successfully!` | | getName() | `TaylorGaussianPlainCoarse` | | Runtime (deployed) bytes | **18,466** (matches expected; limit 24,576) | Comparators (zlib-decompressed base64 `code_zb64`): t03 sha256 `cb6d945511e1e10af78baa64c2a6cb25806f0998403ce6440654bfc3c70092d9` (matches), runtime 14,654 bytes. IB sha256 `301941829a44bb60977bb28181a5e4bfa6544f3696763f987054789b2611d686` (matches), runtime 14,528 bytes, getName `inputs_b`. ## Setup - Platform: Linux x86_64. - amm-challenge cloned and checked out at `6b6921f8d463314aa7c96234e1be25a25245f704`, inside the workspace's scratch directory (not /tmp). - The 8-line setup script from port-3's Setup section was saved as scratch/setup.sh and run once from the checkout root. It exited 0: the wheel sha256 check passed, solc 0.8.24 was installed, and StarterStrategy validated. - Engine: `amm_sim_rs.run_batch(creation_bytecode, VanillaStrategy, configs, 8)`, each strategy alone against the 30 bps VanillaStrategy. Configs are a direct copy of `MatchRunner._build_configs`: for config i, `np.random.default_rng(seed=i)` draws size, then rate, then sigma (BASELINE_VARIANCE, all vary flags on), the other fields come from `build_base_config`, and the sim seed is i. - Score is `edges['submission']`. Chunks are 32 seeds each (8 chunks per arm). Before each engine call the chunk file was written to reserve its seeds, and a chunk file that already existed was refused. `gas_stats_reset()` was called before each chunk and `gas_stats()` after it. - Order: candidate on all seeds, then t03 on all seeds, then IB on all seeds. ## 2. Paired results (diff = candidate − comparator, per seed) Arm means over all 256 seeds: candidate **528.825462975**, t03 **528.191428771**, IB **527.459746389**. ``` cand-t03: n=256 mean_diff=0.634034204 se=0.091375516 sd=1.462008251 wins=164 worst5: (9601734, -3.022759519), (9601560, -2.732704485), (9601677, -2.011663823), (9601683, -1.985385973), (9601707, -1.979273664) best5: (9601611, +5.889910066), (9601610, +4.932596079), (9601600, +4.417588895), (9601676, +4.274538283), (9601592, +4.269747505) cand-IB: n=256 mean_diff=1.365716587 se=0.093565726 sd=1.497051622 wins=212 worst5: (9601734, -2.398700956), (9601598, -1.598856731), (9601683, -1.588940033), (9601728, -1.553048039), (9601742, -1.394149555) best5: (9601676, +7.109739745), (9601551, +6.179751587), (9601610, +5.761923759), (9601611, +5.586310894), (9601717, +5.394622013) ``` se = sample sd / sqrt(n). "wins" = seeds with diff > 0. ## 3. Gas (Submission afterSwap, summed over the 8 chunks) ``` cand afterSwap: calls=2722943 ok=2722943 oog=0 revert=0 other_halt=0 tx_error=0 bad_return=0 peak=205385 mean_ok=95544.3 per-chunk: 9601536_9601568 calls=337622 peak=199583 oog=0; 9601568_9601600 calls=331413 peak=189975 oog=0; 9601600_9601632 calls=343701 peak=188958 oog=0; 9601632_9601664 calls=332025 peak=190734 oog=0; 9601664_9601696 calls=346572 peak=189849 oog=0; 9601696_9601728 calls=344421 peak=199398 oog=0; 9601728_9601760 calls=335881 peak=205385 oog=0; 9601760_9601792 calls=351308 peak=195265 oog=0 t03 afterSwap: calls=2762500 ok=2762500 oog=0 revert=0 other_halt=0 tx_error=0 bad_return=0 peak=235588 mean_ok=135655.5 per-chunk: 9601536_9601568 calls=342817 peak=235448 oog=0; 9601568_9601600 calls=337183 peak=235405 oog=0; 9601600_9601632 calls=348115 peak=235259 oog=0; 9601632_9601664 calls=338032 peak=235394 oog=0; 9601664_9601696 calls=350787 peak=232510 oog=0; 9601696_9601728 calls=349001 peak=235588 oog=0; 9601728_9601760 calls=341229 peak=232486 oog=0; 9601760_9601792 calls=355336 peak=235437 oog=0 IB afterSwap: calls=2741649 ok=2741649 oog=0 revert=0 other_halt=0 tx_error=0 bad_return=0 peak=234977 mean_ok=135324.0 per-chunk: 9601536_9601568 calls=339896 peak=234868 oog=0; 9601568_9601600 calls=335040 peak=234848 oog=0; 9601600_9601632 calls=345290 peak=230489 oog=0; 9601632_9601664 calls=335973 peak=231950 oog=0; 9601664_9601696 calls=348024 peak=234977 oog=0; 9601696_9601728 calls=346456 peak=234864 oog=0; 9601728_9601760 calls=338751 peak=231929 oog=0; 9601760_9601792 calls=352219 peak=234868 oog=0``` Candidate totals: 2,722,943 afterSwap calls, 0 OutOfGas, 0 reverts, peak 205,385, mean 95,544.3 gas per ok call. afterInitialize peak 141,957 (first chunk). t03: peak 235,588, OutOfGas 0. IB: peak 234,977, OutOfGas 0. ## 5. Timing and coverage Seconds per seed is engine wall time inside run_batch (8 workers, 6-core machine), excluding compilation: - cand: n=256 mean=528.825462975 engine_seconds=43.49 s/seed=0.1699 - t03: n=256 mean=528.191428771 engine_seconds=60.53 s/seed=0.2364 - IB: n=256 mean=527.459746389 engine_seconds=57.72 s/seed=0.2255 Seeds not run: **none**. All 256 seeds 9601536..9601791 were run exactly once for each of candidate, t03 and IB. No other engine seeds were used. ## Caveats These are local measurements on one machine. Nothing here independently certifies behaviour on other seeds. Gates P, Q and F were not part of this item and were not re-checked here. ## 4. Per-seed CSV (edge, 9 decimals) ```csv seed,candidate,t03,IB 9601536,419.130074924,420.031319236,419.436662405 9601537,517.870252141,517.602199863,516.021300825 9601538,460.455877039,458.304776781,459.053821318 9601539,570.283209821,569.919241639,568.101440946 9601540,498.088946864,498.729531571,497.988119983 9601541,405.451214087,406.775036610,406.523913647 9601542,671.947454168,672.127682917,671.816135558 9601543,442.199769954,440.387398418,439.559524306 9601544,687.395998794,687.904592329,685.557984186 9601545,457.315958114,458.182117248,457.392171791 9601546,627.795350044,625.141996130,624.008352291 9601547,499.263789169,499.219535165,497.680794894 9601548,501.088594945,502.298502734,500.882510616 9601549,403.335441420,404.444905025,403.703768303 9601550,671.941773240,672.001581229,670.647458182 9601551,573.500002551,571.368683335,567.320250964 9601552,449.551773170,449.032785118,448.833368160 9601553,397.570812432,398.357336605,397.985496830 9601554,414.265013202,413.918378353,413.502785161 9601555,543.744249849,543.692362541,542.919001802 9601556,464.941422277,465.972779213,465.324545413 9601557,580.551859893,580.820086271,578.629428758 9601558,555.952525311,555.849415765,555.454389688 9601559,380.032297510,381.215339709,379.996875978 9601560,477.439154806,480.171859291,478.375870286 9601561,540.783485293,539.926632870,539.210423499 9601562,421.827379924,421.749438407,421.632101186 9601563,668.620717874,666.889885098,666.059176175 9601564,599.997637636,598.276569128,597.850979561 9601565,596.255158541,595.522862846,593.824254614 9601566,578.255246426,575.861635307,575.530076302 9601567,578.653807951,578.560354810,576.553129475 9601568,545.485255434,542.519794633,543.681978082 9601569,409.791536242,410.074296165,409.569206893 9601570,614.563680787,614.493513421,613.694608976 9601571,417.925879334,418.336233449,417.303800283 9601572,410.115365955,409.642798746,409.039702282 9601573,656.652042603,655.368738701,654.055921148 9601574,410.191480563,411.037386364,410.782313054 9601575,550.898829954,549.467402966,549.130986171 9601576,567.386732360,564.823041355,563.779661161 9601577,536.805648251,537.526000052,536.890690990 9601578,658.222734789,657.107265739,656.112377815 9601579,476.028071949,476.989100599,476.318113892 9601580,484.982604218,486.570509269,485.169583977 9601581,437.236370820,437.676556392,437.370253916 9601582,626.785859959,624.707962259,623.314893024 9601583,766.946172704,763.548960798,762.350430209 9601584,545.721601807,545.183563045,544.855937270 9601585,441.876843369,442.098826938,441.614821216 9601586,525.510534365,525.626488730,523.881572867 9601587,479.638220630,478.751305462,478.100729771 9601588,427.563926976,428.448266488,427.923137952 9601589,426.951964769,427.289885168,425.872404840 9601590,512.516360678,512.356699802,512.528333319 9601591,604.481786453,603.766716341,603.195536108 9601592,578.715153120,574.445405615,575.709966017 9601593,468.076210474,466.071001264,466.700353408 9601594,447.507171684,446.538988558,446.710667234 9601595,505.458241640,504.955952228,504.236868182 9601596,392.246249149,393.307180203,392.443277197 9601597,497.716510611,497.451051124,496.763071787 9601598,428.651874437,430.431891366,430.250731168 9601599,519.817774709,519.170356197,518.116065329 9601600,697.248637128,692.831048233,693.281511400 9601601,606.452005518,605.188430328,604.243479982 9601602,514.350197900,515.002177037,515.030700683 9601603,604.235517808,602.734522942,602.161522766 9601604,392.519193524,393.248780981,392.041320272 9601605,606.855767199,604.383051742,604.035128713 9601606,437.094072121,437.567308215,436.556770535 9601607,567.280271074,566.151075162,567.006227157 9601608,539.317386308,537.577337337,537.295949191 9601609,378.014944041,378.153943942,377.395599820 9601610,738.638870884,733.706274805,732.876947125 9601611,709.598498010,703.708587944,704.012187117 9601612,567.383537904,567.349322412,566.704725494 9601613,546.110776203,545.160962752,544.622972559 9601614,547.311432555,544.675466296,542.904312888 9601615,552.441191117,551.845675438,551.209985990 9601616,415.034536959,415.792259398,414.229849215 9601617,487.604986417,487.010864878,486.152246465 9601618,590.894144080,587.906321073,586.362105531 9601619,615.013160732,613.060422070,611.275648679 9601620,477.415575986,477.049110501,477.295274007 9601621,344.409806589,344.613972438,343.894428390 9601622,472.680512134,472.550252826,470.823510157 9601623,508.165908717,508.602739137,508.321190764 9601624,541.823293462,539.848937651,539.102809926 9601625,409.155786758,409.957525171,409.099460527 9601626,576.368036124,572.896493895,573.201069705 9601627,526.685619565,524.388901862,524.358552336 9601628,641.809146426,639.410581801,638.270943305 9601629,666.415486393,666.792661265,665.086400991 9601630,415.725339615,416.037010492,415.885498289 9601631,569.102874101,569.501700331,567.363069709 9601632,623.391965102,620.548477789,619.952926626 9601633,598.927746410,598.383118356,597.139685198 9601634,636.519309122,633.665727731,634.466278739 9601635,458.038091946,459.292643089,458.563429103 9601636,780.093425712,777.467612744,776.543145652 9601637,456.562384678,453.724179832,453.215354404 9601638,400.745081898,401.819061139,400.514856476 9601639,427.538316326,428.594330609,427.499746387 9601640,623.915698401,623.515469281,622.080380778 9601641,586.452651209,585.178634620,584.745344601 9601642,585.946802063,584.989362273,583.263998181 9601643,382.521067325,383.618026834,383.531779458 9601644,627.057530399,624.700049162,624.170472818 9601645,604.361344065,603.577075683,602.648133745 9601646,506.315433885,507.370784919,506.065927123 9601647,575.667759671,572.967189365,572.755302626 9601648,705.644521297,702.434582246,702.370641859 9601649,577.941374160,576.955474140,577.775178536 9601650,365.426493965,365.437928317,365.021670433 9601651,366.972815710,367.247624347,366.866071929 9601652,418.821946249,419.549626651,417.981005075 9601653,461.009199714,461.307459871,460.469890710 9601654,535.257602194,534.579272615,533.834720794 9601655,514.048816833,512.157108363,512.476356303 9601656,514.940268545,514.223362549,515.169035216 9601657,434.957604555,435.133439306,435.044167742 9601658,440.949396894,440.470241760,440.444049798 9601659,536.640907394,536.232080980,535.804350256 9601660,432.232965190,434.130815504,432.918934767 9601661,423.969680350,424.519542986,423.159581174 9601662,467.240073351,466.179141298,466.027565912 9601663,409.920310630,409.773537894,409.123814450 9601664,461.752351210,462.563177882,461.742106599 9601665,502.525490595,503.218375194,501.770549375 9601666,487.557341602,487.495355646,486.453370293 9601667,520.901066173,520.886754073,520.637352417 9601668,506.977527269,504.076191929,503.472541757 9601669,542.540613790,541.841651832,542.100011534 9601670,486.457474400,486.419695939,485.317248669 9601671,608.142730233,605.525753167,605.533966189 9601672,582.012064994,581.339888339,580.554866040 9601673,537.508727592,537.164702771,536.122911674 9601674,566.990400335,564.937074313,563.576364201 9601675,691.842663149,692.160279332,690.251433385 9601676,639.884364362,635.609826079,632.774624617 9601677,430.860925235,432.872589058,431.741044238 9601678,748.683926729,748.715395869,747.928662484 9601679,375.632975433,377.014479151,376.068411075 9601680,410.222220088,410.592446043,410.955836142 9601681,579.450174514,578.124094930,576.366250618 9601682,601.480464114,599.455319435,599.077414669 9601683,451.692415486,453.677801458,453.281355518 9601684,445.057655109,444.039649877,443.638196978 9601685,522.354417204,522.957792410,522.538798670 9601686,547.077612191,547.767988248,547.360064770 9601687,454.679890783,453.802634932,452.228506362 9601688,533.421900367,533.218398441,532.192801795 9601689,615.492626500,613.300634513,612.737207618 9601690,613.923014226,613.731469046,613.420754901 9601691,430.167095947,430.932320635,429.530073143 9601692,539.241198765,538.705705488,538.029920654 9601693,539.687010190,538.023859613,537.167138490 9601694,473.989921164,473.880987942,473.261771270 9601695,590.350454576,588.887195448,587.951372958 9601696,503.452046458,502.324344384,503.010837491 9601697,491.905380393,491.716478484,491.786279675 9601698,608.482927332,606.282415168,606.517670389 9601699,462.819686137,462.264655832,461.147109303 9601700,546.547134906,544.813635597,545.270367392 9601701,555.631108145,554.654949820,553.372945045 9601702,600.427383142,599.214322011,598.505549746 9601703,609.922790715,608.452783880,606.145412902 9601704,546.376997273,545.520643371,545.690156749 9601705,565.565986385,567.258357842,565.910763040 9601706,580.551267013,579.340410943,578.960376644 9601707,534.178773017,536.158046681,534.435963988 9601708,510.516339726,509.164125547,507.891883996 9601709,566.441640398,563.984675289,563.124331200 9601710,509.844646185,509.146966758,508.904012904 9601711,541.978815660,539.865708616,540.658829450 9601712,385.986866638,386.463217839,385.498720481 9601713,585.116557361,583.102579693,583.139818684 9601714,439.224509190,438.631693811,437.597609367 9601715,323.158841730,323.925935180,323.173848809 9601716,457.976752134,458.436149156,457.168450976 9601717,672.753322957,669.559925932,667.358700944 9601718,635.077637944,632.883164292,632.607052018 9601719,555.967500301,553.209753945,552.409644972 9601720,501.776613088,501.639207803,501.572773212 9601721,422.729680075,422.917036416,421.510318079 9601722,482.452501804,483.136966415,482.290006271 9601723,638.887732963,638.583476562,637.779121844 9601724,639.247798900,639.067018338,637.739801800 9601725,454.046434654,454.815672020,452.729558619 9601726,621.115488648,618.745053840,617.579424859 9601727,464.407575388,462.878241290,462.065648034 9601728,442.985525600,444.874820480,444.538573639 9601729,551.660769348,550.143836173,550.146635878 9601730,763.566187959,763.988219345,762.323956919 9601731,458.150134847,458.317007299,457.630765970 9601732,537.715997531,537.021943493,536.311760164 9601733,435.925285685,436.239739643,436.624149109 9601734,340.295929237,343.318688756,342.694630194 9601735,703.187535155,702.308387794,701.648413646 9601736,561.111034365,559.769707736,558.877116868 9601737,478.964014413,480.047561746,479.649114076 9601738,622.540027826,621.251932362,620.575911627 9601739,555.976935417,554.225744827,552.517369137 9601740,516.494338445,514.369414922,513.767351227 9601741,485.556570810,486.285922720,485.191584244 9601742,469.369184028,470.848950062,470.763333583 9601743,562.525368478,563.777717903,562.514632035 9601744,496.115062455,496.691173794,496.598185342 9601745,651.370891785,648.557322303,646.979180160 9601746,427.333158203,427.179100118,426.582348464 9601747,581.829528446,579.639823034,580.507047353 9601748,594.461205743,593.765495920,592.681304150 9601749,669.385402663,665.367654795,665.325801354 9601750,431.705271935,430.974174003,429.979008190 9601751,491.550756015,490.336351911,489.476667440 9601752,622.675638743,620.210893543,620.013873718 9601753,603.828726158,600.290309057,600.201745676 9601754,397.250547801,398.584978205,398.038096561 9601755,364.493555238,364.800954792,364.074065873 9601756,509.559975987,508.987055977,509.067652766 9601757,461.940700295,460.914348327,460.725729285 9601758,591.343380494,590.869588282,589.730915734 9601759,425.666740111,425.339482053,424.352822792 9601760,638.007634805,636.754320667,635.825413843 9601761,538.548840945,538.180605950,537.088548203 9601762,524.715472576,525.297325260,524.536361769 9601763,733.313826683,732.307889371,730.551441002 9601764,473.984777285,473.971769699,473.218231524 9601765,497.889202625,497.021340462,495.969660914 9601766,449.008575453,447.570501814,446.966261319 9601767,675.999115312,672.856816548,671.762364105 9601768,748.252202368,747.238117267,744.671432207 9601769,562.049615316,562.544534488,562.691034940 9601770,613.349336278,611.388590139,610.612776454 9601771,718.794749513,716.081871967,715.805139974 9601772,417.783915843,419.259704369,418.400945213 9601773,506.911679046,506.787886966,506.150547272 9601774,414.038633063,413.292913583,412.637342123 9601775,563.011474456,564.070534309,561.882960795 9601776,531.512443085,530.973964075,529.798756747 9601777,584.800377026,584.668429435,583.982290428 9601778,427.701105313,429.503588739,428.837096419 9601779,455.509923353,456.741660182,455.210196439 9601780,650.666696066,648.259147274,647.103050132 9601781,607.103628824,604.853579846,604.940266992 9601782,344.019707251,344.832063172,344.016894852 9601783,542.990129733,538.966673181,539.036513657 9601784,672.425272660,670.964546956,670.700422357 9601785,662.144137327,660.347561682,660.303370424 9601786,450.447204094,450.975386705,450.504000269 9601787,491.522888913,489.960834286,489.967483787 9601788,538.271573360,538.332239024,538.177396182 9601789,628.461434051,628.468541968,628.269318842 9601790,658.442882848,656.751600611,655.799456394 9601791,426.817195260,426.899158681,426.243133584 ```