# Root merge 1: AMM puzzle results ## Goal and status The assignment gives IB 522.00, 10th place 524.66 (+2.7 versus IB), and first place 528.40 (+6.4 versus IB). This goal enters nothing. Track A targets a validated Gaussian-policy port and +2.7 over IB on 4,000 fresh seeds; Track B promotes a policy only at +0.3 or better. **These results do not establish that the network reached first place.** The strongest complete contract result is a validated Gaussian port with measured fee parity and gas headroom, but it has no IB engine comparison. The IB results cover only 768 of the planned 1,024 seeds in this range and do not report a paired difference against the port. No Track B result meets +0.3. No result reports a board submission or entry. Sources: assignment brief; `b02-ib-12000000`, `b02-ib-12000256`, `b02-ib-12000512`, `b02-ib-12000768`, `b05-port-2`, and the policy results below. ## Track A — gates and runtime constraints Both gate investigations report the same 12 outputs, matching the solved README to six decimals. Column order is perfect-information, Gaussian/plain, Gaussian/QM, lattice/QM. | Seed | Perfect information | Gaussian/plain | Gaussian/QM | Lattice/QM | |---|---:|---:|---:|---:| | 10000 | 448.261189 | 443.455598 | 443.522608 | 443.663520 | | 10001 | 576.779199 | 571.463409 | 571.623551 | 571.977293 | | 10002 | 531.886497 | 525.168028 | 525.865859 | 526.411631 | `gates.py` reportedly runs in 7 seconds. Sources: `b01-gates-1`, `b01-gates-2` (common gate data; both say all 12 matched the README). The reported execution envelope is Solidity 0.8.24, optimizer 200, viaIR, Paris EVM; 250,000 total transaction gas per `afterInitialize` and `afterSwap`, 50,000 for `getName`, 10,000,000 for deployment; EIP-170 runtime size 24,576 bytes; at most 32 inherited storage slots at slot 0; no inline assembly. The required `Strategy` inherits `AMMStrategyBase`, imports only the two specified base files, and implements the three callbacks. External calls/creation and listed opcode/introspection operations are prohibited; fees must be within [0, 1e17]. The reports differ in scanner implementation detail (one describes skipping PUSH immediates and metadata), but agree on the banned operation set and default EIP-170 limit. Sources: `b01-gates-1`, `b01-gates-2`. The gate reports give different observed IB afterSwap peaks: 237,009 on seeds 0–255 versus 205,457 in a local single-seed-10000 run. These are different samples, not measurements of the same run. Both report initialization gas 243,227. One cites an artifact peak of 234,849 on a separate 512-seed sample. These observations suggest leaving margin, particularly for initialization; they are not port gas qualification. Sources: `b01-gates-1`, `b01-gates-2`. ## Track A — IB baseline runs Three valid blocks ran IB against VanillaStrategy on the required seed stream. The 12000256–12000511 block is empty and blocked, so this is not the full 1,024-seed span. | Seeds | n | Score sum | Mean | afterSwap peak / mean gas | OOG / reverts | |---|---:|---:|---:|---:|---:| | 12000000–12000255 | 256 | 134,918.570353 | 527.025665 | 234,958 / 135,281 | 0 / 0 | | 12000256–12000511 | 0 | — | unavailable | unavailable | unavailable | | 12000512–12000767 | 256 | 136,071.262440 | 531.528369 | 234,743 / 135,196 | 0 / 0 | | 12000768–12001023 | 256 | 136,903.691024 | 534.780043 | 234,965 / 135,191 | 0 / 0 | The valid samples total 768 and mean 531.111359, calculated from their reported sums. This is an unpaired score against VanillaStrategy, not an improvement over IB, and does not establish +2.7. The first block reports sd 91.83 and se 5.74; the other blocks omit uncertainty. All valid blocks report `amm-match validate` passed and zero callback OOG/reverts. The blocked block says no configs or engine work were run; its blocker is a platform-prerequisite policy, not an observed engine failure. Sources: `b02-ib-12000000`, `b02-ib-12000256`, `b02-ib-12000512`, `b02-ib-12000768`. The valid runs report configurations following `MatchRunner._build_configs`, seeded by each engine seed, with retail mean size, retail arrival rate and GBM sigma drawn in that order, and `run_batch(..., 8)`. The 12000000 block used four 64-seed commands taking about 31 seconds each; the others report blocks from roughly 38 to 148 seconds. The 12000768 result explicitly calls these scores submission edge vs VanillaStrategy, not paired candidate-minus-IB differences. The cited sources of `b02-ib-12000000` did not hold on reread (two sources), and one source for `b02-ib-12000768` did not hold; their source-dependent provenance details have reduced corroboration. ## Track A — table compression and numerical components ### Compression The sd-level experiment found that retaining sd=4 and 20 bps and interpolating the other levels scored −0.0098 (SE 0.0102) on 2,048 holdout seeds versus `ref/gauss_qm.json`. Keeping sd=4, 20 and 34 bps scored −0.0059 (SE 0.0101). One-level compression performed poorly in tuning (best about −0.59). The retained tables still contain 268,356 or 402,534 cells, so this dimension alone is not a deployable table. The report says its QM sanity output was not bit-identical: maximum reported difference 0.0020 edge, attributed to a floating-point branch flip. Source: `b03-compress-sdlevels`. The rival-mode experiment merged separate phase-1/2 rival tables into one mode. Its best tested 13-knot “s” mode lost −0.3189 (SE 0.0265) tuning and −0.2716 (SE 0.0103) on the 2,048-seed holdout; averaging modes scored −0.2939 holdout. Neither meets the stated −0.2 quality bar. Its baseline exact-match sanity check succeeded, so the losses are from the tested compression. Source: `b03-compress-rivalmode`. The fit experiment found a more promising compression path: fewer rival-coordinate columns with fitted piecewise-linear price knots and sd levels. Candidate `k13_c15_c7_l4` used 13 price knots, 15 phase-1/2 rival columns, 7 phase-0 columns and 4 sd levels; it used 6,968 cells / 7,007 one-byte payload bytes and scored −0.1462 (SE 0.0294) tuning, −0.1306 (SE 0.0102) holdout. `k17_c15_c7_l5` used 11,390 cells / 11,434 bytes and scored −0.0879 tuning, −0.0653 (SE 0.0105) holdout. A 30.8KB candidate scored −0.051 holdout but is far beyond 32 storage slots. The report proposes embedding table data as code constants. Its sanity check notes a 0.0020-edge float-noise discrepancy at seed 10037, so it is not bit exact. Source: `b03-compress-fit`. These compression results are not interchangeable: they compress different axes and use different representations. Rival-mode merge is harmful in its tested form; fitted knots/columns look promising, but none alone demonstrates callback fee parity for the final contract. One cited source for `b03-compress-fit` was flagged on reread; source-dependent explanations have reduced corroboration. ### Math and table lookup Two Q30 math libraries report high sampled accuracy and successful tests, but their APIs, domains, and gas accounting differ. `math-1` reports 19 tests passing, a 5,437-byte runtime harness, and sampled max gas from 3,868 (`exp`) through 147,201 (`truncNormal`). It targets real.py snap/fallback behavior and says full-policy callback parity remains integration work. `math-2` reports 35 tests, a 4,161-byte harness, 817–18,467 sampled gas for scalar/truncation methods, and 102,232 gas for 12 representative silent updates; it explicitly says this is not a callback worst-case proof. It reports a flattened smoke Strategy passed static validation but no full-policy fee parity or engine score. Their error maxima are sampled, not formal bounds. Gas is not directly comparable: math-1 includes external harness/ABI overhead in warm-call maxima; math-2 reports internal-call deltas, with truncation outputs sharing one call. Both use signed decimal Q30 (1e30 scale) but report different clamps/ranges and gas. Sources: `b04-math-1`, `b04-math-2`; two cited sources for each were flagged on reread. Two table harnesses report exact arithmetic parity against a fixed-point Python oracle on selected knots, but use incompatible coordinate units/grids. `tables-1` uses millionths of bps and milli-bps int24 cells; it reports 106 tests, 13,566-byte runtime, sampled lookup max 19,433 gas (ABI excluded), 41 price knots and 13 rival columns in phases 1/2. `tables-2` uses nano-bps and milli-bps samples; it reports 6 tests, 8,351-byte runtime, max 42,108 gas including external ABI/caller cost, 39 price knots and 13 columns per phase. Exactness applies only to selected knots and the fixed-point interpolation oracle, not full-grid compression. `tables-2` reports full-grid compression errors of 26.479375 / 68.759166667 / 69.315583334 bps for phases 0/1/2 and says its knot choice is unscored. Sources: `b04-tables-1`, `b04-tables-2`; one and two cited sources respectively were flagged on reread. ## Track A — complete Gaussian port The two port attempts differ materially. `port-1` is incomplete and fails original full-table parity: 212,446 callbacks, maximum fee difference 58.1094 bps, and 138,037 callbacks over 0.01 bps. Yet on identical compressed tables, real.py vs Solidity reportedly differs by at most about 0.00225 bps. This indicates its measured parity failure appears when table compression/feedback enters the comparison. It passed validation; afterSwap peak 193,882 gas; 64 stress sequences had no reverts and peaked at 213,782. Runtime is 24,132 bytes. It did not compare against IB and is not a full-table parity-passing submission. Source: `b05-port-1`. `port-2` reports a complete `real.py` soft=1, steps 1–6 port using a 71-knot compressed subset expanded to the reference grid. Across every callback of 20 replica trajectories (212,490 callbacks), maximum fee difference was 3.35019e-9 bps and no callback exceeded 0.01 bps. Its separate compression cost was −0.00803 (SE 0.00899), paired over 256 seeds against original `pol_mid.json`. `amm-match validate` passed; runtime is 22,567 bytes. Actual afterSwap peak/mean gas were 145,062/49,544, with zero OOG/reverts; 64 stress sequences peaked at 144,288 without reverts. Gates reportedly matched published digits. It did **not** run the IB engine comparison, so +2.7 is unproven. Source: `b05-port-2` (two cited sources flagged on reread, reducing corroboration of source-dependent setup claims). Port-1 used 45 price knots and 0.01-bps residuals and failed its original-grid parity test; port-2 used 71 knots and 0.005-bps residuals and reports extremely close parity. These are separate implementation results; port-1's compression failure should not be assigned to port-2. ## Track B — Numba replica acceleration All three Numba results report gate match and identical output to their own pure-Python baseline on 64 holdout seeds, with maximum absolute difference 2.7393e-10 and zero differing seeds. They are acceleration tooling, not a new policy or engine/gas qualification. Reported speedups differ: 99.5x (`b06-numba-1`), 74.1x (`b06-numba-2`), 55.7x (`b06-numba-3`), due to different machines/timing methods. The third reports bit identity to local Python on 2,048 seeds but 34/2,048 differences above 1e-6 against `ref/lattice_qm.json` (max 0.074), attributed to libm differences; it reports no such difference above 1e-6 on 10000–10063. The second describes parity to 1e-6 rather than bit identity. First JIT compilation reports vary from 75–100 seconds to about 2.5 seconds on their respective machines. Each describes a standard-library fallback. Sources: `b06-numba-1`, `b06-numba-2`, `b06-numba-3`; one cited source for numba-2 was flagged on reread. The results describe optional packages and do not claim the offline verifier dependencies are bundled. ## Track B — policy experiments The table lists reported paired holdout differences versus the lattice reference; positive is better. Experiments were blind to arb/retail flags in policy inputs. | Idea | Holdout | Reported finding | |---|---:|---| | Posterior reweight/search | −2.8664 (SE 0.0236), n=2048 | Worse. Misread changed little; price error rose. Estimated ~48,400 posterior contributions per callback plus lattice update, far beyond gas budget. Source: `b07-idea-posterior`. | | Per-run rho/sigma adaptation | +0.022491 (SE 0.007481), n=2048 | Small gain, below +0.3. Misread 16.2395%→16.1937%; price error 13.6476→13.6307 bps. Gas estimate only. Source: `b07-idea-perrun`. | | Router-conditioned likelihood | +0.000151 (SE 0.000179), n=512 | Essentially unchanged at alpha=0, preserving baseline. Only 512 holdout seeds completed; remaining chunks not run. Nonzero direct strength was harmful on an 8-seed probe. Source: `b07-idea-router`. | | Trained logistic correction | +0.0227 (SE 0.008), n=2048 | Small gain. Report says existing filter was already calibrated on tested features. Estimated +4–6k gas on first-of-step calls, not measured. Source: `b07-idea-trained`. | | Fresh branch blend, q=pi | +0.1336 (SE 0.0118), n=2048 | Positive but below threshold; quoted gain is better branch-specific quotes under ambiguity, not improved classification. Estimated +15–25k gas on ambiguous first-step calls. Source: `b08-fresh-1`. | | Fresh branch blend, exponent g=2 | +0.1834 (SE 0.0107), n=2048 | Strongest completed holdout here, still below +0.3. Uses pi^g/(pi^g+(1-pi)^g); estimated +20–30k gas on ambiguous calls. Source: `b08-fresh-2`. | | RouterEvidence posterior update | +0.08919 (SE 0.01041), n=2048 | Positive, below threshold. Misread 16.2395%→15.9388%; price error 13.6476→13.5467 bps. Estimated 0.3–1.5M gas on first-step calls, unmeasured and above budget. Source: `b08-fresh-3`. | The branch blends are related, not additive: q=pi and exponent g=2 are different tuning choices. Per-run and trained corrections also show similar small gains but do not meet +0.3. RouterEvidence reports the largest misread reduction, but its estimated gas is prohibitive for a direct port. All idea gas figures are estimates, not EVM measurements. No result clears the +0.3 promotion bar, so none is shown as carried into the next port. `b07-idea-perrun` has two cited sources flagged on reread; `b08-fresh-3` has two. Treat their source-dependent explanations cautiously. ## Evidence limits and missing work This merge synthesizes the supplied result artifacts and is not a fresh reproduction. Each result artifact is the immediate source for its local measurement; cited repositories, datasets and code archives were not revalidated here. The assignment flags citations that failed rereading: gates-1 and gates-2 (one each); IB 12000000 (two) and 12000768 (one); math-1 and math-2 (two each); tables-1 (one) and tables-2 (two); port-2 (two); numba-2 (one); idea-perrun (two); fresh-3 (two). This limits corroboration of claims relying on those external citations, while retaining the figures recorded in the results. Nothing was inferred for the unavailable IB block, and the router idea's incomplete holdout is stated above.