Iteration 05 · 2026-06-09 · driver: native Claude Code /loop (laptop run)
← Dashboard · PR terrylica/mql5#94 · card 79 · cut off bootstrap #90
fxview_cache.forex_bars: bit-exact Rust verified against a pinned Python SSoT, populated through the wired producer, with batch≡streaming parity and an independent FOSS corroboration. PR #94 open (base main; diff auto-cleans once #90 + #91 + #92 + #93 land).
Kendall's tau-b (Kendall 1945, DOI:10.1093/biomet/33.3.239) between the per-bar signed mid log-return (X) and the per-bar spread in bps (Y) over the 200-bar strictly-trailing window. Causal: the window is the 200 bars BEFORE bar i (current bar excluded). Value ∈ [−1, 1]. None on warmup (<10 both-finite pairs) or an all-tied window. First two-input substrate: X = ln(close)−diff (8 h weekend/Ouroboros gap-nulled, like #1), Y = spread_close/close·1e4 (per-bar, never gap-nulled); a both-finite pair mask drops any gap-nulled logret pair.
| Layer | Artifact | Result |
|---|---|---|
| Python SSoT | oracle_kendall_taub_ret_spread.py — scipy.stats.kendalltau(variant="b").statistic over the ret_spread window (scipy≥1.13 BSD-3), bit-faithful to the probe's k_kendall | sha-pinned jsonl (12000 rows, 11200 finite) + .sha256 sidecar |
| Rust kernel | orthogonal_extension_kernels::kendall_taub_ret_spread — INTEGER-EXACT concordant/discordant/tie counts (O(n²) strict-discordance + tie-run sums) → S/√(tot−xtie)/√(tot−ytie) clamped to [−1,1] (scipy's exact two-sqrt/two-division order); no transcendentals beyond f64::sqrt, no new dep | clippy clean |
| Differential parity | vs the pinned oracle on the frozen fixture | 11200 == oracle, 12000 bars == rows, max|dev| 2.78e-17 (≈1 ulp — tightest of all 4 features) |
| Producer column | BarOrthogonalExtV1 { kendall_taub_ret_spread } + BarRow + schema.sql Nullable(Float64) CODEC(Gorilla(8),ZSTD(1)) + feature_metadata.yaml | test_schema_contract 4/4 |
| Producer populate | KendallTaubRetSpreadRollingState — 200-bar ring of (logret, spread_bps) pairs + prior close/close-time; read-before-push observe(close_mid, spread_close, open_time_us, close_time_us) @ finalize | — |
| batch≡streaming | streaming observe() over the fixture per partition | 11200 == oracle, max|dev| 2.78e-17 (identical to batch) |
| 3-way FOSS | scipy vs independent clean-room numpy sign-outer-product tau-b | PASS — 0 value-mismatches, 0 None/Some, max|dev| 0.000e+00 / 11200 |
scipy is the canonical tau-b and no second mainstream Python library implements it independently (pandas/pingouin all wrap scipy). So the independent leg is a from-scratch clean-room numpy estimator sharing NO code with scipy: the concordant-minus-discordant count via a dense sign outer-product np.sign(x[:,None]−x)·np.sign(y[:,None]−y) summed over the strict upper triangle, and the x/y tie-pair sums via np.unique(…, return_counts=True) — a different algorithm from scipy's O(n log n) lexsort + Fenwick inversion counting. They agree bit-for-bit (max|dev| 0.000e+00) across all 11200 windows: the integer concordance counts are identical and the final S/√/√ expression matches in order. Triangulates with Rust==scipy at 2.78e-17 ⇒ scipy == clean-room numpy == Rust.
observe() forms this bar's (logret, spread) pair from close_mid + spread_close + the prior close/close-time (gap-null), reads tau-b over the trailing 200 pairs BEFORE this bar, then folds this bar's pair in. Residual: live bigblack producer-vs-oracle smoke (no CH/MT5 on laptop — deferred to operator).np.diff(np.log(close)) (two logs, subtract); an early Rust ln(close/prev) (divide, one log) diverged at 4.9e-5 on one XAUUSD@5 window because the ~1-ulp difference flipped a borderline tie/order in a rank statistic. Fixed to the two-log form → 2.78e-17; the producer populate uses the same form.mise run check:all-gates green on macOS except (a) worktree-context check:git-hook-installed and (b) the STANDING foreign research-orthogonality substrate-skip (see handoff). feature-metadata:verify-offline PASS.CompletedBar field required a 1-line Default::default() in 9 explicit literals (2 blocklisted test files) — inserted by exact-match on the stripped literal opener, so -> CompletedBar { return-type lines are never touched. Same pattern as #91/#92/#93.kendall_taub_ret_spread; field-unions with #91/#92/#93 at operator merge. Merge order: #90 → #91 → #92 → #93 → #94.research-orthogonality substrate-skip recurs as a STANDING foreign item (first surfaced #92; rust-enhancement loop follow-up; scripts/research/ untouched).Feature #5 — lziv_complexity_signs (card 40, LZ76 complexity of the log-return sign sequence, EXACT count + ε on the normalization).
Presentation only — never the SSoT.