{
  "credit": "Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved: original replica, Gaussian filter, silence/no-arbitrage truncation, tables, fee rule and exact-arithmetic arb/retail tell.",
  "mech": "silence-bound: extra silence-count-dependent variance contraction on top of existing silent-band conditioning",
  "already_present": true,
  "definition": {
    "formula": "At the first callback of a new timestamp, dt=t-tlast, k=min(dt-1,12), L=log(sp*(1-fb)), H=log(sp/(1-fa)). Retain the original k iterations (m_j,v_j)=moments(N(m_(j-1),v_(j-1)+SIG2) | L<=log(p)<=H). After the loop set q=max(0,k-silence_start+1), v=v_k/(1+silence_strength*q), m=m_k; then add SIG2 for the current step and perform the original tell/posterior update, rival logic and lookup. No contraction on dt=0, k<silence_start, or silence_strength=0.",
    "interpretation": "This tests stronger confidence after prolonged silence than the inherited Gaussian moment projection supplies. It is a heuristic variance correction, not a newly proved tighter price bound. It changes the prior entering the current-step likelihood calculation and therefore the belief passed to the lookup. It never conditions away the current step process variance before the tell.",
    "parameters": {
      "silence_strength": [
        0.025,
        0.05,
        0.1,
        0.2
      ],
      "silence_start": [
        1,
        2,
        3
      ],
      "SIG2": 8.93025e-07,
      "silent_cap": 12
    },
    "state_kept": "No additional persistent state. Reuse the existing mean, variance, previous callback timestamp, previous own spot and quoted fees. q is local; the two selected parameters are compile-time constants in a prospective contract. Only afterSwap-visible data and previous own state enter this rule.",
    "baselines": {
      "LEAN": {
        "a0": 0.35,
        "ainf": 0.35,
        "tau": 2.0
      },
      "AGE": {
        "a0": 0.0,
        "ainf": 0.7,
        "tau": 1.0
      }
    },
    "method": {
      "selection_seeds": "64000..65023 inclusive",
      "round_size": 128,
      "stop_rule": "Drop at the first cumulative round with mean_diff+3*se<0. No setting crossed this threshold. All 12 completed 1024 seeds.",
      "selection_rule": "largest mean among settings surviving all eight rounds, else largest stopping mean; ties lower strength then lower start",
      "report_seeds": "10000..12047 inclusive; the same chosen setting was frozen before either report",
      "report_execution": "One candidate run per seed against LEAN and one stacked candidate run per seed against AGE; both 2048-seed reports ran to completion without early stopping.",
      "n_steps_per_seed": 10000,
      "difference": "candidate edge minus matched baseline edge",
      "se": "sample sd of paired differences (n-1 divisor), divided by sqrt(n)",
      "seeds_positive": "number of strict positive paired differences",
      "multiple_testing": "Selection score is exploratory after 12 settings. Report seeds were not used to choose parameters; no post-report tuning."
    },
    "source_hashes": {
      "fastlean_base_sha256": "d9c758bb280fe24e09c039496f84ab0804173ff70cec24c332f8683f28efa582",
      "fastlean_patched_sha256": "509dd67eac88e9233f29a081f9cdbda4532d90b81e20b68bfab7e3b86377c4f0",
      "unified_diff_sha256": "2c7095c6a518aefaf0807229224b15a10ee37ded6b6d5f64190eaee8a84ecec0",
      "leanbase_py_sha256": "ba015769f7981d7798acbbc9aff8c0e0c59825bb1541d55bcdef49311d7a04bc",
      "real_py_sha256": "6a4a0f0e7f8b43d38e5eaa9d8b2e847a0771aee7f89551b122fe89bfe7969b5f",
      "stalerival_py_sha256": "d124a171d35b024daed840e5449d352b2b5e50a68ce98c8a9aaafaf3419d23da",
      "tellpol_py_sha256": "7d5961c45bec56292533e65607245ad119b8733c760a5bf28f76a2e07bc3960b",
      "pol_mid_json_sha256": "efbb5ee102db4d312f64565d9bf7232b6becbe02b624164f744a402bbbf2983b",
      "qm_k1e5_json_sha256": "5ff53e42ca87390e5f65d1caa3f7a480e67a8212fb0670274dfd562b05ba1afd"
    },
    "reproduce": "Decode patch_zb64 as base64 then zlib; apply unified diff with patch -p1 in the original fastlean directory from artifact a88ff982eba7e078bc6ccb1555b90a211c00c9fd76ec90a62ab13a4074f2c3d0. Load the supplied research tables; call fastlean.load(amm_dir, a0=0.35, ainf=0.35, tau=2, silence_strength=0.1, silence_start=3), then fastlean.run_batch(tabs, range(10000,12048)). Baseline: same call with silence_strength=0. For AGE set a0=0, ainf=0.7, tau=1 for both candidate and baseline. The hook stays off. These are Python API parameters; the original CLI remains baseline-only.",
    "runtime": {
      "python": "3.12.16",
      "numpy": "2.5.4",
      "numba": "0.68.1",
      "llvmlite": "0.50.0"
    },
    "validation": {
      "source_inputs": "All 10 available modules named in the LEANBASE frozen dependency manifest matched their SHA256 values; experiment.py is packed but not named in that manifest. Both table digests matched the pinned upstream SHA256SUMS.",
      "P": "PASS: unmodified kit gatep.py on the materialized Taylor research snapshot, all 12 published gate values.",
      "Q_noop": {
        "n": 128,
        "seeds": "64000..64063 and 10000..10063",
        "bit_identical": 128,
        "max_abs_edge_error": 0.0,
        "zero_linear_weights_identical": true,
        "invalid_parameter_cases_rejected": 5
      },
      "T_original": {
        "seeds": [
          64000,
          64001,
          64002,
          64003
        ],
        "recorded_callbacks": 41460,
        "recorded_label_mismatches": 0,
        "perturbed_inputs": 52650,
        "perturbed_label_mismatches": 0
      },
      "T_F_candidate_vs_independent_cpython": {
        "method": "Copied the packed CPython real.py and inserted the stated formula after its silent loop. Shadowed every candidate callback with compiled on_trade using the same side, amounts, timestamp and reserves; separately compared whole-seed edges. This oracle uses no true price or arb flag in its decisions.",
        "lean": {
          "baseline": "LEAN",
          "parameters": {
            "silence_strength": 0.1,
            "silence_start": 3
          },
          "seeds": [
            64000,
            64001,
            64002,
            64003
          ],
          "callbacks": 41458,
          "first_callbacks": 27401,
          "label_mismatches": 0,
          "fee_mismatches": 0,
          "max_fee_error_bps": 0.0,
          "max_m_error": 0.0,
          "max_v_error": 0.0,
          "max_edge_error": 0.0
        },
        "age": {
          "baseline": "AGE",
          "parameters": {
            "silence_strength": 0.1,
            "silence_start": 3
          },
          "seeds": [
            64000,
            64001,
            64002,
            64003
          ],
          "callbacks": 41459,
          "first_callbacks": 27394,
          "label_mismatches": 0,
          "fee_mismatches": 0,
          "max_fee_error_bps": 0.0,
          "max_m_error": 0.0,
          "max_v_error": 0.0,
          "max_edge_error": 0.0
        }
      },
      "statistics": "Recomputed all cumulative screening rounds and both reports with stdlib statistics.mean/stdev; verified first-crossing stop rules, seed ranges, positive counts and frozen selection.",
      "patch": "Applied the decoded unified diff to a clean original copy and verified the resulting bytes equal the tested candidate."
    },
    "policy_review": {
      "where": "Read leanbase.py, stalerival.py, real.py and tellpol.py before implementation. leanbase.Policy -> stalerival.Policy -> tellpol.TellPolicy -> real.RealPolicy. real.RealPolicy.on_trade already repeats v += SIG2; trunc(m,v,lo,hi) once per fully silent step, capped at 12, then adds the current step diffusion. A retail first trade also truncates to the prior quote band. fastlean.py:on_trade ports these operations.",
      "source_urls": [
        "https://raw.githubusercontent.com/gtmcknight/amm-sim/66604b3426d8e97a73e2c39940b9b4dece51cc73/research/solved/real.py",
        "https://api.imd.fun/artifacts/efb8e653f8fd061cecf3e92b186470c9c96c5188523364b60ed101e9672869aa",
        "https://api.imd.fun/artifacts/a88ff982eba7e078bc6ccb1555b90a211c00c9fd76ec90a62ab13a4074f2c3d0"
      ],
      "absent_variant": "A further variance-only contraction depending on completed silent-step count is absent from all four policy files and from the compiled replica."
    }
  },
  "settings_tried": [
    {
      "parameters": {
        "silence_strength": 0.025,
        "silence_start": 1
      },
      "n": 1024,
      "mean_diff": -0.001918643776141149,
      "se": 0.0029401222079102705,
      "dropped_early": false
    },
    {
      "parameters": {
        "silence_strength": 0.05,
        "silence_start": 1
      },
      "n": 1024,
      "mean_diff": -0.002432878582975362,
      "se": 0.0033052230389609845,
      "dropped_early": false
    },
    {
      "parameters": {
        "silence_strength": 0.1,
        "silence_start": 1
      },
      "n": 1024,
      "mean_diff": -0.0012592065053335655,
      "se": 0.003712019117047054,
      "dropped_early": false
    },
    {
      "parameters": {
        "silence_strength": 0.2,
        "silence_start": 1
      },
      "n": 1024,
      "mean_diff": -0.0032999385594366104,
      "se": 0.005799253317729791,
      "dropped_early": false
    },
    {
      "parameters": {
        "silence_strength": 0.025,
        "silence_start": 2
      },
      "n": 1024,
      "mean_diff": 0.00046562037420344593,
      "se": 0.002875785194793946,
      "dropped_early": false
    },
    {
      "parameters": {
        "silence_strength": 0.05,
        "silence_start": 2
      },
      "n": 1024,
      "mean_diff": 0.0009835792871880078,
      "se": 0.0029055747353747244,
      "dropped_early": false
    },
    {
      "parameters": {
        "silence_strength": 0.1,
        "silence_start": 2
      },
      "n": 1024,
      "mean_diff": 0.00027490394530044204,
      "se": 0.003174237767027067,
      "dropped_early": false
    },
    {
      "parameters": {
        "silence_strength": 0.2,
        "silence_start": 2
      },
      "n": 1024,
      "mean_diff": -0.0011369857386275828,
      "se": 0.005304938969435387,
      "dropped_early": false
    },
    {
      "parameters": {
        "silence_strength": 0.025,
        "silence_start": 3
      },
      "n": 1024,
      "mean_diff": -0.0007022987773678824,
      "se": 0.0024120022033672973,
      "dropped_early": false
    },
    {
      "parameters": {
        "silence_strength": 0.05,
        "silence_start": 3
      },
      "n": 1024,
      "mean_diff": 0.0023794998414906066,
      "se": 0.002517130168075714,
      "dropped_early": false
    },
    {
      "parameters": {
        "silence_strength": 0.1,
        "silence_start": 3
      },
      "n": 1024,
      "mean_diff": 0.0029668883392731105,
      "se": 0.0026920308615193027,
      "dropped_early": false
    },
    {
      "parameters": {
        "silence_strength": 0.2,
        "silence_start": 3
      },
      "n": 1024,
      "mean_diff": 7.259587462593586e-05,
      "se": 0.003178584543330996,
      "dropped_early": false
    }
  ],
  "chosen": {
    "parameters": {
      "silence_strength": 0.1,
      "silence_start": 3
    },
    "n": 1024,
    "mean_diff": 0.0029668883392731105,
    "se": 0.0026920308615193027,
    "selection_rule": "largest mean among settings surviving all eight rounds, else largest stopping mean; ties lower strength then lower start"
  },
  "report": {
    "vs_lean": {
      "n": 2048,
      "mean_diff": -0.0008279686961202848,
      "se": 0.0019242159702547905,
      "seeds_positive": 1029,
      "seeds_negative": 1019,
      "seeds_equal": 0,
      "mean_baseline": 536.603390956178,
      "mean_candidate": 536.6025629874819,
      "min_diff": -0.631548386771442,
      "max_diff": 0.46841701097469013,
      "rows_sha256": "483ecbd27ca0b3a9826b366e5840bef276916533f17b8906539b06ea1e30a019"
    },
    "on_age": {
      "n": 2048,
      "mean_diff": -0.0006687704036579534,
      "se": 0.0019155571807606612,
      "seeds_positive": 1000,
      "seeds_negative": 1048,
      "seeds_equal": 0,
      "mean_baseline": 536.6231002985178,
      "mean_candidate": 536.6224315281141,
      "min_diff": -0.41171708508221627,
      "max_diff": 0.9431518415395885,
      "rows_sha256": "d57d03d0a0da263eb5b8d5deac355572fee8db30854d2c39c56bc437819c0287"
    }
  },
  "promote": false,
  "contract_cost": {
    "storage_words": 0,
    "gas": {
      "type": "measured isolated WAD arithmetic probe; full contract integration unmeasured",
      "incremental_min": 48,
      "incremental_max": 564,
      "samples": [
        {
          "dt": 1,
          "base_gas": 5271,
          "candidate_gas": 5319,
          "incremental_gas": 48
        },
        {
          "dt": 4,
          "base_gas": 5271,
          "candidate_gas": 5830,
          "incremental_gas": 559
        },
        {
          "dt": 12,
          "base_gas": 5271,
          "candidate_gas": 5830,
          "incremental_gas": 559
        },
        {
          "dt": 100,
          "base_gas": 5271,
          "candidate_gas": 5835,
          "incremental_gas": 564
        }
      ],
      "compiler": "Solidity 0.8.24, optimizer enabled, 200 runs, Cancun EVM, metadata hash disabled",
      "compiler_sha256": "fb03a29a517452b9f12bcf459ef37d0a543765bb3bbc911e70a87d6a37c30d5f",
      "scope": "Difference between external pure functions returning unchanged v and applying the block below, called with v=1e12. Common call and test-harness costs cancel in the difference. Not an afterSwap peak or OOG measurement."
    },
    "characters": {
      "incremental_block": 80,
      "including_one_full_credit_comment": 200,
      "solidity_block": "if(dt>3){uint256 q=dt-1;if(q>12)q=12;q-=2;v=v*1e18/(1e18+100000000000000000*q);}",
      "scope": "Exact character count of an illustrative WAD-scaled variance update with parameters compiled in. Assumes existing v and dt variables; excludes integration glue."
    },
    "runtime_bytes": {
      "base_probe": 119,
      "candidate_probe": 366,
      "incremental_probe": 247,
      "integrated_contract_measured": false
    },
    "budget_context": {
      "given_current_peak_gas": 208000,
      "peak_gas_limit": 245000,
      "given_current_runtime_bytes": 22440,
      "runtime_bytes_limit": 24576,
      "given_current_source_characters": 47230,
      "source_characters_limit": 50000,
      "remaining_before_change": {
        "gas": 37000,
        "runtime_bytes": 2136,
        "source_characters": 2770
      },
      "assessment": "The isolated primitive is small relative to the stated headroom, but its bytecode and gas deltas are not certified integration bounds. No production contract is returned."
    }
  },
  "patch_zb64": "eNq1Vm1v2zYQ/u5fcWs/WKopVVIcO31xkQZIugBFgCHBAiwwBEqibDYypZCUU+/X747ye7AhwFAGiHXHe3l0fO6oIAiAvy+5sZXgKmxWvcFgANmB5vwcgmE8ZmMY0M8ZnJ/34C0E/3PB98uvNxdfby8pmCmhrGpuR8OHOJl+hAgWDGJYMkjAJHMGJ1BmDIZQcvB03apCFFAKYUAqKGudC5/BKZiGwQgamVaIn8EYfj4zOIPVM3iNFktZtwa0MEIvBTzzwvgut8QglPkME+OKwHbuMeTKOgQrlYuCQBhZCdINAUFYoVNLabNnSssxC0LqAlPytQmfiV7wFq7XWYaY5eaewdUFQ8dUKokxePcAbl1tazFG2/uIARaA4w+XqmRgecuwGmvPkruH3uB1GchuF//Dq+Oz7tVzkRqrhZrZ+b6Ga9uDc/VDWi/n+VxM7nQrsLiFKKGpK5mvXBDPlOTF4BrB+R977m1N+RBNYQILbudhVc+8OIrCyP9EGzFtoOSEhAS36cQTEq8eTqdOGnbSqJNOD01HTgyjjsrDhI2QysMTFseOy5uFPIKUCKW5mglvIZVXWAggRiok/gbvZi1hMIHb62/JoTr9mxF3l5jR6lblHgkMqhqrLP3eYGP3Fm678gUZ0RmWXEuu7Ce446sKgXgzu8gflZzNrd83UGs5k4pXXVBuZa2AZzXyWBpAzZwgF+F+/MufVnMwcy3VI3KQDOei1dJYmX+CvNV4jjYwVjRQyLJsDcXUYoEscCFrVUjKcxBWlljl8RS+0LF83OlpPbVSWHeSPz1k01H98AHp6V1hm/kwgNg/dF7Ce3dGuOUSvOvC9f6r3lWzzxuDPh5FCJC9ke8TVmnSrF2BqIzYN3y/NeRouAv4F6JGqi/tv5we8Wf04QPOwME4OmXxyZY/WthWK8BB4HrLe/YxSRzBu3cQn/UA/wJqBtwrPL5YpIXUDJ4Wk/7TIn2MRXAa/jC16jNql0kf/6ULWWx0PJpE4clp16DrR+zSSYJ9gmfwSwKzveM5bn20jI7afxJv+uPNmzd3PKtwNNflmsz9bupync+RalrkttYrGpY2n4dmjtT4AnYuwLZNJQDrnmYctxDKozAhBuyw4Hmq2nbnKE1JE0V4x9h8bJUXgOHzEV01l8iIP3nVikuta+31X7gsWmMhE9DlAY49qmqlxAybbyn6/qswYWUcIGL+kfa3yWEFyYxCxfD5eAcVcfJK9GS/gc4VJRYzQQCwucI46a/ZfocMJxKEjjh1I5RXm7Ch1/hRY+NuqYSM8Tct8sdrnZ4WW5+be3Si17976N/c96c42K8udqqrC6e6SfasElS5VhvHI/rqGCebrw43pTO6lNDcXSkpfQR4d+tkdBGXmaZN1HtlhqE56fhOx9e216hRTci15ivvYXdf0lU5ZVDYVSMmaODuVL8XdDfzvk/X6Yj4PkLEm85H+fc0a8yeCofM9hEbbStgq/kOsEM4XVPqlyZhh1N3ffE5wxedxF5sEHGn/sHE+8oAy3bLdpAJa/K9v1/D9feG3938bhz+A6ioBEA=",
  "not_done": [
    "No Solidity port of the complete policy, integrated runtime/source size, engine afterSwap gas, OOG certification, G or engine E gate. Only an isolated arithmetic cost probe was compiled and tested.",
    "No QLX5 or qt1 engine comparison and no fresh engine seeds consumed. The fast replica paired baseline here is LEANBASE, not QLX5 with its drift-tolerant rival split.",
    "No engine-faithful reserve/k repair or engine-log parity proof. Existing replica/engine differences remain; replica gains are not claimed to transfer from this experiment.",
    "Q candidate/CPython parity covers four selection seeds on each of LEAN and AGE; the 2048-seed reports use the compiled replica, without CPython per-seed replay.",
    "The original silence mechanism was already present. This experiment only tests extra variance contraction, not every possible use of silence.",
    "No leaderboard submission; no submission permission requested or implied.",
    "Not promoted: at least one of the two report means is below +0.03. Do not advance this setting on the strength of this result."
  ]
}
