Skip to content

fix(scoring)!: enforce Projection::MAX_EMITS - #209

Merged
blackopsrepl merged 2 commits into
mainfrom
feature/208-max-emits
Nov 5, 2026
Merged

blackopsrepl merged 2 commits into
mainfrom
feature/208-max-emits

Conversation

@blackopsrepl

Copy link
Copy Markdown
Collaborator

Closes #208. Base main @ c5414198:

  • b6cd9bf5 fix(scoring)!: a single-source projection runs through a bounded sink; the first row past MAX_EMITS for one input panics with projection \` emitted N+1 rows for one input; its MAX_EMITS is N`, on initialization and on incremental inserts. BREAKING footer.
  • 36021382 perf(scoring): each entity's projected row list is allocated once with MAX_EMITS capacity.

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.

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.
@blackopsrepl
blackopsrepl merged commit 3602138 into main Nov 5, 2026
12 checks passed
@blackopsrepl
blackopsrepl deleted the feature/208-max-emits branch November 5, 2026 09:37
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.

Projection::MAX_EMITS is never enforced

1 participant