# A4: port-3 confirmation on fresh engine seeds This is an unchanged-source confirmation on seeds **9600768–9601023**, inclusive (256 paired markets). All numerical results below are local measurements from the specified native engine, not figures copied from earlier artifact reports. Each strategy ran alone against 30 bps VanillaStrategy. No assigned seed was rerun or used to tune a strategy. Port-3 exceeds t03 by **+0.617335950** (SE **0.084013921**) and IB by **+1.354394557** (SE **0.092949707**) on this block. Port-3 wins 170/256 paired comparisons with t03 and 219/256 with IB. ## Setup | Check | Observed result | |---|---| | Checkout | amm-challenge `6b6921f8d463314aa7c96234e1be25a25245f704`; workspace `test/scratch/amm-challenge` | | Setup | Requested script saved as `scratch/setup.sh` and run once; success | | Native engine | `amm_sim_rs` 0.1.0.post1, requested cp310-abi3 manylinux wheel | | Wheel SHA-256 | `aedb68280aca34c110968f00148387c95885207913fb2cf19a1ab4c5cfd6887a`; checksum passed | | Python / Solidity | Python 3.12.3; solc 0.8.24; optimizer 200 runs, viaIR, EVM Paris | | Dependencies | numpy 2.5.4; numba 0.68.1; cma 4.5.0; py-solc-x 2.1.0; pyrevm 0.3.7 | | Setup validator | `Strategy 'StarterStrategy' validated successfully!` | | Engine invocation | `amm_sim_rs.run_batch(X, VanillaStrategy, configs, 8)` | | Segmentation | 8 disjoint chunks of 32 seeds per strategy; state in `scratch/engine_{strategy}_{start}.json`; seed reservation before invocation | ## Sources and validation Port-3 was extracted verbatim from the Solidity block in [its artifact](https://api.imd.fun/artifacts/0dbcc10af41b3c3467ff0d9b9cb64c81328fcf18295f9be06b2d81bb98874067). t03 and IB were decoded from `zlib(base64(code_zb64))` in [t03](https://api.imd.fun/artifacts/2333ecf28d4356bd232b85c1e55842e94e1ada05e1cd067830b5625dfdbc5336) and [IB](https://api.imd.fun/artifacts/afd5183e9ff3235334e041c00b0cd19079599a2c6464db95f8c1586712105557). Source hashes were checked before any engine run. | Strategy | Source SHA-256 | Deployed bytes | |---|---|---:| | port | `62930b8e68277c69fc1acfba18de781e684d7fc6daac8dc562b8210dc3932ac1` | 18,466 | | t03 | `cb6d945511e1e10af78baa64c2a6cb25806f0998403ce6440654bfc3c70092d9` | 14,654 | | ib | `301941829a44bb60977bb28181a5e4bfa6544f3696763f987054789b2611d686` | 14,528 | Command: `. scratch/env.sh && timeout 470 amm-match validate contracts/src/Strategy.sol` Validator output: `Strategy 'TaylorGaussianPlainCoarse' validated successfully!` Port-3 deployed runtime is **18,466 bytes**, below 24,576. Configs follow [MatchRunner._build_configs](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/competition/match.py) and [baseline config](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/competition/config.py). For assigned seed i, `default_rng(i)` draws retail mean size uniform[19,21], arrival rate uniform[0.6,1.0], then sigma uniform[0.000882,0.001008]. The direct transcription avoids constructing millions of preceding configs. Its configuration fields were checked against the actual `_build_configs` implementation for all 256 assigned seeds, without another engine invocation. Other settings: 10,000 steps; initial price 100; reserves 100/10,000; GBM mu 0, dt 1; retail size sigma 1.2; buy probability 0.5. The opponent is the pinned [VanillaStrategy](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/contracts/src/VanillaStrategy.sol). ## Edge results Edge is `batch.results[*].edges["submission"]`, in engine edge units. Mean and paired statistics use unrounded per-seed values; CSV is rounded only for display. SE is sample standard deviation of paired differences divided by sqrt(n). A win means strictly positive paired difference. | Strategy | n | Mean edge | |---|---:|---:| | port | 256 | 534.602148660 | | t03 | 256 | 533.984812710 | | ib | 256 | 533.247754102 | | Paired difference | n | mean_diff | se | Wins | Ties | |---|---:|---:|---:|---:|---:| | port-3 − t03 | 256 | 0.617335950 | 0.084013921 | 170 | 0 | | port-3 − ib | 256 | 1.354394557 | 0.092949707 | 219 | 0 | Worst five paired outcomes (lowest differences): | Comparison | Seed | Diff | |---|---:|---:| | port-3 − t03 | 9600978 | -2.936703332 | | port-3 − t03 | 9600881 | -2.160652881 | | port-3 − t03 | 9601009 | -2.017120337 | | port-3 − t03 | 9600833 | -1.843099339 | | port-3 − t03 | 9600853 | -1.813771889 | | port-3 − ib | 9600978 | -1.883011982 | | port-3 − ib | 9600775 | -1.836834331 | | port-3 − ib | 9600883 | -1.195045610 | | port-3 − ib | 9601009 | -1.157687437 | | port-3 − ib | 9600870 | -1.106520604 | ## Gas `amm_sim_rs.gas_stats()` was reset immediately before each chunk and collected immediately afterward. Calls, successful calls, gas sums and failure counters are summed across chunks; peak is the maximum `max_ok_gas`; mean is total `sum_ok_gas / ok` (call weighted). Submission is the tested strategy; Baseline is VanillaStrategy. | Strategy | Role | afterSwap calls | OOG | Peak gas | Mean gas | |---|---|---:|---:|---:|---:| | port | Submission | 2,754,680 | 0 | 206,273 | 95426.647665 | | port | Baseline | 2,840,940 | 0 | 22,592 | 22562.672221 | | t03 | Submission | 2,792,831 | 0 | 235,405 | 135485.908565 | | t03 | Baseline | 2,760,537 | 0 | 22,592 | 22562.762180 | | ib | Submission | 2,769,897 | 0 | 234,977 | 135150.387892 | | ib | Baseline | 2,763,109 | 0 | 22,592 | 22562.772766 | All callbacks, including afterInitialize and getName, succeeded for all three strategies and their Vanilla opponents: zero OOG, revert, other_halt, tx_error or bad_return. All measured submission afterSwap peaks are below 245,000 gas. ## Per-seed CSV ```csv seed,port,t03,ib 9600768,469.122,470.253,470.103 9600769,494.713,492.995,491.568 9600770,479.783,479.002,478.034 9600771,567.442,568.068,567.290 9600772,512.860,512.775,511.766 9600773,475.180,473.993,473.301 9600774,555.861,556.767,555.530 9600775,456.969,458.480,458.806 9600776,715.041,712.961,713.080 9600777,467.533,467.661,466.604 9600778,458.501,458.899,458.501 9600779,569.829,571.076,569.348 9600780,628.630,629.464,625.482 9600781,557.104,557.580,555.998 9600782,623.121,621.177,618.926 9600783,555.544,552.725,552.591 9600784,616.455,615.210,614.770 9600785,469.332,469.853,469.664 9600786,488.412,487.385,486.387 9600787,446.208,445.317,445.834 9600788,413.581,411.599,411.974 9600789,544.194,544.140,542.712 9600790,521.997,521.542,520.104 9600791,417.678,417.766,416.530 9600792,578.606,578.884,577.784 9600793,520.410,519.899,519.771 9600794,732.801,731.270,731.629 9600795,533.060,532.152,531.777 9600796,463.402,462.429,462.215 9600797,447.398,447.070,445.620 9600798,594.286,590.812,589.763 9600799,531.141,530.191,530.999 9600800,626.224,622.281,622.021 9600801,588.509,585.279,584.173 9600802,594.438,594.513,594.601 9600803,572.856,573.884,573.044 9600804,633.390,630.404,629.547 9600805,396.978,397.931,397.218 9600806,416.259,415.978,416.564 9600807,713.875,712.989,710.281 9600808,379.763,380.544,379.544 9600809,589.048,590.173,590.005 9600810,518.529,519.164,517.967 9600811,481.857,481.386,480.381 9600812,510.156,509.642,510.638 9600813,392.307,393.092,392.056 9600814,475.871,475.075,474.040 9600815,662.931,661.154,660.242 9600816,422.079,421.843,421.158 9600817,364.841,364.196,363.464 9600818,565.219,563.203,563.614 9600819,569.990,568.603,567.856 9600820,431.972,432.809,431.911 9600821,640.720,639.342,639.125 9600822,454.648,453.657,452.995 9600823,428.477,427.996,428.187 9600824,444.529,446.268,443.706 9600825,518.390,518.061,518.163 9600826,581.802,579.867,579.106 9600827,529.342,528.832,527.466 9600828,448.205,448.233,447.699 9600829,619.505,618.060,618.504 9600830,393.882,395.065,394.129 9600831,604.925,602.257,602.881 9600832,578.374,578.572,576.640 9600833,474.320,476.163,475.424 9600834,397.622,398.328,397.453 9600835,529.166,529.217,528.170 9600836,504.502,503.349,501.002 9600837,458.648,457.820,457.597 9600838,550.561,551.189,551.077 9600839,499.668,500.913,499.690 9600840,507.595,507.192,507.540 9600841,635.125,635.267,635.020 9600842,458.254,456.573,456.522 9600843,647.016,647.549,646.658 9600844,429.327,429.278,428.897 9600845,654.767,651.224,649.970 9600846,534.047,535.622,534.366 9600847,555.034,552.979,552.006 9600848,469.644,471.396,470.517 9600849,511.098,510.504,509.321 9600850,609.927,608.672,607.809 9600851,417.110,416.552,415.808 9600852,491.770,490.627,490.167 9600853,417.041,418.855,417.883 9600854,609.495,608.012,607.083 9600855,542.741,541.995,541.067 9600856,453.228,451.663,451.029 9600857,572.392,573.342,572.122 9600858,546.765,545.102,544.652 9600859,488.805,488.670,487.717 9600860,673.655,671.504,671.217 9600861,468.215,468.816,468.314 9600862,636.505,634.603,633.099 9600863,439.814,438.882,437.837 9600864,701.544,699.184,699.119 9600865,406.111,405.323,405.525 9600866,551.010,549.941,548.648 9600867,475.688,475.997,474.701 9600868,670.205,668.318,668.820 9600869,413.822,414.985,414.291 9600870,569.445,570.700,570.552 9600871,569.488,568.230,566.238 9600872,595.428,594.918,594.839 9600873,623.571,622.225,620.250 9600874,392.585,393.084,392.822 9600875,579.729,577.552,578.158 9600876,639.213,636.197,634.610 9600877,484.526,485.126,484.481 9600878,472.817,471.680,471.395 9600879,575.788,574.952,574.306 9600880,569.173,567.406,566.867 9600881,508.722,510.883,508.581 9600882,627.774,627.002,625.929 9600883,441.859,442.225,443.055 9600884,548.413,547.059,545.962 9600885,429.702,429.922,429.288 9600886,612.938,611.583,612.541 9600887,643.184,641.403,641.214 9600888,622.300,622.718,621.308 9600889,633.926,634.591,633.592 9600890,470.610,470.746,470.366 9600891,594.094,594.489,593.973 9600892,677.929,674.329,673.171 9600893,457.763,458.381,457.928 9600894,493.059,493.786,493.189 9600895,388.173,388.332,387.668 9600896,530.903,530.455,529.523 9600897,555.764,556.078,556.447 9600898,682.580,683.302,680.876 9600899,570.948,570.879,570.457 9600900,714.084,709.335,708.896 9600901,479.450,480.393,479.374 9600902,474.373,475.881,474.836 9600903,545.453,544.132,544.589 9600904,588.023,586.308,585.268 9600905,502.880,502.627,502.009 9600906,577.110,575.284,574.968 9600907,563.629,561.845,561.817 9600908,426.694,427.221,426.223 9600909,639.343,639.294,638.027 9600910,477.459,477.844,478.039 9600911,588.921,586.617,586.485 9600912,654.479,653.957,653.408 9600913,438.623,438.015,437.596 9600914,506.957,507.610,507.188 9600915,438.051,438.588,437.806 9600916,489.562,489.580,488.439 9600917,709.892,705.493,705.077 9600918,434.880,434.243,433.425 9600919,625.702,624.369,623.609 9600920,614.556,614.419,614.445 9600921,590.113,588.459,588.637 9600922,640.028,640.333,639.515 9600923,775.732,774.530,773.520 9600924,461.939,462.696,461.645 9600925,592.185,592.690,592.314 9600926,423.233,423.628,422.927 9600927,449.425,448.474,443.159 9600928,516.575,516.183,515.652 9600929,453.479,452.403,451.453 9600930,623.801,622.366,620.827 9600931,592.084,589.408,590.064 9600932,694.552,690.184,686.301 9600933,469.604,468.209,468.023 9600934,602.372,601.840,602.252 9600935,421.859,420.033,419.778 9600936,587.641,585.456,586.412 9600937,605.751,606.316,604.204 9600938,604.096,603.002,602.935 9600939,532.966,532.776,532.556 9600940,694.430,692.668,689.407 9600941,840.872,835.393,835.761 9600942,497.017,496.791,496.744 9600943,437.992,437.284,436.564 9600944,473.280,471.220,471.048 9600945,683.462,682.072,680.762 9600946,499.868,498.698,498.554 9600947,470.193,470.809,468.792 9600948,416.134,417.489,417.071 9600949,420.503,419.964,419.168 9600950,514.680,514.833,514.446 9600951,546.122,545.421,545.455 9600952,467.711,467.559,467.453 9600953,503.355,503.049,503.762 9600954,464.048,464.474,463.698 9600955,636.530,634.196,635.967 9600956,631.227,629.481,628.436 9600957,519.194,519.045,518.174 9600958,496.895,496.094,495.435 9600959,482.988,482.028,481.822 9600960,374.279,375.579,374.345 9600961,443.144,441.967,442.021 9600962,506.377,508.156,506.187 9600963,677.441,675.468,675.177 9600964,592.338,591.121,591.205 9600965,433.944,433.710,433.089 9600966,610.936,608.974,607.864 9600967,585.567,582.593,581.253 9600968,437.539,438.346,437.077 9600969,369.696,370.134,369.435 9600970,422.765,422.515,421.876 9600971,441.458,440.863,440.933 9600972,666.033,663.417,661.760 9600973,520.989,521.326,520.295 9600974,463.920,464.799,463.522 9600975,412.129,411.861,408.831 9600976,474.284,474.669,474.083 9600977,505.153,504.751,505.517 9600978,473.333,476.269,475.216 9600979,650.842,649.371,648.785 9600980,499.711,498.557,498.419 9600981,730.530,725.887,724.512 9600982,644.943,642.922,641.643 9600983,542.674,542.142,541.300 9600984,377.036,375.496,375.012 9600985,391.545,392.843,391.444 9600986,565.972,564.226,562.771 9600987,410.545,409.644,409.066 9600988,694.917,694.186,691.333 9600989,423.434,422.218,422.020 9600990,476.117,476.095,475.344 9600991,453.156,452.825,451.958 9600992,745.986,745.131,744.239 9600993,470.402,470.269,469.178 9600994,462.154,463.005,461.784 9600995,600.953,600.813,599.978 9600996,556.410,554.429,553.363 9600997,590.872,590.623,589.644 9600998,472.572,472.263,471.993 9600999,466.160,466.016,465.262 9601000,584.461,585.436,583.474 9601001,626.991,626.407,626.163 9601002,635.137,633.223,632.425 9601003,668.164,666.637,666.591 9601004,578.784,577.277,576.567 9601005,418.999,418.838,418.271 9601006,497.342,496.763,496.313 9601007,530.052,528.031,527.096 9601008,709.669,708.987,709.850 9601009,425.830,427.847,426.988 9601010,587.152,586.331,584.793 9601011,483.446,481.750,481.555 9601012,603.180,603.756,602.683 9601013,598.118,598.537,597.243 9601014,589.910,587.963,587.367 9601015,685.446,681.760,681.441 9601016,646.925,647.243,645.863 9601017,719.934,718.345,716.139 9601018,488.964,487.641,487.386 9601019,459.038,458.143,457.412 9601020,397.907,399.641,398.361 9601021,543.887,542.184,541.537 9601022,405.908,406.751,406.547 9601023,489.866,488.940,487.306 ``` ## Problems and limits No setup, compilation, validation or engine failures occurred. No source was changed or tuned, and no assigned strategy/seed pair was rerun. This item confirms the frozen port on block A4 only; it does not rerun replica gates P/Q/F or assert performance outside these seeds. Scratch dependencies and intermediate files are execution scaffolding, not delivered outputs.