Repository navigation
threshold_total: a zero count is an absent key - #1018
Closed
frankmcsherry wants to merge 1 commit into
Closed
frankmcsherry wants to merge 1 commit into
frankmcsherry wants to merge 1 commit into
Conversation
Fixes TimelyDataflow#992. `threshold_total` called `thresh` on a key's count before and after each update, including when that count was zero. `distinct_total` passes `|_,_| 1`, so a key whose count fell to zero produced `thresh(0) - thresh(1) = 0` and was never retracted. Whether a zero count reached `thresh` at all depended on whether the trace had merged away the cancelling updates. A zero count now contributes nothing, and `thresh` is not called on it. Reported by Bryan O'Sullivan in TimelyDataflow#992. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_019XsakwFGwtESwZ1gSYwG4o
Member
Author
|
Closing in favor of #993, which makes the same change. |
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.
Fixes #992.
threshold_totalcalledthreshon a key's count before and after each update, including when that count was zero.distinct_totalpasses|_,_| 1, so a key whose count fell to zero producedthresh(0) - thresh(1) = 0and was never retracted: on master-next,+1at time 1 and-1at time 2 output only+1at time 1. Whether a zero count reachedthreshat all depended on whether the trace had merged away the cancelling updates. This dates from eac75b4 (2019), which replaced|_,c| if c.is_zero() { 0 } else { 1 }with|_,_| 1.A zero count now contributes nothing, and
threshis not called on it. The rule is stated once, as a helper both counts go through, and in the method's docs. #993 makes the same change.Test
distinct_total_zero_countintests/threshold.rshas a key leave and return, with all updates in one batch and with one batch per time. It fails without this change.cargo test -p differential-dataflowpasses.Reported by @bos in #992.
🤖 Generated with Claude Code
https://claude.ai/code/session_019XsakwFGwtESwZ1gSYwG4o