# gd-a — ComboG phase-0 gas diet Platform: Linux x86_64. Setup completed once with the supplied setup script. The TC-A input SHA-256 was `b87234c89e094f4955578417c1266129b0f96e6dfda68e3fb8866e00eeda71a2`. Credit Taylor (gtmcknight) for the replica, solved filter/policy, and qm tables; TC-A carries that credit in its header ([source](https://raw.githubusercontent.com/identity-md-launches/goal-3170-beat-network-s-amm-entry/4eb3e985fd31e3cd17832501b95b6d2491aca73d/contracts/Candidate.sol)). ## Gates and change Gate P passed before modification, using `python3 -I gates.py` at Taylor commit `4812a638`: Gaussian+qm values were `443.522608`, `571.623551`, and `525.865859` for seeds 10000–10002. The upstream gate script labels that column `gaussian+qm` ([source](https://raw.githubusercontent.com/gtmcknight/amm-sim/4812a6382311624e1506aca131ca35c378f930d9/research/solved/gates.py)). The COMBO port and its reference came from the supplied artifact ([source](https://api.imdnotdead.fun/artifacts/4cc25dfb91f2ca8a957de08c6a38bbd3e4aed7fb288be8242e5677ea77bbf0b1)). The only diet change to that port is in `offsets`: for `ph==0 && sd==0`, leave `k=0` and `tt=0`, skip the sd-axis search, and do not call `bern(k+1,X.B1)`. Tables, spline evaluation, rounding, storage, and all other code are unchanged. No assembly or new storage was added. On seed 70000, mixed `dt=1` peak changed from 215,761 gas (ungated supplied port) to 215,557 gas: **204 gas saved**. ## Final probe and gate Final source and `ComboG.GATE` were both set to **1**, because no candidate in `{1,2,3,4,6,9,ungated}` qualifies: the required `dt=1` bucket already exceeds 205,000. The final five-seed, 245,000-gas replay was seeds 70000..70004; no recovery calls were needed. | mixed dt bucket | callbacks | peak gas | OOG | |---|---:|---:|---:| | 1 | 21,539 | 216,709 | 0 | | 2 | 0 | 0 | 0 | | 3 | 0 | 0 | 0 | | 4 | 0 | 0 | 0 | | 5–6 | 0 | 0 | 0 | | 7–9 | 0 | 0 | 0 | | 10–12 | 0 | 0 | 0 | | >=13 | 0 | 0 | 0 | Non-mixed callbacks: 30,359; peak: **182,431**; OOG: 0. Thus the non-mixed condition holds, but `dt=1` does not. **Problems:** no qualifying GATE exists; `GATE=1` is frozen only as the requested fallback, not as a budget-passing candidate. ## Frozen source `amm-match validate scratch/work/Strategy.sol`: PASS (`TaylorComboGQmTrim2`). Source SHA-256: `8cfcc0b72b477bd309c0233355b2b6f501fb1a2c027eb7efedce934654d3c6b2`; runtime: **22,173 bytes**. The frozen unified diff is the supplied COMBO-port unified diff against TC-A, with its `GATE` line changed to `uint256 constant GATE=1`, plus this sole diet hunk: ```diff @@ - uint256 k;while(k<6&&sd>=S(k+1))k++; - int256 tt=(sd-S(k))*U/(S(k+1)-S(k));if(tt<0)tt=0;if(tt>U)tt=U; + uint256 k;int256 tt;bool arb0=ph==0&&sd==0; + if(!arb0){while(k<6&&sd>=S(k+1))k++; + tt=(sd-S(k))*U/(S(k+1)-S(k));if(tt<0)tt=0;if(tt>U)tt=U;} @@ - Ctx memory X;(uint256[87] memory W,uint256 nr,uint256 nc)=table(ph,sy);X.nr=nr;X.nc=nc;X.last=last;X.tt=tt;bern(k,X.B0);bern(k+1,X.B1); + Ctx memory X;(uint256[87] memory W,uint256 nr,uint256 nc)=table(ph,sy);X.nr=nr;X.nc=nc;X.last=last;X.tt=tt;bern(k,X.B0);if(!arb0)bern(k+1,X.B1); ``` `combog.py` is exactly the artifact’s `## Exact ComboG code` block, except its class default is frozen as: ```python class ComboG(TwoComp): GATE = 1 ``` No fee-policy arithmetic was changed by the diet; the reference retains the supplied mixed-offset quoting code and only its gate default differs. ## F `python check.py CAND.sol combog.ComboG 70000 70050 out.json` was run as five/ten-seed chunks covering every seed 70000..70049, each with 2,000 callbacks (100,000 total). Effective fees use the checker’s clamp to `[0,0.1]`. `{max_bps: 3.0968576748141574e-06, seed: 70003, callback: 655, pyrevm_peak: 217182 (seed 70005, callback 1286), oog: 0}` This passes the 0.01-bps fee threshold, although the peak confirms the independent gas-gate failure. ## Commands ```sh sh scratch/setup.sh python3 -I gates.py amm-match validate scratch/work/Strategy.sol python scratch/tools/probe.py scratch/work/Strategy.sol --start 70000 --end 70005 python scratch/K/check.py scratch/work/Strategy.sol combog.ComboG 70000 70050 out.json ``` The last command was executed in contiguous chunks solely to keep individual commands below the eight-minute limit; the union was exactly `[70000,70050)`.