# qt1 engine baseline — eb-b Credit: Taylor (gtmcknight), author of the solved policy, filter, qm tables and pinned harness. Qt1 is unchanged. All new measurements below are local engine observations, not leaderboard scores. ## Setup | Step | Result | |---|---| | Clone amm-challenge | PASS; commit `6b6921f8d463314aa7c96234e1be25a25245f704` | | Clone Taylor amm-sim, side by side | PASS; commit `4812a6382311624e1506aca131ca35c378f930d9` | | Run `sh ../amm-sim/setup-fast.sh` once from amm-challenge | PASS, exit 0; Linux x86_64 | | Installed engine, Python environment and compiler | PASS; setup installed pyrevm 0.3.7, py-solc-x 2.1.0 and solc 0.8.24 | | Instrumented `.so` hash | PASS; `ff88b6353c2aad7342f0a26194f7347e78b9c3b38d683a7449006d423978cd14` | | Wheel SHA256 | PASS; downloaded release wheel independently hashed to `aedb68280aca34c110968f00148387c95885207913fb2cf19a1ab4c5cfd6887a`, matching the supplied expected hash | | StarterStrategy validation | PASS | | Extract qt1 from Q | PASS; 42,990 bytes; SHA256 `c68887cff61180e12ba2b1ceb333edf76a830f91f63b5d775a8806fb9ec08aca` | Pinned sources: [setup](https://raw.githubusercontent.com/gtmcknight/amm-sim/4812a6382311624e1506aca131ca35c378f930d9/setup-fast.sh), [harness](https://raw.githubusercontent.com/gtmcknight/amm-sim/4812a6382311624e1506aca131ca35c378f930d9/harness.py), [Q](https://api.imdnotdead.fun/artifacts/8a6e303b662e1a5ea9bb47f31acedd3988ef65b3ddb66d074517aa59ad41ca40). Hash checks and measurements are this run's local observations. Setup output: ``` amm_sim_rs.abi3.so sha256 ff88b6353c2aad7342f0a26194f7347e78b9c3b38d683a7449006d423978cd14 Validating strategy... Compiling strategy... Strategy 'StarterStrategy' validated successfully! ``` ## Validate `amm-match validate contracts/src/Qt1.sol`, exit 0: ``` Validating strategy... Compiling strategy... Strategy 'TaylorGaussianQMSpline' validated successfully! ``` Deployed runtime: **20,605 bytes**, measured from `SolidityCompiler.compile(...).deployed_bytecode` in every chunk. Compiler: solc 0.8.24, optimizer enabled with 200 runs, viaIR, Paris, per the [pinned compiler](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/evm/compiler.py). Below the 24,576-byte cap. ## Engine Qt1 alone versus the [30 bps VanillaStrategy](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/contracts/src/VanillaStrategy.sol), four disjoint chunks in ascending seed order, eight workers. Each seed executed exactly once. Each chunk calls `gas_stats_reset()`, `run_batch(qt1, vanilla, configs, 8)`, then `gas_stats()`, through Taylor's harness `run` helper. Edges are the returned `r.edges["submission"]`, not subtraction of the normalizer's edge. SE is sample standard deviation / sqrt(128). Configs use the exact [MatchRunner._build_configs](https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/competition/match.py) body with only its loop range replaced by the chunk's range. Each seed independently initializes `np.random.default_rng(seed=i)`; skipping the unused prefix preserves all requested configurations. The unmodified harness CLI repeats A by default; its `main` was therefore bypassed to respect the no-rerun requirement. The wrapper appears under Commands. Gas includes only role `Submission`. Means are total `sum_ok_gas` / total successful calls, weighted across chunks. All calls succeeded; all submission OOG, revert, other_halt, tx_error and bad_return counters were zero. Chunk times measure `run_batch` wall time and exclude compilation and config construction. ```json { "strategy": "qt1", "seeds": "9800128..9800255", "n": 128, "mean": 513.5049728806645, "se": 8.588810151732844, "edges": { "9800128": 575.0714848105139, "9800129": 475.6252019871907, "9800130": 719.1114206940086, "9800131": 384.7419453844864, "9800132": 467.0871941428443, "9800133": 353.00257182483097, "9800134": 715.1251631716032, "9800135": 520.415370372429, "9800136": 545.800705131955, "9800137": 611.7712441276748, "9800138": 428.9693149517274, "9800139": 440.31575844331854, "9800140": 435.4192025416303, "9800141": 406.61565077703887, "9800142": 562.1980337163214, "9800143": 473.6185355387734, "9800144": 464.40493254179046, "9800145": 529.9043438287505, "9800146": 581.5862406018566, "9800147": 562.3226667411282, "9800148": 644.0074698913195, "9800149": 619.7617685873588, "9800150": 364.7783112924784, "9800151": 369.5664820054741, "9800152": 553.0100479069719, "9800153": 781.3041907881907, "9800154": 457.2947998756057, "9800155": 499.2091442130844, "9800156": 604.2197827572509, "9800157": 437.64190310681965, "9800158": 403.4876617499161, "9800159": 367.3968925116981, "9800160": 684.1071262766168, "9800161": 550.2630834626159, "9800162": 504.12051937167337, "9800163": 435.10386712585307, "9800164": 608.6606485574624, "9800165": 500.10828599613177, "9800166": 450.8811356712151, "9800167": 460.7547314380382, "9800168": 613.5160145379806, "9800169": 627.151588010116, "9800170": 481.42549042748476, "9800171": 560.5163089072701, "9800172": 648.4826641982822, "9800173": 560.9907156986683, "9800174": 403.7459092854356, "9800175": 452.9330943647069, "9800176": 455.3403295175043, "9800177": 520.1346256073443, "9800178": 441.59021813505257, "9800179": 430.8419948980403, "9800180": 554.0530295098395, "9800181": 618.7110608285203, "9800182": 561.4411239531878, "9800183": 408.914505376551, "9800184": 542.4436205914367, "9800185": 672.5279709071236, "9800186": 449.8774118461121, "9800187": 597.0975276658238, "9800188": 522.7024831101515, "9800189": 495.82559090063614, "9800190": 448.11696161445565, "9800191": 562.736690479302, "9800192": 605.5488419214121, "9800193": 528.2131339185435, "9800194": 642.0842107545084, "9800195": 454.15263630609684, "9800196": 414.3309887074359, "9800197": 598.6413669983391, "9800198": 494.35622067231185, "9800199": 673.9990550489474, "9800200": 611.2165386208662, "9800201": 442.72699914946054, "9800202": 763.2511209594478, "9800203": 704.5716953724557, "9800204": 433.67109252252794, "9800205": 424.02722524419545, "9800206": 366.7709245477803, "9800207": 502.2541491720047, "9800208": 508.8008937576638, "9800209": 628.4881391885355, "9800210": 409.09390837469755, "9800211": 391.06110151486394, "9800212": 612.1762562631736, "9800213": 450.64933861409696, "9800214": 355.3722772380656, "9800215": 555.1633784577178, "9800216": 574.9332889100654, "9800217": 643.6282044857821, "9800218": 398.2043121412238, "9800219": 471.20892993988355, "9800220": 386.44425251687704, "9800221": 398.48372483311755, "9800222": 427.865248075649, "9800223": 472.9893901384924, "9800224": 505.6488652285993, "9800225": 542.3764764326198, "9800226": 598.5634230283115, "9800227": 632.2864819446598, "9800228": 526.4278865190308, "9800229": 456.51210815047847, "9800230": 421.29314959211376, "9800231": 480.09868107240345, "9800232": 443.74011792648594, "9800233": 561.1104954180284, "9800234": 500.8134454375696, "9800235": 514.2266115612928, "9800236": 475.3821034560523, "9800237": 376.0013191122208, "9800238": 420.1541985061714, "9800239": 558.5611875386364, "9800240": 607.6922047088852, "9800241": 497.9098430774859, "9800242": 424.6557555702577, "9800243": 355.7695415789743, "9800244": 644.2760493799045, "9800245": 393.52787582975395, "9800246": 628.8802401301547, "9800247": 492.24282154612155, "9800248": 436.29791281502463, "9800249": 726.0195078086158, "9800250": 515.1534085457338, "9800251": 589.9640685211443, "9800252": 554.9376305231932, "9800253": 473.24060667512407, "9800254": 378.32455109597794, "9800255": 472.26735134111334 }, "gas": { "afterSwap": { "calls": 1371375, "oog": 0, "peak": 209112, "mean": 138190.15968790447 }, "afterInitialize": { "calls": 128, "oog": 0, "peak": 90858, "mean": 90858.0 } }, "peak_per_chunk": [ 208981, 204494, 209112, 208981 ], "wall_s_per_chunk": [ 22.39, 23.252, 24.575, 20.795 ] } ``` ## Commands All commands ran inside the workspace. Checkouts and temporary state were confined to the explicitly permitted disposable `test/scratch/` tree. `C` below denotes `test/scratch/amm-challenge`; commands using `scratch/env.sh` ran with C as the working directory. Shell redirections only save local logs. No engine seeds outside the specified range were run. No command took eight minutes. The command inventory (including read-only inspections and output generation) follows. Long Python heredocs are described by their complete operational content or supplied verbatim below. ```sh pwd rg --files -g '!lib/**' -g '!node_modules/**' | head -40 mkdir -p test/scratch artifacts/goal/batches/e1-engine-base/items/eb-b git clone https://github.com/benedictbrady/amm-challenge test/scratch/amm-challenge git -C test/scratch/amm-challenge checkout 6b6921f8d463314aa7c96234e1be25a25245f704 git clone https://github.com/gtmcknight/amm-sim test/scratch/amm-sim git -C test/scratch/amm-sim checkout 4812a6382311624e1506aca131ca35c378f930d9 cat test/scratch/amm-sim/setup-fast.sh sed -n '1,260p' test/scratch/amm-sim/harness.py # from C: sh ../amm-sim/setup-fast.sh > ../setup.log 2>&1 # from repository root: curl -Lf https://api.imdnotdead.fun/artifacts/8a6e303b662e1a5ea9bb47f31acedd3988ef65b3ddb66d074517aa59ad41ca40 -o test/scratch/Q.txt sed -n '1,65p' test/scratch/Q.txt cat test/scratch/setup.log rg -n 'Strategy.sol|```solidity' test/scratch/Q.txt cat test/scratch/amm-challenge/amm_competition/evm/compiler.py | head -200 rg -n '_build_configs' test/scratch/amm-challenge/amm_competition/competition/match.py sed -n '100,135p' test/scratch/amm-challenge/amm_competition/competition/match.py # python3 heredoc: extract block following ## Strategy.sol and ```solidity; # assert its length and SHA256, write unchanged bytes to C/contracts/src/Qt1.sol; # print length, hash and first 500 characters. curl -LsSf https://github.com/gtmcknight/amm-sim/releases/download/sim-6b6921f8/amm_sim_rs-0.1.0.post1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl -o test/scratch/amm-challenge/scratch/engine.whl sha256sum test/scratch/amm-challenge/scratch/engine.whl # from C: . scratch/env.sh && amm-match validate contracts/src/Qt1.sol > scratch/validate.log 2>&1 # from root: sed -n '130,150p' test/scratch/amm-challenge/amm_competition/competition/match.py # cat heredoc creates C/scratch/baseline.py, reproduced below. # from C, each once: . scratch/env.sh && python scratch/baseline.py 9800128 9800160 > scratch/chunk-9800128.log 2>&1 . scratch/env.sh && python scratch/baseline.py 9800160 9800192 > scratch/chunk-9800160.log 2>&1 . scratch/env.sh && python scratch/baseline.py 9800192 9800224 > scratch/chunk-9800192.log 2>&1 . scratch/env.sh && python scratch/baseline.py 9800224 9800256 > scratch/chunk-9800224.log 2>&1 # read-only inspections from root: cat test/scratch/amm-challenge/scratch/validate.log sed -n '1,85p' test/scratch/amm-challenge/amm_competition/evm/baseline.py head -20 test/scratch/amm-challenge/contracts/src/VanillaStrategy.sol git status --short head -c 500 test/scratch/amm-challenge/scratch/chunk-9800128.log ls test/scratch/amm-challenge/scratch/chunk* # from C: cat scratch/chunk-9800128.json ``` Python wrapper (`cat > C/scratch/baseline.py`): ```python # Credit Taylor (gtmcknight): pinned harness.py and solved qt1 policy. import sys, inspect, textwrap, json, time, hashlib from pathlib import Path sys.path.insert(0,str(Path('../amm-sim').resolve())) import harness as h import amm_sim_rs from amm_competition.evm.compiler import SolidityCompiler from amm_competition.competition import match s0,s1=map(int,sys.argv[1:3]) out=Path(f'scratch/chunk-{s0}.json') assert not out.exists(), 'never rerun a seed' source=Path('contracts/src/Qt1.sol').read_text() c=SolidityCompiler().compile(source) assert c.success,c.errors print('runtime_bytes',len(c.deployed_bytecode),flush=True) # Execute the pinned _build_configs body verbatim except iterate only the requested # seed range; each config uses its own default_rng(seed=i), no prefix dependency. body=textwrap.dedent(inspect.getsource(h.MatchRunner._build_configs)) assert body.count('range(self.n_simulations)')==1 body=body.replace('range(self.n_simulations)',f'range({s0}, {s1})') ns=dict(vars(match)); exec(body,ns) runner=h.MatchRunner(n_simulations=s1,config=h.build_base_config(seed=None),n_workers=8,variance=h.BASELINE_VARIANCE) cfgs=ns['_build_configs'](runner) assert [x.seed for x in cfgs]==list(range(s0,s1)) vanilla=list(h.get_vanilla_bytecode_and_abi()[0]) r,e=h.run('qt1',list(c.bytecode),vanilla,cfgs) d={'runtime_bytes':len(c.deployed_bytecode),'source_sha256':hashlib.sha256(source.encode()).hexdigest(),'seeds':[s0,s1],'run':r,'edges':{str(k):v[0] for k,v in sorted(e.items())}} out.write_text(json.dumps(d,indent=2)); print(json.dumps(d),flush=True) assert r['valid'], r ``` Other Python commands: a `python3` heredoc fetched the five raw GitHub URLs listed in sources.json using `urllib.request.urlopen`, asserted each listed quote appeared verbatim, and wrote sources.json with those URLs plus Q and its exact Taylor credit line. A `cat` heredoc wrote `test/scratch/report.py`; `python3 test/scratch/report.py` aggregated the four saved JSON outputs using `statistics.mean`, `statistics.stdev / sqrt(n)`, summed gas counters, maxima and weighted means, asserted all 128 distinct seeds and successful calls, and wrote this report. Final `python3` verification parsed both named files, checked all source quotes, required sections, JSON seed coverage and gas limits, byte limits, and unchanged qt1 source SHA256; `git status --short --untracked-files=all` checked output paths. Tool session polls only collected output; they executed no additional shell commands or simulations. Final local checks: **PASS** — both JSON documents parse; all 128 expected seed keys occur once; mean and sample SE recompute exactly; every callback succeeded; size and gas caps hold; qt1 source SHA256 remains unchanged; all six source quotes were fetched again and matched. These checks are local evidence only. `result.md` is below 64,000 bytes and `sources.json` is 1,343 bytes. Required outputs remain untracked (ignored by the repository rules); nothing was staged or committed. Additional inspection commands were a Python heredoc that printed each completed chunk's seed range, timing, validity and peak; `cat > test/scratch/verify.py` containing the checks described above; `python3 test/scratch/report.py`; `python3 test/scratch/verify.py`; and `git status --short --untracked-files=all`. This final Python heredoc inserted the observed check results into the report and checked the final byte limit and untracked status with `git ls-files --error-unmatch` for each required output. ## Problems No setup, validation or simulation step failed. The measured afterSwap peak may exceed the historical 208,775 figure because these are fresh seeds; the measured maximum remains below 245,000. No policy changes, candidate comparison, replica Gate P/Q or fee-parity Gate F were attempted: this item is the unchanged qt1 engine baseline only. These results alone do not establish an improvement over qt1 or a leaderboard gain. Temporary engines, dependencies and logs are disposable scaffolding; the two requested files contain the deliverable.