# A1: port-3 confirmation on fresh engine seeds On this fixed 256-seed sample, port-3 beats t03 by **+0.617718299 edge** (SE **0.088286959**, 167 wins) and IB by **+1.379937501 edge** (SE **0.086433425**, 215 wins). It validates at **18,466 deployed bytes** and records **0 OutOfGas**, with **204,472 gas** peak afterSwap, below the 245,000 limit. Local engine measurements on the assigned 256 seeds; no tuning or reruns were performed. Every strategy ran separately against VanillaStrategy. Results below are generated from the saved single-use chunk outputs, not copied from the source artifacts. ## Setup | Component | Observed setup / outcome | |---|---| | Checkout | [amm-challenge](https://github.com/benedictbrady/amm-challenge/tree/6b6921f8d463314aa7c96234e1be25a25245f704), commit `6b6921f8d463314aa7c96234e1be25a25245f704`; detached checkout under exempt `test/scratch/` | | Setup | Supplied `scratch/setup.sh` saved and run once from checkout root; exit 0; later commands sourced `scratch/env.sh` | | Python | CPython 3.12.3 | | Engine | `amm_sim_rs-0.1.0.post1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl`; SHA-256 `aedb68280aca34c110968f00148387c95885207913fb2cf19a1ab4c5cfd6887a`, verified by supplied setup | | Packages | numpy 2.5.4; numba 0.68.1; cma 4.5.0; py-solc-x 2.1.0; pyrevm 0.3.7; editable pinned amm-challenge | | Compiler | solc 0.8.24; [pinned compiler defaults](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/evm/compiler.py): optimizer 200 runs, viaIR, Paris EVM | | Setup validation | `Strategy 'StarterStrategy' validated successfully!` | | Execution | `amm_sim_rs.run_batch(X, VanillaStrategy, configs, 8)`; eight 32-seed chunks per strategy; reserved chunk files before invocation; each engine command bounded by 470 seconds | ### Source identity and validation Exact source bytes extracted without edits from the named artifacts. Port-3 was extracted from its `contracts/src/Strategy.sol` fenced block; t03 and IB were decoded using zlib(base64(code_zb64)). Full SHA-256 checks matched the port hash and each baseline artifact’s `code_sha256`, including the requested prefixes. | Strategy | Artifact source | Source SHA-256 | Deployed bytes | |---|---|---|---:| | port | [artifact](https://api.imdnotdead.fun/artifacts/0dbcc10af41b3c3467ff0d9b9cb64c81328fcf18295f9be06b2d81bb98874067) | `62930b8e68277c69fc1acfba18de781e684d7fc6daac8dc562b8210dc3932ac1` | 18,466 | | t03 | [artifact](https://api.imdnotdead.fun/artifacts/2333ecf28d4356bd232b85c1e55842e94e1ada05e1cd067830b5625dfdbc5336) | `cb6d945511e1e10af78baa64c2a6cb25806f0998403ce6440654bfc3c70092d9` | 14,654 | | ib | [artifact](https://api.imdnotdead.fun/artifacts/afd5183e9ff3235334e041c00b0cd19079599a2c6464db95f8c1586712105557) | `301941829a44bb60977bb28181a5e4bfa6544f3696763f987054789b2611d686` | 14,528 | Validation command: `. scratch/env.sh && timeout 470 amm-match validate contracts/src/Strategy.sol` (exit 0). Exact final line: ```text Strategy 'TaylorGaussianPlainCoarse' validated successfully! ``` Port-3 deployed bytecode is 18,466 bytes, below 24,576. The original header credits Taylor (gtmcknight); the source was not modified. ## Measurement method Only seeds **9600000..9600255**, inclusive, were executed. Configurations directly transcribe the pinned [MatchRunner._build_configs](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/competition/match.py): for each seed i, `np.random.default_rng(i)` draws retail mean size, retail arrival rate, then GBM sigma, in that order. The [baseline settings](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/competition/config.py) give 10,000 steps, price 100, reserves (100, 10,000), mu 0, dt 1, retail buy probability 0.5, size sigma 1.2; uniform ranges are size [19,21], arrival [0.6,1.0], GBM sigma [0.000882,0.001008]. The opponent is the unchanged [30 bps VanillaStrategy](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/contracts/src/VanillaStrategy.sol). Edge is each result’s `edges["submission"]`, rather than a head-to-head match between candidate strategies. Paired differences use full precision before CSV rounding. SE = sample standard deviation of paired differences / sqrt(n); wins count strictly positive differences. Worst5 are the five smallest differences. ## Mean edge | Strategy | n | Mean edge | |---|---:|---:| | port | 256 | 536.582364319 | | t03 | 256 | 535.964646020 | | ib | 256 | 535.202426817 | ## Paired comparisons | Comparison | n | mean_diff | se | wins | ties | |---|---:|---:|---:|---:|---:| | port-3 minus t03 | 256 | 0.617718299 | 0.088286959 | 167 | 0 | | port-3 minus ib | 256 | 1.379937501 | 0.086433425 | 215 | 0 | | Comparison | worst5 (seed, diff) | |---|---| | port-3 minus t03 | (9600044, -2.677465988); (9600078, -2.631023953); (9600111, -2.483006736); (9600164, -2.450307732); (9600063, -2.271666978) | | port-3 minus ib | (9600118, -1.510317512); (9600078, -1.232227586); (9600044, -1.206703253); (9600070, -1.203985654); (9600063, -1.172264658) | ## Engine gas instrumentation `amm_sim_rs.gas_stats_reset()` preceded every chunk; `amm_sim_rs.gas_stats()` was captured immediately after it. Below aggregates only role `Submission`, callback `afterSwap`: counts and gas sums are summed across the eight chunks; peak is the maximum chunk peak; mean is total `sum_ok_gas` / total `ok` (call-weighted, including engine transaction overhead). | Strategy | afterSwap calls | ok | oog | peak gas | mean gas | |---|---:|---:|---:|---:|---:| | port | 2756066 | 2756066 | 0 | 204472 | 95428.994888 | | t03 | 2791556 | 2791556 | 0 | 238223 | 135485.392048 | | ib | 2770049 | 2770049 | 0 | 237663 | 135142.138937 | Additional afterSwap error counts from the same gas snapshots: | Strategy | revert | other_halt | tx_error | bad_return | |---|---:|---:|---:|---:| | port | 0 | 0 | 0 | 0 | | t03 | 0 | 0 | 0 | 0 | | ib | 0 | 0 | 0 | 0 | ## Per-seed CSV ```csv seed,port,t03,ib 9600000,596.746,596.726,595.620 9600001,452.808,450.705,450.098 9600002,661.668,660.661,658.675 9600003,404.694,404.103,403.165 9600004,394.478,395.276,395.252 9600005,582.917,581.540,580.693 9600006,428.102,427.848,426.409 9600007,752.975,751.052,750.546 9600008,681.697,680.284,679.907 9600009,551.915,550.509,550.242 9600010,649.380,649.366,647.824 9600011,423.799,423.866,423.060 9600012,535.202,535.968,536.150 9600013,654.548,651.479,650.324 9600014,399.152,400.126,398.019 9600015,388.774,387.489,386.518 9600016,471.293,470.000,470.019 9600017,405.057,406.264,405.507 9600018,482.897,482.143,482.442 9600019,371.218,371.007,369.882 9600020,530.645,530.718,529.600 9600021,503.020,500.633,500.924 9600022,641.181,638.938,637.621 9600023,395.358,396.192,395.090 9600024,487.652,488.114,487.729 9600025,424.095,424.875,423.779 9600026,566.252,564.686,562.032 9600027,708.388,704.177,703.513 9600028,430.474,432.000,430.784 9600029,584.489,583.067,582.544 9600030,463.508,465.244,463.538 9600031,405.147,406.027,404.868 9600032,626.727,625.180,626.646 9600033,723.026,721.544,720.689 9600034,586.622,586.361,585.767 9600035,433.022,433.028,433.153 9600036,455.255,455.386,454.354 9600037,524.869,526.146,524.598 9600038,481.444,481.790,480.600 9600039,575.319,574.852,573.868 9600040,632.662,628.951,628.151 9600041,456.355,455.702,455.437 9600042,489.096,488.594,487.929 9600043,523.706,521.816,522.746 9600044,479.477,482.154,480.684 9600045,655.641,650.712,650.671 9600046,469.651,470.113,470.159 9600047,451.906,452.972,451.080 9600048,526.505,527.099,525.915 9600049,505.575,505.357,505.689 9600050,428.223,428.746,426.147 9600051,569.088,567.860,566.941 9600052,388.946,387.714,388.224 9600053,686.759,687.373,685.341 9600054,601.458,600.719,599.024 9600055,657.863,653.125,653.050 9600056,556.264,556.685,555.030 9600057,524.899,525.383,525.396 9600058,617.760,616.944,616.463 9600059,558.502,555.787,554.170 9600060,463.011,462.002,461.377 9600061,672.195,669.977,669.017 9600062,558.672,557.487,555.873 9600063,669.282,671.554,670.454 9600064,565.419,566.261,564.656 9600065,389.643,388.117,387.204 9600066,402.590,402.426,402.883 9600067,623.224,620.377,619.813 9600068,688.188,684.151,683.779 9600069,431.495,432.175,431.071 9600070,434.854,436.362,436.058 9600071,446.318,445.700,445.546 9600072,420.392,419.984,420.406 9600073,497.308,496.669,495.350 9600074,546.431,547.641,546.304 9600075,558.463,559.497,558.409 9600076,736.142,731.617,731.671 9600077,425.828,426.077,425.495 9600078,427.057,429.688,428.290 9600079,500.267,500.228,499.830 9600080,557.330,556.478,555.571 9600081,599.603,599.031,597.455 9600082,412.052,412.147,411.703 9600083,407.792,409.342,407.345 9600084,689.443,689.337,687.420 9600085,411.680,411.417,411.935 9600086,591.069,588.800,588.599 9600087,660.543,659.250,657.255 9600088,531.431,529.941,529.064 9600089,708.068,704.967,704.498 9600090,607.711,606.717,606.493 9600091,572.430,571.065,570.135 9600092,412.199,411.702,411.655 9600093,650.645,649.132,648.681 9600094,511.100,509.953,508.200 9600095,582.883,583.677,583.514 9600096,492.314,491.831,491.436 9600097,633.725,633.230,631.799 9600098,442.137,444.061,443.046 9600099,485.874,484.557,483.998 9600100,514.971,513.805,511.290 9600101,580.105,580.477,580.204 9600102,510.369,510.077,508.717 9600103,639.601,638.377,638.152 9600104,452.487,453.114,452.386 9600105,462.612,463.024,461.306 9600106,607.579,606.876,606.174 9600107,442.550,441.517,442.106 9600108,651.648,651.414,651.015 9600109,503.483,505.178,503.404 9600110,561.144,559.242,559.007 9600111,360.095,362.578,361.174 9600112,547.752,546.584,545.880 9600113,399.768,400.256,399.140 9600114,530.603,529.329,529.212 9600115,540.129,538.334,537.209 9600116,578.860,576.214,575.276 9600117,530.607,529.649,529.197 9600118,484.131,486.128,485.642 9600119,511.030,511.533,509.838 9600120,350.991,351.885,350.811 9600121,569.480,569.571,568.977 9600122,431.593,431.026,430.320 9600123,475.738,477.142,475.268 9600124,624.861,622.372,621.815 9600125,589.994,587.605,585.903 9600126,612.009,611.098,608.511 9600127,375.129,375.918,374.881 9600128,630.388,627.848,625.838 9600129,482.313,483.454,481.900 9600130,611.001,610.557,609.186 9600131,396.644,396.221,396.089 9600132,810.188,806.816,806.627 9600133,380.505,381.519,381.132 9600134,434.955,433.732,433.126 9600135,588.426,585.771,585.917 9600136,589.278,589.469,588.183 9600137,454.685,455.702,455.038 9600138,486.790,487.860,487.863 9600139,505.134,504.182,503.295 9600140,454.744,455.176,454.545 9600141,564.539,563.966,563.756 9600142,706.334,703.274,703.905 9600143,487.352,488.288,487.979 9600144,657.801,655.885,653.960 9600145,492.905,491.121,491.211 9600146,626.128,624.508,624.369 9600147,611.200,610.112,610.404 9600148,427.071,427.737,425.790 9600149,543.132,541.322,540.965 9600150,576.034,574.102,573.661 9600151,396.870,397.970,397.757 9600152,532.805,530.366,530.651 9600153,732.240,731.624,730.248 9600154,741.002,736.438,736.409 9600155,410.015,410.421,409.073 9600156,628.056,625.026,625.228 9600157,532.026,533.153,531.709 9600158,532.807,533.031,531.795 9600159,459.056,460.526,458.967 9600160,561.736,559.845,558.761 9600161,715.917,715.659,716.113 9600162,559.646,558.585,557.198 9600163,547.148,546.119,545.475 9600164,533.547,535.997,534.404 9600165,499.575,498.157,497.069 9600166,628.097,626.569,625.863 9600167,593.396,591.980,590.770 9600168,591.615,589.742,588.956 9600169,463.455,463.287,463.103 9600170,553.186,553.729,552.415 9600171,464.990,465.169,464.673 9600172,623.957,622.941,622.312 9600173,544.748,543.941,543.576 9600174,475.476,473.714,473.374 9600175,642.104,641.836,641.313 9600176,593.668,594.239,593.715 9600177,421.531,421.783,420.792 9600178,497.469,496.444,496.086 9600179,537.548,537.043,535.849 9600180,643.941,643.519,641.331 9600181,470.659,471.509,469.998 9600182,591.469,589.626,589.770 9600183,507.041,506.028,505.274 9600184,560.387,561.200,560.451 9600185,498.477,498.051,496.955 9600186,669.219,668.406,666.834 9600187,451.807,450.027,449.163 9600188,531.208,530.556,528.806 9600189,556.495,556.846,556.877 9600190,612.351,612.289,610.937 9600191,459.783,460.472,460.369 9600192,629.219,629.325,628.516 9600193,679.144,676.159,676.502 9600194,567.262,566.438,564.700 9600195,634.022,634.015,633.653 9600196,441.482,442.184,441.281 9600197,489.255,490.064,488.907 9600198,486.834,487.242,484.303 9600199,722.302,720.658,720.667 9600200,530.271,528.101,527.106 9600201,662.012,660.503,659.773 9600202,372.751,372.946,373.405 9600203,589.415,589.742,588.975 9600204,604.531,603.041,600.368 9600205,411.440,412.129,411.366 9600206,512.620,511.483,510.871 9600207,548.086,546.456,546.590 9600208,355.937,355.864,356.043 9600209,473.739,473.296,472.994 9600210,629.157,627.978,627.018 9600211,664.959,665.495,664.861 9600212,542.190,538.756,538.918 9600213,435.772,436.141,436.830 9600214,599.562,597.170,597.377 9600215,750.696,746.141,746.656 9600216,461.834,461.565,460.810 9600217,643.511,643.484,641.899 9600218,452.729,452.036,452.787 9600219,671.728,669.107,668.485 9600220,391.471,392.532,390.925 9600221,559.872,558.627,558.004 9600222,440.843,441.748,440.824 9600223,575.585,574.139,573.147 9600224,636.266,635.188,636.052 9600225,656.802,656.261,654.689 9600226,653.727,653.611,652.475 9600227,743.898,742.526,741.588 9600228,660.172,657.004,657.331 9600229,394.635,396.291,395.557 9600230,519.446,519.673,519.067 9600231,511.420,510.004,508.996 9600232,592.375,590.947,591.116 9600233,431.364,430.359,430.198 9600234,475.842,476.874,476.643 9600235,614.750,613.279,612.766 9600236,618.980,617.426,615.867 9600237,518.435,517.194,515.885 9600238,408.239,408.928,408.120 9600239,518.927,516.775,518.077 9600240,540.503,539.371,537.909 9600241,341.866,343.139,342.645 9600242,508.989,508.211,507.266 9600243,514.959,513.634,513.232 9600244,446.732,445.781,445.521 9600245,523.086,521.908,521.249 9600246,596.144,595.727,595.110 9600247,471.683,471.306,470.705 9600248,546.034,546.046,545.114 9600249,590.079,587.713,588.596 9600250,557.808,557.473,555.416 9600251,563.670,562.632,561.832 9600252,516.186,517.644,516.799 9600253,459.606,460.198,458.140 9600254,577.613,576.014,574.298 9600255,568.270,566.641,567.447 ``` ## Problems and limits The port-3 artifact is Markdown, whereas t03 and IB are JSON; an initial JSON parsing attempt on port-3 was corrected by extracting its named Solidity block and verifying the exact hash. No setup, compilation, validation, or engine chunk failed. No seeds were rerun. This is a fixed-source engine confirmation, not a new port or a replica-gate rerun. P/Q/F results from the original artifact were not independently re-established by this item. Observed gas peaks describe these callbacks only; they are not a proof for all possible states. Local measurements are not independent certification. Chunk elapsed seconds (local measurement): | Strategy | 32-seed chunks in ascending seed order | |---|---| | port | 19.874, 38.778, 31.450, 36.647, 43.097, 42.573, 30.724, 38.151 | | t03 | 46.462, 52.264, 52.521, 53.203, 53.439, 43.379, 51.959, 52.895 | | ib | 51.304, 49.983, 42.742, 43.469, 43.333, 27.893, 25.707, 27.130 |