surjection: Fix test condition failures in probabilistic tests#355
Open
mllwchrry wants to merge 1 commit intoBlockstreamResearch:masterfrom
Open
surjection: Fix test condition failures in probabilistic tests#355mllwchrry wants to merge 1 commit intoBlockstreamResearch:masterfrom
mllwchrry wants to merge 1 commit intoBlockstreamResearch:masterfrom
Conversation
Member
|
I can't remember why we have this randomized design where proof initialization does rejection sampling and can fail. It's explained here how it works: https://github.com/BlockstreamResearch/secp256k1-zkp/blob/master/src/modules/surjection/surjection.md#initialization But I don't see the point. Can you provide an intuition for this for context? I mean, one could simply put the input asset at a random position in the subset and then sample some other input assets to add to the subset. The probability that this looks random can be determined mathematically and doesn't need to be estimated "experimentally". I feel like I don't understand what's going on here. |
|
|
||
| if (n_inputs >= 3) { | ||
| /* succeed in 10*n_inputs tries (probability of failure e^-10) */ | ||
| /* succeed in 100*n_inputs tries (probability of failure e^-300) */ |
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 two CI failures:
test_input_selectionwhere test condition failed:result < n_inputs * 10(see https://github.com/BlockstreamResearch/secp256k1-zkp/actions/runs/23255024904/job/67611676287). The test had assertions that were stricter than the actual iteration budget.test_input_selection_distribution_helperwhere test condition failed:result > 0(see https://github.com/mllwchrry/secp256k1-zkp/actions/runs/23445282634/job/68207165336). Maximum iterations (64) were insufficient: ~10^-8 failure rate per call * 10,000 calls = ~0.01% failure.