{"item":"posterior-a","batch":"e03-full-posterior","credit":"Taylor (gtmcknight): replica2.py, dp.py (V_N), qmdp.py, latt.py, real.py, evalpol.py, gates.py, pol_mid.json, qm_k1e-5.json (github.com/gtmcknight/amm-sim @4812a6382311624e1506aca131ca35c378f930d9, research/solved). qt1 (QMRef), TC (TwoComp), COMBO and QMS1 are IdentityMD items built on Taylor's work. Every file embedded under 'source' carries that credit in its header.","summary":{"what":"Candidate C quotes by argmax over one feasible absolute (ask, bid) of the posterior-weighted solved V_N, using the full 121-cell 2.5 bps lattice posterior of latt.py (numba port), with COMBO's callback/rival rules. Cflag is the same code with the true arb flag injected (oracle-only). Replica only; no contract, no engine run.","report_10000_12047":{"C-COMBO":{"n":2048,"mean_diff":0.421303,"se":0.012069},"C-qt1":{"n":2048,"mean_diff":1.018694,"se":0.014377},"Cflag-Flag":{"n":2048,"mean_diff":0.105171,"se":0.008712},"Cflag-COMBO":{"n":2048,"mean_diff":2.67529,"se":0.021282},"Cflag-qt1":{"n":2048,"mean_diff":3.272681,"se":0.022819}},"choose_64000_65023":{"C-COMBO":{"n":1024,"mean_diff":0.411819,"se":0.016819},"C-qt1":{"n":1024,"mean_diff":1.021424,"se":0.020743},"Cflag-Flag":{"n":1024,"mean_diff":0.121876,"se":0.011755},"Cflag-COMBO":{"n":1024,"mean_diff":2.625254,"se":0.028119},"Cflag-qt1":{"n":1024,"mean_diff":3.234859,"se":0.031085}},"quoting_vs_filter_report":{"C-Ctrl":{"n":2048,"mean_diff":0.345436,"se":0.01145},"Ctrl-COMBO":{"n":2048,"mean_diff":0.075867,"se":0.008241},"Cflag-CtrlFlag":{"n":2048,"mean_diff":0.100811,"se":0.008488},"CtrlFlag-Flag":{"n":2048,"mean_diff":0.00436,"se":0.002582}},"findings":["Full-posterior quoting is worth +0.345 (se 0.011) over mean/sd tables on the same posterior code (C-Ctrl, report), and +0.101 (se 0.008) when the arb flag is known (Cflag-CtrlFlag): most of its value is in handling the unresolved arb/retail mixture.","The lattice filter alone adds little over TwoComp under the same table quoting (Ctrl-COMBO +0.076, se 0.008); first-call error rate 15.85% (C), 15.97% (Ctrl), 16.12% (COMBO), 17.31% (qt1).","The arb/retail call is still the gap: Cflag-C = +2.254 (se 0.021) on report. C closes none of it; it quotes better given the same call.","Cross-check: COMBO-qt1 on report is +0.597391 (se 0.013388), equal to the figure published in the COMBO artifact."],"units":"replica edge per run (10000 steps); paired on identical seeds; se = sample_sd(paired differences)/sqrt(n); worst5 = [seed, diff]. Replica figures are not board scores."},"gates":{"P":"pass (gates.py reproduces the README at 6 dp before any change; qt1=QMRef reproduces 443.101741, 571.454483, 525.908441)","Q":"complete coverage on both windows: True","F":"not applicable (no contract in this item)"},"hashes":{"source_commit_verified":"4812a6382311624e1506aca131ca35c378f930d9","inputs_sha256":{"README.md":"02d2b51f17adbb5411a2a67f7a37255143ba381a73ff10abba557d7d23c0cef2","gates.py":"603280c1f595ca163ffaf2ba1ebdc7945fdb08dabae67fc53c922d39e1cce604","replica2.py":"6e37b4e61e1ffa5ffb1e43912ddb8659105989aa986eb48fcd1d7608f8dca685","evalpol.py":"6e67667bfed7798bdd3384652a6efc6ba0b1fce653740d0f9af2bcbcb8e6a27c","real.py":"1305b5333731c046c3e6736cc2578eff4635c88132a39c22f5780d78aef2c81e","latt.py":"925c0fe996b19fd51fb79a85d5e4dba4bc2f5453d0a156cc1e480f65a6a00cc8","dp.py":"ca4e7c378d23c46c7def4716611135c471a831d15234b984fe30d58d9eec5734","qmdp.py":"63b8c35048718c37eb0a5dae9e70849fa3af257c335e4a2e3a625c833f1dc1eb","pol_mid.json":"efbb5ee102db4d312f64565d9bf7232b6becbe02b624164f744a402bbbf2983b","qm_k1e-5.json":"5ff53e42ca87390e5f65d1caa3f7a480e67a8212fb0670274dfd562b05ba1afd"},"artifacts_sha256_equals_url_suffix":{"qt1":"8a6e303b662e1a5ea9bb47f31acedd3988ef65b3ddb66d074517aa59ad41ca40","TC":"d3c849db2ac31e567b57e52b80b86e8c24c842e5b4125b9d75c78e3cb07115b9","COMBO":"d360bea6c8c982717b7b43a8069a87013169c89ee3e4da25622db4d880b936d4","QMS1":"17d249ab0c33fc44931d9b105cf3f9e3846a560bd518b67310c2a56defacdecc"},"extracted_sha256":{"qmref.py":"1dfc9b7a3c2237ff7a93dd9f0af54b9bdab16f2ce0a7eb00784cb4432598db92","twocomp.py":"9d3c1833321493fb51bbde4e1b4dabc2f8978bd6d774ee2af8dc8aed13f0f0af","combo.py":"c5b711a0b4fb4783e8879a484bf87a427171f4a11aa5eb5ec3513c24ead1a796","blob.bin":"3ac7cb8811ecfb6a17f499aa4e9b70dd55f7fb6432b3aec3b904e11a3dece38e","qt1_Strategy.sol":"c68887cff61180e12ba2b1ceb333edf76a830f91f63b5d775a8806fb9ec08aca","match_published":"qmref.py 1dfc9b7a... and blob 3ac7cb88... as published in the COMBO and qt1 artifacts; twocomp.py 9d3c1833... and combo.py c5b711a0... as published in COMBO; Strategy.sol (fenced block + trailing newline, 42,990 bytes) c68887cf... as given in the brief. TC's embedded QMRef differs from qmref.py only by its first comment line."},"own_code_sha256":{"fp.py":"bddc2e5ef46ae1d230962bf211b1c303ede9c626bd048ef6486252468d6054bf","pols.py":"7aad30db5d8428ba233f6de080ef75b3ca10af9650b9fedd514490335147111f","run.py":"62602ed5011c1baf8db9c6dae2b7ad72f6b0694b83a84086dfe8f2af17192e4b","st.py":"903e6559e292abb2796060cfbb59b867d02045a4d333682af547aabaa9a96dd9","solve_ck.py":"d394ece498d09add56d1bdb00dea825ffb62c0cc642c8af8e93962c89ce4e59d","tests.py":"5b08c1ce84036a98f965d89ba9dfdd6f9df2db1ae98313587598b7171e21dd65","tests_b.py":"0699f0e6c6f1b932e569bb597030cf4af55ab724ae3951e7a8cb7c59ea64ab4b","diag1.py":"16e3202dfad7354df7ca5b7565681b8f5e7b15f0f3dfb3de91260317643f7f57"},"freeze_manifest":{"written_utc":"2026-11-10T08:48:00Z","note":"sha256sum of code, tables and the choose rows, written after the choose selection and before the first report-seed run of any candidate. st.py (statistics only) had the credit added to its header line after the freeze, so its hash under own_code_sha256 differs from the manifest line; no policy, runner or table file changed; the manifest also listed w/qmref.py, w/twocomp.py, w/combo.py, w/blob.bin and the three VN files with the sha256 values given under extracted_sha256 and regeneration.VN.sha256","lines":["bddc2e5ef46ae1d230962bf211b1c303ede9c626bd048ef6486252468d6054bf  fp.py","7aad30db5d8428ba233f6de080ef75b3ca10af9650b9fedd514490335147111f  pols.py","62602ed5011c1baf8db9c6dae2b7ad72f6b0694b83a84086dfe8f2af17192e4b  run.py","f620bd4fab7c62df58f9f6f3aa8b7d67ce80ae03c6ef00811681ae4816ea8e10  st.py","d394ece498d09add56d1bdb00dea825ffb62c0cc642c8af8e93962c89ce4e59d  solve_ck.py","5b08c1ce84036a98f965d89ba9dfdd6f9df2db1ae98313587598b7171e21dd65  tests.py","f8c03dc52eb062f12bf2afa840ed4e3996458a22bde75848b5aee3b7b405ef4b  choose_base.jsonl","9905c6273dfedacc1bed2e6d6f5cc5bb11e13c8ba3bcea627c6933b2b5e93d1d  choose_C.jsonl"]}},"P_output":{"command":"python3 -I gates.py (unmodified checkout, CPython 3.12.3, 6.0 s)","stdout":["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"],"matches_README_6dp":true,"qt1_QMRef_seeds_10000_10002":["443.101741","571.454483","525.908441"],"qt1_expected":["443.101741","571.454483","525.908441"],"qt1_is":"QMRef('blob.bin') from the qt1 artifact, not RealPolicy","qt1_error_counter_wrapper_identical_edges":true},"objective":{"C":"On every own-pool callback, after the filter/rival/phase update: (ask*, bid*) = argmax over feasible absolute quotes (fee >= 0 on each side) of U(ask, bid) = sum_e P(e) * V_N[phase(e)](w - e, w2(e), a - e, b + e) + kappa * hfac * IG(ask, bid). e runs over price hypotheses on the 5 bps DP lattice anchored at xref (the arb reading on an ambiguous first trade, else the posterior's mode cell); P(e) is the 121-cell 2.5 bps lattice posterior re-binned linearly onto that lattice; w = ln(own spot) - xref and (a, b) = (ln ask - xref, xref - ln bid) in lattice units, so every hypothesis sees the SAME absolute quote with its own state/action shift. V_N is interpolated linearly in w (two rows, quotes held fixed relative to price) and in the rival coordinate (two columns). The maximum is taken after the sum; optimal quotes are never averaged. A parabola through the argmax and its neighbours refines each side (as dp.refine/qmdp.qtab).","rival_phase_rules":"COMBO's: carried s2h, synced, cnt, sp, tlast and fees exactly as COMBO/TwoComp (band clip against the posterior mean at a first trade, router identity on trades read as retail). Per hypothesis: ambiguous first trade (1-hard < pi < hard) -> arb branch (weight pi, point at lp): phase 0, rival = pre-step s2h clipped to that price's band; retail branch (weight (1-pi) x cut posterior cell): phase 1, rival = pre-step s2h clipped to the cell price's band, then moved by this fill if the router identity beats it (its own synced decision). Every other callback: phase from cnt; rival displacement ln s2h - x_e when synced, clipped to +-30 bps when not (qmdp modes s/c).","information_term":"IG = expected drop of belief variance (bps^2) at the next step boundary, computed as qmdp.igtab but on the true lattice posterior convolved with latt.py's kernel; hfac = sum_e P(e) (1 - h[phase(e)]) with dp.phase_probs(0.8). kappa is the one selected parameter.","Cflag":"identical code and settings; at a step's first own trade pi = float(bool(arb)) immediately after the likelihood, before posterior/rival/phase/quote updates; other callbacks unchanged. Flag = ComboFlag = combo.py with that one line inserted (patch below). Both are oracle-only diagnostics.","Ctrl":"control with the identical posterior code (the same numba filt()) and COMBO's mean/sd-table quoting on the QMS1 tables: pi-weighted branch offsets on ambiguous first trades, lookup at the posterior mean and sd otherwise. C-Ctrl isolates quoting; Ctrl-COMBO isolates the filter change (lattice vs TwoComp). CtrlFlag is Ctrl with the flag.","not_a_bound":"V_N is the perfect-information value, so the objective assumes the price is known from the next decision on (QMDP). It is an approximation, not a rigorous upper bound on what real observables allow."},"params":{"selected":{"kappa":5e-06,"hard":0.999,"rho":0.26,"cells":121,"cell_bps":2.5,"dp_lattice_bps":5,"AMINL":-12,"NA":43,"silent_step_cap":30,"sigma_bps":9.45,"fill_law":"lognormal median 11.12 bps, log-sd 1.176"},"selection_rule":"kappa chosen by live C-COMBO on the full choose window 64000..65023 among the grid below; Cflag uses the same settings. Everything else is latt.py / dp.py / COMBO defaults and was not tuned.","choose_grid_C_minus_COMBO":[{"pair":"C(kappa=2.5e-6)-COMBO","n":1024,"complete":true,"mean_diff":0.400204,"se":0.017446,"worst5":[[64326,-1.787961],[64600,-1.261765],[64678,-1.17289],[64161,-1.170792],[64568,-1.148775]]},{"pair":"C(kappa=5e-6)-COMBO","n":1024,"complete":true,"mean_diff":0.411819,"se":0.016819,"worst5":[[64326,-2.062885],[64715,-1.631935],[64600,-1.298243],[64568,-1.271591],[64114,-1.161465]]},{"pair":"C(kappa=7.5e-6)-COMBO","n":1024,"complete":true,"mean_diff":0.401888,"se":0.01665,"worst5":[[64326,-2.133424],[64568,-1.501258],[64151,-1.220088],[64044,-1.206992],[64715,-1.192472]]},{"pair":"C(kappa=1e-5)-COMBO","n":1024,"complete":true,"mean_diff":0.329008,"se":0.017155,"worst5":[[64326,-2.176997],[64568,-1.569078],[64901,-1.318541],[64715,-1.245946],[64151,-1.232983]]}],"dev_prescreen_62000_62127":{"note":"used only to place the kappa grid; seeds disjoint from choose and report","rows":[{"pair":"C(kappa=0)-COMBO","n":128,"mean_diff":0.203829,"se":0.052115},{"pair":"C(kappa=5e-6)-COMBO","n":128,"mean_diff":0.363146,"se":0.048784},{"pair":"C(kappa=1e-5)-COMBO","n":128,"mean_diff":0.291377,"se":0.04652},{"pair":"C(kappa=1.5e-5)-COMBO","n":128,"mean_diff":0.031833,"se":0.052664},{"pair":"C(kappa=2e-5)-COMBO","n":128,"mean_diff":-0.345104,"se":0.057138},{"pair":"Ctrl-COMBO","n":128,"mean_diff":0.023425,"se":0.032615}]}},"choose":{"window":"64000..65023","paired":[{"pair":"C-COMBO","n":1024,"complete":true,"mean_diff":0.411819,"se":0.016819,"worst5":[[64326,-2.062885],[64715,-1.631935],[64600,-1.298243],[64568,-1.271591],[64114,-1.161465]]},{"pair":"C-qt1","n":1024,"complete":true,"mean_diff":1.021424,"se":0.020743,"worst5":[[64101,-2.158313],[64859,-0.79321],[64190,-0.774948],[64053,-0.735262],[64458,-0.698223]]},{"pair":"Cflag-Flag","n":1024,"complete":true,"mean_diff":0.121876,"se":0.011755,"worst5":[[64568,-1.289436],[64501,-1.114486],[64343,-0.91852],[64937,-0.912168],[64694,-0.903435]]},{"pair":"Cflag-COMBO","n":1024,"complete":true,"mean_diff":2.625254,"se":0.028119,"worst5":[[64003,-0.7779],[64901,-0.459113],[64132,0.035344],[64778,0.086017],[64490,0.254728]]},{"pair":"Cflag-qt1","n":1024,"complete":true,"mean_diff":3.234859,"se":0.031085,"worst5":[[64322,0.283197],[64101,0.38749],[64020,0.483178],[64593,0.583716],[64509,0.667375]]},{"pair":"C-Ctrl","n":1024,"complete":true,"mean_diff":0.346527,"se":0.016655,"worst5":[[64326,-2.748139],[64720,-2.173988],[64715,-1.534573],[64600,-1.230394],[64173,-1.135135]]},{"pair":"Ctrl-COMBO","n":1024,"complete":true,"mean_diff":0.065293,"se":0.011333,"worst5":[[64044,-1.421291],[64522,-1.022142],[64225,-1.021018],[64087,-0.927819],[64839,-0.892367]]},{"pair":"Ctrl-qt1","n":1024,"complete":true,"mean_diff":0.674897,"se":0.0197,"worst5":[[64101,-2.281743],[64522,-1.47696],[64245,-1.242384],[64590,-1.231896],[64859,-0.96336]]},{"pair":"Cflag-CtrlFlag","n":1024,"complete":true,"mean_diff":0.108567,"se":0.011665,"worst5":[[64568,-1.299098],[64937,-1.220462],[64694,-1.158284],[64501,-1.060081],[64353,-0.901374]]},{"pair":"CtrlFlag-Flag","n":1024,"complete":true,"mean_diff":0.013309,"se":0.003648,"worst5":[[64356,-0.523874],[64629,-0.506718],[64220,-0.494462],[64048,-0.463132],[64489,-0.395019]]},{"pair":"COMBO-qt1","n":1024,"complete":true,"mean_diff":0.609605,"se":0.019401,"worst5":[[64101,-2.776983],[64845,-1.163868],[64374,-1.023434],[64795,-0.983171],[64555,-0.946189]]},{"pair":"Flag-COMBO","n":1024,"complete":true,"mean_diff":2.503378,"se":0.02856,"worst5":[[64901,-1.316929],[64003,-1.15932],[64132,-0.028623],[64778,0.009376],[64150,0.051428]]},{"pair":"Flag-qt1","n":1024,"complete":true,"mean_diff":3.112983,"se":0.030987,"worst5":[[64322,0.08756],[64509,0.148183],[64593,0.208364],[64109,0.570966],[64636,0.581355]]},{"pair":"Cflag-C","n":1024,"complete":true,"mean_diff":2.213435,"se":0.028613,"worst5":[[64003,-0.824387],[64778,-0.779767],[64703,-0.463407],[64901,-0.242246],[64484,-0.183291]]}],"policies":{"C":{"n":1024,"seed_min":64000,"seed_max":65023,"gaps":false,"mean_edge":536.741919,"first_call_errors":{"wrong":1134071,"total":7191116,"rate":0.1577},"rows_sha256":"2ab189dc2e10552af269cb4108f391c98a309de5895ff0352e1c177408959b53"},"Cflag":{"n":1024,"seed_min":64000,"seed_max":65023,"gaps":false,"mean_edge":538.955354,"first_call_errors":{"wrong":0,"total":7132305,"rate":0.0},"rows_sha256":"67f7436ff43550f0950a5a0415e6bb6a9531846c47f985b91ebb53e3dd6b8a2c"},"COMBO":{"n":1024,"seed_min":64000,"seed_max":65023,"gaps":false,"mean_edge":536.3301,"first_call_errors":{"wrong":1154223,"total":7201469,"rate":0.16028},"rows_sha256":"f7750384758b34c0b63b4113c9d2004034ab7b65ae2f8447ca4b237bb40874b1"},"Ctrl":{"n":1024,"seed_min":64000,"seed_max":65023,"gaps":false,"mean_edge":536.395393,"first_call_errors":{"wrong":1143363,"total":7197138,"rate":0.15886},"rows_sha256":"eb03155a5e32da348048713d8cd566d211c58baf71a33fb17b87b7c3811eb0e7"},"CtrlFlag":{"n":1024,"seed_min":64000,"seed_max":65023,"gaps":false,"mean_edge":538.846787,"first_call_errors":{"wrong":0,"total":7192302,"rate":0.0},"rows_sha256":"2fb88f7b3e880854981c9e4ef8da7c08aa542069e58cdd201c306ffe985cfdaa"},"Flag":{"n":1024,"seed_min":64000,"seed_max":65023,"gaps":false,"mean_edge":538.833479,"first_call_errors":{"wrong":0,"total":7192654,"rate":0.0},"rows_sha256":"7dbf162295ff5f54023e627b16f458249a0c5e01d9a4f8dd86a7937fa4f06f50"},"qt1":{"n":1024,"seed_min":64000,"seed_max":65023,"gaps":false,"mean_edge":535.720495,"first_call_errors":{"wrong":1239361,"total":7197347,"rate":0.1722},"rows_sha256":"2f30ab046aa7c0c17834cafc427e50e5d326fa7d1776f482baeed6ab3a32fff5"}},"coverage_complete":true,"posterior_numerics":{"C":{"runs":1024,"quotes":11221460,"max_hyp":41,"max_wsum_dev":0.0032082668980789597,"w_clamps":41508,"died":0,"ambiguous_first":6446127,"first":7191116,"mean_hyp_per_quote":15.316},"Cflag":{"runs":1024,"quotes":11047105,"max_hyp":39,"max_wsum_dev":2.1949109196839345e-12,"w_clamps":17104,"died":0,"ambiguous_first":0,"first":7132305,"mean_hyp_per_quote":6.013}}},"report":{"window":"10000..12047","paired":[{"pair":"C-COMBO","n":2048,"complete":true,"mean_diff":0.421303,"se":0.012069,"worst5":[[11701,-3.297309],[10822,-1.775378],[10942,-1.526736],[11048,-1.387052],[11911,-1.361245]]},{"pair":"C-qt1","n":2048,"complete":true,"mean_diff":1.018694,"se":0.014377,"worst5":[[10146,-2.347376],[10822,-2.168156],[11808,-1.379221],[10519,-1.332292],[11376,-1.185107]]},{"pair":"Cflag-Flag","n":2048,"complete":true,"mean_diff":0.105171,"se":0.008712,"worst5":[[11540,-2.626447],[12006,-2.013741],[11701,-1.361033],[10797,-1.311727],[10208,-1.245605]]},{"pair":"Cflag-COMBO","n":2048,"complete":true,"mean_diff":2.67529,"se":0.021282,"worst5":[[11701,-2.499738],[11693,-0.897214],[11519,-0.67813],[10731,-0.309788],[11911,-0.243216]]},{"pair":"Cflag-qt1","n":2048,"complete":true,"mean_diff":3.272681,"se":0.022819,"worst5":[[11062,-0.643108],[11701,-0.140637],[11808,0.170575],[11519,0.227687],[10731,0.248658]]},{"pair":"C-Ctrl","n":2048,"complete":true,"mean_diff":0.345436,"se":0.01145,"worst5":[[11701,-2.550763],[10822,-2.055844],[11488,-1.876343],[10942,-1.731219],[11827,-1.538953]]},{"pair":"Ctrl-COMBO","n":2048,"complete":true,"mean_diff":0.075867,"se":0.008241,"worst5":[[10335,-1.381199],[10772,-1.368529],[10795,-1.195548],[11332,-1.164743],[11624,-1.111776]]},{"pair":"Ctrl-qt1","n":2048,"complete":true,"mean_diff":0.673258,"se":0.013822,"worst5":[[11808,-1.946048],[10519,-1.649939],[11376,-1.475193],[10162,-1.404043],[10146,-1.369645]]},{"pair":"Cflag-CtrlFlag","n":2048,"complete":true,"mean_diff":0.100811,"se":0.008488,"worst5":[[11540,-2.217585],[12006,-1.945152],[11701,-1.391221],[10208,-1.319446],[10797,-1.30209]]},{"pair":"CtrlFlag-Flag","n":2048,"complete":true,"mean_diff":0.00436,"se":0.002582,"worst5":[[10852,-0.918055],[11510,-0.564178],[10369,-0.554335],[11939,-0.526347],[11318,-0.463878]]},{"pair":"COMBO-qt1","n":2048,"complete":true,"mean_diff":0.597391,"se":0.013388,"worst5":[[10146,-3.552497],[11062,-2.334849],[11808,-1.822738],[10519,-1.782691],[11376,-1.750296]]},{"pair":"Flag-COMBO","n":2048,"complete":true,"mean_diff":2.570119,"se":0.020763,"worst5":[[11701,-1.138705],[11519,-0.810231],[11911,-0.365037],[10578,-0.297158],[10367,-0.244856]]},{"pair":"Flag-qt1","n":2048,"complete":true,"mean_diff":3.16751,"se":0.022386,"worst5":[[11062,-1.300795],[10146,-0.016155],[11519,0.095586],[11376,0.277364],[10141,0.297378]]},{"pair":"Cflag-C","n":2048,"complete":true,"mean_diff":2.253987,"se":0.020678,"worst5":[[11821,-1.18525],[11519,-0.94892],[11407,-0.462887],[10923,-0.442572],[10731,-0.381655]]}],"policies":{"C":{"n":2048,"seed_min":10000,"seed_max":12047,"gaps":false,"mean_edge":534.281524,"first_call_errors":{"wrong":2276651,"total":14361984,"rate":0.15852},"rows_sha256":"04c3689685691a652697f343ffb59983e75484a8e2af42e28ffb022dca6d0916"},"Cflag":{"n":2048,"seed_min":10000,"seed_max":12047,"gaps":false,"mean_edge":536.535512,"first_call_errors":{"wrong":0,"total":14242413,"rate":0.0},"rows_sha256":"13e2890df55dc9610754a1c55f7156f81a321c538a9181cc49155bbf512e308b"},"COMBO":{"n":2048,"seed_min":10000,"seed_max":12047,"gaps":false,"mean_edge":533.860222,"first_call_errors":{"wrong":2318251,"total":14382447,"rate":0.16119},"rows_sha256":"76242bb3d068e4b29325ce7e64fb12121b61a127bfebb25e31bf92fe9e2d3d36"},"Ctrl":{"n":2048,"seed_min":10000,"seed_max":12047,"gaps":false,"mean_edge":533.936089,"first_call_errors":{"wrong":2294972,"total":14372698,"rate":0.15968},"rows_sha256":"86ea69f09c2aa51384bbabc0907f8aac0135a1194813e991f8c575b014db356b"},"CtrlFlag":{"n":2048,"seed_min":10000,"seed_max":12047,"gaps":false,"mean_edge":536.434701,"first_call_errors":{"wrong":0,"total":14363115,"rate":0.0},"rows_sha256":"012c401b4acd573a6ba15ef1d1d454b893eb175937096bbf41233de3048917b8"},"Flag":{"n":2048,"seed_min":10000,"seed_max":12047,"gaps":false,"mean_edge":536.430341,"first_call_errors":{"wrong":0,"total":14364018,"rate":0.0},"rows_sha256":"4bded265b49a4ab8f5e068c3263d026141d45443710160e65e8c797e7f1c1d12"},"qt1":{"n":2048,"seed_min":10000,"seed_max":12047,"gaps":false,"mean_edge":533.262831,"first_call_errors":{"wrong":2487830,"total":14374445,"rate":0.17307},"rows_sha256":"aa96d03c76ce4a986f5f2606450b540d691ae30eda805d8e39dbf2b1b92f200e"}},"coverage_complete":true,"posterior_numerics":{"C":{"runs":2048,"quotes":22391976,"max_hyp":42,"max_wsum_dev":0.005125266137450013,"w_clamps":77146,"died":0,"ambiguous_first":12880124,"first":14361984,"mean_hyp_per_quote":15.311},"Cflag":{"runs":2048,"quotes":22041125,"max_hyp":39,"max_wsum_dev":2.0504709041802016e-12,"w_clamps":31659,"died":0,"ambiguous_first":0,"first":14242413,"mean_hyp_per_quote":6.02}}},"row_hash_definition":"rows_sha256 = sha256 of '\\n'.join(f'{seed},{pol},{edge!r}') over the window's seeds in ascending order, pol being the runner name (qt1, combo, flag, ctrl, ctrlflag, C@5e-6, Cflag@5e-6), edge the float repr of replica2.run(seed, policy)['edge'].","first_call_errors_definition":"at each first own trade of a step (dt >= 1): wrong when (trade read as arb, pi > 0.5) != true arb flag; counted by wrappers that do not alter the policy (truth used for the count only). Flagged variants are 0 by construction.","controls":{"lattice_port":{"got":["443.663520","571.977293","526.411631"],"gates_lattice_qm":["443.663520","571.977293","526.411631"],"note":"numba filt() + Taylor's full qm_k1e-5.json through RealPolicy.lookup reproduces gates.py's lattice+qm column at 6 dp"},"point_mass_vs_pol_mid":{"phase0":{"states":4173,"max_abs_fee_diff_bps":0.00076,"n_over_0p01bps":0,"max_abs_fee_diff_bps_w_within_100bps":0.0005},"phase1":{"states":15729,"max_abs_fee_diff_bps":0.000791,"n_over_0p01bps":0,"max_abs_fee_diff_bps_w_within_100bps":0.00058},"phase2":{"states":15729,"max_abs_fee_diff_bps":0.000821,"n_over_0p01bps":0,"max_abs_fee_diff_bps_w_within_100bps":0.000596},"note":"quoteC under a point mass on every DP node (321 rows x 13/49/49 rival columns, kappa 0) against pol_mid.json fees; tables are rounded to 3 decimals"},"oracle_point_mass":{"quoteC":["448.230088","576.888218","531.877992"],"DPPolicy":["448.261189","576.779199","531.886497"],"note":"point mass at the true price and true rival through quoteC (kappa 0) vs DPPolicy(pol_mid.json), seeds 10000..10002: checks state/action shifts off-lattice. Oracle test, not a policy."},"hidden_input_invariance":{"C@5e-6/62000":{"edge":"357.46472167338925","edge_scrambled":"357.46472167338925","identical":true},"C@5e-6/62001":{"edge":"444.45887605830484","edge_scrambled":"444.45887605830484","identical":true},"ctrl/62000":{"edge":"358.5146006948573","edge_scrambled":"358.5146006948573","identical":true},"ctrl/62001":{"edge":"444.2468271967872","edge_scrambled":"444.2468271967872","identical":true}},"flagged_variant_reads_arb":{"edge":"359.85118864606204","edge_scrambled":"264.0229585526748","differs":true},"frozen_code_reproduces_choose_rows":{"checked":12,"all_identical":true},"live_inputs":"C and Ctrl read is_buy, timestamp and reserves only; init parameters, p, s2, j and arb are ignored (CPol passes arb=False into the filter unless flag=True)."},"numerical_errors":{"posterior_mass":"max_wsum_dev = max over quotes of |sum of hypothesis weights - 1| (mass that diffused off the +-150 bps lattice before the next renormalisation); died = beliefs with no mass left in the no-arb interval (restart at the arb reading, as latt.py); w_clamps = hypothesis evaluations with own displacement clamped to the +-800 bps table edge. Totals per window are under choose/report.posterior_numerics.","approximations":["posterior re-binned from 2.5 bps cells to the 5 bps DP lattice (linear split, mean preserving; adds up to 2.5 bps sd)","V_N stored as float32 (as dp.py saves it)","hypothesis offsets beyond the DP action grid (-60..+150 bps) are clamped as in qmdp.qtab","rival coordinate interpolated linearly between grid columns: against the bilinear table the point-mass quote differs by 0.17 to 0.21 bps median, at most 5.1 / 11.7 / 8.5 bps in phases 0 / 1 / 2 (diag1.py: 4000 random off-node states per phase, |w| <= 60 bps; the largest gaps sit where the rival is near its band edge or 45 to 60 bps away)","retail fill likelihood and rho are the fixed laws of real.py/latt.py; sigma and order rate are not estimated per run"],"vn_solve":"relative value iteration converged at sweep 110 (diff 1.88e-07 < 2e-07), gain 536.821"},"regeneration":{"VN":{"command":"DP_AMINL=-12 DP_NA=43 python3 -I solve_ck.py vn/pol_regen.json 380   (run twice: checkpoint at sweep 89 after 383 s, finished at sweep 110 after 100 s; 4 cores)","what":"solve_ck.py calls dp.py's own qnodes/znodes/phase_probs/build_geo/step_end/decide/build_G/passive/refine in solve()'s order (lam 0.8, sigma 9.45 bps, size 20; physics untouched) and only adds a resumable checkpoint so no command exceeds 8 minutes.","tables_identical_to_pol_mid_json":true,"gain":0.05368206098114671,"gain_in_pol_mid_json":0.05368206098114493,"sha256":{"pol_regen_VN0.npy":"dc602095804048829da58040ce5b40dee25b25edaeeba921f45033e9894072b6","pol_regen_VN1.npy":"871274b7f2ede9ee9f610c7dfaf7fe450d971259aec3cf4b74245d9cb79be0fd","pol_regen_VN2.npy":"7fa4b401dde383b3a37f2ba3f79edb63702ece1f4c059f8a486850cdbb32c086","pol_regen.json":"fafe2c68faec494c434339f78ae688bd281a3fd23f0921d0d63a39d9bd06ff04"},"shapes":"VN0 (321,13,43,43), VN1 and VN2 (321,49,43,43), float32"},"QMS1_tables":"decoded at load by qmref.py from blob.bin (sha256 3ac7cb88...), used by qt1, COMBO, Flag, Ctrl, CtrlFlag"},"patch_Flag":{"file":"combo.py (class Combo.on_trade)","old":"pi = la / (la + lr) if la + lr > 0 else 0.\\n            is_arb = pi > .5","new":"pi = la / (la + lr) if la + lr > 0 else 0.\\n            pi = float(bool(arb))\\n            is_arb = pi > .5","applied_by":"fp.combo_flag_cls() (asserts the old text occurs exactly once, execs the patched source)"},"commands":["git clone github.com/gtmcknight/amm-sim; git checkout 4812a6382311624e1506aca131ca35c378f930d9; curl the four artifacts; python3 -I extract.py (fenced blocks -> w/qmref.py, w/twocomp.py, w/combo.py, base64 -> w/blob.bin)","python3 -I gates.py                                   # 6.0 s, Gate P","python3 -m pip install --target pylib numpy numba     # numpy 2.5.4, numba 0.68.1","DP_AMINL=-12 DP_NA=43 python3 -I solve_ck.py vn/pol_regen.json 380   # 383 s + 100 s","python3 -I tests.py                                   # 12 s: T1 qt1, T2 lattice port, T3 point mass, T4 oracle point mass (+ smoke on dev seeds)","python3 -I run.py dev.jsonl 62000 62128 combo,ctrl,C@0,C@1e-5,C@2e-5 ; ... C@5e-6,C@1.5e-5      # 102 s + 56 s","python3 -I run.py choose_base.jsonl 64000 65024 qt1,combo,flag,ctrl                               # 274 s","python3 -I run.py choose_C.jsonl 64000 65024 C@2.5e-6,C@5e-6,C@7.5e-6,C@1e-5                      # 441 s + 451 s (resumed)","sha256sum ... > freeze.txt                                                                          # freeze","python3 -I run.py choose_flag.jsonl 64000 65024 Cflag@5e-6,ctrlflag                               # 172 s","python3 -I run.py report.jsonl 10000 12048 qt1,combo,flag,ctrl,ctrlflag,C@5e-6,Cflag@5e-6         # four resumed commands, each under 8 min","python3 -I tests_b.py ; python3 -I st.py <lo> <hi> <a/b,...> <files> ; python3 -I build.py"],"timings":{"machine":"4 cores, Linux x86_64, CPython 3.12.3","mean_seconds_per_run_report":{"C":0.872,"Cflag":0.421,"COMBO":0.311,"Ctrl":0.351,"CtrlFlag":0.249,"Flag":0.231,"qt1":0.191},"longest_command_s":451},"limitations":["Replica evidence only (Taylor's replica uses different RNG streams from the Rust engine); nothing here ran on the engine and no contract was written, as the item asks.","C is not plain-stdlib: it needs numpy + numba and 262 MB of V_N, run as system `python3 -I` with a local package directory on sys.path. qt1, COMBO and Flag run on the standard library as published.","C is not contract-shaped: 121 cells and a 43x43 search over V_N per callback are far beyond 245k gas. Its value is as a measurement of what full-posterior quoting adds over mean/sd tables.","Seeds 10000..10002 lie inside the report window. Before the freeze they were used for Gate P and for the reference-policy checks T1, T2 and T4 (qt1, the lattice port with Taylor's tables, and the perfect-information oracle point mass). T4 exposed a bug in the candidate range (offsets below the DP's -60 bps bound were returned as fee 0), fixed before any choose or report run. No live C/Ctrl/Cflag run touched a report seed before the freeze, and no setting was selected on report seeds.","Only kappa was selected (4 values on choose, placed by a 128-seed dev prescreen). hard, rho, the fill law, the anchoring and the interpolation scheme were fixed a priori and not explored; a different choice may do better or worse.","Working state is under test/scratch/ (this workspace's writable area) rather than scratch/, and is not delivered; everything needed to regenerate it is embedded under 'source'.","The thresholds for an 'ambiguous first trade' are latt.py's (hard 0.999), not COMBO's .005/.995; Ctrl uses the same thresholds as C so that C-Ctrl compares quoting on one posterior code path. The two policies still follow different trajectories because their quotes differ.","Each (seed, policy) was run once; the replica is deterministic, and 12 stored rows were re-run after the freeze and matched bit for bit."],"source":{"fp.py":"\"\"\"fp.py -- candidate C: quote by argmax of the posterior-weighted solved V_N over the full price-lattice posterior.\nCredit: Taylor (gtmcknight) -- replica2.py, dp.py (V_N), latt.py (121-cell lattice filter), real.py, qm tables\n(github.com/gtmcknight/amm-sim @4812a638, research/solved). qt1 reference (QMRef), TwoComp and COMBO are IdentityMD\nitems built on them. The lattice filter below is a numba port of latt.py's on_trade, statement for statement.\nNeeds numpy + numba (V_N is 262 MB of float32); replica2.run is called unmodified.\n\"\"\"\nimport sys, os, math\nHERE = os.path.dirname(os.path.abspath(__file__))\nSOLVED = os.path.join(HERE, 'src/amm-sim/research/solved')\nfor _d in (os.path.join(HERE, 'pylib'), SOLVED, os.path.join(HERE, 'w')):\n    if _d not in sys.path: sys.path.insert(0, _d)\nimport numpy as np\nfrom numba import njit\nimport replica2 as R\nfrom combo import Combo\n\nH = 5e-4; W0 = 160; NW = 321; FB = 6; AMINL = -12; NA = 43; N2 = 49\n_out = [14, 17, 20, 25, 30, 40, 50, 60, 80, 100, 130, 160]\nW2L = np.array([-v for v in _out[::-1]] + list(range(-12, 13)) + _out, dtype=np.float64)\nHC = 2.5e-4; NC = 121; N0 = NC // 2; SIG = 0.000945\n_s = SIG / HC; KM = int(math.ceil(4.0 * _s))\n_w = [math.exp(-0.5 * (k / _s) ** 2) for k in range(-KM, KM + 1)]; _t = sum(_w)\nKER = np.array([v / _t for v in _w])\nRHO = 0.26; LD_M = math.log(11.12e-4); LD_S = 1.176; G2 = 0.997; SQ2PI = 2.5066282746310002; LG = -math.log(G2)\nMAXF = 0.1\ndef _phase_probs(lam):\n    p0 = math.exp(-lam); p1 = lam * p0; h0 = 1.0 - p0; h1 = (1.0 - p0 - p1) / (1.0 - p0); h2 = 1.0 - h1 / (lam / h0 - 1.0)\n    return np.array([h0, h1, h2])\nHS = _phase_probs(0.8)\nEM = 80; NE = 2 * EM + 1; UM = 200\n# state slots\nC_, M_, V_, SP, FBQ, FAQ, S2H, TL, CNT, SYN, LO, HI, FIRST, AMB, PI, LP, MT, VT, OLD2, PH, ISARB, RC, RLO, RHI = range(24)\nNFIRST, NWRONG, NDIED, NAMB, NQ, SUMNH, MAXDW, NCLAMP, MAXNH, UGAP = range(24, 34)\nNST = 40\n\n\n@njit(cache=True)\ndef w2pos(v):\n    if v <= W2L[0]: return 0.0\n    if v >= W2L[N2 - 1]: return float(N2 - 1)\n    lo = 0; hi = N2 - 1\n    while hi - lo > 1:\n        mid = (lo + hi) // 2\n        if W2L[mid] <= v: lo = mid\n        else: hi = mid\n    return lo + (v - W2L[lo]) / (W2L[hi] - W2L[lo])\n\n\n@njit(cache=True)\ndef _diffuse_into(P, T, lo_i, hi_i):\n    for j in range(NC): T[j] = 0.0\n    for i in range(lo_i, hi_i + 1):\n        pv = P[i]\n        if pv <= 1e-15: continue\n        j0 = i - KM\n        for k in range(2 * KM + 1):\n            j = j0 + k\n            if j >= 0 and j < NC: T[j] += pv * KER[k]\n\n\n@njit(cache=True)\ndef _diffuse(P, T, st):\n    lo_i = int(st[LO]); hi_i = int(st[HI])\n    _diffuse_into(P, T, lo_i, hi_i)\n    for j in range(NC): P[j] = T[j]\n    st[LO] = max(0, lo_i - KM); st[HI] = min(NC - 1, hi_i + KM)\n\n\n@njit(cache=True)\ndef _cut(P, st, lo, hi):\n    c = st[C_]; tot = 0.0\n    for i in range(int(st[LO]), int(st[HI]) + 1):\n        if P[i] == 0.0: continue\n        x0 = c + (i - N0 - 0.5) * HC; x1 = x0 + HC\n        a = lo if lo > x0 else x0; b = hi if hi < x1 else x1\n        f = (b - a) / HC\n        if f <= 0.0: P[i] = 0.0\n        else:\n            if f < 1.0: P[i] *= f\n            tot += P[i]\n    return tot\n\n\n@njit(cache=True)\ndef _norm(P, st, tot):\n    if tot <= 1e-300: return False\n    inv = 1.0 / tot; lo = -1; hi = -1\n    for i in range(int(st[LO]), int(st[HI]) + 1):\n        if P[i] > 0.0:\n            P[i] *= inv\n            if P[i] < 1e-12: P[i] = 0.0\n            else:\n                if lo < 0: lo = i\n                hi = i\n    if lo < 0: return False\n    st[LO] = lo; st[HI] = hi\n    return True\n\n\n@njit(cache=True)\ndef _dens(P, st, x):\n    pos = (x - st[C_]) / HC + N0\n    i = int(math.floor(pos)); f = pos - i\n    if i < 0 or i >= NC - 1: return 0.0\n    return (P[i] * (1 - f) + P[i + 1] * f) / HC\n\n\n@njit(cache=True)\ndef _moments(P, st):\n    m = 0.0; tot = 0.0; lo = int(st[LO]); hi = int(st[HI])\n    for i in range(lo, hi + 1):\n        m += P[i] * (i - N0); tot += P[i]\n    if tot <= 0.0:\n        st[M_] = st[C_]; st[V_] = 0.0; return\n    m /= tot; v = 0.0\n    for i in range(lo, hi + 1): v += P[i] * (i - N0 - m) ** 2\n    v /= tot\n    st[M_] = st[C_] + m * HC; st[V_] = v * HC * HC\n\n\n@njit(cache=True)\ndef _recentre(P, T, st, cnew):\n    sh = (cnew - st[C_]) / HC; lo = int(st[LO]); hi = int(st[HI])\n    for j in range(NC): T[j] = 0.0\n    for i in range(lo, hi + 1):\n        if P[i] == 0.0: continue\n        pos = i - sh; j = int(math.floor(pos)); f = pos - j\n        if j >= 0 and j < NC: T[j] += P[i] * (1 - f)\n        if j + 1 >= 0 and j + 1 < NC: T[j + 1] += P[i] * f\n    for j in range(NC): P[j] = T[j]\n    st[C_] = cnew\n    st[LO] = max(0, int(math.floor(lo - sh)) - 1); st[HI] = min(NC - 1, int(math.ceil(hi - sh)) + 1)\n\n\n@njit(cache=True)\ndef _pin(P, st, x):\n    st[C_] = x\n    for j in range(NC): P[j] = 0.0\n    P[N0] = 1.0; st[LO] = N0; st[HI] = N0\n\n\n@njit(cache=True)\ndef _deposit(P, st, x, w):\n    pos = (x - st[C_]) / HC + N0\n    i = int(math.floor(pos)); f = pos - i\n    if i >= 0 and i < NC:\n        P[i] += w * (1 - f); st[LO] = min(st[LO], i); st[HI] = max(st[HI], i)\n    if i + 1 >= 0 and i + 1 < NC:\n        P[i + 1] += w * f; st[LO] = min(st[LO], i + 1); st[HI] = max(st[HI], i + 1)\n\n\n@njit(cache=True)\ndef filt(st, P, T, PR, is_buy, s, t, flag, arb, hard):\n    \"\"\"latt.py's on_trade up to (not including) the quote. flag=True: pi := float(arb) right after the likelihood.\"\"\"\n    dt = t - st[TL]; is_arb = False; amb = 0.0; st[FIRST] = 0.0\n    if dt >= 1:\n        st[FIRST] = 1.0; st[CNT] = 0.0\n        lo = math.log(st[SP] * (1.0 - st[FBQ])); hi = math.log(st[SP] / (1.0 - st[FAQ]))\n        ok = True; n = int(dt) - 1\n        if n > 30: n = 30\n        for _ in range(n):\n            _diffuse(P, T, st)\n            ok = _norm(P, st, _cut(P, st, lo, hi))\n            if not ok: break\n        if ok: _diffuse(P, T, st)\n        lp = math.log(s * (1.0 - st[FBQ])) if is_buy else math.log(s / (1.0 - st[FAQ]))\n        st[OLD2] = st[S2H]; st[LP] = lp\n        if not ok:\n            _pin(P, st, lp); pi = 1.0; st[NDIED] += 1\n            if flag: pi = 1.0 if arb else 0.0\n        else:\n            l_arb = _dens(P, st, lp)\n            d = abs(math.log(s / st[SP]))\n            if d < 1e-9: d = 1e-9\n            Z = _cut(P, st, lo, hi)\n            zz = (math.log(d) - LD_M) / LD_S\n            l_ret = Z * RHO * (math.exp(-0.5 * zz * zz) / SQ2PI) / (d * LD_S)\n            pi = l_arb / (l_arb + l_ret) if (l_arb + l_ret) > 0 else 1.0\n            if flag: pi = 1.0 if arb else 0.0\n            if pi >= hard or Z <= 1e-300: _pin(P, st, lp)\n            elif pi <= 1.0 - hard: _norm(P, st, Z)\n            else:\n                _norm(P, st, Z)\n                for j in range(NC): PR[j] = P[j]\n                st[RC] = st[C_]; st[RLO] = st[LO]; st[RHI] = st[HI]\n                _moments(P, st); st[MT] = st[M_]; st[VT] = st[V_]\n                amb = 1.0; st[NAMB] += 1\n                for i in range(int(st[LO]), int(st[HI]) + 1): P[i] *= (1.0 - pi)\n                if pi > 0.5: _recentre(P, T, st, lp)\n                _deposit(P, st, lp, pi)\n        is_arb = pi > 0.5\n        st[PI] = pi; st[NFIRST] += 1\n        if is_arb != arb: st[NWRONG] += 1\n        _moments(P, st)\n        if abs(st[M_] - st[C_]) > 40 * HC:\n            _recentre(P, T, st, st[M_]); _moments(P, st)\n        pe = math.exp(st[M_])\n        if st[S2H] < pe * G2: st[S2H] = pe * G2\n        elif st[S2H] > pe / G2: st[S2H] = pe / G2\n        st[SYN] = 0.0\n    if not is_arb:\n        if is_buy:\n            cand = s * (1.0 - st[FBQ]) / G2\n            if cand < st[S2H]:\n                st[S2H] = cand; st[SYN] = 1.0\n        else:\n            cand = s * G2 / (1.0 - st[FAQ])\n            if cand > st[S2H]:\n                st[S2H] = cand; st[SYN] = 1.0\n        st[CNT] += 1\n        phs = 1 if st[CNT] <= 1 else 2\n    else:\n        phs = 0\n    st[TL] = t; st[SP] = s; st[PH] = phs; st[AMB] = amb; st[ISARB] = 1.0 if is_arb else 0.0\n\n\n@njit(cache=True)\ndef quoteC(st, P, T, PR, WA, WB, U, SS, VN0, VN1, VN2, is_buy, s, kap):\n    \"\"\"argmax over one feasible absolute (ask, bid) of sum_e P(e) V_N[phase(e)](w - e, w2(e), a - e, b + e) [+ kap IG].\n    Hypotheses e sit on the 5 bps lattice anchored at xref (the arb reading / the posterior mode cell);\n    the same absolute quote is evaluated for every e, then maximised. Fees in force (st[FBQ], st[FAQ]) are still the old ones here.\"\"\"\n    ls = math.log(s); amb = st[AMB] > 0.0; phs = int(st[PH])\n    for e in range(NE):\n        WA[e] = 0.0; WB[e] = 0.0\n    if amb:\n        pi = st[PI]; xref = st[LP]; WA[EM] = pi; rc = st[RC]\n        for i in range(int(st[RLO]), int(st[RHI]) + 1):\n            pv = PR[i]\n            if pv <= 0.0: continue\n            e = (rc + (i - N0) * HC - xref) / H\n            e0 = int(math.floor(e)); fe = e - e0; b0 = e0 + EM\n            if b0 < 0: b0 = 0\n            if b0 > NE - 2: b0 = NE - 2\n            WB[b0] += (1.0 - pi) * pv * (1.0 - fe); WB[b0 + 1] += (1.0 - pi) * pv * fe\n    else:\n        lo_i = int(st[LO]); hi_i = int(st[HI]); imax = lo_i; pm = -1.0\n        for i in range(lo_i, hi_i + 1):\n            if P[i] > pm:\n                pm = P[i]; imax = i\n        xref = st[C_] + (imax - N0) * HC\n        for i in range(lo_i, hi_i + 1):\n            pv = P[i]\n            if pv <= 0.0: continue\n            d2 = i - imax\n            if d2 % 2 == 0:\n                b0 = d2 // 2 + EM\n                if b0 < 0: b0 = 0\n                if b0 > NE - 1: b0 = NE - 1\n                WB[b0] += pv\n            else:\n                b0 = (d2 - 1) // 2 + EM\n                if b0 < 0: b0 = 0\n                if b0 > NE - 2: b0 = NE - 2\n                WB[b0] += 0.5 * pv; WB[b0 + 1] += 0.5 * pv\n    emin = NE; emax = -1\n    for e in range(NE):\n        if WA[e] > 1e-12 or WB[e] > 1e-12:\n            if emin == NE: emin = e\n            emax = e\n    if emax < 0:\n        emin = EM; emax = EM; WB[EM] = 1.0\n    wref = (ls - xref) / H; F = int(math.floor(wref)); f = wref - F\n    a_lo = F if F > AMINL else AMINL; a_hi = 30 + (emax - EM)\n    if a_hi < a_lo: a_hi = a_lo\n    NJ = a_hi - a_lo + 1\n    if NJ > UM: NJ = UM\n    b_lo = -F - 1 if -F - 1 > AMINL else AMINL; b_hi = 30 - (emin - EM)\n    if b_hi < b_lo: b_hi = b_lo\n    NI = b_hi - b_lo + 1\n    if NI > UM: NI = UM\n    for j in range(NJ):\n        for i in range(NI): U[j, i] = 0.0\n    lold = math.log(st[OLD2]) if amb else 0.0\n    ls2 = math.log(st[S2H])\n    candl = math.log(s * (1.0 - st[FBQ]) / G2) if is_buy else math.log(s * G2 / (1.0 - st[FAQ]))\n    hfac = 0.0; wsum = 0.0; nh = 0\n    for eb in range(emin, emax + 1):\n        e = eb - EM; xe = xref + e * H\n        pw = wref - e + W0\n        if pw < 0.0:\n            pw = 0.0; st[NCLAMP] += 1\n        if pw > NW - 1:\n            pw = float(NW - 1); st[NCLAMP] += 1\n        iw = int(pw)\n        if iw > NW - 2: iw = NW - 2\n        fw = pw - iw\n        for grp in range(2):\n            wgt = WA[eb] if grp == 0 else WB[eb]\n            if wgt <= 1e-12: continue\n            nh += 1\n            if grp == 0:            # ambiguous first trade, arb branch: phase 0, rival clipped to the band of this price\n                ph = 0; r = (lold - xe) / H\n                if r < -FB: r = -float(FB)\n                if r > FB: r = float(FB)\n            elif amb:               # ambiguous first trade, retail branch: phase 1, band clip from the pre-step rival, then this fill\n                ph = 1; r = lold - xe\n                if r < -LG: r = -LG\n                if r > LG: r = LG\n                if is_buy:\n                    if candl < xe + r: r = candl - xe\n                else:\n                    if candl > xe + r: r = candl - xe\n                r = r / H\n            else:\n                ph = phs; r = (ls2 - xe) / H\n                if ph == 0 or st[SYN] == 0.0:\n                    if r < -FB: r = -float(FB)\n                    if r > FB: r = float(FB)\n            if ph == 0:\n                V = VN0; p2 = r + FB; n2 = 2 * FB + 1\n            elif ph == 1:\n                V = VN1; p2 = w2pos(r); n2 = N2\n            else:\n                V = VN2; p2 = w2pos(r); n2 = N2\n            c0 = int(p2)\n            if c0 > n2 - 2: c0 = n2 - 2\n            g = p2 - c0\n            w00 = wgt * (1 - fw) * (1 - g); w01 = wgt * (1 - fw) * g; w10 = wgt * fw * (1 - g); w11 = wgt * fw * g\n            Va = V[iw, c0]; Vb = V[iw, c0 + 1]; Vc = V[iw + 1, c0]; Vd = V[iw + 1, c0 + 1]\n            for j in range(NJ):\n                ia = a_lo + j - e - AMINL\n                if ia < 0: ia = 0\n                if ia > NA - 1: ia = NA - 1\n                for i in range(NI):\n                    ib = b_lo + i + e - AMINL\n                    if ib < 0: ib = 0\n                    if ib > NA - 1: ib = NA - 1\n                    U[j, i] += w00 * Va[ia, ib] + w01 * Vb[ia, ib] + w10 * Vc[ia, ib] + w11 * Vd[ia, ib]\n            hfac += wgt * (1.0 - HS[ph]); wsum += wgt\n    st[NQ] += 1; st[SUMNH] += nh\n    if nh > st[MAXNH]: st[MAXNH] = nh\n    if abs(wsum - 1.0) > st[MAXDW]: st[MAXDW] = abs(wsum - 1.0)\n    if kap != 0.0:\n        # information term as qmdp.igtab, on the true lattice posterior: expected drop of belief variance (bps^2) at the next step boundary\n        _diffuse_into(P, T, int(st[LO]), int(st[HI]))\n        c = st[C_]; SS[0, 0] = 0.0; SS[1, 0] = 0.0; SS[2, 0] = 0.0\n        for n in range(NC):\n            x = (c + (n - N0) * HC - ls) * 1e4\n            SS[0, n + 1] = SS[0, n] + T[n]; SS[1, n + 1] = SS[1, n] + T[n] * x; SS[2, n + 1] = SS[2, n] + T[n] * x * x\n        tot = SS[0, NC]\n        if tot > 0.0:\n            mu = SS[1, NC] / tot; v0 = SS[2, NC] / tot - mu * mu\n            for j in range(NJ):\n                fal = a_lo + j - wref\n                if fal < 0.0: fal = 0.0\n                hi_n = int(math.floor((ls + fal * H - c) / HC + N0))\n                if hi_n > NC - 1: hi_n = NC - 1\n                for i in range(NI):\n                    fbl = b_lo + i + wref\n                    if fbl < 0.0: fbl = 0.0\n                    lo_n = int(math.ceil((ls - fbl * H - c) / HC + N0))\n                    if lo_n < 0: lo_n = 0\n                    ig = v0\n                    if hi_n >= lo_n:\n                        ps = SS[0, hi_n + 1] - SS[0, lo_n]\n                        if ps > 1e-12 * tot:\n                            m1 = (SS[1, hi_n + 1] - SS[1, lo_n]) / ps\n                            var = (SS[2, hi_n + 1] - SS[2, lo_n]) / ps - m1 * m1\n                            if var < 0.0: var = 0.0\n                            ig = v0 - ps / tot * var\n                    U[j, i] += kap * hfac * ig\n    best = -1e300; bj = 0; bi = 0\n    for j in range(NJ):\n        for i in range(NI):\n            if U[j, i] > best:\n                best = U[j, i]; bj = j; bi = i\n    fal = a_lo + bj - wref\n    if fal < 0.0: fal = 0.0\n    if bj >= 1 and bj < NJ - 1:\n        fprev = a_lo + bj - 1 - wref\n        if fprev < 0.0: fprev = 0.0\n        h1 = fal - fprev\n        if h1 > 0.2:\n            vm = U[bj - 1, bi]; v0_ = U[bj, bi]; vp = U[bj + 1, bi]\n            d2_ = h1 * (vp - v0_) - (v0_ - vm)\n            if d2_ < 0.0:\n                dd = -0.5 * (h1 * h1 * (vp - v0_) + (v0_ - vm)) / d2_\n                if dd > 0.5: dd = 0.5\n                if dd < -0.5 * h1: dd = -0.5 * h1\n                fal += dd\n    fbl = b_lo + bi + wref\n    if fbl < 0.0: fbl = 0.0\n    if bi >= 1 and bi < NI - 1 and fbl > 0.0:\n        fprev = b_lo + bi - 1 + wref\n        if fprev < 0.0: fprev = 0.0\n        h1 = fbl - fprev\n        if h1 > 0.2:\n            vm = U[bj, bi - 1]; v0_ = U[bj, bi]; vp = U[bj, bi + 1]\n            d2_ = h1 * (vp - v0_) - (v0_ - vm)\n            if d2_ < 0.0:\n                dd = -0.5 * (h1 * h1 * (vp - v0_) + (v0_ - vm)) / d2_\n                if dd > 0.5: dd = 0.5\n                if dd < -0.5 * h1: dd = -0.5 * h1\n                fbl += dd\n    fa = 1.0 - math.exp(-fal * H); fb = 1.0 - math.exp(-fbl * H)\n    st[FBQ] = fb if fb < MAXF else MAXF; st[FAQ] = fa if fa < MAXF else MAXF\n    return fb, fa\n\n\n@njit(cache=True)\ndef cbC(st, P, T, PR, WA, WB, U, SS, VN0, VN1, VN2, is_buy, s, t, flag, arb, hard, kap):\n    filt(st, P, T, PR, is_buy, s, t, flag, arb, hard)\n    return quoteC(st, P, T, PR, WA, WB, U, SS, VN0, VN1, VN2, is_buy, s, kap)\n\n\ndef new_state():\n    st = np.zeros(NST); P = np.zeros(NC); P[N0] = 1.0\n    st[C_] = math.log(100.0); st[M_] = st[C_]; st[SP] = 100.0; st[S2H] = 100.0; st[LO] = N0; st[HI] = N0\n    st[FBQ] = 0.003; st[FAQ] = 0.003; st[OLD2] = 100.0\n    return st, P\n\n\n_VN = None\ndef load_vn(prefix=os.path.join(HERE, 'vn/pol_regen')):\n    global _VN\n    if _VN is None: _VN = tuple(np.ascontiguousarray(np.load(prefix + f'_VN{j}.npy')) for j in range(3))\n    return _VN\n\n\nclass CPol:\n    \"\"\"Candidate C (flag=False: live, uses own callbacks only) / Cflag (flag=True: oracle-only diagnostic).\"\"\"\n    wants_j = True\n    def __init__(self, kap=0.0, hard=0.999, flag=False):\n        self.VN = load_vn(); self.kap = float(kap); self.hard = float(hard); self.flag = bool(flag)\n        self.st, self.P = new_state(); self.T = np.zeros(NC); self.PR = np.zeros(NC)\n        self.WA = np.zeros(NE); self.WB = np.zeros(NE); self.U = np.zeros((UM, UM)); self.SS = np.zeros((3, NC + 1))\n    def init(self, *a):\n        return quoteC(self.st, self.P, self.T, self.PR, self.WA, self.WB, self.U, self.SS, self.VN[0], self.VN[1], self.VN[2], False, 100.0, self.kap)\n    def on_trade(self, is_buy, ax, ay, t, x, y, arb=False, p=100., s2=100., j=0):\n        return cbC(self.st, self.P, self.T, self.PR, self.WA, self.WB, self.U, self.SS, self.VN[0], self.VN[1], self.VN[2],\n                   bool(is_buy), y / x, float(t), self.flag, bool(arb) if self.flag else False, self.hard, self.kap)\n    def errs(self):   # wrong count needs the truth: only filled for the flagged variant here; live variant is counted by ErrWrap\n        return int(self.st[NWRONG]), int(self.st[NFIRST])\n    def diag(self):\n        s = self.st\n        return dict(nq=int(s[NQ]), mean_hyp=s[SUMNH] / max(1.0, s[NQ]), max_hyp=int(s[MAXNH]), max_wsum_dev=float(s[MAXDW]),\n                    w_clamps=int(s[NCLAMP]), died=int(s[NDIED]), amb=int(s[NAMB]), first=int(s[NFIRST]))\n\n\nclass Ctrl(Combo):\n    \"\"\"Control: the identical lattice posterior code (filt) with COMBO's mean/sd-table quoting (QMS1 tables):\n    ambiguous first trade -> pi-weighted branch offsets; otherwise lookup at the posterior mean and sd.\"\"\"\n    def __init__(self, blob_path, hard=0.999, flag=False):\n        super().__init__(blob_path)\n        self.hard = float(hard); self.flag = bool(flag)\n        self.st, self.P = new_state(); self.T_ = np.zeros(NC); self.PR = np.zeros(NC)\n    def init(self, *a):\n        fb, fa = super().init(*a)\n        self.st[FBQ] = min(MAXF, max(0.0, fb)); self.st[FAQ] = min(MAXF, max(0.0, fa))\n        return fb, fa\n    def on_trade(self, is_buy, ax, ay, t, x, y, arb=False, p=100., s2=100., j=0):\n        s = y / x; st = self.st; fbo = st[FBQ]; fao = st[FAQ]\n        filt(st, self.P, self.T_, self.PR, bool(is_buy), s, float(t), self.flag, bool(arb) if self.flag else False, self.hard)\n        ls = math.log(s); m = st[M_]; ph = int(st[PH]); w = (ls - m) * 1e4\n        if st[AMB] > 0.0:\n            pi = st[PI]; lp = st[LP]; mt = st[MT]; vt = st[VT]; old_s2 = st[OLD2]\n            pa = math.exp(lp); pr = math.exp(mt)\n            s2_arb = max(pa * .997, min(pa / .997, old_s2)); s2_ret = max(pr * .997, min(pr / .997, old_s2))\n            cand_ret = s * (1 - fbo) / .997 if is_buy else s * .997 / (1 - fao)\n            synced_ret = (cand_ret < s2_ret) if is_buy else (cand_ret > s2_ret)\n            if synced_ret: s2_ret = cand_ret\n            aa, ba = self.lookup_offsets((ls - lp) * 1e4, (math.log(s2_arb) - lp) * 1e4, 0, 0., False)\n            ar, br = self.lookup_offsets((ls - mt) * 1e4, (math.log(s2_ret) - mt) * 1e4, 1, math.sqrt(vt) * 1e4, synced_ret)\n            a = pi * aa + (1 - pi) * ar; b = pi * ba + (1 - pi) * br\n        else:\n            a, b = self.lookup_offsets(w, (math.log(st[S2H]) - m) * 1e4, ph, math.sqrt(st[V_]) * 1e4, st[SYN] > 0.0)\n        fa = 1.0 - math.exp(-(a - w) * 1e-4) if a > w else 0.0\n        fb = 1.0 - math.exp(-(b + w) * 1e-4) if b > -w else 0.0\n        st[FBQ] = min(MAXF, max(0.0, fb)); st[FAQ] = min(MAXF, max(0.0, fa))\n        return fb, fa\n\n\ndef err_wrap(cls):\n    \"\"\"Counts first-own-trade classification errors for QMRef-family policies without changing them: after the call cnt==0 iff the trade was read as an arb.\"\"\"\n    class W(cls):\n        def __init__(self, *a):\n            super().__init__(*a); self.nf = 0; self.nw = 0\n        def on_trade(self, is_buy, ax, ay, t, x, y, arb=False, p=100., s2=100., j=0):\n            first = (t - self.tlast) >= 1\n            r = super().on_trade(is_buy, ax, ay, t, x, y, arb, p, s2, j)\n            if first:\n                self.nf += 1\n                if (self.cnt == 0) != bool(arb): self.nw += 1\n            return r\n    return W\n\n\nclass TruthCount:\n    \"\"\"Diagnostic wrapper for C / Ctrl: passes callbacks through untouched, counts read-as-arb != arb at first own trades.\"\"\"\n    wants_j = True\n    def __init__(self, pol): self.pol = pol; self.nf = 0; self.nw = 0\n    def init(self, *a): return self.pol.init(*a)\n    def on_trade(self, is_buy, ax, ay, t, x, y, arb=False, p=100., s2=100., j=0):\n        r = self.pol.on_trade(is_buy, ax, ay, t, x, y, arb, p, s2, j)\n        st = self.pol.st\n        if st[FIRST] > 0.0:\n            self.nf += 1\n            if (st[ISARB] > 0.0) != bool(arb): self.nw += 1\n        return r\n\n\nclass Scramble:\n    \"\"\"Hidden-input invariance: feeds garbage for init parameters, arb, p, s2, j.\"\"\"\n    wants_j = True\n    def __init__(self, pol): self.pol = pol\n    def init(self, *a): return self.pol.init(123.0, -7.0, 1e9)\n    def on_trade(self, is_buy, ax, ay, t, x, y, arb=False, p=100., s2=100., j=0):\n        return self.pol.on_trade(is_buy, ax, ay, t, x, y, not arb, 3.14159, 2.71828e5, 77)\n\n\n_FLAGCLS = None\nPATCH_OLD = \"            pi = la / (la + lr) if la + lr > 0 else 0.\\n            is_arb = pi > .5\\n\"\nPATCH_NEW = \"            pi = la / (la + lr) if la + lr > 0 else 0.\\n            pi = float(bool(arb))\\n            is_arb = pi > .5\\n\"\ndef combo_flag_cls():\n    \"\"\"Flag = ComboFlag: combo.py with one inserted line (pi = float(bool(arb)) right after the likelihood) in Combo.on_trade.\"\"\"\n    global _FLAGCLS\n    if _FLAGCLS is None:\n        src = open(os.path.join(HERE, 'w/combo.py'), encoding='utf-8').read()\n        assert src.count(PATCH_OLD) == 1\n        ns = {'__name__': 'comboflag'}\n        exec(compile(src.replace(PATCH_OLD, PATCH_NEW), 'comboflag.py', 'exec'), ns)\n        _FLAGCLS = ns['Combo']\n    return _FLAGCLS\n","pols.py":{"zlib_base64":"e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VeSLtwiKiqXBGAZucXDxjESRTNLR/Y+nr8MImu9JaobhFQzRpD6FjMNggXs0uEWEvDA5iGmMWtogvKDaXIEql7j22dJHN5EkDFKewSvZRrBtRyCRDz1IYmvcDwC/HdpYnmhRLYlG3mELp5DwVteJ0eNMYqgL+oCWJoKdczoZtb9Pa0u+k2QHn9HB3tKrXP+8sSroym0fnIFcefM/d3aX0Nh7mUeQMZ+g65tbYn05pws6dqtHO/6+duONHX/ZYTSy49PdJJ7uF0m9aOPiGys0x8AjG0bofClu1qqE1iHpBHPO5qGLvRsdC9heEGTYoXIFeWkpXnLS2ROoqq3GyCdTnwlqzf4pdeO4Jtp+W1ugcknXZY6KgrR62IU9W0fk7kjUQVEnDiHPrNsBEgkck/mv/cHBgch3FcfTDcLGwkM6s1fvSIiCj1mbmo4rb3YkPXBSu7UcUCYlL1NCBNsRvEEkm/uTInA75i1xu3fuY432wYXhgU2q8QYRxTdcaT4YqzXHKFPLscIyO4qVoxh1PetS4bNDmnLFNG/6Lm8Kzkpc67UgaQhnUPASF06Q5k6UTjwGZ2dgm6UpL+MjOLFt1cSMHB5Pw0ORDxFM+r1pv47A1fiEtjNbUDeDyEt87+Z+hyx4tH4HP+JNOAE1Sfro5xNofJJgm5sVMBDVhqfWyYJjIhteBN7hKzmnHezZLsVGwJ+/2REc45cdeo5wXf73QiT+L/NRpEY=","decode":"zlib.decompress(base64.b64decode(s)).decode()"}},"source_note":"fp.py (the policy: lattice filter port, quote routine, Ctrl, wrappers, Flag patch) is embedded as text when it fits the 64000-byte limit; the auxiliary scripts are zlib+base64 (decode rule beside each); own_code_sha256 gives the sha256 of every decoded file."}