# A2: port-3 confirmation on assigned engine seeds Port-3 paired mean difference: **+0.745907725** versus t03 (SE 0.086837191) and **+1.511038025** versus IB (SE 0.090406828), n=256 each. All 256 assigned seeds completed once per strategy. Scores below are local real-engine measurements, not values copied from the input artifacts. The frozen strategies were each run alone against Vanilla; no tuning or reruns were performed. Edge is `result.edges["submission"]` (the engine edge score in token-Y units), not submission minus Vanilla edge. ## Setup | Component | Setting / observed result | |---|---| | Challenge checkout | `6b6921f8d463314aa7c96234e1be25a25245f704` | | Workspace | Checkout and all transient setup/state inside exempt `test/scratch/amm-challenge/`; no `/tmp` checkout | | Setup | Supplied `scratch/setup.sh` executed once from checkout root; exit 0 | | Python | CPython 3.12.16 | | Engine | `amm_sim_rs-0.1.0.post1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl` | | Wheel SHA-256 | `aedb68280aca34c110968f00148387c95885207913fb2cf19a1ab4c5cfd6887a`, verified | | Required packages | numpy, numba, cma, py-solc-x 2.1.0, pyrevm 0.3.7; editable pinned challenge | | Solidity | 0.8.24, optimizer enabled / 200 runs, viaIR, Paris EVM | | Opponent | Unchanged pinned `VanillaStrategy`, fixed 30 bps on both sides | | Engine invocation | `amm_sim_rs.run_batch(X, VanillaStrategy, configs, 8)` | | Seeds / chunks | 9600256–9600511 inclusive; 8 chunks × 32 seeds per strategy, 24 batches total | | Market | 10,000 steps; initial price 100, reserves 100 X / 10,000 Y; zero GBM drift, dt 1; retail buy probability 0.5, size sigma 1.2 | | Per-seed variation | `default_rng(seed)`: mean size U[19,21], arrival rate U[0.6,1.0], GBM sigma U[0.000882,0.001008], in that order | | Configuration check | All 256 × 12 fields matched pinned `_build_configs` exactly, replacing only its iteration range | | Freshness guard | Exclusive per-strategy/chunk state file reserved before engine invocation; existing reservations rejected | | Command bounds | Each scoring subprocess wrapped in `timeout 470`; no command exceeded 8 minutes | Setup settings come from the [pinned configuration](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/competition/config.py), [runner](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/competition/match.py), [compiler](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/evm/compiler.py), and [Vanilla source](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/contracts/src/VanillaStrategy.sol). Setup success, hashes, validation, byte sizes, timings, scores and gas are observations from this run. ## Source identity and validation Port-3 was extracted verbatim from the `contracts/src/Strategy.sol` Solidity block; t03 and IB were decoded using `zlib.decompress(base64.b64decode(code_zb64))`. No source changes. Taylor (gtmcknight) is credited in the original port-3 header. | Strategy / source | Source SHA-256 | Deployed bytes | |---|---|---:| | [port](https://api.imd.fun/artifacts/0dbcc10af41b3c3467ff0d9b9cb64c81328fcf18295f9be06b2d81bb98874067) | `62930b8e68277c69fc1acfba18de781e684d7fc6daac8dc562b8210dc3932ac1` | 18,466 | | [t03](https://api.imd.fun/artifacts/2333ecf28d4356bd232b85c1e55842e94e1ada05e1cd067830b5625dfdbc5336) | `cb6d945511e1e10af78baa64c2a6cb25806f0998403ce6440654bfc3c70092d9` | 14,654 | | [ib](https://api.imd.fun/artifacts/afd5183e9ff3235334e041c00b0cd19079599a2c6464db95f8c1586712105557) | `301941829a44bb60977bb28181a5e4bfa6544f3696763f987054789b2611d686` | 14,528 | Command: `. scratch/env.sh && timeout 470 amm-match validate contracts/src/Strategy.sol` (exit 0). ```text Validating strategy... Compiling strategy... Strategy 'TaylorGaussianPlainCoarse' validated successfully! ``` Port-3 runtime SHA-256: `35edacf4f75cf0a9d9e5dda1cdc9421b6cdc3c1aad39c55afc457a08df556ce5`. Its 18,466 deployed bytes are within the 24,576-byte limit. The setup starter validation also succeeded. ## Engine scores | Strategy | n | Mean edge | Engine seconds (sum of 8 chunks) | |---|---:|---:|---:| | port | 256 | 538.635996367 | 100.474 | | t03 | 256 | 537.890088643 | 179.158 | | ib | 256 | 537.124958342 | 180.200 | Differences are paired on the identical market seed. SE = sample standard deviation of differences (ddof=1) / √n. Wins count strictly positive port-3 differences; worst5 lists the five lowest differences. Statistics use full precision, before CSV rounding. | Pair | n | mean_diff | se | Wins | Ties | Losses | |---|---:|---:|---:|---:|---:|---:| | port-3 − t03 | 256 | 0.745907725 | 0.086837191 | 178 | 0 | 78 | | port-3 − ib | 256 | 1.511038025 | 0.090406828 | 216 | 0 | 40 | | Pair | worst5 (seed, diff) | |---|---| | port-3 − t03 | (9600362, -2.556215850); (9600443, -2.307139497); (9600466, -2.191836339); (9600472, -2.123359035); (9600478, -1.978871573) | | port-3 − ib | (9600411, -1.674005622); (9600466, -1.418228706); (9600433, -1.386732031); (9600321, -1.386459038); (9600473, -1.375364151) | ## Gas instrumentation `amm_sim_rs.gas_stats_reset()` ran immediately before each batch, and `gas_stats()` was captured immediately after. Counts and gas sums below sum the eight snapshots; peak is their maximum. Mean = `sum_ok_gas / ok`, so it is weighted by calls. Role `Submission` is the strategy being scored; `Baseline` is Vanilla in that separate run. | Strategy | Role / callback | Calls | OOG | Peak gas | Mean gas | |---|---|---:|---:|---:|---:| | port | Submission / afterSwap | 2,772,794 | 0 | 204,932 | 95386.547951 | | port | Baseline / afterSwap | 2,859,683 | 0 | 22,592 | 22562.734097 | | t03 | Submission / afterSwap | 2,806,292 | 0 | 235,527 | 135404.784329 | | t03 | Baseline / afterSwap | 2,781,604 | 0 | 22,592 | 22562.813355 | | ib | Submission / afterSwap | 2,783,219 | 0 | 234,958 | 135078.731757 | | ib | Baseline / afterSwap | 2,783,538 | 0 | 22,592 | 22562.836117 | All recorded callbacks succeeded: no OOG, revert, other halt, transaction error or bad return in any strategy or Vanilla snapshot. Port-3 afterSwap peak is below 245,000 gas on this sample. ## Per-seed CSV ```csv seed,port,t03,ib 9600256,483.164,480.333,478.479 9600257,755.951,752.620,753.147 9600258,606.942,606.838,606.830 9600259,585.092,584.267,583.640 9600260,588.412,585.898,585.452 9600261,477.128,477.494,477.878 9600262,499.304,499.372,497.992 9600263,500.160,499.112,498.015 9600264,487.836,486.330,486.325 9600265,577.873,576.022,575.620 9600266,622.759,621.954,621.786 9600267,586.788,586.903,585.382 9600268,572.918,572.601,572.361 9600269,482.102,480.505,480.390 9600270,542.799,542.517,541.315 9600271,535.834,534.981,533.622 9600272,644.123,644.634,643.515 9600273,435.593,433.759,433.325 9600274,432.287,431.400,429.896 9600275,530.368,529.866,528.926 9600276,454.812,454.173,453.137 9600277,512.208,511.452,510.664 9600278,492.872,492.483,493.316 9600279,696.321,694.696,692.674 9600280,574.974,575.974,575.390 9600281,519.823,518.120,517.417 9600282,497.737,496.557,495.697 9600283,642.201,638.306,638.581 9600284,605.565,606.333,604.585 9600285,573.917,575.162,573.736 9600286,432.657,433.179,433.200 9600287,435.389,433.680,434.308 9600288,603.209,602.255,603.299 9600289,593.803,591.269,589.638 9600290,584.291,583.230,582.163 9600291,561.687,562.207,561.543 9600292,633.765,630.580,631.122 9600293,503.771,502.747,502.882 9600294,641.397,639.709,638.887 9600295,560.636,559.348,558.353 9600296,472.080,471.489,471.667 9600297,625.865,624.570,623.162 9600298,521.080,519.605,518.841 9600299,647.457,645.594,645.559 9600300,596.315,594.898,594.591 9600301,558.061,556.239,553.754 9600302,436.797,436.423,435.326 9600303,392.783,393.359,392.277 9600304,543.439,542.543,542.225 9600305,680.144,679.770,678.749 9600306,531.613,531.796,531.878 9600307,474.682,475.032,473.065 9600308,565.459,563.517,562.771 9600309,498.378,498.988,497.185 9600310,663.913,663.271,662.238 9600311,709.823,707.499,707.438 9600312,684.402,680.515,680.463 9600313,570.552,570.631,569.755 9600314,455.668,454.762,454.081 9600315,381.060,381.351,381.491 9600316,580.714,577.492,576.191 9600317,479.122,478.889,478.930 9600318,488.377,485.705,485.594 9600319,657.642,656.363,655.597 9600320,498.889,498.738,498.380 9600321,579.456,580.508,580.843 9600322,467.999,467.993,467.038 9600323,600.768,598.101,595.184 9600324,435.012,435.655,435.142 9600325,565.892,565.880,564.960 9600326,571.928,569.973,569.557 9600327,409.746,410.224,409.060 9600328,491.631,490.835,489.056 9600329,477.720,476.851,477.453 9600330,494.779,493.560,493.018 9600331,411.303,410.803,410.259 9600332,466.894,466.352,465.652 9600333,675.894,675.546,675.473 9600334,614.576,611.945,611.882 9600335,590.666,590.130,589.203 9600336,615.309,612.053,611.698 9600337,439.370,440.113,439.292 9600338,739.540,736.552,736.358 9600339,550.229,549.599,547.937 9600340,661.974,658.191,658.206 9600341,555.375,554.229,553.315 9600342,384.864,384.855,384.579 9600343,646.193,645.734,643.569 9600344,616.623,613.613,612.866 9600345,670.222,666.578,667.002 9600346,568.612,567.209,566.053 9600347,474.554,474.063,473.614 9600348,563.964,564.608,563.149 9600349,452.757,454.336,453.630 9600350,487.740,486.815,487.263 9600351,547.582,546.477,545.416 9600352,561.557,559.070,559.094 9600353,664.746,660.096,659.539 9600354,541.840,539.450,539.498 9600355,478.233,478.130,476.682 9600356,489.556,489.054,488.317 9600357,471.756,471.618,471.944 9600358,601.106,598.246,598.860 9600359,518.204,518.800,518.171 9600360,611.475,609.985,609.677 9600361,448.972,450.759,449.072 9600362,356.857,359.413,358.204 9600363,344.754,344.992,344.489 9600364,445.567,446.480,444.161 9600365,419.710,418.419,418.155 9600366,475.897,476.367,476.310 9600367,518.694,519.681,518.861 9600368,459.775,459.459,458.865 9600369,465.357,462.539,462.145 9600370,535.571,534.213,533.473 9600371,394.938,396.060,395.411 9600372,451.803,453.315,452.528 9600373,535.703,536.542,534.767 9600374,363.800,364.356,364.086 9600375,518.709,517.484,515.357 9600376,561.198,559.620,559.421 9600377,590.136,588.692,588.154 9600378,668.290,667.014,667.125 9600379,627.058,624.112,624.465 9600380,383.065,382.718,382.785 9600381,528.073,528.386,527.494 9600382,508.653,509.114,507.706 9600383,623.615,621.000,619.405 9600384,460.508,461.079,460.226 9600385,531.291,531.088,530.807 9600386,419.522,419.998,419.617 9600387,512.210,511.443,508.101 9600388,578.246,576.097,575.867 9600389,531.697,531.236,529.937 9600390,490.010,489.191,488.919 9600391,445.646,443.679,443.173 9600392,519.551,517.992,517.592 9600393,571.933,568.687,569.319 9600394,474.219,473.465,472.972 9600395,596.830,596.342,593.817 9600396,477.502,475.928,475.335 9600397,595.127,593.255,592.526 9600398,608.427,605.249,604.867 9600399,527.639,527.461,526.948 9600400,666.691,666.275,665.115 9600401,618.761,619.441,619.301 9600402,524.508,524.880,524.937 9600403,512.957,512.488,512.117 9600404,494.972,493.889,492.866 9600405,714.065,710.849,710.301 9600406,539.742,539.976,538.923 9600407,392.215,393.607,393.234 9600408,631.425,630.476,628.722 9600409,515.382,515.430,513.277 9600410,543.394,544.534,542.500 9600411,466.138,467.231,467.812 9600412,659.074,655.241,654.114 9600413,555.818,554.546,553.750 9600414,519.615,519.821,518.383 9600415,664.960,661.835,660.117 9600416,371.026,372.196,371.150 9600417,553.187,551.200,551.519 9600418,622.469,623.799,622.472 9600419,580.431,580.497,580.050 9600420,498.733,498.234,497.235 9600421,502.980,503.470,502.367 9600422,733.490,730.719,727.126 9600423,565.280,564.432,563.093 9600424,475.397,474.592,473.167 9600425,444.929,444.366,443.532 9600426,556.948,557.152,555.455 9600427,626.448,626.159,625.739 9600428,588.863,586.985,586.140 9600429,411.315,412.212,411.872 9600430,577.793,576.059,575.992 9600431,626.030,625.019,624.574 9600432,527.931,525.427,524.487 9600433,395.817,397.789,397.204 9600434,422.540,422.869,421.286 9600435,527.138,525.361,523.850 9600436,542.480,542.905,539.924 9600437,712.558,711.373,710.682 9600438,556.653,555.898,554.624 9600439,477.666,478.581,477.527 9600440,570.729,568.166,568.225 9600441,482.869,481.744,482.051 9600442,604.560,603.381,603.158 9600443,548.412,550.719,548.114 9600444,625.029,624.035,622.101 9600445,584.590,581.731,580.829 9600446,555.340,554.334,554.472 9600447,569.050,567.206,566.432 9600448,431.462,431.597,431.765 9600449,408.325,406.717,405.686 9600450,509.510,508.756,508.576 9600451,521.895,522.640,521.624 9600452,530.517,529.270,528.343 9600453,428.829,428.411,427.726 9600454,620.396,618.309,616.587 9600455,559.263,556.450,555.705 9600456,696.898,692.557,692.436 9600457,467.379,465.261,463.021 9600458,397.350,398.220,396.622 9600459,636.738,635.522,634.951 9600460,493.054,493.306,493.305 9600461,524.208,524.187,523.708 9600462,556.172,555.246,554.461 9600463,626.822,624.814,624.017 9600464,549.201,550.556,548.726 9600465,457.995,457.571,456.708 9600466,374.707,376.899,376.125 9600467,627.677,628.285,628.319 9600468,715.855,713.320,711.776 9600469,423.776,422.729,421.593 9600470,463.430,463.119,461.632 9600471,572.225,571.229,569.523 9600472,387.681,389.804,388.593 9600473,459.375,461.005,460.750 9600474,570.827,570.541,570.153 9600475,452.100,452.670,451.607 9600476,628.557,629.630,629.120 9600477,357.447,358.559,357.995 9600478,362.282,364.261,363.512 9600479,622.154,621.766,621.090 9600480,368.056,368.533,367.971 9600481,584.285,583.867,583.345 9600482,649.545,646.284,646.212 9600483,427.011,427.390,425.640 9600484,511.470,508.758,508.422 9600485,540.482,541.205,539.092 9600486,547.402,546.249,545.806 9600487,493.956,493.607,492.743 9600488,460.041,461.050,459.684 9600489,527.412,525.333,525.355 9600490,619.193,620.592,620.509 9600491,544.017,545.974,544.175 9600492,612.905,612.690,611.499 9600493,497.899,496.203,496.343 9600494,444.804,444.106,443.316 9600495,491.101,491.979,490.079 9600496,650.771,650.531,649.375 9600497,478.802,478.946,478.920 9600498,666.090,663.739,663.832 9600499,585.972,584.020,581.828 9600500,665.190,664.017,663.262 9600501,392.376,392.146,391.752 9600502,612.821,610.842,610.418 9600503,500.530,498.865,498.497 9600504,773.541,772.560,770.915 9600505,736.931,735.366,735.814 9600506,592.005,590.983,590.181 9600507,762.921,764.009,762.686 9600508,614.141,613.773,613.538 9600509,497.789,496.782,495.713 9600510,458.221,457.860,457.815 9600511,573.649,574.605,573.909 ``` ## Problems and scope No setup, validation, compilation or engine failure occurred. These are confirmation results for the specified block only. Replica gates P/Q/F were not rerun: this item requests confirmation of the frozen existing port, and makes no new claim about those gates. The finite engine sample does not establish gas safety or score superiority on every possible seed. ## Scoring harness The harness below was run once for each strategy/chunk start. `compiled.json` cached unmodified sources compiled through the pinned `SolidityCompiler.compile`, with `VanillaStrategy` as the normalizer contract name. Scoring was always prefixed with `. scratch/env.sh && timeout 470 python scratch/score.py KIND START`. ```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 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 kind=sys.argv[1];start=int(sys.argv[2]);end=start+32 assert kind in ['port','t03','ib'] assert 9600256<=start