# B4: unchanged port-3 on fresh engine seeds This report measures unchanged port-3, t03 and IB on all 256 assigned seeds, **9601792–9602047**, each strategy alone against VanillaStrategy. Results are local engine measurements from this run, not figures copied from the input artifacts. ## Setup and identity | Step | Result | |---|---| | Workspace | Pinned checkout and temporary state under exempt `test/scratch/amm-challenge/`; no /tmp checkout | | Challenge checkout | `6b6921f8d463314aa7c96234e1be25a25245f704`, detached HEAD | | Supplied scratch/setup.sh | Saved and executed once from checkout root; exit 0 | | Wheel | `amm_sim_rs-0.1.0.post1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl` | | Wheel SHA-256 | `aedb68280aca34c110968f00148387c95885207913fb2cf19a1ab4c5cfd6887a`; checksum passed | | Python | 3.12.16 | | Packages | amm-sim-rs 0.1.0.post1, numpy 2.5.4, numba 0.68.1, cma 4.5.0, py-solc-x 2.1.0, pyrevm 0.3.7 | | Editable challenge install | Passed | | Solidity | solcx-installed 0.8.24; optimizer enabled, 200 runs, viaIR, Paris | | Starter validation | `Strategy 'StarterStrategy' validated successfully!` | | Port-3 validation | `Strategy 'TaylorGaussianPlainCoarse' validated successfully!` | Port-3 was extracted verbatim, including its trailing newline, from the contracts/src/Strategy.sol Solidity block of the [port-3 artifact](https://api.imd.fun/artifacts/0dbcc10af41b3c3467ff0d9b9cb64c81328fcf18295f9be06b2d81bb98874067). t03 and IB were obtained by zlib decompression of base64-decoded code_zb64 from their respective artifacts. All source hashes below were computed locally and match the required hashes/prefixes. No strategy source was modified. | Strategy and 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 | Port-3 is below the 24,576-byte deployment limit. Bytecode and sizes came from the pinned [SolidityCompiler](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/evm/compiler.py). The validation command was `. scratch/env.sh && timeout 470 amm-match validate contracts/src/Strategy.sol` (exit 0). Original Taylor (gtmcknight) contract-header attribution is preserved. ## Engine method Each invocation used `amm_sim_rs.run_batch(X, VanillaStrategy, configs, 8)`, with X as the compiled creation bytecode of one strategy. The normalizer was the unchanged pinned [VanillaStrategy, fixed 30 bps](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/contracts/src/VanillaStrategy.sol). No port-versus-t03 or port-versus-IB pool match was run. Configurations directly transcribe [MatchRunner._build_configs](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/competition/match.py), substituting assigned seed i. For each i, np.random.default_rng(seed=i) draws retail mean size, arrival rate and GBM sigma in that order, from the pinned [variance and base configuration](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/competition/config.py). Each simulation has 10,000 steps; initial price 100, X=100, Y=10,000; GBM mu=0, dt=1; retail buy probability 0.5, size sigma 1.2; uniform mean size [19,21], arrival rate [0.6,1.0], GBM sigma [0.000882,0.001008]. Only seeds 9601792–9602047 were used. Every strategy/seed pair was executed once, without retries or tuning. There were 24 invocations: 8 disjoint chunks of 32 seeds per strategy. State was reserved before invocation and saved under scratch/. Order: port-3, t03, IB, then the next seed range. Every invocation was capped by timeout 470. Engine runtimes ranged from 14.918 to 22.095 seconds per chunk. Setup, compilation and validation also completed within 8 minutes per command. Edge means engine `r.edges["submission"]`, not submission edge minus Vanilla edge. Paired differences compare submission edge between separate matches at the same seed. Calculations use unrounded results; the per-seed display is rounded to 3 decimals. ## Results | Strategy | n | Mean edge | |---|---:|---:| | port | 256 | 537.269064385 | | t03 | 256 | 536.622128221 | | ib | 256 | 535.852111855 | | Paired comparison | n | mean_diff | se | Wins | Ties | Losses | |---|---:|---:|---:|---:|---:|---:| | port-3 minus t03 | 256 | +0.646936163 | 0.087597898 | 167 | 0 | 89 | | port-3 minus ib | 256 | +1.416952530 | 0.097643179 | 207 | 0 | 49 | SE is sample standard deviation of paired differences (ddof=1) / sqrt(n). Wins count strictly positive differences before rounding. Worst5 means the five smallest paired differences. | Comparison | worst5 (seed, diff), ascending diff | |---|---| | port-3 minus t03 | (9601808, -2.311534423); (9602020, -2.060258578); (9601877, -2.034937987); (9602011, -2.031919168); (9601894, -1.971185269) | | port-3 minus ib | (9601808, -3.207422303); (9601904, -2.543943032); (9601946, -1.893936355); (9601877, -1.473378766); (9601797, -1.461482046) | ## Gas These are Submission / afterSwap entries from `amm_sim_rs.gas_stats()` after each chunk, reset immediately before execution. Calls and failure counters are summed; peak is the maximum of max_ok_gas; mean is total sum_ok_gas / total ok, weighted by successful calls. | Strategy | afterSwap calls | oog | Peak gas | Mean gas | |---|---:|---:|---:|---:| | port | 2,785,441 | 0 | 207,453 | 95334.742430 | | t03 | 2,819,139 | 0 | 235,406 | 135337.788772 | | ib | 2,795,900 | 0 | 234,825 | 134999.591851 | All callbacks in both roles for all three strategies had zero oog, revert, other_halt, tx_error and bad_return; all calls were successful. Port-3 observed afterSwap peak is below 245,000 gas. This sample maximum is not a bound on all possible callbacks. ## Per-seed CSV ```csv seed,port,t03,ib 9601792,474.025,475.306,474.412 9601793,481.364,480.363,479.363 9601794,646.584,644.443,643.807 9601795,567.541,565.288,564.968 9601796,593.040,593.775,593.323 9601797,436.187,438.023,437.648 9601798,684.533,681.459,680.734 9601799,625.734,623.989,623.457 9601800,578.985,578.681,578.067 9601801,357.372,357.890,357.498 9601802,561.140,561.152,561.244 9601803,530.060,529.149,529.135 9601804,468.611,468.470,467.808 9601805,401.022,401.050,401.194 9601806,624.414,620.539,620.045 9601807,398.396,399.023,397.130 9601808,621.720,624.031,624.927 9601809,456.924,456.758,455.114 9601810,472.879,473.821,474.270 9601811,592.547,590.675,589.778 9601812,609.483,606.825,606.231 9601813,588.579,587.044,586.237 9601814,578.618,577.930,578.616 9601815,396.343,397.705,396.800 9601816,581.151,579.587,577.589 9601817,458.360,458.260,456.405 9601818,485.543,485.538,484.043 9601819,540.562,540.164,539.384 9601820,530.232,530.935,529.682 9601821,608.004,606.515,605.423 9601822,398.701,399.813,399.457 9601823,608.531,605.018,604.090 9601824,515.508,513.897,513.620 9601825,623.129,620.598,618.134 9601826,557.596,555.885,555.015 9601827,654.594,655.577,655.471 9601828,525.061,523.707,523.602 9601829,600.307,598.079,597.491 9601830,573.565,569.277,569.228 9601831,515.211,515.445,515.234 9601832,419.262,418.726,417.557 9601833,570.442,570.571,570.083 9601834,535.187,535.565,534.510 9601835,454.663,453.590,453.453 9601836,487.800,487.974,488.311 9601837,622.505,621.859,619.244 9601838,551.258,549.749,549.860 9601839,676.573,674.804,673.432 9601840,480.607,479.643,479.182 9601841,671.244,666.303,662.416 9601842,681.723,680.462,680.658 9601843,382.774,383.007,382.505 9601844,614.413,612.275,613.024 9601845,430.584,430.009,429.360 9601846,574.752,574.023,573.784 9601847,480.571,481.495,479.855 9601848,547.097,545.495,545.994 9601849,464.238,463.846,462.210 9601850,560.024,557.607,556.901 9601851,572.135,572.128,571.314 9601852,618.391,617.245,617.588 9601853,534.299,535.395,532.201 9601854,496.081,495.911,495.108 9601855,572.509,572.938,571.529 9601856,391.078,392.208,392.101 9601857,649.615,646.999,646.396 9601858,431.104,430.169,429.787 9601859,571.647,570.142,569.565 9601860,653.659,652.359,650.685 9601861,430.563,431.531,430.638 9601862,353.942,354.820,355.016 9601863,604.452,603.498,602.301 9601864,603.831,602.845,600.455 9601865,509.619,508.190,507.120 9601866,545.982,544.687,545.502 9601867,739.430,737.725,736.505 9601868,525.797,526.908,525.864 9601869,528.830,526.770,527.374 9601870,547.855,545.395,546.104 9601871,525.959,527.078,525.856 9601872,431.414,432.058,431.961 9601873,636.725,635.353,634.117 9601874,527.925,526.996,527.377 9601875,371.994,373.270,372.799 9601876,514.959,512.939,512.175 9601877,449.008,451.042,450.481 9601878,514.277,512.649,513.154 9601879,437.484,437.233,437.392 9601880,532.346,531.706,531.659 9601881,587.898,585.651,583.957 9601882,411.863,413.277,412.332 9601883,599.208,599.596,599.772 9601884,699.024,698.734,696.445 9601885,393.293,394.014,393.187 9601886,708.744,707.330,707.749 9601887,471.362,471.247,470.193 9601888,570.480,570.324,569.203 9601889,529.503,529.618,528.379 9601890,551.810,551.290,550.678 9601891,490.511,491.522,490.667 9601892,459.935,456.436,456.990 9601893,410.271,409.736,408.370 9601894,394.556,396.527,395.905 9601895,569.703,570.746,569.632 9601896,612.468,612.617,611.661 9601897,574.237,574.044,573.296 9601898,544.919,544.977,543.392 9601899,564.605,562.104,562.212 9601900,437.640,438.144,437.048 9601901,599.778,600.085,599.159 9601902,401.588,401.715,400.944 9601903,593.040,592.323,592.335 9601904,582.403,581.316,584.947 9601905,506.526,507.746,506.787 9601906,590.399,591.359,591.315 9601907,663.464,662.284,658.644 9601908,595.698,594.685,592.980 9601909,496.536,495.793,493.986 9601910,644.475,642.202,640.771 9601911,482.155,482.793,481.961 9601912,355.038,355.618,355.599 9601913,687.074,683.746,683.153 9601914,488.362,488.802,488.082 9601915,605.346,600.946,601.389 9601916,573.849,573.452,570.958 9601917,633.944,631.921,631.822 9601918,715.812,711.251,712.594 9601919,528.664,527.651,526.419 9601920,414.712,415.100,414.408 9601921,525.217,523.897,522.873 9601922,485.754,485.321,483.997 9601923,502.717,502.084,502.304 9601924,670.223,670.796,670.874 9601925,494.360,492.425,492.336 9601926,444.117,445.992,445.503 9601927,469.638,469.780,469.383 9601928,528.536,528.963,527.225 9601929,645.399,645.298,644.902 9601930,487.223,486.918,485.559 9601931,643.806,642.063,641.418 9601932,407.080,408.019,407.340 9601933,364.572,364.841,364.141 9601934,625.213,623.911,622.681 9601935,531.603,529.056,528.488 9601936,532.093,529.331,529.099 9601937,608.226,606.286,604.641 9601938,583.705,581.022,581.534 9601939,626.106,627.468,625.663 9601940,550.322,548.959,547.879 9601941,617.834,616.725,615.224 9601942,645.075,643.706,642.906 9601943,700.437,697.568,696.535 9601944,477.988,476.103,475.309 9601945,608.647,608.817,607.368 9601946,636.192,638.162,638.086 9601947,546.819,545.735,545.944 9601948,547.511,546.097,546.024 9601949,435.393,434.628,433.462 9601950,553.095,552.648,551.690 9601951,600.492,597.263,596.967 9601952,609.545,608.778,607.996 9601953,596.621,595.476,595.637 9601954,469.505,468.454,466.522 9601955,597.021,595.522,596.531 9601956,625.283,625.502,625.389 9601957,517.594,516.259,516.389 9601958,535.278,535.923,535.514 9601959,678.320,678.625,674.668 9601960,577.888,576.871,575.595 9601961,453.079,453.984,453.349 9601962,643.830,641.898,642.417 9601963,425.979,424.010,423.196 9601964,502.500,501.929,500.742 9601965,462.900,462.278,461.141 9601966,482.374,480.483,478.967 9601967,599.401,599.450,598.896 9601968,689.537,687.628,684.472 9601969,657.460,656.153,654.105 9601970,413.985,415.204,414.868 9601971,606.476,604.110,604.291 9601972,576.551,575.961,575.065 9601973,540.936,540.314,539.032 9601974,450.455,450.456,448.995 9601975,578.042,576.321,575.036 9601976,437.947,436.610,434.813 9601977,660.828,662.741,661.423 9601978,477.720,477.624,476.706 9601979,500.740,499.737,499.750 9601980,574.029,571.370,571.180 9601981,495.207,490.410,490.571 9601982,390.689,390.350,390.633 9601983,490.327,490.648,490.166 9601984,496.449,495.173,494.031 9601985,505.558,504.657,504.182 9601986,562.784,563.859,563.334 9601987,512.379,510.324,509.613 9601988,683.187,681.912,681.197 9601989,642.763,640.167,639.598 9601990,557.261,555.326,553.903 9601991,525.734,525.321,524.853 9601992,637.904,637.787,634.640 9601993,716.627,713.303,712.049 9601994,538.396,537.305,535.552 9601995,452.460,452.551,450.839 9601996,678.542,679.249,677.055 9601997,438.965,439.164,438.006 9601998,541.586,540.960,540.771 9601999,487.963,489.323,487.825 9602000,551.307,551.929,551.364 9602001,491.709,492.768,492.342 9602002,607.105,605.408,606.463 9602003,438.857,438.338,436.436 9602004,528.977,530.834,529.361 9602005,643.720,644.818,643.312 9602006,541.571,543.051,541.840 9602007,539.244,540.368,538.909 9602008,582.418,581.132,580.047 9602009,516.241,514.553,513.682 9602010,503.082,502.270,500.553 9602011,428.934,430.966,430.334 9602012,564.513,562.549,561.518 9602013,402.389,401.530,398.730 9602014,460.140,459.655,458.891 9602015,560.663,558.393,557.643 9602016,465.032,465.233,464.206 9602017,465.366,466.849,466.361 9602018,464.226,463.251,462.090 9602019,569.878,570.336,568.190 9602020,369.915,371.975,370.977 9602021,579.709,577.583,578.102 9602022,355.312,356.752,356.373 9602023,755.075,752.703,752.296 9602024,447.110,447.047,445.622 9602025,594.854,593.590,592.905 9602026,459.818,460.158,459.065 9602027,476.039,475.125,474.863 9602028,564.792,564.159,563.205 9602029,655.032,653.372,652.647 9602030,605.408,604.873,604.961 9602031,596.404,593.096,592.734 9602032,558.455,559.854,556.390 9602033,599.764,598.163,598.399 9602034,479.058,479.985,479.541 9602035,398.596,398.776,398.679 9602036,545.767,546.397,544.394 9602037,391.153,390.879,389.233 9602038,500.586,500.257,498.691 9602039,582.999,582.690,582.644 9602040,540.475,539.689,539.814 9602041,433.038,433.224,432.425 9602042,537.378,536.852,536.391 9602043,589.230,588.947,587.737 9602044,313.176,313.166,313.472 9602045,555.514,554.519,554.183 9602046,644.562,641.307,641.350 9602047,402.610,402.954,402.464 ``` ## Problems and limits No setup, compilation, validation or engine failures occurred. There are no missing seeds or reruns. The web browsing tool could not open the three artifact endpoints; direct HTTPS downloads succeeded and supplied the exact sources whose hashes appear above. This bounded confirmation does not repeat replica gates P/Q/F or change the policy. Prior artifact performance claims are not adopted as measurements for B4. The following is the exact chunk harness used. Its compiled cache came from the pinned SolidityCompiler().compile(...), contract name Strategy for all candidates and VanillaStrategy for the normalizer. Source identities and deployed sizes are listed above. The harness and calculation description provide provenance for local observations; linked sources provide the downloaded inputs and pinned configuration. ## Chunk harness ```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 kind=sys.argv[1];start=int(sys.argv[2]);end=start+32 assert kind in ('port','t03','ib') assert 9601792<=start scratch/KIND_START.log 2>&1 ``` KIND iterated over port, t03, ib; START over range(9601792,9602048,32), outer loop START. Aggregation checked 256 unique ordered seeds, 32 completed rows per chunk, matching source hashes and finite edges. Means use statistics.mean; paired SE uses statistics.stdev(diffs)/sqrt(256); worst5 sorts (seed,diff) by (diff,seed); wins count diff>0. CSV rounds only when formatting. Configuration-only verification also compared all 256 generated configurations to the actual MatchRunner._build_configs method with RNG seeds offset into the assigned range: every non-seed field matched exactly; config seed IDs were separately checked. This verification made no engine calls.