docs(erp): explain multi-family shape matching - #382
Merged
Conversation
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
The ERP implementation now accepts an observation with multiple fitted distribution hypotheses, but the design document still described one preclassified family. That made the documented policy look like hard Zipf/uniform classification and left confidence and ambiguity handling as future work.
What
Document the two-stage policy: observe an empirical population, retain multiple family fits, reject weak or ambiguous fits, and match the selected fit to bounded sketch-bench ERP records. Clarify exact custom-dataset identity, the intended shape fallback, and the current backend boundary.
How
The document now mirrors the shared
ErpShapeObservationandErpShapeFitcontracts. It distinguishes fit eligibility from ERP record ranking and describes the implemented order: confidence/goodness gates, ambiguity margin, family and parameter-schema compatibility, bounded shape distance, accuracy/runtime checks, cost, then stable record ID.Before this PR
The document showed one
erp_shape { family, parameters }for both benchmark and observation and said different families were never interpolated. Readers could reasonably conclude that runtime data was classified as one known distribution before matching.After this PR
The benchmark record still declares its known generator shape. A runtime observation carries several approximate hypotheses with goodness-of-fit and confidence. Poor, ambiguous, and out-of-distribution observations fail closed to theoretical sizing or exact execution.
Verification
ErpShapeObservation,ErpShapeFit, andselect_multi_fiton currentmain.git diff --checkpassed.