# lattice-1: lattice-filter gas probe ## Gate P Ran `python3 -I gates.py` from Taylor's pinned `research/solved` directory before modifying any reference files. Output: ```text seed perfect-info 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 ``` The lattice+qm column reproduces the three requested values. ## Lattice callback work from `latt.py` - Belief: 121 price cells at 2.5 bps spacing, spanning ±150 bps about a moving center. The diffusion kernel has `M = ceil(4 * 9.45 / 2.5) = 16` and therefore 33 taps (not 11); it is the normalized Gaussian weight array for offsets −16 through +16. - On a new timestamp step, `dt-1` silent steps are capped at 30. Each silent step does one diffusion, then a cut to the prior no-arbitrage interval and normalization. If the belief survives, one more diffusion is applied for the current step. Thus the maximum is 31 diffusion passes and 30 cut/normalization passes per callback. - A diffusion visits each non-negligible source cell and considers up to 33 destinations. The full-window upper bound is 121 × 33 = 3,993 source-tap contributions per pass, or 123,783 across 31 passes. Out-of-window destinations are discarded. Each contribution entails a probability-kernel multiply and accumulation; zero/tiny source cells are skipped. The per-cell loop also checks destination bounds. - Each cut and normalization scans the current support (at most 121 cells); moment computation scans support twice. A retail posterior mixture may additionally scale the retained cells and deposit into up to two cells. Recentering scans support and redistributes each mass to up to two cells. - Python persistent filter state is 121 probabilities plus center `c`, support bounds `lo_i/hi_i`, and inherited policy state (`m`, `v`, `fb`, `fa`, prior own spot/time, rival estimate, count and sync state). The challenge base exposes only 32 storage words, so a direct one-word-per-cell Solidity translation cannot fit its allowed storage. A Solidity version needs a measured packed representation and unpack/repack logic. These are source-derived operation bounds, not Solidity gas measurements. ## Contract and runtime measurements Not completed. The supplied setup script was saved and run once from the pinned `amm-challenge` checkout under this item's `work/` directory. It downloaded the specified wheel and verified its SHA-256, then failed at package installation: ```text error: Failed to determine installation plan Caused by: A path dependency is incompatible with the current platform: scratch/amm_sim_rs-0.1.0.post1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl ``` This workspace is macOS (`macos-aarch64` CPython was selected); the brief supplies a Linux `manylinux2014_x86_64` binary. Consequently `amm_sim_rs`, the challenge validation command, and pyrevm replay could not be set up here. No Solidity lattice contract was compiled or replayed, and no callback trace was recorded. I therefore cannot give truthful deployed bytes, gas peak/mean, OOG count, fee-match error, reductions-versus-match results, or a fit verdict. The port-3 artifact was inspected for shell/storage conventions but its Gaussian measurements do not establish lattice gas behavior. ## Verdict **Unmeasured; no fit claim.** Gate P passes. The lattice filter's source-level work is bounded as above, but whether its packed Solidity implementation fits 245,000 gas and the 32-word storage limit remains unresolved. A Linux x86_64 runner (or compatible engine wheel and EVM runtime) is required to finish contract validation and the requested replay measurements.