{"credit":"Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved: the solved policy, exact-arithmetic arb/retail tell, filter and U1 tables that LEAN and QLX5 are built on.","item":"d4-opportunity/arb-truth","where":"replica_oracle_diagnostic","metric":"paired per-seed replica edge: QLX5 with oracle pi at the first own callback of each timestamp minus unchanged QLX5 (engine-faithful port A/60dc237f), seeds 64000..64127","gain_vs_base":"0.010618736694635977","se":"0.0071337180886503525","n":128,"seeds":[64000,64127],"gain_note":"counterfactual sensitivity of edge to perfect arb/retail labels at the first-callback update only; NOT a deployable gain, NOT an upper bound. mean+2se = 0.024886 < 0.03, so the sequential rule stopped after round 1; seeds 64128..64255 were not run.","source_sha256":"8122fa7cff19d82d9bea922366f9d65302f22aaade56b6a4605e825afe6f7ccf","source_hash_scope":"SHA256 of the measured probe qlxcore.py (= qlxcore.py 701dbfd1175fee7d129de92db21b1ddc78645796c422b29d8efba2eda501ab00 of A/60dc237fa0a4d42f3b6e2d2bed61c1a2df08d27c31ccd95cce508ee9c8689de4 + patch below). Probe enginecore_f.py: fefbd9d023094ba3e5dfac0c7127617b414a47089f8bb2835d16da8ace646eaa (from 60af56a7570fabd603c6374d38a38f88b3c35a8f1e8192f588769460a96bfcfd). QLX5 contract source e183e5bc3fb794b7067703b10a7da9920267aa5f4caa968e16ca101b02338f40 (decoded from code_zb64.QLX5 of A/1ef80bfb6d6791b877b1f4048a5e63cf2ae54153e6e8763ae3f8ab13132dfb15, unchanged); qlx_tables.json 8c6d33c5c1024bc23593f46123aad1712c0cc8af3f4a118c5875258f9d7b81a6.","advance":false,"advance_reason":"diagnostic only (brief: advance=false). Even perfect first-callback labels move edge by +0.0106 (se 0.0071), below the 0.03 stop line.","rounds":[{"round":1,"seeds":[64000,64127],"n":128,"mean":0.010618736694635977,"se":0.0071337180886503525,"mean_plus_2se":0.02488617287193668,"decision":"stop (mean+2se < 0.03)"},{"round":2,"seeds":[64128,64255],"n":0,"decision":"not run: stopped after round 1"}],"moments":{"baseline":{"n":128,"mean":534.9978274476013,"sd":92.49512468872837,"se":8.175491236761884},"probe":{"n":128,"mean":535.008446184296,"sd":92.49650052637519,"se":8.175612844778119},"paired_diff":{"n":128,"mean":0.010618736694635977,"sd":0.08070880696892482,"se":0.0071337180886503525,"pos":68,"neg":60,"zero":0,"min":-0.15832046255820842,"max":0.3942467987059217},"diff_half_means_64000_64063_and_64064_64127":[0.019713974814705715,0.00152349857456624]},"paired_rows_format":"[seed, baseline edge f64 hex, probe edge f64 hex, probe-baseline (9 dp), OFF false-arb labels (truth retail, model arb), OFF false-retail labels (truth arb, model retail)]; unrounded edges are the exact f64 from the hex","paired_rows":[[64000,"0x1.c1d417f12897ap+8","0x1.c1c2155cda67dp+8",-0.070351857,1,0],[64001,"0x1.affad2849f381p+8","0x1.aff0278218112p+8",-0.041671904,0,0],[64002,"0x1.4340414aa709dp+9","0x1.4345336dcc3a5p+9",0.038639444,2,0],[64003,"0x1.090b281792bf9p+9","0x1.090e6ea4762dcp+9",0.025590526,2,1],[64004,"0x1.130204e71abbfp+9","0x1.13001978b116ap+9",-0.014997293,2,1],[64005,"0x1.172133ebf412ap+9","0x1.17257f5e0b58fp+9",0.033552419,3,2],[64006,"0x1.92e925de107e9p+8","0x1.92ec390fc9922p+8",0.012011631,0,0],[64007,"0x1.295ce0b5740fcp+9","0x1.2962a32e331fap+9",0.044997304,2,0],[64008,"0x1.57c5a6500bd9fp+9","0x1.57bd04a286c73p+9",-0.067434015,2,0],[64009,"0x1.2417da17df0f8p+9","0x1.241ff1c9d62e5p+9",0.063223119,3,1],[64010,"0x1.18386d6a3ba6bp+9","0x1.18403746f53f5p+9",0.060847846,2,0],[64011,"0x1.02ba9ff9d953bp+9","0x1.02b4a8867bbabp+9",-0.046614094,1,2],[64012,"0x1.26caa199a3cd0p+9","0x1.26dab95aa64fdp+9",0.125724913,1,1],[64013,"0x1.98265b79ab20fp+8","0x1.988b48d55e1f9p+8",0.394246799,8,2],[64014,"0x1.f7dd7a1913cbfp+8","0x1.f7ddeefb8acd3p+8",0.001783518,0,0],[64015,"0x1.c2db5d4661c17p+8","0x1.c2e333bdcaff6p+8",0.030616248,1,0],[64016,"0x1.ab62736a5d156p+8","0x1.ab5d7203a70e7p+8",-0.019552631,0,0],[64017,"0x1.d3da475fd9ba0p+8","0x1.d3cd1d35b180ap+8",-0.051424632,1,0],[64018,"0x1.1db8a10e27851p+9","0x1.1db9fa3f7378ap+9",0.010534441,1,0],[64019,"0x1.8e225167281b1p+8","0x1.8e1ffa8563a94p+8",-0.009138213,2,0],[64020,"0x1.3e220af4ffc45p+9","0x1.3e45c9f23b212p+9",0.279266027,2,1],[64021,"0x1.f777ae28a1188p+8","0x1.f777d7da391d1p+8",0.000636196,0,0],[64022,"0x1.1ce942b7e1971p+9","0x1.1cf38453d7aa7p+9",0.080127235,4,0],[64023,"0x1.7393861e1164fp+9","0x1.7394f8cac98efp+9",0.011312094,2,2],[64024,"0x1.a6c067a6156d2p+8","0x1.a6c2fd208ae01p+8",0.010093359,2,0],[64025,"0x1.12c62f63919b6p+9","0x1.12cd8c6aa47a3p+9",0.057526478,1,0],[64026,"0x1.7401fd26bedddp+8","0x1.7406d46fd4125p+8",0.018909996,0,0],[64027,"0x1.b9e1a50a3e8d6p+8","0x1.b9c8adba7b4b3p+8",-0.097523675,2,2],[64028,"0x1.c6d142ae15286p+8","0x1.c6c12dda9a826p+8",-0.062817781,2,3],[64029,"0x1.1382943135040p+9","0x1.13869129f78ecp+9",0.031157584,1,0],[64030,"0x1.2036d46254ef0p+9","0x1.2037a666f89fcp+9",0.006409244,1,0],[64031,"0x1.3ce6d9b0ab8cap+9","0x1.3cd6e169a5a06p+9",-0.124764326,1,0],[64032,"0x1.9258db720569fp+8","0x1.923e7ac213e98p+8",-0.103037831,3,0],[64033,"0x1.16004c1b3ecd0p+9","0x1.160bc1e8d1192p+9",0.089532563,2,0],[64034,"0x1.494ac4ae9f3c9p+9","0x1.49474034d4818p+9",-0.027480339,1,0],[64035,"0x1.2aedebaa86c06p+9","0x1.2aeda45fa81cdp+9",-0.002175673,0,0],[64036,"0x1.c32e427067d0ap+8","0x1.c32fef62e3372p+8",0.006545215,2,0],[64037,"0x1.faf745b9e9e58p+8","0x1.fb1ec00710b6dp+8",0.154209921,5,1],[64038,"0x1.6e77afa036597p+8","0x1.6e7897ab953bbp+8",0.003540717,1,0],[64039,"0x1.063f828f1183bp+9","0x1.06450790d24f6p+9",0.043121547,1,0],[64040,"0x1.63dddfbb263a5p+8","0x1.63fdc0f8ee819p+8",0.12453066,1,0],[64041,"0x1.318595b611e5dp+9","0x1.317da88d9b79ep+9",-0.06192499,2,0],[64042,"0x1.2ccae89386531p+9","0x1.2cd3e49be9aecp+9",0.07019143,0,0],[64043,"0x1.e64e727661f09p+8","0x1.e652f1690f574p+8",0.017562072,3,1],[64044,"0x1.e34b15bdf5840p+8","0x1.e356b8de9dd10p+8",0.045457879,2,0],[64045,"0x1.0a1af1400647cp+9","0x1.0a281929064afp+9",0.102780461,3,0],[64046,"0x1.bbed41b78019bp+8","0x1.bbfcf9a222708p+8",0.061400094,3,0],[64047,"0x1.017241c4f1f35p+9","0x1.0175dcacc0fe8p+9",0.028164841,3,0],[64048,"0x1.409427425e391p+9","0x1.40903db939b43p+9",-0.030564444,1,0],[64049,"0x1.2bb2b63d7ef53p+9","0x1.2bb4645248a68p+9",0.013125037,2,0],[64050,"0x1.d109810053f4bp+8","0x1.d10e521640c7dp+8",0.018815394,2,0],[64051,"0x1.8f6a93474e1a6p+8","0x1.8f8d337570df1p+8",0.135256656,0,0],[64052,"0x1.70d928ceaa2eep+9","0x1.70ce781434f32p+9",-0.083518321,1,1],[64053,"0x1.70f116670e1f7p+9","0x1.70e694e9dddedp+9",-0.082076691,1,1],[64054,"0x1.b94ffc5c316d3p+8","0x1.b94f032c0a176p+8",-0.003802309,4,1],[64055,"0x1.fe1ce87c72bcdp+8","0x1.fe12d46373cc3p+8",-0.039369166,3,3],[64056,"0x1.3cf053fc8e525p+9","0x1.3cfaf4c43b676p+9",0.083031616,2,1],[64057,"0x1.0fbd8ecbaa8f7p+9","0x1.0fa98f5b1f42dp+9",-0.156232899,3,0],[64058,"0x1.1f9571edf9965p+9","0x1.1f96818bbf923p+9",0.008289072,1,0],[64059,"0x1.4ebceafb1af0cp+9","0x1.4ec3b4438f808p+9",0.053017671,2,0],[64060,"0x1.2f9a7edeb84bfp+9","0x1.2f9a8449bebbdp+9",0.000165346,0,0],[64061,"0x1.39c47384d932dp+9","0x1.39bbc56ad9d95p+9",-0.067813158,2,0],[64062,"0x1.68886bfd16cffp+9","0x1.68969ef69a2cdp+9",0.110930623,3,2],[64063,"0x1.0b585c9840504p+9","0x1.0b5acea3efb1ap+9",0.019105397,0,0],[64064,"0x1.7d5b873b4f538p+9","0x1.7d5d2a19631b0p+9",0.012782821,3,0],[64065,"0x1.0c5d53a23f49ap+9","0x1.0c78a61d11c07p+9",0.213454583,2,0],[64066,"0x1.03ed033d2bd1cp+9","0x1.03eb76286a238p+9",-0.012117953,2,2],[64067,"0x1.1bb7cde437eaep+9","0x1.1bd0e13b3d8d6p+9",0.195902708,2,6],[64068,"0x1.fbaf97366c4e2p+8","0x1.fba6ef09347fbp+8",-0.033816172,3,0],[64069,"0x1.48d793eaf1183p+9","0x1.48d50e210fd09p+9",-0.019707904,1,0],[64070,"0x1.011d4a27cd1a7p+9","0x1.011e790ef1d18p+9",0.009243863,0,0],[64071,"0x1.46c336eafc496p+9","0x1.46c1ae31a93cap+9",-0.011984983,1,0],[64072,"0x1.0363aec51688bp+9","0x1.03633faf86934p+9",-0.003390022,0,0],[64073,"0x1.d319772856a22p+8","0x1.d31301793ededp+8",-0.025233215,1,2],[64074,"0x1.ea28d129bcb76p+8","0x1.ea2a9a9d45124p+8",0.006980153,1,0],[64075,"0x1.d72639b73cb83p+8","0x1.d71b4bbee470ep+8",-0.042693636,2,0],[64076,"0x1.b3279c89057cap+8","0x1.b31c77d94caf6p+8",-0.04352854,0,0],[64077,"0x1.4b38c8bf3fb52p+9","0x1.4b3ddd9269eeep+9",0.039698024,1,0],[64078,"0x1.b67078e3329efp+8","0x1.b6630928d2dcbp+8",-0.052486084,2,0],[64079,"0x1.981f1cd229595p+8","0x1.980f0ab0af4c6p+8",-0.062776654,3,2],[64080,"0x1.81f8807ec137bp+8","0x1.81ec4ddbd7485p+8",-0.04764765,0,0],[64081,"0x1.f74508363532ap+8","0x1.f73aad96c77dep+8",-0.040445294,1,0],[64082,"0x1.aeb88adf4f5d5p+8","0x1.aebd4a2eaea23p+8",0.01854416,1,0],[64083,"0x1.17cb7bc9da7edp+9","0x1.17c89eb9f58c7p+9",-0.02237128,2,0],[64084,"0x1.300ed809e984dp+9","0x1.300df4ea23f8ep+9",-0.006931278,2,0],[64085,"0x1.36e7e5c6ab33bp+9","0x1.36d3a1ee5eb6ep+9",-0.158320463,2,1],[64086,"0x1.e7bf575c1a4f5p+8","0x1.e7c46a737099ap+8",0.019822558,1,0],[64087,"0x1.382e52b90bb6fp+9","0x1.38368e7d0fac3p+9",0.064323904,3,0],[64088,"0x1.42edf14eeb5f6p+9","0x1.42eac863d5440p+9",-0.024686228,1,0],[64089,"0x1.10171653ddbc5p+9","0x1.1012092647fa3p+9",-0.039464663,0,0],[64090,"0x1.512b59f00ef7fp+9","0x1.513205df84bdep+9",0.052122052,1,0],[64091,"0x1.2a81099217bf6p+9","0x1.2a828f362d04ap+9",0.011890898,0,0],[64092,"0x1.43e9ca18cb6e7p+9","0x1.43fadb883d1cap+9",0.133344584,4,1],[64093,"0x1.3e87228fc9981p+9","0x1.3e844801a1ae1p+9",-0.022294778,0,0],[64094,"0x1.070e28472360fp+9","0x1.0709030cc587ep+9",-0.040198608,2,1],[64095,"0x1.1b319fda7387fp+9","0x1.1b2c2eb44b3cbp+9",-0.042515535,0,0],[64096,"0x1.d789ddbaf26afp+8","0x1.d788c2c02ae37p+8",-0.004317926,2,1],[64097,"0x1.05f7cad1354e5p+9","0x1.05ff28bb047b2p+9",0.057553507,1,0],[64098,"0x1.b59d7b02a2490p+8","0x1.b57cea30b55ddp+8",-0.127209778,1,0],[64099,"0x1.53021882cc737p+9","0x1.530a1ae5c38efp+9",0.062572833,2,0],[64100,"0x1.92f72c2a2b8d1p+8","0x1.92e7f70070827p+8",-0.059404953,2,0],[64101,"0x1.a752b05f0b92dp+8","0x1.a730250210ec8p+8",-0.134939014,3,6],[64102,"0x1.90a7ae4c41185p+8","0x1.90a0d8964e4d9p+8",-0.026698467,2,0],[64103,"0x1.12293ca8f560ep+9","0x1.123b5d36c93d8p+9",0.14161847,2,1],[64104,"0x1.274e27b98bb42p+9","0x1.274c086a85c45p+9",-0.016580465,3,1],[64105,"0x1.e1b202450dc41p+8","0x1.e1bcec0654567p+8",0.042629318,2,0],[64106,"0x1.1a71db6f07b7bp+9","0x1.1a61010eefea9p+9",-0.131664287,1,0],[64107,"0x1.2db504dc9a29fp+9","0x1.2db3f7f012895p+9",-0.008206907,2,1],[64108,"0x1.9ced39bec753ap+8","0x1.9ce507bcfe34ep+8",-0.032013046,0,0],[64109,"0x1.e7c38dfc37d6fp+8","0x1.e7d8269997d3dp+8",0.080453716,0,0],[64110,"0x1.33bec0c0fb225p+9","0x1.33c4280588993p+9",0.042213983,1,1],[64111,"0x1.11472c2475992p+9","0x1.115a9a013d289p+9",0.151790235,2,3],[64112,"0x1.9eaf82ad9a313p+8","0x1.9ebabc7083876p+8",0.043850119,1,1],[64113,"0x1.02191cc4fe6afp+9","0x1.02129ba113dcap+9",-0.050816049,3,0],[64114,"0x1.e1b2a3fe85835p+8","0x1.e1a8a5144f520p+8",-0.039045943,1,0],[64115,"0x1.46ea948bd1bbep+9","0x1.46e4c92b7b349p+9",-0.045269053,2,0],[64116,"0x1.dfbe2f40a6bfbp+8","0x1.dfc60b682dc05p+8",0.03070304,3,4],[64117,"0x1.eea33189586ebp+8","0x1.eeb16537e96b8p+8",0.055476103,1,1],[64118,"0x1.26f5dd36dbc77p+9","0x1.26ff739378416p+9",0.074901177,2,0],[64119,"0x1.c3cf242cfe2d3p+8","0x1.c3ccae1c558bap+8",-0.00961403,2,3],[64120,"0x1.bf68d2a1b7a8ep+8","0x1.bf6c3b54b0500p+8",0.013316332,0,0],[64121,"0x1.fe31086b84c85p+8","0x1.fe0f37c6d635ap+8",-0.132089894,2,1],[64122,"0x1.3ca8930fa0c27p+9","0x1.3ca57e8eb2dc0p+9",-0.024063221,1,0],[64123,"0x1.47a549f299ecep+9","0x1.479f20fa673fdp+9",-0.048125291,1,0],[64124,"0x1.c7d66447be5bfp+8","0x1.c80278be973bfp+8",0.17218726,2,0],[64125,"0x1.eaf583559f3c5p+8","0x1.eaf1f69f2349bp+8",-0.013865857,1,0],[64126,"0x1.a69f88de84d37p+8","0x1.a6a8a95f00202p+8",0.035652189,1,0],[64127,"0x1.2a4a745092ffcp+9","0x1.2a46be6282e37p+9",-0.028989561,1,0]],"hook":{"exposure":"engine core kernel writes the generating event type into the policy-private int64 state vector just before execute(): state[0]=1 before an arbitrage fill (arb() branch), state[0]=2 before a retail fill (split/route loop). The njit callback passes state[0] into the objmode policy call as ev. No RNG draw, float operation, ordering or routing of the engine changes (OFF parity below).","timing":"callback time, after the engine executed the fill on the own pool and before the returned fees are applied; same point at which the contract afterSwap runs.","use":"Policy.swap: only when ts > self.t (first own callback of a timestamp) and inside update(): the model posterior pi is computed exactly as before (tell, chance, likelihoods), recorded, and then, if knob oracle=1, replaced by 1e18 when ev==1 (arbitrage) and 0 when ev==2 (retail). The existing logic then runs unchanged: arb = pi > pi_arb; pi=1 -> m=ln(post-trade price) v=0 (arb branch); pi=0 -> truncated-filter mt,vt (retail branch); rival clip, phase (ph=0 after arb), syn/cnt reset, bounds and tables unchanged. Later callbacks of the same timestamp, q_hit_x (qx), split tracking (m0) and fees are not touched.","mapping":"In the engine each step runs price move -> arbitrage on each pool (at most one arb fill per pool, always before retail) -> retail orders. So the first own callback of a timestamp is an arbitrage fill iff the own pool was arbitraged that step; ev==1 at a first callback never co-occurs with an earlier own retail fill of the same step. No event with ev outside {1,2} was observed.","not_available_cases":["the event type itself is engine-internal: TradeInfo/afterSwap carries no label, so the hook is not implementable in a deployable contract","step 0: own callbacks at timestamp 0 never satisfy ts > self.t (self.t starts at 0), so the hook does not fire (101 callbacks over 128 seeds)","later callbacks of the same timestamp (all retail by construction) are left to the model by design (q_hit_x / bound logic)","whether the rival pool was arbitraged this step is not exposed and not used"],"knob":"oracle (default 0) added to KNOBS; oracle=0 is the unchanged QLX5 port","patch_unified_diff":"--- port/qlxcore/enginecore_f.py\t1970-01-01 00:00:00.000000000 +0000\n+++ probe/qlxcore/enginecore_f.py\t2026-11-11 02:14:41.767393447 +0000\n@@ -249,6 +249,7 @@\n         for i in range(2):\n             kind,amount,profit=arb(p[i],price)\n             if kind>=0:\n+                state[0]=1  # PROBE: event type = arbitrage\n                 ok,ax,ay=execute(p[i],kind,amount,t,i==0,callback,state)\n                 if ok:\n                     edges[i]+=-profit\n@@ -265,6 +266,7 @@\n             amounts=split(p,buy,total); kind=2 if buy else 0\n             for i in range(2):\n                 if amounts[i]>0.0001:\n+                    state[0]=2  # PROBE: event type = retail\n                     ok,ax,ay=execute(p[i],kind,amounts[i],t,i==0,callback,state)\n                     if ok:\n                         if buy: edge=ay-unwad(wad(ax))*price\n--- port/qlxcore/qlxcore.py\t1970-01-01 00:00:00.000000000 +0000\n+++ probe/qlxcore/qlxcore.py\t2026-11-11 02:14:41.767393447 +0000\n@@ -83,6 +83,7 @@\n     ('fee_max', U // 10, 'fee cap, WAD'),\n     ('fee_init', 2823606104386589, 'both fees returned by afterInitialize, WAD'),\n     ('guard_lo', 2999999999999948, 'fee guard: lowest fee wad whose binary64 gamma equals the 30 bps rival gamma'),\n+    ('oracle', 0, 'PROBE: 1 = at the first own callback of a timestamp replace posterior pi by truth (1 arb, 0 retail)'),\n     ('guard_hi', 3000000000000057, 'fee guard: highest such fee wad; a fee in [guard_lo, guard_hi] steps to the nearer outside neighbour'),\n ]\n DEFAULTS = {k: v for k, v, _ in KNOBS}\n@@ -490,6 +491,7 @@\n         self.k = dict(DEFAULTS); self.k.update(knobs)\n         self.T = T or load_tables()\n         self.calls = self.tries = self.hits = self.firsts = self.arbs = self.tell_pos = self.guard = 0\n+        self.rec = []; self.rcnt = {}; self.acnt = {}; self.pi_model = 0\n \n     def init(self, x, y):\n         sp = y * U // x\n@@ -529,7 +531,7 @@\n         fa = U - exp(tdiv(-xa, 10000)) if xa > 0 else 0\n         return clip(fb, 0, K['fee_max']), clip(fa, 0, K['fee_max'])\n \n-    def update(self, m, v, fb, fa, sp, r, s, buy, dt, hit, chance):\n+    def update(self, m, v, fb, fa, sp, r, s, buy, dt, hit, chance, ev=0):\n         K = self.k; zf = K['z_floor']\n         lo = ln(mul(sp, U - fb)); hi = ln(divi(sp, U - fa))\n         n = min(dt - 1, K['gap_cap'])\n@@ -547,6 +549,9 @@\n         lr = divi(mul(mul(Z, K['rho']), pi), mul(d, K['ld_s']))\n         lr = mul(lr, chance)\n         pi = divi(la, la + lr) if (hit and la + lr > 0) else (0 if hit else K['tell_miss_pi'])\n+        self.pi_model = pi\n+        if K['oracle']:\n+            pi = U if ev == 1 else 0  # PROBE hook: truth replaces only pi\n         arb = pi > K['pi_arb']\n         if K['pi_soft_lo'] < pi < K['pi_hard']:\n             m2 = mul(pi, lp) + mul(U - pi, mt)\n@@ -566,10 +571,12 @@\n             return lo - 1 if f - (lo - 1) <= (hi + 1) - f else hi + 1\n         return f\n \n-    def swap(self, buy, ax, ay, ts, rx, ry):\n+    def swap(self, buy, ax, ay, ts, rx, ry, ev=0):\n         K = self.k\n         m = self.m; v = self.v; sp = self.sp; r = self.r; fb = self.fb; fa = self.fa; cnt = self.cnt; syn = self.syn\n         self.calls += 1\n+        if ev == 2: self.rcnt[ts] = self.rcnt.get(ts, 0) + 1\n+        elif ev == 1: self.acnt[ts] = self.acnt.get(ts, 0) + 1\n         s = ry * U // rx; arb = False\n         if ts > self.t:\n             self.firsts += 1\n@@ -578,7 +585,8 @@\n             chance = ulp_over_grid_wad(ax if buy else ay, self.px if buy else self.py, rx if buy else ry,\n                                        K['chance_floor_shift']) if hit else 0\n             self.tell_pos += hit\n-            m, v, r, arb = self.update(m, v, fb, fa, sp, r, s, buy, ts - self.t, hit, chance); cnt = 0; syn = False\n+            m, v, r, arb = self.update(m, v, fb, fa, sp, r, s, buy, ts - self.t, hit, chance, ev); cnt = 0; syn = False\n+            self.rec.append((ts, ts - self.t, buy, ev, hit, self.pi_model > K['pi_arb'], self.pi_model))\n             self.arbs += arb\n         ph = 0\n         if not arb:\n@@ -618,14 +626,14 @@\n _LOG = [None]\n \n \n-def _py_callback(initializing, is_buy, axh, axl, ayh, ayl, t, rxh, rxl, ryh, ryl):\n+def _py_callback(initializing, is_buy, axh, axl, ayh, ayl, t, rxh, rxl, ryh, ryl, ev=0):\n     pol = _POL[0]\n     ax = (int(axh) << 64) | int(axl); ay = (int(ayh) << 64) | int(ayl)\n     rx = (int(rxh) << 64) | int(rxl); ry = (int(ryh) << 64) | int(ryl)\n     if initializing:\n         b, a = pol.init(rx, ry)\n     else:\n-        b, a = pol.swap(bool(is_buy), ax, ay, int(t), rx, ry)\n+        b, a = pol.swap(bool(is_buy), ax, ay, int(t), rx, ry, int(ev))\n     if _LOG[0] is not None:\n         _LOG[0].append((bool(initializing), bool(is_buy), ax, ay, int(t), rx, ry, b, a))\n     return b, a\n@@ -634,7 +642,7 @@\n @njit\n def callback(initializing, is_buy, ax, ay, t, rx, ry, state):\n     with objmode(b='int64', a='int64'):\n-        b, a = _py_callback(initializing, is_buy, ax[0], ax[1], ay[0], ay[1], t, rx[0], rx[1], ry[0], ry[1])\n+        b, a = _py_callback(initializing, is_buy, ax[0], ax[1], ay[0], ay[1], t, rx[0], rx[1], ry[0], ry[1], state[0])\n     return b, a\n \n \n@@ -648,4 +656,5 @@\n         _POL[0] = None; _LOG[0] = None\n     out = dict(steps=r['steps'], events=r['events']) if trace else {}\n     return dict(out, seed=int(seed), edge=r['edge'], normalizer_edge=r['normalizer_edge'], calls=pol.calls, firsts=pol.firsts,\n-                arbs=pol.arbs, tell_pos=pol.tell_pos, tries=pol.tries, hits=pol.hits, guard_shifts=pol.guard, m0=pol.m0)\n+                arbs=pol.arbs, tell_pos=pol.tell_pos, tries=pol.tries, hits=pol.hits, guard_shifts=pol.guard, m0=pol.m0,\n+                rec=pol.rec, rcnt=pol.rcnt, acnt=pol.acnt)\n","reproduce":["kit: curl -sSL https://github.com/identity-md-launches/goal-3178-build-shared-evaluation-kit/archive/45e7563d1a29ffca9d608fdf60c90bf2624d2d01.tar.gz | tar xz -C test/scratch/kitsrc; bash kitsrc/*/setup_fast.sh --platform linux-x86_64 --cache test/scratch/cache --scratch test/scratch/runtime","curl https://api.imd.fun/artifacts/{60dc237fa0a4d42f3b6e2d2bed61c1a2df08d27c31ccd95cce508ee9c8689de4,362fb97f041087bf3548c302af4c0f82d2537d6a6c0157a95ac06d0cb70a5ce4,8d5400696659b56bc12eeffc34dec5e58c5c119ddddaca681792db59586dd760,1ef80bfb6d6791b877b1f4048a5e63cf2ae54153e6e8763ae3f8ab13132dfb15}; decode code_zb64/payload_zb64 (base64(zlib(tar)))","decode code_zb64.QLX5 of 1ef80bfb to QLX5.sol (sha256 e183e5bc...); python3 -I qlxcore/mktables.py QLX5.sol qlxcore/qlx_tables.json (8c6d33c5...)","copy qlxcore/ to probe/qlxcore/ and apply patch_unified_diff (patch -p0 style, files enginecore_f.py and qlxcore.py)","arms (spawned Pool(8), one NUMBA_CACHE_DIR per implementation): baseline = untouched qlxcore run(seed, T); OFF = probe run(seed, T, oracle=0); probe = probe run(seed, T, oracle=1); Cython rebuild (build_cy.sh of A/8d540069 from wheels cython 3.1.4 / setuptools 80.9.0, hashes pinned) as a third baseline"]},"off_parity":{"audit_rows_unrounded_A_362fb97f_per_seed_512_csv":{"base":[{"seed":10010512,"edge":"606.1300985640944","edge_hex":"4082f10a711db056","audit_engine_hex":"4082f10a711db056","bits_equal":true,"calls":12227,"audit_port_calls":12227,"tries":8155,"audit_tries":8155,"hits":7255,"audit_hits":7255},{"seed":10010513,"edge":"482.77829524211705","edge_hex":"407e2c73e5b63867","audit_engine_hex":"407e2c73e5b63867","bits_equal":true,"calls":9988,"audit_port_calls":9988,"tries":6388,"audit_tries":6388,"hits":5684,"audit_hits":5684},{"seed":10010514,"edge":"404.7966542836623","edge_hex":"40794cbf188fe8c4","audit_engine_hex":"40794cbf188fe8c4","bits_equal":true,"calls":9532,"audit_port_calls":9532,"tries":5838,"audit_tries":5838,"hits":5236,"audit_hits":5236},{"seed":10010515,"edge":"450.2556494695746","edge_hex":"407c241723e5f101","audit_engine_hex":"407c241723e5f101","bits_equal":true,"calls":10484,"audit_port_calls":10484,"tries":6858,"audit_tries":6858,"hits":6117,"audit_hits":6117}],"off":[{"seed":10010512,"edge":"606.1300985640944","edge_hex":"4082f10a711db056","audit_engine_hex":"4082f10a711db056","bits_equal":true,"calls":12227,"audit_port_calls":12227,"tries":8155,"audit_tries":8155,"hits":7255,"audit_hits":7255},{"seed":10010513,"edge":"482.77829524211705","edge_hex":"407e2c73e5b63867","audit_engine_hex":"407e2c73e5b63867","bits_equal":true,"calls":9988,"audit_port_calls":9988,"tries":6388,"audit_tries":6388,"hits":5684,"audit_hits":5684},{"seed":10010514,"edge":"404.7966542836623","edge_hex":"40794cbf188fe8c4","audit_engine_hex":"40794cbf188fe8c4","bits_equal":true,"calls":9532,"audit_port_calls":9532,"tries":5838,"audit_tries":5838,"hits":5236,"audit_hits":5236},{"seed":10010515,"edge":"450.2556494695746","edge_hex":"407c241723e5f101","audit_engine_hex":"407c241723e5f101","bits_equal":true,"calls":10484,"audit_port_calls":10484,"tries":6858,"audit_tries":6858,"hits":6117,"audit_hits":6117}],"cy":[{"seed":10010512,"edge":"606.1300985640944","edge_hex":"4082f10a711db056","audit_engine_hex":"4082f10a711db056","bits_equal":true,"calls":12227,"audit_port_calls":12227,"tries":8155,"audit_tries":8155,"hits":7255,"audit_hits":7255},{"seed":10010513,"edge":"482.77829524211705","edge_hex":"407e2c73e5b63867","audit_engine_hex":"407e2c73e5b63867","bits_equal":true,"calls":9988,"audit_port_calls":9988,"tries":6388,"audit_tries":6388,"hits":5684,"audit_hits":5684},{"seed":10010514,"edge":"404.7966542836623","edge_hex":"40794cbf188fe8c4","audit_engine_hex":"40794cbf188fe8c4","bits_equal":true,"calls":9532,"audit_port_calls":9532,"tries":5838,"audit_tries":5838,"hits":5236,"audit_hits":5236},{"seed":10010515,"edge":"450.2556494695746","edge_hex":"407c241723e5f101","audit_engine_hex":"407c241723e5f101","bits_equal":true,"calls":10484,"audit_port_calls":10484,"tries":6858,"audit_tries":6858,"hits":6117,"audit_hits":6117}],"on":[{"seed":10010512,"edge":"606.0725251973928","edge_hex":"4082f09488173781","audit_engine_hex":"4082f10a711db056","bits_equal":false,"calls":12226,"audit_port_calls":12227,"tries":8154,"audit_tries":8155,"hits":7265,"audit_hits":7255},{"seed":10010513,"edge":"482.99465157675166","edge_hex":"407e2fea17c59103","audit_engine_hex":"407e2c73e5b63867","bits_equal":false,"calls":9991,"audit_port_calls":9988,"tries":6392,"audit_tries":6388,"hits":5702,"audit_hits":5684},{"seed":10010514,"edge":"404.8217329254087","edge_hex":"40794d25d16c8ad4","audit_engine_hex":"40794cbf188fe8c4","bits_equal":false,"calls":9533,"audit_port_calls":9532,"tries":5839,"audit_tries":5838,"hits":5236,"audit_hits":5236},{"seed":10010515,"edge":"450.2783927994943","edge_hex":"407c24744c021452","audit_engine_hex":"407c241723e5f101","bits_equal":false,"calls":10485,"audit_port_calls":10484,"tries":6862,"audit_tries":6858,"hits":6132,"audit_hits":6117}]},"summary":"baseline, probe OFF and rebuilt Cython (qlxhot.py 3d28cffd8e4fe258e412c9e42f7be7b8f590a719e1267293704af5c0f53d3e93, qlxcore_cy.py 7e1d0d75..., qlxhot.c 3ec6cc3133036121548f2321debfe83bba43227206a0f513b1d30cc0e5c64844, all byte-identical to the recipe) equal engine_hex on 4/4 old audit rows 10010512..10010515 with equal afterSwap counts, split tries and hits; probe ON differs (expected).","round1_off_eq_baseline_bits":"128/128 (edge bits, calls, tries, hits)","round1_cython_eq_baseline_bits":"128/128"},"branch_counts":{"OFF_run_totals_128_seeds":{"calls":1392888,"firsts":898965,"arbs":488512,"tell_pos":488930,"tries":901085,"hits":803007,"guard":0,"own_arb_fills":488375,"own_retail_fills":904513,"step0_calls":101},"probe_run_totals_128_seeds":{"calls":1392736,"firsts":898932,"arbs":488313,"tell_pos":488808,"tries":901137,"hits":803106,"guard":0,"own_arb_fills":488313,"own_retail_fills":904423,"step0_calls":101}},"confusion_matrix_first_callbacks":{"legend":"A/R = truth arbitrage/retail fill (engine event); a/r = model label pi > pi_arb (0.5) at that update. Counted over first own callbacks of a timestamp (t>=1).","OFF_baseline_run":{"Aa":488307,"Ar":68,"Ra":205,"Rr":410385},"probe_run_model_label_before_replacement":{"Aa":488298,"Ar":15,"Ra":191,"Rr":410428},"OFF_rates":{"false_arb_rate_among_truth_retail":0.0004992815217126574,"false_retail_rate_among_truth_arb":0.0001392372664448426,"label_error_rate":0.0003036825682868632}},"subgroups_OFF":{"by_side":{"buy|Aa":244137,"buy|Ar":36,"buy|Ra":109,"buy|Rr":204857,"sell|Aa":244170,"sell|Ar":32,"sell|Ra":96,"sell|Rr":205528},"by_step_gap":{"1|Aa":439213,"1|Ar":52,"1|Ra":114,"1|Rr":241399,"2|Aa":32089,"2|Ar":5,"2|Ra":46,"2|Rr":96284,"3|Aa":10233,"3|Ar":9,"3|Ra":20,"3|Rr":40390,"4-6|Aa":6163,"4-6|Ar":2,"4-6|Ra":24,"4-6|Rr":29021,"7+|Aa":609,"7+|Ra":1,"7+|Rr":3291},"by_own_retail_fills_same_timestamp":{"0|Aa":255793,"0|Ar":33,"1|Aa":161318,"1|Ar":22,"1|Ra":142,"1|Rr":276881,"2|Aa":55676,"2|Ar":13,"2|Ra":50,"2|Rr":102343,"3+|Aa":15520,"3+|Ra":13,"3+|Rr":31161},"by_tell_hit":{"0|Rr":410035,"1|Aa":488307,"1|Ar":68,"1|Ra":205,"1|Rr":350}},"subgroups_probe_run":{"by_side":{"buy|Aa":244168,"buy|Ar":9,"buy|Ra":109,"buy|Rr":204861,"sell|Aa":244130,"sell|Ar":6,"sell|Ra":82,"sell|Rr":205567},"by_step_gap":{"1|Aa":439231,"1|Ar":5,"1|Ra":112,"1|Rr":241394,"2|Aa":32060,"2|Ar":1,"2|Ra":46,"2|Rr":96293,"3|Aa":10242,"3|Ar":7,"3|Ra":13,"3|Rr":40402,"4-6|Aa":6158,"4-6|Ar":2,"4-6|Ra":20,"4-6|Rr":29053,"7+|Aa":607,"7+|Rr":3286},"by_own_retail_fills_same_timestamp":{"0|Aa":255837,"0|Ar":7,"1|Aa":161291,"1|Ar":4,"1|Ra":130,"1|Rr":276919,"2|Aa":55661,"2|Ar":4,"2|Ra":46,"2|Rr":102344,"3+|Aa":15509,"3+|Ra":15,"3+|Rr":31165},"by_tell_hit":{"0|Rr":410124,"1|Aa":488298,"1|Ar":15,"1|Ra":191,"1|Rr":304}},"downstream_edge_effect":{"paired_diff":{"n":128,"mean":0.010618736694635977,"sd":0.08070880696892482,"se":0.0071337180886503525,"pos":68,"neg":60,"zero":0,"min":-0.15832046255820842,"max":0.3942467987059217},"per_seed":{"false_arb_total":205,"false_retail_total":68,"seeds_with_false_arb":106,"corr_diff_vs_false_arb":0.3089403697431866,"mean_diff_seeds_with_false_arb":{"n":106,"mean":0.012080073209792751,"sd":0.08641404475706832,"se":0.008393273998164832},"mean_diff_seeds_without":{"n":22,"mean":0.003577751667062433,"sd":0.044654275507473015,"se":0.009520323526534036}},"note":"seeds with >=1 OFF false-arb label (106/128) gain +0.0121 (se 0.0084), others +0.0036 (se 0.0095); corr(per-seed diff, false-arb count)=0.31. Label correction also re-rolls downstream fills, so per-seed diffs are mostly path noise (sd 0.081)."},"hypotheses":["H1 (counts: hit|0 -> 410035 Rr, 0 arb): every truth-arb first callback is tell-positive; a tell miss is always retail. All 273 errors lie inside the tell-positive set (489,000 callbacks), where 205 of 555 tell-positive retail fills (37%) get pi>0.5. Observable test: rate of pi>0.5 among tell-positive callbacks whose move size |ln(s/s_prev)| sits in the retail log-normal bulk.","H2 (counts: Ar=68, 52 at gap 1, 33 with no retail fill that step): false-retail labels on true arbs are tell-positive with pi<=0.5, i.e. small arb moves the filter density la scores low; observable as tell-positive + small post-trade move relative to filter sd.","H3 (counts: Ra rate 0.047% at gap 1 vs 0.083% at gap 4-6; corr 0.31 with per-seed gain): false-arb labels after silent steps (wider filter variance) carry most of the +0.0106; but with total label error 0.030% and the full oracle below 0.03, relabeling at the first callback is not a lever worth a deployable feature search."],"proposed_deployable_features_excluded":"none proposed from seed IDs, future prices or latent engine values; hypotheses use only tell result, step gap, side, move size and filter sd, all visible at a deployable callback.","limitations":["replica (engine-faithful Python port, proven bit-equal to the unrounded engine on 512 old seeds by A/362fb97f and A/72b58a14 and on 4 rows here); no engine run, no Solidity port, no fresh E seeds (10,200,000+), no Q or E gate claim, nothing submitted","single 128-seed round (stopped); se 0.0071 on a +0.0106 mean, so the sign is not settled at 2 se","counterfactual: truth enters only pi at the first-callback update; it is not an upper bound on what better labeling could achieve (other uses of truth, e.g. same-step callbacks or qx, are untouched)","subgroup counts are first-callback counts summed over seeds, not independent samples","pure-Python control port used for all arms (Cython rebuild used only as a bit-equality check of the baseline, 1.29x faster wall here)"],"engine_work":{"fresh_seeds_from_10200000":0,"engine_runs":0,"leaderboard_submissions":0},"inputs":{"replica_checked":"72b58a1407966f0223f06ab7c6ddd979a24fb4593f1a9b3dc43508a7f133d00b","cython_build":"8d5400696659b56bc12eeffc34dec5e58c5c119ddddaca681792db59586dd760","original_port":"60dc237fa0a4d42f3b6e2d2bed61c1a2df08d27c31ccd95cce508ee9c8689de4","engine_audit":"362fb97f041087bf3548c302af4c0f82d2537d6a6c0157a95ac06d0cb70a5ce4","qlx5":"1ef80bfb6d6791b877b1f4048a5e63cf2ae54153e6e8763ae3f8ab13132dfb15","kit":"identity-md-launches/goal-3178-build-shared-evaluation-kit@45e7563d1a29ffca9d608fdf60c90bf2624d2d01"}}