Repository navigation
fix(scoring)!: enforce Projection::MAX_EMITS - #209
Merged
Merged
Conversation
Projection::MAX_EMITS was documented as the most rows one project call emits, but nothing read it at runtime, so a projection emitting more was accepted silently. A single-source projection now runs through a bounded sink that counts each input's rows and panics on the first row past the bound, naming the projection and both counts, on both the full and the incremental path. BREAKING CHANGE: a Projection that emits more rows for one input than its MAX_EMITS now panics; raise MAX_EMITS to the real maximum.
A projected source's per-entity row list started empty and grew by doubling as rows arrived. It is now allocated once with MAX_EMITS capacity, which holds every row a single-source projection can emit for that entity, and the bound's documentation says so. Closes #208.
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.
Closes #208. Base
main@c5414198:b6cd9bf5fix(scoring)!: a single-source projection runs through a bounded sink; the first row pastMAX_EMITSfor one input panics withprojection \` emitted N+1 rows for one input; its MAX_EMITS is N`, on initialization and on incremental inserts. BREAKING footer.36021382perf(scoring): each entity's projected row list is allocated once withMAX_EMITScapacity.Tests: at the bound (initialize, retract/insert, evaluate agree), over the bound on initialization, over the bound on an incremental insert. Mutation: disabling the check fails both panic tests.
Gate (fmt, clippy, doc-names file-length facade-reachability public-api deps, rustdoc, examples, workspace all-feature tests, doctests): EXIT 0, 1585 passed, 0 failed, 71 result lines.