fix(erp): match bounded multi-family runtime observations - #609
Merged
Merged
Conversation
This was referenced Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 --checkpassed. 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.