Skip to content

fix(erp): match bounded multi-family runtime observations - #609

Merged
zzylol merged 2 commits into
mainfrom
feat/erp-production-closure
Sep 11, 2026
Merged

zzylol merged 2 commits into
mainfrom
feat/erp-production-closure

Conversation

@zzylol

@zzylol zzylol commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Why

Runtime observations should retain uncertainty across fitted distributions and use the Planner's bounded nearest-profile policy. A failed bounded observation must not publish a partial distribution.

What

Use the shared multi-fit observation contract for ERP selection and runtime feedback hydration. Reject incomplete observations after key, interval, or counter limits are exceeded. Filter unsupported runtime configurations before ranking profiles.

How

The observer retains uniform and fitted Zipf candidates with total-variation fit distances and heuristic confidence scores. Sparse, bounded interval counters replace index-driven allocation. Selection delegates to Planner select_multi_fit, including exact dataset fingerprints and bounded shape matching; the existing theoretical/exact fallback remains.

Before this PR

An observation was forced into one distribution family. Custom data could not use approximate shape matching. A rejected key could leave a publishable partial observation, and a large interval index could allocate unbounded memory.

After this PR

For example, a custom stream close to a measured Zipf profile can use that profile without claiming it is exactly Zipf. Ambiguous or distant observations fail closed. Invalid observations cannot produce snapshots. Existing single-shape feedback producers must migrate to the shared observation payload.

Verification

cargo +1.98.0 test -p control_plane physical::erp --lib --quiet: 12 passed. Covers custom multi-fit matching, runtime configuration filtering, theoretical/exact fallback, feedback hydration, canonical uniform matching, sparse interval limits, and invalidation after overflow or key limits. git diff --check passed. Visual evidence is not applicable.

Limitations

Fit confidence is a heuristic score, not a statistical accuracy guarantee. Production empirical accuracy remains limited to the existing validated KLL rank-error contract. Real startup-process testing exposed a separate v1 per-series KLL fallback gate; this PR does not claim to remove that gate or demonstrate query acceleration. The process integration test and workload measurements remain follow-up work.

@zzylol
zzylol merged commit 17f38bf into main Sep 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant