[Testing] Add deterministic ALSP spam-decision boundary tests - #8628
Open
janezpodhostnik wants to merge 1 commit into
Open
[Testing] Add deterministic ALSP spam-decision boundary tests#8628janezpodhostnik wants to merge 1 commit into
janezpodhostnik wants to merge 1 commit into
Conversation
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
zhangchiqing
approved these changes
Jul 30, 2026
Kay-Zee
approved these changes
Jul 31, 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.
Follow-up to #8626/#8627. The widened statistical bounds in the sync spam load tests left
the low-probability groups unable to detect an implementation that never reports
misbehavior (their lower bound is 0). This PR replaces that statistical coverage with
exact unit tests.
Changes
engine/common/synchronization/engine.go(behavior-preserving — same expressions, same
float32semantics):shouldReportProbabilistically,batchRequestMisbehaviorProbability,rangeRequestMisbehaviorProbability. The probabilistic decision was previously inlined3× and untestable deterministically (hardwired crypto RNG).
engine_alsp_probability_test.go): never report atp=0, always at p=1, draw n=0 reports for any p>0 (the case the load tests could not
discriminate), exact boundaries at p=0.5 and p=0.1, and the documented
(n+1)/64scaling example values for range/batch requests.
discriminating power (p=0.0, p=0.5, p≈0.156, and the unconditional always-report
groups); dropped the eleven low-probability groups whose bounds could not fail for a
broken implementation. Cuts ~11,000 processed messages from the suite.
Package passes
go test -race(repeated runs); lint clean.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.