Conversation
ed255
commented
Feb 4, 2026
| // Group statement indices by their content. | ||
| let mut content_to_indices: HashMap<&Statement, Vec<usize>> = HashMap::new(); | ||
| let mut statement_dedup_index: HashMap<&Statement, usize> = HashMap::new(); | ||
| let mut statement_content_groups = Vec::new(); |
Collaborator
Author
There was a problem hiding this comment.
This change is to generate a deterministic statement_content_groups.
robknight
reviewed
Feb 5, 2026
| // Incremental approach: try solving with increasing POD counts | ||
| // Start with min_pods and increment until we find a feasible solution | ||
| for target_pods in min_pods..=input.max_pods { | ||
| println!("DBG try solve for {} pods", target_pods); |
Collaborator
There was a problem hiding this comment.
I don't think that we should merge these debug prints, though perhaps this suggests that we need better logging/tracing in general.
|
|
||
| impl Eq for Value {} | ||
|
|
||
| impl Ord for Value { |
Collaborator
There was a problem hiding this comment.
This used to exist and was intentionally removed: #393
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.
Previously we were using HashMap and HashSet for the Dictionary and Set containers. This was very efficient but it was slightly inconvenient because sometimes we iterate over the entries of those collections to generate statements for recursive predicates, leading to non-deterministic order of statements which makes debugging issues harder.
By using BTreeMap and BTreeSet we always get deterministic iteration over the container entries, at a small cost of performance (which should be negligible because we target consumer devices and the bottleneck is in the proving process).
As an added bonus, now when we iterate over the Dictionary and Set we visit the entries in the same order as they are laid out in the Merkle Tree.
I've also done a small change in
MultiPodBuilderto make an internal structure deterministic.I've requested review of 2 people to get critical feedback on this change.