{"item":"e01-filter-grid64/rep-b","variant":"64-bucket posterior grid of z=ln(p/spot) (grid64), replicate B, independent build, not an RS2 overlay; policy = frozen oracle_table.json driven by p_hat=spot*exp(E[z]) and inferred arb flag","status":"complete for the replica evaluation asked; target gap<=2 NOT met (measured 6.49 +- 0.09 SE on 256 seeds)","headline":{"eval_seeds":"10000..10255 (256 seeds, 10000 steps each, replica.py configs drawn from seed)","oracle_table_true_p_true_flag":535.2162,"filtered_closed_loop":528.7263,"diag_true_p_inferred_flag":534.7217,"gap_oracle_minus_filter":{"n":256,"mean":6.4899,"se":0.0927,"ci95":[6.3083,6.6715]},"gap_oracle_minus_diag(flag inference cost)":{"n":256,"mean":0.4945,"se":0.0204,"ci95":[0.4546,0.5344]},"gap_diag_minus_filter(price-estimate cost)":{"n":256,"mean":5.9954,"se":0.093,"ci95":[5.8131,6.1777]},"callback_rms_bps":16.598,"coverage_50pct_interval":0.7013,"coverage_90pct_interval":0.9098,"mean_posterior_sd_bps":11.127,"reading":"Flag inference costs only 0.49; the price estimate between pins costs 6.0. Posterior is overdispersed at 50% (70% coverage) and about right at 90% (91%). Replica levels sit ~3-5 above board (brief); 535.2 oracle here vs brief's 532.45 on its 1000 seeds is seed-set difference."},"seeds_configs":{"train":"128..255 only (tuning used 128..192 at 10000 steps, plus 128..135 at 2000-3000 steps for debugging)","frozen_before_eval":true,"eval":"10000..10255","ablation":"10000..10063 router-likelihood off, not retuned","grid_error_shadow":"10000..10015, open-loop 256-bin shadow on the 64-bin closed-loop trajectory","never_touched":"5148000..5151999","configs":"replica.run(seed) draws size_mean~U(19,21), lam~U(0.6,1.0), sigma~U(0.000882,0.001008) from Random(10_000_000+seed); these are hidden from the filter","engine":"real Rust engine (amm_sim_rs wheel sha256 aedb6828...887a) was installed and validates StarterStrategy, but NOT used for scoring here: this item is a replica filter evaluation; no Solidity port"},"inputs":[{"url":"https://raw.githubusercontent.com/gtmcknight/amm-sim/main/research/filter-brief.md","sha256":"0ef2200226b68aa58de6aad268442ba09ada710c54b3fb0ec35c77b491f78a4b"},{"url":"https://raw.githubusercontent.com/gtmcknight/amm-sim/main/research/oracle_table.json","sha256":"3e9d1fc8874c6d796d4c26948d486b587f2a6b5610b20fba99923a60954cf4b5"},{"url":"https://raw.githubusercontent.com/gtmcknight/amm-sim/main/research/replica.py","sha256":"d079712fa1f4850ad8337e656e7ee8dbdde806cd4762d597fae50f547ef9c7c4","note":"used unmodified; harness only wraps the policy"},{"url":"https://raw.githubusercontent.com/gtmcknight/amm-sim/main/research/setup.sh","sha256":"dc7fa6a1e59f5b043d3954cf68d538318b7affaf5c0db3ca69a1822680f300d4"},{"url":"https://github.com/benedictbrady/amm-challenge","commit":"6b6921f8d463314aa7c96234e1be25a25245f704"}],"method":{"state":"64 bins over z=ln(p/spot), nodes lo+(i+0.5)h; z re-referenced to the new spot after every own trade (lo -= ln(s_after/s_before)). Start: delta at z=0 (p0 = initial spot 100 from init reserves 100/10000).","transition":"per elapsed step, Gaussian transition MASS from node points onto a fresh 64-bin grid spanning support +-5*sd_eff (sd_eff^2=sigma_hat^2+h^2/12): conservative recentering = grid follows the support each step; kernel-tail mass beyond 5 sd is recorded then renormalized","silent_steps":"every fully silent step t_last+1..t-1: diffuse, then truncate bins (uniform-within-bin fraction) to [ln(1-bid), -ln(1-ask)] using the fees in force then (stored own fees)","first_callback_at_t":"diffuse one step, then latent alternatives: A (arb) atom at zA = l - ln(1-oldAsk) if AMM sold X, zA = l + ln(1-oldBid) if AMM bought X (l = ln(s_after/s_before)); i.e. p = s_after/(1-oldAsk) or s_after*(1-oldBid). L_A = prior density at zA (density in l). R (retail): truncate to the band at s_before (no arb this step), times retail amount likelihood, times PRE*(1-exp(-lam0))*0.5, converted to density in l by |dl/damount|. wA = L_A/(L_A+L_R). Posterior = (1-wA)*R + wA*delta(zA), rebinned by mass- and mean-conserving cloud-in-cell onto 64 bins. Flag fed to table = wA>0.5.","later_callbacks_same_t":"retail only; no diffusion; multiply by router likelihood with the rival band widened by the cumulative |l| already seen at this step","router_likelihood":"for each node p, rival spot s2 uniform in ln over p*[e^-WID, e^+WID] (7 points; WID applies only to the first fill of a step, i.e. just after the rival's arb phase), order size lognormal(ln(20)-0.72, 1.2) marginalized: invert the replica's router split formula for the size that yields the observed fill (r = sqrt(g_own/g_rival) since x*y=K for both pools) with Jacobian; full-fill clamp branch uses lognormal(fill). Router-off ablation: z-independent half-split lognormal.","sigma":"sigma_hat^2 = (sum d^2 + N0*sigma0^2)/(sum dt + N0), d = ln p between consecutive pins with wA>0.9, N0=2000 steps, sigma0=0.000945. Acknowledged bias: pins are selected events (p just left the band) and misclassified retail pins add spurious moves; measured sigma_hat/sigma_true = 1.065 +- 0.030 (sd across seeds) in the filter arm, 1.191 in the diag arm.","policy":"oracle_table.json frozen: linear knot interpolation (np.interp, endpoint clamp) over d=ln(spot/p_hat) at -8..8 x 0.003; askFee=1-exp(d-ask*0.003), bidFee=1-exp(-bid*0.003-d), + arb_flag 0.1463 to both offsets when flag; clamp [0,0.1].","frozen_parameters":{"NB":64,"NSIG":5.0,"SIG0":0.000945,"SIG_N0":2000,"LAM0":0.8,"SIZE0":20.0,"SD_LN":1.2,"NQ":7,"GF_PRE":0.5,"GF_WID":0.006,"flag_threshold":0.5,"pin_threshold_for_sigma":0.9},"tuning_on_train_128_192_gap_oracle_minus_filter":{"PRE1_WID0.003":7.361,"PRE1_WID0.003_routeroff":6.744,"PRE0.5_WID0.003":6.99,"PRE2_WID0.003":9.616,"PRE1_WID0.006":6.816,"PRE1_WID0.0015":8.339,"PRE0.5_WID0.006(chosen)":6.725,"PRE0.5_WID0.009":6.578,"PRE0.35_WID0.009":7.02,"note":"64 seeds, oracle edge 518.775; differences <0.2 are within noise; chose 0.5/0.006 for lower RMS than 0.5/0.009"}},"hidden_input_isolation":"GridFilter.on_trade(is_buy, ax, ay, t, x, y) only; harness passes true p, s2, replica arb flag and init sigma/lam/size to nothing but evaluation lines (error, coverage, flag confusion) and to the oracle/diag arms' table input. Replay test: recorded observations through a fresh filter reproduce fees and wA bit-identically.","harness_changes":"none to replica.py (sha above). harness.py wraps the policy (Arm) and runs arms with multiprocessing.Pool(4), checkpoint jsonl per seed with resume. Simulator semantics preserved.","aggregate":{"oracle":{"edge":535.2162,"retail":566.713,"arb":-31.4968,"rv":76274.8037,"av":23965.6829,"fb":36.8191,"fa":35.8437},"filter":{"edge":528.7263,"retail":564.8124,"arb":-36.086,"rv":75243.3873,"av":25106.9483,"fb":37.2042,"fa":36.2416,"rms_bps":16.598,"callbacks":2631901,"mean_post_sd_bps":11.127,"cov50":0.7013,"cov90":0.9098,"flag_tp":858905,"flag_fp":284430,"flag_fn":51227,"flag_tn":531473,"kernel_tail_mass_lost_per_run":0.00131,"fallbacks":0,"sigma_hat_over_true_mean":1.065,"sigma_hat_over_true_sd":0.0297,"sec_per_run":1.16},"diag_truep_inferredflag":{"edge":534.7217,"retail":565.9722,"arb":-31.2504,"rv":75236.6084,"av":23664.7407,"fb":37.5225,"fa":36.5345,"rms_bps":17.233,"callbacks":2590977,"mean_post_sd_bps":10.418,"cov50":0.7059,"cov90":0.8968,"flag_tp":872334,"flag_fp":314108,"flag_fn":31603,"flag_tn":489604,"kernel_tail_mass_lost_per_run":0.00136,"fallbacks":0,"sigma_hat_over_true_mean":1.1906,"sigma_hat_over_true_sd":0.0519,"sec_per_run":1.11},"gap_oracle_minus_filter":{"n":256,"mean":6.4899,"se":0.0927,"ci95":[6.3083,6.6715]},"gap_oracle_minus_diag":{"n":256,"mean":0.4945,"se":0.0204,"ci95":[0.4546,0.5344]},"gap_diag_minus_filter":{"n":256,"mean":5.9954,"se":0.093,"ci95":[5.8131,6.1777]},"ablation_router_off_10000_10063":{"router_off":{"edge":520.1536,"retail":565.4468,"arb":-45.2932,"rv":74621.3328,"av":24285.7065,"fb":36.8589,"fa":36.3734,"rms_bps":15.696,"callbacks":655097,"mean_post_sd_bps":11.617,"cov50":0.7129,"cov90":0.9316,"flag_tp":207194,"flag_fp":55274,"flag_fn":18385,"flag_tn":149129,"kernel_tail_mass_lost_per_run":0.00124,"fallbacks":0,"sigma_hat_over_true_mean":1.0522,"sigma_hat_over_true_sd":0.0299,"sec_per_run":1.0},"router_on":{"edge":519.6945,"retail":566.477,"arb":-46.7826,"rv":74576.3271,"av":24778.8918,"fb":36.801,"fa":36.3071,"rms_bps":16.622,"callbacks":655277,"mean_post_sd_bps":11.144,"cov50":0.6991,"cov90":0.9092,"flag_tp":212950,"flag_fp":71410,"flag_fn":12780,"flag_tn":132918,"kernel_tail_mass_lost_per_run":0.0013,"fallbacks":0,"sigma_hat_over_true_mean":1.0675,"sigma_hat_over_true_sd":0.0291,"sec_per_run":1.27},"gap_oracle_minus_routeroff":{"n":64,"mean":6.2359,"se":0.1809,"ci95":[5.8814,6.5904]},"gap_oracle_minus_routeron_same64":{"n":64,"mean":6.6951,"se":0.1823,"ci95":[6.3377,7.0524]},"routeron_minus_routeroff":{"n":64,"mean":-0.4591,"se":0.0877,"ci95":[-0.6309,-0.2873]}},"grid_error_64_vs_256_shadow_10000_10015":{"seeds":16,"rms_mean_diff_64_vs_256_bps":0.272,"rms_err_256_bps":16.359,"rms_err_64_bps":16.433,"tail_mass_lost_64":0.0013,"tail_mass_lost_256":0.00129}},"tests":{"command":". scratch/env.sh && python tests.py (in the work dir holding replica.py, oracle_table.json, grid64.py, harness.py, out/*.jsonl)","results":{"isolation_replay_identical_3000_steps":true,"filter_source_mentions_truth":false,"pin_sellX":{"wA":0.4644,"mu_bps":11.888,"true_bps":30.045,"atom_mass_within_1bp_of_truth":0.4644,"sign_ok":true},"pin_buyX":{"wA":0.4644,"mu_bps":-11.885,"true_bps":-30.045,"atom_mass_within_1bp_of_truth":0.4644,"sign_ok":true},"pin_note":"t=30 after 29 silent steps at 30bps fees, p 36bps outside spot; posterior is the arb/retail mixture, so mean is pulled toward retail branch by (1-wA)","diffusion_steps_t0..5_then_repeat_then_t9":[6,6,10],"repeat_ok":true,"gap_propagation_ok":true,"silent50_mass":1.0,"silent50_mean_in_band":true,"silent50_sd_bps":17.11}},"commands":["python harness.py oracle 10000 10255 out/oracle.jsonl","python harness.py filter 10000 10255 out/filter.jsonl","python harness.py diag 10000 10255 out/diag.jsonl","python harness.py filter_norouter 10000 10063 out/norouter.jsonl","python harness.py filter_shadow256 10000 10015 out/shadow.jsonl","python tests.py","GF_PRE=.. GF_WID=.. python quick.py oracle,filter 128 192 10000 (tuning)"],"runtime":{"eval_oracle+filter+diag(256 each)+ablation(64)+extra oracle(64)":"169 s wall on 4 cores","shadow256_16_seeds":"51 s","filter_sec_per_10000_step_run":1.16,"total_item_wall":"about 45 minutes including setup, coding and tuning"},"port_cost_estimate_UNMEASURED":"State: 64 bins + lo,h,sigma stats, t_last, last pin: 64 masses as uint32 packed 8 per slot = 8 slots + 2 slots scalars (~10 SSTORE, ~25-50k gas warm/cold). Compute as implemented: each step is a 64x64 erf kernel (4096 erf) ~1M+ gas, so a direct port is infeasible under 245k; a port needs a fixed-h grid with a precomputed shift-invariant kernel (~15 taps, ~1k MACs ~30-50k gas per step) and collapsing k silent steps into one sigma*sqrt(k) diffusion plus one truncation (approximation, not measured here), router likelihood with 7 quadrature points x 64 nodes needs a ln/exp table (~64*7*~300 gas ~130k) and would likely be dropped (it hurt anyway). No Solidity written.","dead_ends":["Router likelihood as specified (rival uniform within its band, lognormal size) HURTS: router-on minus router-off = {\"n\": 64, \"mean\": -0.4591, \"se\": 0.0877, \"ci95\": [-0.6309, -0.2873]} on 10000..10063 (and +0.62 worse gap on train 128..192 at PRE=1). Likely cause: the rival is not uniform in its band (it sits at the band edge after its own arb) and the size prior is fixed; not retuned per brief.","Arb/retail discrimination at the first callback is weak: confusion on eval (filter arm, first callbacks) tp=858905 fp=284430 fn=51227 tn=531473; arb trades of 5-15 bps look like retail fills. But hard-flag cost is only 0.49 (diag arm), so the loss is in the mean, not the flag.","PRE multiplier on the retail-hypothesis prior: 2.0 -> gap 9.62, 1.0 -> 7.36, 0.5 -> 6.99, 0.35 -> 7.02 (train 128..192).","Unit test with a 40 bps arb at t=0 from a delta prior classifies as retail (wA=0.002): a 4-sigma one-step move is genuinely implausible; the test was moved to t=30 where wA=0.46 and the atom carries exactly wA mass at the true z."],"limitations":["Replica only (pure Python, levels differ from the Rust engine by ~1%); no engine run, no Solidity, no 4,000-seed confirm (out of scope for this item).","Gap target <=2 not reached: 6.49 [6.31, 6.67] 95% CI.","Grid error is negligible vs filter error: 64 vs 256 bins differ by 0.27 bps RMS in the mean (16 seeds), RMS error 16.43 vs 16.36 bps; kernel tail mass lost ~0.0013 per whole run.","Silence model ignores the information in retail orders that route entirely to the rival and retail at t_last after the last own fill.","lambda and size are fixed priors (0.8, 20), not learned online.","Retail fill probability under R uses (1-exp(-lam0))*0.5, ignoring that some orders give no fill to us.","Per-seed rows list filter-arm retail/arb edge and volume plus oracle-arm splits; diag splits are only aggregated."],"per_seed":{"columns":["seed","filter_edge","oracle_edge","diag_edge","f_retail","f_arb","f_rv","f_av","o_retail","o_arb","o_rv","o_av","sqlogerr_sum","n_callbacks"],"rows":[[10000,439.15,445.68,445.66,462.45,-23.3,61538.9,21554.8,465.43,-19.74,62675.9,20750.2,0.022298,8425],[10001,566.8,572.58,572.2,597.26,-30.46,87563.8,27099.1,598.35,-25.76,88625.9,26003.2,0.029714,11707],[10002,521.76,527.96,527.43,553.48,-31.72,68253.7,25120.9,555.45,-27.49,69313.4,23992.1,0.026526,9595],[10003,565.69,573.65,573.64,596.46,-30.78,81798.2,27144.3,599.42,-25.77,82803.4,25935.7,0.030917,11135],[10004,516.93,524.58,524.19,544.05,-27.11,72587.3,24550.7,547.56,-22.98,73739.1,23809.0,0.023595,9886],[10005,522.66,527.72,528.03,550.47,-27.82,72637.0,24216.2,550.98,-23.25,73536.7,23415.1,0.026109,9924],[10006,479.01,487.63,486.95,506.5,-27.49,74174.0,24233.7,510.14,-22.51,75295.3,22987.6,0.027419,10273],[10007,520.15,527.21,526.54,548.64,-28.49,76134.5,24658.9,551.18,-23.97,77241.7,23734.7,0.029064,10466],[10008,654.25,664.11,663.46,687.84,-33.59,94976.7,28833.4,692.07,-27.96,96182.8,27361.5,0.032808,12049],[10009,645.59,653.72,653.35,678.02,-32.43,91775.5,28344.2,681.55,-27.83,92582.0,27195.2,0.032608,12098],[10010,473.13,479.55,479.38,499.75,-26.62,75196.5,23964.3,501.59,-22.04,76559.1,22846.0,0.029748,10715],[10011,365.81,371.52,370.73,386.44,-20.63,58135.7,19289.4,388.94,-17.41,58837.2,18499.1,0.020739,8329],[10012,453.79,459.01,458.07,481.17,-27.38,74252.8,24171.1,481.25,-22.24,75283.0,22752.0,0.032431,10372],[10013,398.42,402.84,402.57,419.66,-21.23,57300.9,19528.6,420.48,-17.64,58203.6,18876.2,0.02025,8295],[10014,696.69,702.85,702.78,734.27,-37.58,86696.8,27670.2,735.24,-32.39,87672.9,26631.4,0.028893,11215],[10015,622.26,632.35,631.86,656.47,-34.2,91856.6,29015.4,660.94,-28.59,93503.0,27734.4,0.035874,11788],[10016,560.89,569.33,568.94,631.51,-70.62,70651.7,24540.6,635.45,-66.12,71950.9,23389.4,0.028547,9666],[10017,489.78,494.5,494.09,518.01,-28.24,71871.1,24625.7,518.83,-24.33,73102.3,23875.5,0.024622,10054],[10018,475.96,482.17,481.51,502.99,-27.03,69579.6,24530.8,504.76,-22.59,70468.3,23389.5,0.024234,9588],[10019,450.14,455.47,454.95,473.26,-23.11,61090.5,21308.8,474.96,-19.49,62125.1,20406.8,0.021486,8415],[10020,491.45,498.15,497.83,517.76,-26.3,67598.3,24153.1,521.04,-22.89,68459.2,23205.9,0.023346,9363],[10021,407.19,413.41,412.06,429.03,-21.84,56367.3,20496.4,431.32,-17.9,57694.6,19503.5,0.024947,8343],[10022,434.89,442.05,441.53,458.7,-23.8,61040.0,21288.9,461.87,-19.82,61812.1,20258.8,0.02504,8662],[10023,628.28,635.3,634.55,662.53,-34.25,86537.6,27570.8,664.3,-29.0,87928.1,26225.6,0.029685,10902],[10024,475.78,483.68,483.08,503.67,-27.9,72671.0,24843.9,506.96,-23.29,73871.9,23742.6,0.028759,10543],[10025,442.73,447.67,446.8,467.39,-24.66,61690.1,21505.8,468.13,-20.47,62443.0,20480.2,0.02674,9180],[10026,342.83,347.39,346.91,362.8,-19.97,53733.4,19032.6,364.63,-17.24,54624.3,18424.6,0.021517,8342],[10027,543.96,549.7,549.49,573.85,-29.89,72729.2,25527.1,574.39,-24.69,73912.3,24197.0,0.031928,10122],[10028,521.04,527.77,527.59,552.03,-30.98,67645.9,23906.5,554.83,-27.06,68636.1,23006.4,0.026157,9254],[10029,436.36,444.58,443.42,460.51,-24.15,72036.6,22597.4,464.82,-20.23,72759.9,21296.3,0.02834,10312],[10030,590.41,597.82,596.99,624.16,-33.76,88764.6,28605.9,625.56,-27.74,89759.8,27046.8,0.034542,11698],[10031,336.56,343.56,342.49,359.22,-22.66,57004.2,20897.0,361.74,-18.18,58011.8,19671.3,0.027658,8631],[10032,630.67,637.94,637.6,663.0,-32.33,85972.6,27585.0,664.71,-26.77,86665.2,26071.3,0.028767,10971],[10033,530.64,536.47,536.27,561.22,-30.58,81171.8,26419.2,561.38,-24.91,82155.1,25099.6,0.031548,10826],[10034,559.26,566.53,565.74,588.8,-29.55,83595.6,25992.5,590.85,-24.32,84707.2,24619.4,0.03467,11445],[10035,627.0,636.15,635.08,661.6,-34.6,93755.0,29188.3,664.6,-28.45,95095.9,27580.5,0.034304,12238],[10036,539.71,546.61,545.98,569.99,-30.28,81079.9,26034.3,571.12,-24.51,82299.7,24452.7,0.033447,10944],[10037,439.7,445.19,444.6,464.31,-24.61,66560.4,22568.8,466.13,-20.94,67463.8,21410.7,0.025178,9384],[10038,614.68,620.6,619.81,647.42,-32.74,91287.9,28386.5,647.59,-26.99,92526.2,26774.9,0.037144,12394],[10039,583.55,590.59,589.79,617.89,-34.34,78055.5,25614.3,619.97,-29.38,79366.7,24324.3,0.032424,10580],[10040,602.92,609.97,610.28,634.42,-31.5,90663.7,28115.5,636.92,-26.95,91583.5,27149.7,0.029961,12235],[10041,623.73,632.27,631.87,654.02,-30.29,86017.2,27191.8,657.78,-25.51,86753.1,25889.8,0.028425,11301],[10042,706.46,711.21,711.36,741.76,-35.3,93163.4,30006.1,740.97,-29.76,94008.0,28684.4,0.02925,12122],[10043,631.45,639.26,638.66,663.94,-32.49,88525.3,27814.2,666.8,-27.54,89317.9,26457.0,0.03348,11542],[10044,416.61,421.89,421.42,440.35,-23.74,60962.8,21567.1,441.49,-19.6,61836.4,20568.2,0.020973,8476],[10045,382.47,388.1,387.53,406.48,-24.01,60906.0,22003.8,408.24,-20.14,61897.6,21024.5,0.027085,9002],[10046,426.38,434.19,433.19,454.74,-28.36,68779.8,24672.0,457.45,-23.26,69989.2,23412.0,0.029451,10010],[10047,591.61,599.63,599.37,624.82,-33.21,90650.9,29038.5,627.58,-27.95,92297.6,27513.5,0.030924,12052],[10048,491.83,497.21,496.38,518.64,-26.81,71100.3,23677.6,519.67,-22.46,71937.2,22578.9,0.02969,9960],[10049,379.19,385.92,385.38,399.85,-20.67,57009.0,19773.4,403.3,-17.38,57913.7,18881.8,0.022371,8519],[10050,369.93,378.55,377.8,391.91,-21.98,57439.1,20673.9,397.26,-18.71,58403.8,19888.4,0.023826,8740],[10051,419.66,424.73,424.12,442.82,-23.16,59853.4,21288.2,444.66,-19.93,61019.2,20861.3,0.02284,8561],[10052,424.82,431.54,430.63,450.27,-25.46,68494.3,23114.8,452.52,-20.98,69599.4,22037.8,0.028389,10056],[10053,533.09,538.02,537.56,561.79,-28.7,73188.4,24577.3,561.56,-23.54,74075.3,23255.8,0.028294,10068],[10054,440.89,444.32,443.42,469.72,-28.83,63561.5,22503.2,468.33,-24.01,64442.6,21140.2,0.029672,9134],[10055,703.53,710.74,709.65,740.35,-36.82,95370.8,30941.1,741.36,-30.62,96633.6,29556.2,0.034508,12426],[10056,576.9,583.46,583.26,606.63,-29.73,83702.3,26236.9,608.56,-25.1,84401.3,25291.4,0.02738,10802],[10057,505.07,510.83,509.95,531.43,-26.36,68758.9,23539.5,532.81,-21.98,69676.4,22301.7,0.02801,9639],[10058,435.06,440.07,439.34,457.93,-22.87,58577.8,21059.2,459.6,-19.53,59355.0,20169.3,0.022708,8824],[10059,501.85,509.43,508.99,530.84,-28.98,71801.4,25323.5,534.18,-24.74,72847.8,24403.8,0.026992,9873],[10060,921.98,928.78,928.52,2095.4,-1173.41,91239.5,31729.3,2097.79,-1169.01,92364.9,30248.8,0.032741,11646],[10061,555.6,562.89,562.19,584.15,-28.54,82633.1,25606.1,587.03,-24.13,83911.5,24668.9,0.029683,11205],[10062,600.19,610.97,610.65,631.26,-31.08,89364.2,27486.0,636.67,-25.7,90987.0,26017.3,0.034659,11766],[10063,423.64,429.33,428.83,446.41,-22.77,63753.3,21294.7,448.66,-19.32,64899.9,20338.0,0.025059,9189],[10064,656.35,662.11,661.92,691.34,-34.99,94439.1,29012.8,691.76,-29.65,95375.4,27643.7,0.030861,12060],[10065,579.98,586.35,585.92,610.18,-30.2,82139.6,26215.7,611.99,-25.65,83054.3,25086.1,0.030071,10902],[10066,479.21,486.2,485.36,505.83,-26.62,73330.9,23638.4,508.71,-22.5,74209.3,22714.0,0.028527,9900],[10067,629.14,635.01,634.65,661.21,-32.07,79757.3,26623.8,662.2,-27.19,80612.3,25592.5,0.026138,10504],[10068,499.9,504.96,505.05,525.05,-25.15,60200.2,23013.1,527.02,-22.06,61435.2,22258.6,0.021197,8608],[10069,617.38,623.17,622.98,648.25,-30.87,80711.8,26422.9,649.62,-26.46,81738.8,25253.8,0.028301,10884],[10070,407.58,413.64,413.06,432.4,-24.82,57959.5,22347.8,434.48,-20.84,59110.0,21204.3,0.024808,8323],[10071,431.68,437.32,436.54,455.21,-23.53,62297.2,21312.1,457.18,-19.86,63530.3,20212.3,0.026937,8923],[10072,599.69,605.89,605.61,648.41,-48.73,77059.9,24646.4,651.23,-45.34,78127.0,23887.5,0.026753,10421],[10073,562.24,567.73,567.15,591.22,-28.98,81193.4,26341.7,592.59,-24.86,81977.7,25489.1,0.026775,10866],[10074,525.47,533.09,533.34,553.09,-27.63,73995.7,24377.7,556.81,-23.72,74947.0,23394.8,0.025681,10036],[10075,555.97,562.43,561.86,585.93,-29.97,79647.3,26173.1,587.22,-24.8,80847.8,24748.0,0.032934,11163],[10076,523.73,530.86,530.33,552.66,-28.93,78230.2,25624.1,555.45,-24.59,79544.4,24536.4,0.029024,10841],[10077,424.11,430.35,429.82,448.08,-23.98,66476.0,22131.1,450.09,-19.75,67501.3,20810.3,0.028887,9698],[10078,614.29,622.08,622.07,647.39,-33.1,89145.2,27174.2,649.53,-27.45,90459.4,25915.6,0.032082,11445],[10079,645.5,650.6,650.7,680.46,-34.96,88862.1,29026.3,679.75,-29.15,89864.7,27638.8,0.034135,11631],[10080,482.25,488.07,488.15,511.19,-28.94,69391.4,25028.8,511.78,-23.71,70169.1,23521.5,0.028341,9610],[10081,563.01,567.41,566.98,593.66,-30.65,75857.4,25703.9,593.5,-26.08,76711.2,24565.9,0.026298,10135],[10082,561.66,566.75,566.69,590.82,-29.16,75766.5,25259.8,591.77,-25.02,76932.0,24101.9,0.02846,10298],[10083,461.6,467.21,466.84,488.0,-26.4,72790.9,24125.5,489.64,-22.43,73590.9,23243.0,0.024557,10337],[10084,470.22,476.21,475.51,496.01,-25.78,68382.7,22990.6,497.38,-21.18,69537.8,21897.8,0.025922,9220],[10085,450.95,455.72,454.97,475.38,-24.43,63275.1,22527.5,476.5,-20.78,63971.2,21520.7,0.023396,9106],[10086,566.8,573.84,573.38,598.39,-31.6,83625.7,26861.8,599.91,-26.07,84818.4,25516.6,0.03277,11229],[10087,564.77,571.97,571.42,594.43,-29.66,86334.3,26138.2,596.53,-24.57,87788.9,24983.3,0.033098,11752],[10088,435.24,442.48,441.83,461.12,-25.89,66293.4,23231.1,464.67,-22.19,67514.0,22278.4,0.02691,9236],[10089,409.38,414.9,413.81,433.65,-24.28,60407.2,21954.8,435.17,-20.26,61437.0,20855.1,0.024488,8512],[10090,580.22,587.68,586.65,613.87,-33.65,87310.2,28305.7,615.69,-28.01,88384.6,26948.0,0.032765,11835],[10091,481.21,486.86,486.54,508.65,-27.44,67392.5,24011.7,510.75,-23.89,68348.7,22955.8,0.02438,9662],[10092,553.87,557.74,558.07,581.57,-27.7,74842.4,24916.3,581.48,-23.74,75794.4,23932.7,0.025334,10046],[10093,654.86,663.39,663.26,695.81,-40.95,92618.1,29026.9,699.15,-35.76,93750.1,27632.8,0.033245,12038],[10094,474.39,480.63,480.46,502.43,-28.05,68578.0,24961.0,504.36,-23.73,69559.8,23972.7,0.024391,9581],[10095,589.79,597.95,597.76,622.87,-33.07,84711.5,27839.5,624.98,-27.04,86224.6,26286.0,0.033973,11142],[10096,487.13,492.09,492.08,512.84,-25.72,66500.8,23259.0,513.59,-21.5,67388.8,22189.3,0.02441,9302],[10097,506.25,512.78,512.61,532.04,-25.79,72528.7,22879.1,534.44,-21.66,73626.5,21849.9,0.028569,10042],[10098,497.98,503.26,502.89,524.86,-26.88,76407.5,24387.1,525.88,-22.62,77056.5,23409.1,0.029278,10884],[10099,464.59,470.46,469.77,489.67,-25.07,71552.5,23023.8,491.43,-20.97,72535.9,22150.8,0.026746,9754],[10100,439.69,444.11,443.66,468.9,-29.21,61332.2,22320.8,469.17,-25.06,62527.8,21210.4,0.027522,8667],[10101,529.61,536.95,536.43,558.6,-28.99,75644.3,25128.0,560.53,-23.58,76583.4,23932.7,0.028537,10397],[10102,730.07,737.22,737.36,770.08,-40.01,97793.2,30692.6,771.58,-34.37,98773.2,29531.1,0.03088,12605],[10103,735.45,741.54,741.39,770.03,-34.58,92975.5,28995.9,770.88,-29.34,93943.9,27808.1,0.03181,11897],[10104,697.73,703.15,703.08,734.52,-36.79,96698.9,30751.1,733.45,-30.29,97836.8,29156.0,0.031463,12234],[10105,466.41,472.25,472.12,491.78,-25.37,62945.4,23146.0,493.69,-21.44,63971.3,22504.4,0.024879,9178],[10106,426.32,429.55,429.12,450.93,-24.6,58867.5,20756.0,450.28,-20.73,59645.2,19830.5,0.022896,8353],[10107,484.38,491.97,491.42,512.21,-27.83,71532.0,24693.6,515.42,-23.45,72703.6,23671.6,0.028216,9994],[10108,528.45,535.48,534.47,559.11,-30.67,74888.5,25591.2,561.94,-26.46,76029.3,24762.6,0.028867,10460],[10109,732.07,738.83,738.66,784.18,-52.11,96113.2,29781.2,785.2,-46.37,97073.5,28431.6,0.032609,12010],[10110,566.5,572.96,572.28,597.23,-30.73,89078.6,27006.9,598.9,-25.94,89948.3,25753.4,0.031887,12223],[10111,398.57,406.3,406.06,423.94,-25.37,60469.2,22732.7,427.79,-21.48,61769.9,21909.3,0.024794,8713],[10112,458.1,464.07,463.4,484.64,-26.54,64907.6,23207.3,486.23,-22.16,65699.0,22298.2,0.024933,8901],[10113,432.03,436.53,435.77,455.38,-23.35,61911.1,21484.2,456.17,-19.64,62787.3,20343.0,0.024386,8910],[10114,530.61,535.08,534.43,559.64,-29.04,81095.5,25851.9,558.95,-23.87,82133.5,24578.5,0.029846,11321],[10115,654.58,663.15,663.36,689.02,-34.44,92987.2,29754.1,692.4,-29.24,94157.6,28539.4,0.03146,12035],[10116,518.12,526.86,526.1,545.25,-27.13,74477.2,24328.6,549.63,-22.77,75362.6,23337.1,0.026481,9595],[10117,408.02,413.05,412.63,431.66,-23.64,61244.0,21955.1,433.02,-19.97,62164.0,20894.3,0.023476,8626],[10118,419.24,424.53,424.71,444.24,-24.99,61210.3,22914.4,445.83,-21.3,62259.0,21920.4,0.021141,8649],[10119,411.15,416.95,416.99,436.45,-25.31,62548.3,22568.4,437.95,-21.0,63496.8,21587.4,0.023619,8641],[10120,544.63,553.43,552.9,575.4,-30.77,83681.5,26971.9,579.0,-25.57,84469.5,25696.7,0.031717,11332],[10121,528.84,536.69,535.86,559.46,-30.62,79819.0,26542.3,561.8,-25.11,81214.7,25202.0,0.033743,11116],[10122,580.5,587.94,587.22,613.14,-32.64,86495.6,27365.7,614.97,-27.02,87700.3,25883.9,0.034835,11457],[10123,501.17,506.72,506.55,529.78,-28.61,71471.4,25446.7,530.57,-23.86,72650.4,24285.2,0.026112,9533],[10124,523.58,533.84,533.04,553.0,-29.42,73843.7,25687.2,558.5,-24.66,75113.1,24609.6,0.030881,10198],[10125,451.95,455.31,454.83,479.1,-27.16,71294.2,24287.3,477.64,-22.33,72280.2,23038.3,0.028732,9735],[10126,453.05,460.69,459.67,477.4,-24.34,64970.5,21325.4,481.21,-20.51,66047.4,20326.3,0.029489,9296],[10127,489.24,495.76,495.27,516.69,-27.44,72607.7,24692.5,518.8,-23.04,73636.0,23522.2,0.027963,10388],[10128,727.89,732.52,732.15,771.03,-43.13,97626.0,31123.4,769.39,-36.86,98182.2,29572.0,0.03164,12550],[10129,530.71,535.3,534.87,559.54,-28.83,78056.5,25681.4,559.9,-24.6,78739.5,24589.3,0.027735,10517],[10130,456.58,461.72,461.17,482.1,-25.52,68159.8,23275.6,483.33,-21.62,69077.8,22130.8,0.026964,9756],[10131,492.37,499.68,498.71,518.98,-26.61,67059.4,23296.2,522.59,-22.91,68305.5,22361.8,0.02565,9258],[10132,499.07,503.6,503.19,524.02,-24.95,65160.4,22691.3,525.56,-21.96,66052.8,21957.1,0.021775,9103],[10133,625.09,631.5,631.16,655.25,-30.16,85246.1,27099.2,657.09,-25.59,86472.0,25991.0,0.029764,11291],[10134,530.17,536.23,536.11,561.29,-31.12,77029.2,26845.0,562.46,-26.23,78211.9,25530.3,0.029119,10700],[10135,454.62,459.54,459.01,481.8,-27.18,69636.7,24110.4,482.07,-22.53,70066.4,22997.1,0.025066,9878],[10136,609.95,620.34,620.24,641.69,-31.75,89815.4,27242.6,646.98,-26.64,90948.9,25917.2,0.03355,11951],[10137,616.1,622.68,622.3,647.27,-31.17,86819.0,27361.2,648.65,-25.98,87946.3,26090.7,0.029676,11137],[10138,493.15,501.37,500.56,520.58,-27.43,67651.1,24110.7,524.74,-23.37,68393.0,23183.3,0.023992,9596],[10139,460.74,467.56,466.94,486.23,-25.49,68100.3,22792.4,489.01,-21.45,69183.8,22078.3,0.027108,9397],[10140,548.08,552.86,552.69,575.78,-27.7,79434.9,25568.1,576.4,-23.55,79958.9,24330.9,0.024013,10711],[10141,576.46,580.65,580.93,613.22,-36.76,79014.4,25526.3,613.56,-32.9,79716.4,24308.5,0.027248,10609],[10142,620.6,628.25,627.86,655.01,-34.41,92363.9,29419.4,657.0,-28.75,93782.0,28066.2,0.033271,11967],[10143,466.2,471.45,471.37,490.94,-24.74,65130.2,22308.9,492.0,-20.55,66033.3,21128.1,0.022296,8737],[10144,434.99,440.81,440.3,460.17,-25.18,66316.1,22832.4,462.01,-21.2,67257.8,21701.7,0.026355,9482],[10145,476.12,481.6,481.04,501.18,-25.06,67002.8,23048.0,503.59,-22.0,68116.8,22496.2,0.025231,9647],[10146,754.18,765.78,765.96,1025.25,-271.07,86391.4,29701.0,1030.38,-264.6,87523.3,28422.9,0.034456,11476],[10147,464.77,469.59,468.74,490.93,-26.17,68737.3,23786.1,491.65,-22.06,69300.4,22773.4,0.02424,9634],[10148,686.75,692.35,691.78,719.83,-33.08,89488.5,28011.2,720.96,-28.61,90018.1,27080.8,0.027392,11064],[10149,515.89,523.63,522.74,549.52,-33.63,76760.2,26841.7,552.5,-28.87,77919.2,25707.9,0.031855,10612],[10150,579.79,589.25,588.44,610.63,-30.84,83329.8,26924.7,615.02,-25.77,84703.9,25602.1,0.031889,11303],[10151,469.99,474.56,473.89,495.14,-25.15,68789.9,23115.5,495.79,-21.24,69775.4,22186.8,0.026315,9786],[10152,412.43,418.11,417.82,436.53,-24.09,60381.8,22277.9,438.22,-20.11,61647.4,21430.1,0.022585,8576],[10153,551.37,555.93,555.23,580.05,-28.68,81215.7,25591.7,579.66,-23.73,82123.3,24364.7,0.028986,11191],[10154,485.9,490.94,490.51,510.74,-24.84,71656.9,22953.9,511.99,-21.05,72437.3,22045.7,0.023835,10056],[10155,471.26,478.58,478.19,496.08,-24.82,68506.1,22149.3,499.15,-20.57,69513.5,21128.4,0.028201,9894],[10156,528.85,534.11,533.69,564.96,-36.12,68912.0,24026.1,565.42,-31.31,69939.3,22958.9,0.027343,9764],[10157,528.34,537.99,537.48,553.88,-25.54,75093.4,23547.8,559.43,-21.44,76479.3,22667.2,0.025912,9844],[10158,432.47,437.86,437.2,457.31,-24.84,61608.0,23048.5,459.49,-21.63,62652.5,22145.4,0.021236,8542],[10159,433.17,439.39,438.61,458.81,-25.64,63471.7,23352.8,461.22,-21.82,64756.4,22390.1,0.027818,9250],[10160,418.48,422.61,421.87,444.18,-25.71,61565.3,23023.6,443.91,-21.3,62739.3,22032.5,0.023783,8693],[10161,452.36,458.62,458.62,478.56,-26.21,65992.9,23701.8,481.19,-22.57,66902.6,23046.3,0.022559,9251],[10162,716.59,721.72,721.35,751.55,-34.97,98783.7,29620.3,750.71,-28.99,99412.2,28286.8,0.029344,12144],[10163,660.37,669.13,668.61,695.26,-34.89,95604.6,30022.9,698.12,-28.98,96491.2,28433.5,0.033159,12375],[10164,678.74,684.24,683.85,798.56,-119.81,83620.5,28161.3,797.9,-113.65,84637.3,27140.3,0.030905,10986],[10165,436.47,441.79,441.67,461.85,-25.39,68391.5,22651.1,463.38,-21.59,69229.1,21617.5,0.025769,9772],[10166,414.13,419.54,419.37,438.03,-23.89,59061.3,21573.4,439.55,-20.02,60228.7,20326.8,0.025609,8562],[10167,490.0,494.24,494.01,518.45,-28.45,67837.7,23471.4,518.32,-24.08,68553.1,22548.1,0.025093,9845],[10168,620.0,627.24,626.39,741.14,-121.14,71028.0,26176.2,743.47,-116.23,72372.6,25179.8,0.02878,9687],[10169,565.0,572.88,572.16,593.99,-28.99,84768.4,25986.6,596.62,-23.74,86227.2,24856.6,0.029913,10999],[10170,382.95,389.7,388.79,407.16,-24.21,62384.0,21798.4,409.69,-19.99,63579.9,20750.0,0.028487,9175],[10171,565.42,568.42,568.09,594.65,-29.23,73427.5,25470.0,592.95,-24.53,73966.4,24504.8,0.024937,9865],[10172,679.59,686.94,685.9,716.52,-36.93,94640.5,29334.2,718.27,-31.33,96020.8,27825.0,0.035482,11883],[10173,392.55,398.48,397.97,414.36,-21.82,56097.5,20075.3,416.84,-18.36,57172.7,19102.4,0.023273,8374],[10174,535.71,544.04,543.68,565.76,-30.05,83093.3,26667.8,569.15,-25.11,84192.2,25323.0,0.031058,11308],[10175,500.72,505.19,504.5,527.8,-27.07,72637.2,23854.4,527.59,-22.41,73421.1,22900.0,0.025652,9806],[10176,441.4,449.16,448.39,467.18,-25.78,67071.3,23305.5,470.67,-21.52,68039.4,22220.6,0.02393,9436],[10177,648.89,656.15,655.54,720.38,-71.49,82853.1,26989.3,723.55,-67.4,84006.7,25567.2,0.028569,11022],[10178,655.6,664.21,664.17,691.03,-35.42,90933.3,28242.9,693.64,-29.43,92440.2,26773.1,0.033996,11326],[10179,376.23,382.43,381.36,400.0,-23.77,57455.6,21510.1,402.56,-20.13,58039.3,20550.9,0.023311,8410],[10180,578.67,585.75,585.41,611.45,-32.79,82136.8,28285.7,613.76,-28.01,82863.4,27032.0,0.030698,11000],[10181,457.18,463.97,463.28,484.24,-27.07,69763.5,24263.1,486.56,-22.59,71357.5,23215.1,0.031744,10029],[10182,568.31,575.17,574.93,599.84,-31.53,84427.5,27630.9,601.24,-26.07,85531.3,26442.7,0.029098,10978],[10183,625.95,633.1,632.96,662.55,-36.59,85606.2,28211.0,664.19,-31.09,86634.0,26556.6,0.033179,11343],[10184,516.52,522.57,521.71,552.39,-35.87,65630.5,23835.0,554.68,-32.11,66433.0,22991.7,0.024977,9206],[10185,537.09,545.63,545.12,572.08,-34.99,76964.0,25785.1,575.64,-30.01,78505.7,24520.7,0.033105,10602],[10186,569.68,575.46,574.97,600.68,-31.0,72068.8,26030.4,601.64,-26.18,73215.0,24722.0,0.029554,10110],[10187,544.46,551.66,550.95,583.78,-39.31,75586.3,24481.1,587.27,-35.61,76596.7,23534.2,0.025282,10000],[10188,527.64,533.4,532.79,557.13,-29.49,78803.0,25667.5,557.76,-24.35,79826.1,24323.2,0.028183,10594],[10189,712.71,717.58,717.68,749.75,-37.05,94001.7,29726.0,749.15,-31.58,94950.6,28257.1,0.033592,12245],[10190,653.14,661.69,660.96,687.46,-34.32,85478.2,27606.4,691.01,-29.32,86593.4,26388.1,0.030109,11354],[10191,657.68,662.48,662.0,695.27,-37.59,88271.9,27327.4,694.8,-32.33,89216.1,26095.4,0.031073,11642],[10192,658.46,665.87,665.29,692.72,-34.26,92103.2,28233.8,693.75,-27.88,93249.3,26495.2,0.036257,12010],[10193,577.21,583.35,582.59,608.43,-31.22,85457.0,27668.2,608.68,-25.34,86069.9,26114.6,0.028525,11722],[10194,505.39,512.13,511.3,536.04,-30.65,80227.9,26788.7,537.52,-25.39,80970.0,25248.7,0.031429,10957],[10195,548.31,554.53,553.99,578.44,-30.13,80375.8,26348.3,580.04,-25.52,81175.4,25363.8,0.028286,11089],[10196,578.83,587.12,586.75,611.92,-33.09,85776.1,27652.9,614.76,-27.63,86662.4,26571.6,0.03604,11724],[10197,436.31,443.35,442.86,461.42,-25.11,64058.0,23167.9,464.4,-21.05,65132.3,21997.9,0.026036,8791],[10198,551.22,558.4,558.07,583.93,-32.71,74152.7,25834.2,585.83,-27.43,75026.7,24607.5,0.02762,10543],[10199,478.98,483.7,483.41,511.53,-32.55,63126.9,22642.2,511.4,-27.7,64109.1,21490.6,0.023929,8858],[10200,555.68,563.07,562.9,585.5,-29.81,81542.6,26045.8,588.22,-25.14,82790.9,24875.1,0.030062,11024],[10201,477.89,482.41,481.92,503.74,-25.85,73903.6,23389.4,503.45,-21.05,74911.2,22273.1,0.027183,10099],[10202,561.74,570.12,569.59,592.77,-31.02,79790.1,25459.3,596.3,-26.18,81156.6,24138.7,0.030849,10655],[10203,612.56,618.45,617.68,645.14,-32.58,86424.3,28150.5,646.18,-27.72,87694.2,27106.1,0.028776,11124],[10204,452.71,456.7,456.54,479.94,-27.24,66829.1,24074.3,479.65,-22.95,67522.1,23083.3,0.023238,9470],[10205,413.67,420.64,419.95,437.49,-23.81,63787.4,22055.6,440.52,-19.88,64878.1,20969.4,0.025738,9585],[10206,515.52,523.64,523.4,543.43,-27.91,77568.2,24594.9,546.25,-22.62,78877.4,23133.5,0.030469,10296],[10207,632.03,637.32,636.98,666.92,-34.89,88088.7,29431.8,666.89,-29.56,88922.4,27905.4,0.030316,11382],[10208,621.48,629.59,628.93,698.95,-77.47,69334.8,24889.6,702.63,-73.04,70364.0,23759.9,0.026447,9516],[10209,546.4,554.05,553.5,576.84,-30.44,73275.4,24617.8,580.35,-26.3,74507.8,23714.2,0.028196,9816],[10210,422.45,427.14,426.4,445.95,-23.5,62970.0,21585.2,446.54,-19.39,63715.3,20520.3,0.021421,8686],[10211,435.64,441.69,440.73,458.7,-23.06,62216.3,21281.4,461.13,-19.44,63040.3,20305.4,0.026087,9109],[10212,620.05,630.22,629.75,653.06,-33.01,89062.7,28272.9,657.74,-27.52,90156.2,26896.3,0.031055,11392],[10213,575.93,583.88,583.0,606.57,-30.64,83427.1,26654.4,609.32,-25.44,84549.9,25220.6,0.034283,11538],[10214,570.84,578.58,578.02,602.87,-32.03,90447.5,27924.6,605.25,-26.67,91528.2,26328.0,0.034391,11846],[10215,452.42,457.42,457.04,478.84,-26.42,64466.9,23096.3,479.55,-22.14,65389.8,22096.7,0.027411,9554],[10216,450.57,454.86,454.66,476.44,-25.87,59928.1,22578.1,476.59,-21.72,60782.1,21466.0,0.022621,8540],[10217,662.03,668.59,668.09,699.51,-37.48,92257.4,30602.8,699.64,-31.05,93443.5,28921.8,0.036757,11861],[10218,627.24,633.67,633.42,659.48,-32.23,89135.5,28447.5,661.31,-27.64,90199.2,27476.9,0.029195,12177],[10219,518.29,524.93,523.98,549.53,-31.24,82577.0,26586.6,549.81,-24.87,83954.6,24903.4,0.035557,11202],[10220,514.05,518.48,517.46,550.86,-36.81,62438.2,23182.6,551.04,-32.56,63405.5,21917.6,0.025613,8587],[10221,530.89,536.96,536.86,565.52,-34.63,65947.5,25168.3,567.1,-30.13,66801.6,24013.6,0.023782,9065],[10222,616.06,621.72,621.1,648.81,-32.75,82198.2,27590.5,648.79,-27.07,83209.4,26170.8,0.029348,10525],[10223,657.51,664.05,663.35,694.19,-36.68,85336.2,27874.0,695.75,-31.71,86475.3,26605.2,0.034203,11787],[10224,428.92,436.88,435.93,455.24,-26.33,64096.9,21550.8,459.02,-22.13,65273.4,20352.4,0.027554,9350],[10225,476.95,484.1,483.34,503.25,-26.3,71876.4,23823.4,506.79,-22.69,73049.9,23003.3,0.029284,10373],[10226,701.88,707.78,707.22,736.26,-34.38,91949.7,28764.5,737.49,-29.71,92626.9,27722.8,0.027311,11539],[10227,441.16,446.78,445.43,464.63,-23.47,63886.6,21853.6,466.57,-19.8,64907.5,20656.2,0.025031,9080],[10228,533.65,542.25,542.18,563.0,-29.36,82620.1,25516.8,566.2,-23.95,83534.3,24071.8,0.035381,11285],[10229,425.98,433.68,432.92,449.98,-24.0,69207.7,22578.5,454.29,-20.61,70284.8,21562.5,0.028213,9946],[10230,626.01,633.96,633.59,660.65,-34.64,92426.7,29025.7,662.57,-28.61,93846.3,27757.6,0.034029,11673],[10231,688.63,696.75,696.07,723.31,-34.69,89698.6,29320.8,726.7,-29.95,90641.7,28098.2,0.029836,11781],[10232,495.6,502.62,502.13,523.06,-27.46,71186.8,24062.1,525.77,-23.15,72285.3,22898.4,0.031167,10104],[10233,443.36,448.73,448.29,469.3,-25.94,66884.4,23262.3,470.4,-21.67,67777.0,22529.0,0.022892,9217],[10234,533.95,539.9,539.47,564.8,-30.85,73415.0,25515.0,566.2,-26.3,74715.7,24414.9,0.030005,10156],[10235,657.02,663.13,662.92,692.17,-35.16,84207.7,27133.4,693.17,-30.04,85022.0,25803.5,0.030391,10545],[10236,439.28,445.64,444.84,464.48,-25.2,69130.8,22594.0,466.33,-20.69,70209.7,21228.4,0.029568,9957],[10237,638.87,645.7,645.45,671.98,-33.12,86295.2,28666.5,673.89,-28.2,87368.3,27178.7,0.028641,11486],[10238,449.2,454.82,454.27,480.15,-30.95,57882.8,22693.3,481.58,-26.76,58865.0,21767.1,0.023361,8389],[10239,597.08,603.9,603.62,629.35,-32.27,82297.7,27572.1,631.29,-27.4,83419.1,26226.2,0.033669,11197],[10240,593.33,603.95,603.46,634.98,-41.66,82239.0,26747.9,639.54,-35.59,83499.0,25211.4,0.037334,11198],[10241,399.62,406.79,406.04,424.21,-24.6,59111.1,20878.8,427.62,-20.82,60362.8,19995.7,0.026117,8651],[10242,419.09,425.51,425.12,442.45,-23.36,59023.2,20415.4,444.79,-19.27,59467.6,19572.6,0.022805,8670],[10243,615.15,621.37,620.96,686.13,-70.98,72729.0,25998.3,687.69,-66.33,73657.3,24732.9,0.026618,9872],[10244,434.6,440.85,440.89,459.75,-25.14,63455.6,22708.3,462.19,-21.34,64500.4,21798.5,0.024621,9345],[10245,592.72,600.11,599.9,623.99,-31.27,82783.6,26923.4,626.35,-26.24,84022.2,25643.2,0.032907,10999],[10246,556.72,563.33,562.53,587.4,-30.68,82400.7,26722.7,588.89,-25.56,83027.5,25591.6,0.030141,11300],[10247,494.88,504.92,504.03,523.81,-28.93,76200.6,25323.9,528.63,-23.71,77278.8,23845.5,0.031583,10445],[10248,492.98,499.5,498.89,521.09,-28.1,78279.4,25026.3,522.88,-23.38,79583.0,23742.4,0.031514,10460],[10249,531.95,536.97,536.34,560.5,-28.55,76830.9,25517.4,561.25,-24.28,77629.3,24632.1,0.02574,10610],[10250,400.44,407.05,405.54,423.19,-22.74,60382.3,20857.7,426.17,-19.12,61403.5,19933.1,0.026134,9014],[10251,382.44,386.22,385.32,405.43,-23.0,59009.2,21823.0,406.06,-19.84,59862.3,20962.7,0.022927,8957],[10252,394.27,399.77,398.77,417.87,-23.6,58937.3,21114.5,419.62,-19.85,60195.6,20226.3,0.028094,8479],[10253,574.33,581.53,580.88,603.88,-29.55,88275.2,26950.4,606.78,-25.25,89485.3,25796.7,0.032083,11994],[10254,496.36,502.48,502.42,524.24,-27.87,65479.8,24793.6,527.22,-24.74,66520.1,23956.7,0.024127,8994],[10255,596.08,601.82,601.5,626.93,-30.85,86125.0,27265.0,627.8,-25.98,87228.4,26135.1,0.029875,11337]]},"ablation_per_seed":{"columns":["seed","routeroff_edge","sqlogerr_sum","n_callbacks"],"rows":[[10000,439.702,0.01946,8444],[10001,567.497,0.026154,11698],[10002,523.234,0.023793,9641],[10003,566.419,0.026884,11156],[10004,518.198,0.021472,9844],[10005,523.471,0.023426,9955],[10006,480.267,0.023513,10246],[10007,519.374,0.026318,10439],[10008,655.769,0.029953,12047],[10009,647.042,0.030273,12063],[10010,474.194,0.025715,10665],[10011,365.725,0.018225,8346],[10012,453.319,0.029026,10348],[10013,398.069,0.018932,8304],[10014,697.085,0.024012,11235],[10015,622.674,0.03337,11766],[10016,561.046,0.025495,9652],[10017,490.513,0.021746,10074],[10018,476.564,0.02213,9543],[10019,451.508,0.02014,8465],[10020,492.154,0.020858,9358],[10021,406.668,0.021793,8375],[10022,435.223,0.022731,8710],[10023,628.931,0.025884,10919],[10024,476.25,0.025892,10597],[10025,442.727,0.025271,9237],[10026,342.326,0.019375,8373],[10027,544.204,0.026503,10114],[10028,521.876,0.023702,9277],[10029,437.445,0.025429,10253],[10030,590.038,0.030689,11683],[10031,336.164,0.024887,8568],[10032,632.395,0.024931,11011],[10033,530.288,0.027565,10848],[10034,559.73,0.029546,11431],[10035,627.458,0.032545,12178],[10036,541.883,0.029262,10965],[10037,439.251,0.023428,9350],[10038,614.587,0.031241,12387],[10039,584.862,0.028285,10617],[10040,604.02,0.026182,12186],[10041,624.486,0.024774,11297],[10042,706.073,0.026311,12045],[10043,631.528,0.029684,11506],[10044,416.859,0.018186,8474],[10045,382.497,0.023883,8992],[10046,427.577,0.025254,10033],[10047,591.581,0.02955,11979],[10048,491.411,0.028906,9966],[10049,380.738,0.018866,8517],[10050,370.584,0.021514,8794],[10051,419.324,0.020705,8613],[10052,424.908,0.025498,10057],[10053,532.319,0.026404,10058],[10054,442.283,0.025505,9109],[10055,703.439,0.032347,12353],[10056,578.057,0.023815,10746],[10057,504.954,0.023203,9617],[10058,435.85,0.021621,8848],[10059,503.006,0.024135,9859],[10060,921.618,0.030207,11654],[10061,556.029,0.025721,11260],[10062,600.124,0.029212,11743],[10063,424.435,0.022571,9209]]},"source":{"grid64.py":"\"\"\"64-bucket exact-ish posterior of z = ln(p/spot) for the AMM fee challenge replica.\nObservations used: init reserves, and per afterSwap callback: side, amounts, timestamp,\npost-reserves, plus the strategy's own stored fees/history. No p, s2, arb flag, sigma, lambda, size.\"\"\"\nimport math\nimport numpy as np\nfrom numba import njit\n\nK = 100.0 * 10000.0\nG2 = 1.0 - 0.003\nSQ2 = math.sqrt(2.0)\n# priors (config-distribution midpoints, NOT per-run truth)\nSIG0 = 0.000945\nLAM0 = 0.8\nSIZE0 = 20.0\nMU_LN0 = math.log(SIZE0) - 0.5 * 1.2 * 1.2\nSD_LN = 1.2\nNSIG = 5.0       # transition kernel kept to +-NSIG sd (tail mass recorded)\nSIG_N0 = 2000.0  # pseudo-steps of prior weight for sigma estimate\nNQ = 7           # rival-spot quadrature points\nimport os\nPRE_MULT = float(os.environ.get('GF_PRE', '0.5'))\nWID0 = float(os.environ.get('GF_WID', '0.006'))\n\n\n@njit(cache=True)\ndef Phi(u):\n    return 0.5 * (1.0 + math.erf(u / 1.4142135623730951))\n\n\n@njit(cache=True)\ndef support(lo, h, m):\n    n = m.shape[0]\n    a = -1\n    b = -1\n    for i in range(n):\n        if m[i] > 1e-13:\n            if a < 0:\n                a = i\n            b = i\n    if a < 0:\n        a = 0\n        b = n - 1\n    return lo + (a + 0.5) * h, lo + (b + 0.5) * h\n\n\n@njit(cache=True)\ndef diffuse(lo, h, m, sd, out):\n    \"\"\"Gaussian transition mass from node points onto a fresh grid covering support +- NSIG sd.\n    Returns (lo2, h2, lost_tail_mass); out holds normalized masses.\"\"\"\n    n = m.shape[0]\n    se = math.sqrt(sd * sd + h * h / 12.0)\n    za, zb = support(lo, h, m)\n    lo2 = za - NSIG * se\n    h2 = (zb - za + 2.0 * NSIG * se) / n\n    for j in range(n):\n        out[j] = 0.0\n    tot = 0.0\n    for i in range(n):\n        mi = m[i]\n        if mi <= 1e-15:\n            continue\n        zi = lo + (i + 0.5) * h\n        prev = Phi((lo2 - zi) / se)\n        for j in range(n):\n            cur = Phi((lo2 + (j + 1) * h2 - zi) / se)\n            w = mi * (cur - prev)\n            out[j] += w\n            prev = cur\n    for j in range(n):\n        tot += out[j]\n    lost = 1.0 - tot\n    if tot > 0:\n        for j in range(n):\n            out[j] /= tot\n    return lo2, h2, lost\n\n\n@njit(cache=True)\ndef truncate(lo, h, m, a, b):\n    \"\"\"Multiply each bin (uniform on its interval) by its fraction inside [a,b]; return kept mass (unnormalized).\"\"\"\n    n = m.shape[0]\n    tot = 0.0\n    for i in range(n):\n        l = lo + i * h\n        r = l + h\n        lo_ = l if l > a else a\n        hi_ = r if r < b else b\n        f = (hi_ - lo_) / h if hi_ > lo_ else 0.0\n        m[i] *= f\n        tot += m[i]\n    return tot\n\n\n@njit(cache=True)\ndef density_at(lo, h, m, z):\n    \"\"\"piecewise-linear density through node points (mass/h); 0 outside grid hull.\"\"\"\n    n = m.shape[0]\n    u = (z - lo) / h - 0.5\n    if u < -0.5 or u > n - 0.5:\n        return 0.0\n    i = int(math.floor(u))\n    f = u - i\n    a = m[i] / h if 0 <= i < n else 0.0\n    b = m[i + 1] / h if 0 <= i + 1 < n else 0.0\n    if i < 0:\n        return b\n    if i + 1 >= n:\n        return a\n    return a * (1.0 - f) + b * f\n\n\n@njit(cache=True)\ndef moments(lo, h, m):\n    n = m.shape[0]\n    s = 0.0\n    s1 = 0.0\n    s2 = 0.0\n    for i in range(n):\n        z = lo + (i + 0.5) * h\n        s += m[i]\n        s1 += m[i] * z\n        s2 += m[i] * z * z\n    mu = s1 / s\n    v = s2 / s - mu * mu + h * h / 12.0\n    return mu, math.sqrt(max(v, 0.0))\n\n\n@njit(cache=True)\ndef cdf_at(lo, h, m, z):\n    n = m.shape[0]\n    c = 0.0\n    s = 0.0\n    for i in range(n):\n        s += m[i]\n        l = lo + i * h\n        if z >= l + h:\n            c += m[i]\n        elif z > l:\n            c += m[i] * (z - l) / h\n    return c / s\n\n\n@njit(cache=True)\ndef lnpdf(x, mu, sd):\n    if x <= 0:\n        return 0.0\n    u = (math.log(x) - mu) / sd\n    return math.exp(-0.5 * u * u) / (x * sd * 2.5066282746310002)\n\n\n@njit(cache=True)\ndef router_lik(lo, h, m, lik, sell_x, amt, x1, y1, ga, gb, sb, wid, mu_ln, use_router):\n    \"\"\"lik[i] = density of the observed fill amount (Y in for AMM-sells-X, X in for AMM-buys-X)\n    given p = sb*exp(z_i), marginalizing order size (lognormal) and rival spot uniform in ln over\n    p*[e^-wid, e^wid]. If use_router is False: z-independent split-half model.\"\"\"\n    n = m.shape[0]\n    for i in range(n):\n        if not use_router:\n            if sell_x:\n                lik[i] = lnpdf(amt, mu_ln + math.log(0.5), SD_LN)\n            else:\n                lik[i] = lnpdf(amt * sb, mu_ln + math.log(0.5), SD_LN) * sb\n            continue\n        p = sb * math.exp(lo + (i + 0.5) * h)\n        acc = 0.0\n        for q in range(NQ):\n            s2 = p * math.exp(-wid + 2.0 * wid * (q + 0.5) / NQ)\n            if sell_x:  # trader buys X paying amt Y\n                r = math.sqrt(ga / G2)\n                y2 = math.sqrt(K * s2)\n                size = ((amt * (ga + r * G2) + y1) / r - y2) / G2\n                if size > amt:\n                    acc += lnpdf(size, mu_ln, SD_LN) * (ga + r * G2) / (r * G2)\n                else:\n                    acc += lnpdf(amt, mu_ln, SD_LN)\n            else:  # trader sells amt X\n                r = math.sqrt(gb / G2)\n                x2 = math.sqrt(K / s2)\n                tx = ((amt * (gb + r * G2) + x1) / r - x2) / G2\n                if tx > amt:\n                    acc += lnpdf(p * tx, mu_ln, SD_LN) * p * (gb + r * G2) / (r * G2)\n                else:\n                    acc += lnpdf(p * amt, mu_ln, SD_LN) * p\n        lik[i] = acc / NQ\n\n\n@njit(cache=True)\ndef cic_mix(lo, h, m, wR, zA, wA, out):\n    \"\"\"Mass- and mean-conserving (cloud-in-cell) rebin of wR*grid + wA*delta(zA) onto a fresh grid\n    covering both. Returns (lo2, h2).\"\"\"\n    n = m.shape[0]\n    za, zb = support(lo, h, m)\n    a = min(za, zA)\n    b = max(zb, zA)\n    if b - a < 1e-9:\n        b = a + 1e-9\n    h2 = (b - a) / (n - 1)\n    lo2 = a - 0.5 * h2\n    for j in range(n):\n        out[j] = 0.0\n\n    def dep(z, w):\n        u = (z - lo2) / h2 - 0.5\n        i = int(math.floor(u))\n        f = u - i\n        if i < 0:\n            out[0] += w\n        elif i >= n - 1:\n            out[n - 1] += w\n        else:\n            out[i] += w * (1.0 - f)\n            out[i + 1] += w * f\n    s = 0.0\n    for i in range(n):\n        s += m[i]\n    for i in range(n):\n        if m[i] > 0:\n            dep(lo + (i + 0.5) * h, wR * m[i] / s)\n    dep(zA, wA)\n    return lo2, h2\n\n\nclass GridFilter:\n    def __init__(self, x0, y0, nb=64, use_router=True, sig_n0=SIG_N0):\n        self.nb = nb\n        self.use_router = use_router\n        self.x, self.y = x0, y0\n        self.m = np.zeros(nb)\n        self.m[nb // 2] = 1.0\n        self.h = 1e-7\n        self.lo = -(nb // 2 + 0.5) * self.h  # delta at z=0: p0 = initial spot\n        self.buf = np.zeros(nb)\n        self.lik = np.zeros(nb)\n        self.t_last = -1\n        self.fb = self.fa = 0.003\n        self.sig_d2 = 0.0\n        self.sig_dt = 0.0\n        self.sig_n0 = sig_n0\n        self.last_pin = None  # (t, lnp)\n        self.step_impact = 0.0\n        self.lost = 0.0\n        self.n_silent = 0\n        self.n_steps_diffused = 0\n        self.n_fallback = 0\n        self.wA = 0.0\n        self.mu_ln = MU_LN0\n\n    def sigma(self):\n        return math.sqrt((self.sig_d2 + self.sig_n0 * SIG0 * SIG0) / (self.sig_dt + self.sig_n0))\n\n    def set_fees(self, fb, fa):\n        self.fb, self.fa = fb, fa\n\n    def _step(self, sd):\n        lo2, h2, lost = diffuse(self.lo, self.h, self.m, sd, self.buf)\n        self.m, self.buf = self.buf, self.m\n        self.lo, self.h = lo2, h2\n        self.lost += max(lost, 0.0)\n        self.n_steps_diffused += 1\n\n    def _silent(self, sd):\n        self._step(sd)\n        a = math.log(1.0 - self.fb)\n        b = -math.log(1.0 - self.fa)\n        saved = self.m.copy()\n        tot = truncate(self.lo, self.h, self.m, a, b)\n        if tot < 1e-250:\n            self.n_fallback += 1\n            self.m = saved\n        else:\n            self.m /= tot\n        self.n_silent += 1\n\n    def on_trade(self, is_buy, ax, ay, t, x, y):\n        \"\"\"is_buy: AMM bought X. Returns wA (posterior prob first-callback was an arb).\"\"\"\n        sd = self.sigma()\n        sb = self.y / self.x\n        sa = y / x\n        l = math.log(sa / sb)\n        first = t > self.t_last\n        if first:\n            for _ in range(self.t_last + 1, t):\n                self._silent(sd)\n            self._step(sd)\n            self.step_impact = 0.0\n        sell_x = not is_buy\n        amt = ay if sell_x else ax\n        wid = WID0 + (self.step_impact if not first else 0.0)\n        router_lik(self.lo, self.h, self.m, self.lik, sell_x, amt, self.x, self.y,\n                   1.0 - self.fa, 1.0 - self.fb, sb, wid, self.mu_ln, self.use_router)\n        # density in l from density in amount\n        if sell_x:\n            dl = 2.0 * (1.0 - self.fa) / y   # l = 2 ln(y_after/y)\n        else:\n            dl = 2.0 * (1.0 - self.fb) / x\n        wA = 0.0\n        if first:\n            zA = l - math.log(1.0 - self.fa) if sell_x else l + math.log(1.0 - self.fb)\n            LA = density_at(self.lo, self.h, self.m, zA)\n            mR = self.m.copy()\n            Pb = truncate(self.lo, self.h, mR, math.log(1.0 - self.fb), -math.log(1.0 - self.fa))\n            post = mR * self.lik\n            sp = post.sum()\n            pre = (1.0 - math.exp(-LAM0)) * 0.5 * PRE_MULT\n            LR = pre * sp / dl\n            if LA + LR <= 0:\n                self.n_fallback += 1\n                wA = 0.5 if LA == 0 else 1.0\n                if sp <= 0:\n                    post = mR if Pb > 0 else self.m.copy()\n            else:\n                wA = LA / (LA + LR)\n            if sp <= 0:\n                wA = 1.0 if LA > 0 else wA\n                post = mR if mR.sum() > 0 else self.m.copy()\n            if wA > 1 - 1e-12:\n                self.m[:] = 0.0\n                self.m[self.nb // 2] = 1.0\n                self.h = 1e-7\n                self.lo = zA - (self.nb // 2 + 0.5) * self.h\n            else:\n                lo2, h2 = cic_mix(self.lo, self.h, post, 1.0 - wA, zA, wA, self.buf)\n                self.m, self.buf = self.buf, self.m\n                self.lo, self.h = lo2, h2\n            if wA > 0.9:\n                lnp = math.log(sb) + zA\n                if self.last_pin is not None:\n                    dt = t - self.last_pin[0]\n                    if dt > 0:\n                        d = lnp - self.last_pin[1]\n                        self.sig_d2 += d * d\n                        self.sig_dt += dt\n                self.last_pin = (t, lnp)\n        else:\n            post = self.m * self.lik\n            sp = post.sum()\n            if sp > 0:\n                self.m = post / sp\n            else:\n                self.n_fallback += 1\n        self.step_impact += abs(l)\n        self.lo -= l  # re-reference z to the new spot\n        self.x, self.y = x, y\n        self.t_last = t\n        self.wA = wA\n        return wA\n\n    def mean_sd(self):\n        return moments(self.lo, self.h, self.m)\n\n    def cdf(self, z):\n        return cdf_at(self.lo, self.h, self.m, z)\n","harness.py":"\"\"\"Closed-loop arms on the replica (replica.py unchanged). Usage: python harness.py ARM SEED0 SEED1 OUTFILE [nsteps]\nARM: oracle (true p + true arb flag), diag (true p + filter-inferred flag), filter (filter mean + inferred flag),\nfilter_norouter (ablation), filter_shadow256 (filter arm + open-loop 256-bin shadow filter for grid error).\"\"\"\nimport json, math, os, sys, time\nimport numpy as np\nimport replica\nfrom grid64 import GridFilter\n\nHERE = os.path.dirname(os.path.abspath(__file__))\nTAB = json.load(open(os.path.join(HERE, \"oracle_table.json\")))\nASK = np.array(TAB[\"ask\"]); BID = np.array(TAB[\"bid\"]); FLAG = TAB[\"arb_flag\"]\nKN = np.arange(-8, 9) * 0.003\n\n\ndef table_fees(spot, p, flag):\n    d = math.log(spot / p)  # linear knot interpolation, endpoint clamp (np.interp clamps)\n    a = float(np.interp(d, KN, ASK)); b = float(np.interp(d, KN, BID))\n    if flag:\n        a += FLAG; b += FLAG\n    fa = 1.0 - math.exp(d - a * 0.003)\n    fb = 1.0 - math.exp(-b * 0.003 - d)\n    return replica.clampf(fb), replica.clampf(fa)\n\n\nclass Arm:\n    def __init__(self, mode):\n        self.mode = mode\n        self.f = None\n        self.sh = None\n        self.se2 = 0.0; self.n = 0; self.cov50 = 0; self.cov90 = 0; self.sdsum = 0.0\n        self.flag_tp = self.flag_fp = self.flag_fn = self.flag_tn = 0\n        self.sh_d2 = 0.0; self.sh_e2 = 0.0\n\n    def init(self, sigma, lam, size):  # hidden values received by the harness, never forwarded\n        x0, y0 = 100.0, 10000.0  # replica's initial reserves\n        if self.mode != \"oracle\":\n            self.f = GridFilter(x0, y0, use_router=(self.mode != \"filter_norouter\"))\n            if self.mode == \"filter_shadow256\":\n                self.sh = GridFilter(x0, y0, nb=256)\n        fb, fa = table_fees(y0 / x0, y0 / x0, False)\n        if self.f: self.f.set_fees(fb, fa)\n        if self.sh: self.sh.set_fees(fb, fa)\n        return fb, fa\n\n    def on_trade(self, is_buy, ax, ay, t, x, y, arb, p, s2):\n        spot = y / x\n        if self.mode == \"oracle\":\n            return table_fees(spot, p, arb)\n        # ---- filter sees only (is_buy, ax, ay, t, x, y) and its own stored fees\n        wA = self.f.on_trade(is_buy, ax, ay, t, x, y)\n        flag = wA > 0.5\n        mu, sd = self.f.mean_sd()\n        # ---- evaluation-only truth below\n        zt = math.log(p / spot)\n        e = mu - zt\n        self.se2 += e * e; self.n += 1; self.sdsum += sd\n        c = self.f.cdf(zt)\n        self.cov50 += abs(c - 0.5) <= 0.25\n        self.cov90 += abs(c - 0.5) <= 0.45\n        first = getattr(self, \"_tl\", -1) != t\n        self._tl = t\n        if first:\n            if arb and flag: self.flag_tp += 1\n            elif arb: self.flag_fn += 1\n            elif flag: self.flag_fp += 1\n            else: self.flag_tn += 1\n        if self.sh is not None:\n            self.sh.on_trade(is_buy, ax, ay, t, x, y)\n            m2, _ = self.sh.mean_sd()\n            self.sh_d2 += (m2 - mu) ** 2; self.sh_e2 += (m2 - zt) ** 2\n        if self.mode == \"diag\":\n            fb, fa = table_fees(spot, p, flag)\n        else:\n            fb, fa = table_fees(spot, spot * math.exp(mu), flag)\n        self.f.set_fees(fb, fa)\n        if self.sh is not None: self.sh.set_fees(fb, fa)\n        return fb, fa\n\n\ndef one(mode, seed, nsteps):\n    a = Arm(mode)\n    t0 = time.time()\n    r = replica.run(seed, a, n_steps=nsteps)\n    rec = dict(seed=seed, edge=r[\"edge\"], retail=r[\"retail\"], arb=r[\"arb\"], rv=r[\"rv\"], av=r[\"av\"],\n               fb=r[\"fb\"], fa=r[\"fa\"], sec=time.time() - t0)\n    if a.f is not None:\n        f = a.f\n        rec.update(se2=a.se2, n=a.n, sdsum=a.sdsum, cov50=a.cov50, cov90=a.cov90,\n                   tp=a.flag_tp, fp=a.flag_fp, fn=a.flag_fn, tn=a.flag_tn,\n                   lost=f.lost, fallback=f.n_fallback, sig_hat=f.sigma(), sig_true=r[\"sigma\"])\n        if a.sh is not None:\n            rec.update(sh_d2=a.sh_d2, sh_e2=a.sh_e2, sh_lost=a.sh.lost)\n    return rec\n\n\ndef work(args):\n    return one(*args)\n\n\nif __name__ == \"__main__\":\n    from multiprocessing import Pool\n    mode, s0, s1, out = sys.argv[1], int(sys.argv[2]), int(sys.argv[3]), sys.argv[4]\n    nsteps = int(sys.argv[5]) if len(sys.argv) > 5 else 10000\n    done = set()\n    if os.path.exists(out):\n        done = {json.loads(l)[\"seed\"] for l in open(out)}\n    todo = [s for s in range(s0, s1 + 1) if s not in done]\n    with Pool(4) as pool, open(out, \"a\") as fo:\n        for rec in pool.imap_unordered(work, [(mode, s, nsteps) for s in todo]):\n            fo.write(json.dumps(rec) + \"\\n\"); fo.flush()\n","tests.py":"import math, inspect, numpy as np, replica, harness\nfrom grid64 import GridFilter\nres={}\n# 1 hidden-input isolation: filter API has no p/s2/arb/sigma args; replaying recorded observations reproduces fees exactly\nsig=str(inspect.signature(GridFilter.on_trade)); assert sig==\"(self, is_buy, ax, ay, t, x, y)\", sig\nclass Rec(harness.Arm):\n    def on_trade(self,*a):\n        r=super().on_trade(*a); self.log.append((a[:6],r,self.f.wA)); return r\na=Rec('filter'); a.log=[]; replica.run(10000,a,n_steps=3000)\nf=GridFilter(100.0,10000.0); f.set_fees(*harness.table_fees(100.0,100.0,False)); ok=True\nfor obs,fees,wA in a.log:\n    w=f.on_trade(*obs); mu,_=f.mean_sd(); s=obs[5]/obs[4]\n    fb,fa=harness.table_fees(s,s*math.exp(mu),w>0.5); f.set_fees(fb,fa)\n    ok&= (fb,fa)==tuple(fees) and w==wA\nres['isolation_replay_identical_3000_steps']=bool(ok)\n# also: corrupt the truth passed to the harness for the filter's own inputs -> filter internals unchanged (p only used in eval lines)\nsrc=inspect.getsource(GridFilter); res['filter_source_mentions_truth']=any(k in src for k in ['s2)', 'sigma=', 'lam=', '.p '])\n# 2 sign/pin test: AMM sells X to arb -> z_after = -ln(1-fa); AMM buys X from arb -> z_after = ln(1-fb)\nfor side in ['sellX','buyX']:\n    f=GridFilter(100.0,10000.0); f.set_fees(0.003,0.003)\n    x,y=100.0,10000.0; p=100.0*math.exp(0.0036 if side=='sellX' else -0.0036); fa=fb=0.003\n    if side=='sellX':\n        nx=math.sqrt(replica.K/((1-fa)*p)); ax=x-nx; nry=replica.K/nx; ty=(nry-y)/(1-fa); w=f.on_trade(False,ax,ty,30,nx,nry); xa,ya=nx,nry\n    else:\n        g=1-fb; xv=math.sqrt(replica.K*g/p); ax=(xv-x)/g; nrx=x+ax*g; nry=replica.K/nrx; w=f.on_trade(True,ax,y-nry,30,nrx,nry); xa,ya=nrx,nry\n    mu,sd=f.mean_sd(); zt=math.log(p/(ya/xa))\n    res[f'pin_{side}']=dict(wA=round(w,4),mu_bps=round(mu*1e4,3),true_bps=round(zt*1e4,3),atom_mass_within_1bp_of_truth=round(f.cdf(zt+1e-4)-f.cdf(zt-1e-4),4),sign_ok=(mu*zt>0 and abs((f.cdf(zt+1e-4)-f.cdf(zt-1e-4))-w)<0.05))\nres['pin_note']='t=30 after 29 silent steps at 30bps fees, p 36bps outside spot; posterior is the arb/retail mixture, so mean is pulled toward retail branch by (1-wA)'\n# 3 repeated callbacks: second callback at same t adds no diffusion step; gap in t diffuses t-t_last steps\nf=GridFilter(100.0,10000.0); f.set_fees(0.003,0.003)\nf.on_trade(False,0.05,5.0,5,100-0.05,1e6/(100-0.05)); n1=f.n_steps_diffused\nf.on_trade(False,0.05,5.0,5,100-0.1,1e6/(100-0.1)); n2=f.n_steps_diffused\nf.on_trade(True,0.05,5.0,9,100-0.05,1e6/(100-0.05)); n3=f.n_steps_diffused\nres['diffusion_steps_t0..5_then_repeat_then_t9']=[n1,n2,n3]; res['repeat_ok']=(n1==6 and n2==6 and n3==10)\n# 4 gap propagation: per-seed gap mean equals aggregate difference\nimport json\no={json.loads(l)['seed']:json.loads(l) for l in open('out/oracle.jsonl')}; fl={json.loads(l)['seed']:json.loads(l) for l in open('out/filter.jsonl')}\ng=[o[s]['edge']-fl[s]['edge'] for s in sorted(o)]\nres['gap_propagation_ok']=abs(np.mean(g)-(np.mean([o[s]['edge'] for s in o])-np.mean([fl[s]['edge'] for s in fl])))<1e-9\n# 5 mass conservation & truncation within band\nf=GridFilter(100.0,10000.0); f.set_fees(0.003,0.004)\nfor k in range(50): f._silent(0.00095)\nmu,sd=f.mean_sd(); res['silent50_mass']=round(float(f.m.sum()),12); res['silent50_mean_in_band']=bool(math.log(1-0.003)<=mu<=-math.log(1-0.004)); res['silent50_sd_bps']=round(sd*1e4,2)\nprint(json.dumps(res,default=lambda v: bool(v)))\n","sha256":{"grid64.py":"dc322bdcf298727bd2b0c698b4a26f6be2ddc13b5d68bd3d3c10588f836e90d7","harness.py":"fe6c8631b80cdadc56056b72ab541bd764a15763147014aec40c934cb5e9a30d","tests.py":"f4c275852c986d5f1d3a0f9b70dbcad8f74644195bffc2037b7f66f6ae225d45"},"needs":"replica.py and oracle_table.json from the URLs above in the same directory; numpy, numba (installed by setup.sh)"}}