This commit is contained in:
parent
1e59686153
commit
bbe11964b1
3 changed files with 14 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
|||
- Added parallel implementation of `Smt::compute_mutations` with better performance (#365).
|
||||
- Implemented parallel leaf hashing in `Smt::process_sorted_pairs_to_leaves` (#365).
|
||||
- [BREAKING] Updated Winterfell dependency to v0.12 (#374).
|
||||
- Added debug-only duplicate column check in `build_subtree` (#378).
|
||||
|
||||
## 0.13.3 (2025-02-12)
|
||||
|
||||
|
|
|
@ -100,6 +100,7 @@ fn smt_subtree_random(c: &mut Criterion) {
|
|||
})
|
||||
.collect();
|
||||
leaves.sort();
|
||||
leaves.dedup_by_key(|leaf| leaf.col);
|
||||
leaves
|
||||
},
|
||||
|leaves| {
|
||||
|
|
|
@ -478,6 +478,18 @@ fn build_subtree(
|
|||
tree_depth: u8,
|
||||
bottom_depth: u8,
|
||||
) -> (UnorderedMap<NodeIndex, InnerNode>, SubtreeLeaf) {
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
// Ensure that all leaves have unique column indices within this subtree.
|
||||
// In normal usage via public APIs, this should never happen because leaf
|
||||
// construction enforces uniqueness. However, when testing or benchmarking
|
||||
// `build_subtree()` in isolation, duplicate columns can appear if input
|
||||
// constraints are not enforced.
|
||||
let mut seen_cols = BTreeSet::new();
|
||||
for leaf in &leaves {
|
||||
assert!(seen_cols.insert(leaf.col), "Duplicate column found in subtree: {}", leaf.col);
|
||||
}
|
||||
}
|
||||
debug_assert!(bottom_depth <= tree_depth);
|
||||
debug_assert!(Integer::is_multiple_of(&bottom_depth, &SUBTREE_DEPTH));
|
||||
debug_assert!(leaves.len() <= usize::pow(2, SUBTREE_DEPTH as u32));
|
||||
|
|
Loading…
Add table
Reference in a new issue