Navigation

Iteration 06 · 2026-06-09 · driver: native Claude Code /loop (laptop run)

Feature #5 — lziv_complexity_signs (PR #95)

← Dashboard · PR terrylica/mql5#95 · card 40 · cut off bootstrap #90

Done. The fifth ξ-confirmed candidate — the FIRST information/complexity (Lempel-Ziv-76) feature — is a REAL continuous-float production column on 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 #95 open (base main; diff auto-cleans once #90 + #91 + #92 + #93 + #94 land).

What it computes

Normalized Lempel-Ziv 1976 complexity (DOI:10.1109/TIT.1976.1055501) of the binary up/down sign sequence of the per-bar mid log-return over the 200-bar strictly-trailing window — an entropy-rate / predictability proxy for the bar's directional sequence. Causal: the window is the 200 bars BEFORE bar i (current bar excluded). Value ≈ 1 for a near-random sign sequence. None on warmup (<16 finite trailing signs). Substrate "signs": np.sign(logret), logret = ln(close)−diff (8 h weekend/Ouroboros gap-nulled, like #1); binarization (s>0) → bit 1 iff up-bar, else 0 (a flat bar logret==0→sign 0 and a down bar→sign −1 BOTH map to bit 0); the finite-sign filter drops gap-null / first-bar signs.

The chain — one SSoT, bit-exact to the column

LayerArtifactResult
Python SSoToracle_lziv_complexity_signs.pyantropy.lziv_complexity(bits, normalize=True) (antropy 0.2.2 BSD-3), bit-faithful to the probe's k_lziv_signssha-pinned jsonl (12000 rows, 11200 finite) + .sha256 sidecar
Rust kernelorthogonal_extension_kernels::lziv_complexity_signs — EXACT integer port of antropy's _lz_complexity (the LZ76 exhaustive-production / Kaspar-Schuster state machine) + c/(n/(ln(n)/ln(base))) normalization (base=max(2,#distinct)); no new dep (f64::ln)clippy clean
Differential parityvs the pinned oracle on the frozen fixture11200 == oracle, 12000 bars == rows, max|dev| 2.22e-16 (LZ76 count exact, norm ≈1 ulp)
Producer columnBarOrthogonalExtV1 { lziv_complexity_signs } + BarRow + schema.sql Nullable(Float64) CODEC(Gorilla(8),ZSTD(1)) + feature_metadata.yamltest_schema_contract 4/4
Producer populateLzivComplexitySignsRollingState — 200-bar sign ring + prior close/close-time; read-before-push observe(close_mid, open_time_us, close_time_us) @ finalize
batch≡streamingstreaming observe() over the fixture per partition11200 == oracle, max|dev| 2.22e-16 (identical to batch)
3-way FOSSantropy vs independent clean-room substring-membership LZ76PASS — self-validated on 6 vectors; 0 value-mismatches, 0 None/Some, max|dev| 0.000e+00 / 11200

3-way FOSS finding (it earned its keep)

antropy is the canonical Python LZ76 and there is no second mainstream independent implementation. So the independent leg is a from-scratch clean-room estimator sharing NO code with antropy: the textbook "exhaustive history" substring-membership formulation (each phrase is the shortest prefix of the remainder not yet a substring of the consumed history) vs antropy's Kaspar-Schuster exhaustive-production state machine — a different algorithm computing the same LZ76 production complexity. It is first self-validated against antropy's raw counts on 6 pinned vectors (all-up→2, alt→3, n16→6, rand32→9, doc→6, [1,0,…]→3), then agrees bit-for-bit (max|dev| 0.000e+00) across all 11200 windows. Triangulates with Rust==antropy at 2.22e-16 ⇒ antropy == clean-room LZ76 == Rust.

Challenge-and-Held (inline; sub-agent dispatch skipped per the tick-3 signal)

Gates / scope

Next

Feature #6 — mann_kendall_z (card 20, Mann-Kendall trend test: EXACT integer S statistic, ε on the Z standardization).

Presentation only — never the SSoT.