Skip to content

Latest commit

 

History

History
78 lines (59 loc) · 4.71 KB

File metadata and controls

78 lines (59 loc) · 4.71 KB

Engineering: Known Issues, Caveats, and Resolved Robustness Items

An honest register. There are no open correctness bugs; this page records (A) robustness items that were resolved in this crate, and (B) remaining design trade-offs that are intentional and documented, not defects.

A. Resolved robustness items

These were latent divergences/stubs inherited at extraction; they are now fixed, each with a regression test.

Item Was Now Test
MsmWeight::c_func non-finite guard returned a finite value for non-finite args, diverging from MsmConfig::c_func returns $+\infty$ on any non-finite argument (parity) test_c_func_non_finite_is_infinite
Hard-coded quantization range cached engine quantized to a fixed $[0,100]$, saturating out-of-range series data-driven range over query + all targets; degenerate → midpoint 127 ADR 0003; quantize tests
MsmStateSource::compute_state stub always returned LazyState::Pending fully implemented: pure positional lattice, correct edges, finality embedding_shortest_path_equals_msm_distance, unreachable_and_out_of_grid_states_are_dead
MsmWfst as StateSource always returned Pending (a stub) serves cached states as Computed; Pending only as the trait's "call expand() first" signal state_source_serves_cached_and_signals_pending

B. Remaining design trade-offs (intentional)

B1. epsilon couples exploration scale and step size

AdaptiveMsmConfig::epsilon sets both the Laplace scale ($1/\epsilon$) and the gradient-descent step. Small $\epsilon$ ⇒ large exploration noise and small steps, which can drive perturbations into the [min_c, max_c] clamps and bias the gradient near a bound. Impact, measured: with an aggressive scale the convergence experiment undershoots $c^\star$ with the lower percentile pinned at the bound; holding $\epsilon$ near the data spacing and decoupling the rate through the loss scale converges cleanly ($\approx 23\times$ loss reduction) — see ../scientific/ledger/2026-07-12-learner-convergence.md and ADR 0002. Mitigation: the default examples/convergence.rs demonstrates the decoupled parameterisation.

B2. regret_bound is a reference formula, not a certificate

It evaluates the FPTL order $\text{max_cost}\cdot\sqrt{T\ln\lvert\Sigma\rvert}$. This scalar finite-difference learner is not the FPL path-expert algorithm that theorem is about, so the value is a landmark, not a guarantee it is attained (theory §5). What is established (convergence under convexity) is in ../formal/fptl-regret.md.

B3. CachePolicy::Lru eviction is approximate

Under memory pressure the cached engine drops ~10% of entries by map iteration order, not by true least-recently-used recency (no access-order tracking). It is correct (evicted states are recomputed on demand) and cheap; strict LRU is not provided. See caching.md §3.

B4. Two engines, two final_weight conventions

MsmWfst bakes the accumulated path cost into a final state's final_weight (self-contained distance engine), whereas MsmStateSource uses one() and leaves accumulation to a shortest-distance pass (composition-friendly). This is a deliberate distinction between an eager cached engine and a stateless source, not an inconsistency; both compute the same MSM distance (../design/msm-wfst-embedding.md §3).

B5. Quantization is lossy

u8 labels can collide for nearby values. This only affects WFST composition/matching; MSM costs are always computed from exact $f64$ values, so distances are unaffected (ADR 0003).

B6. u32 state-id space

The positional encoding is u32; astronomically large series × m × n products could overflow it. num_states_hint exposes the exclusive upper bound so a driver can detect the regime. Realistic time-series sizes are far below the limit (security-and-robustness.md §4).

C. Explicit non-goals / future work

  • A genuine FPL/tropical path-expert learner that provably attains the regret bound (the scalar learner is a deliberate simplicity choice — ADR 0002).
  • Strict LRU caching with access-order tracking (B3).
  • Full mechanization (Rocq/TLA+) of the MSM-WFST embedding equivalence beyond the admit-free abstract model and executable validation already provided (../formal/README.md).