Repository navigation
Conversation
mini_bdd_mgrt keeps every node in a std::list so that push_back does not move existing nodes: reverse_map and mini_bddt hold pointers into that container. Each list node is its own heap allocation, so following a low or high edge misses the cache. std::deque has the same pointer stability on push_back, and it packs the 40-byte nodes into blocks (12 per 512-byte block with libstdc++). Measured with a stand-alone driver against develop's miniBDD (x86-64, g++ 11.5 -O2, invariants not checked, pinned to one core, three runs). Live node counts and result checksums were identical before and after. Building a 10-bit multiplier, 99,491 live nodes. Seconds, list then deque: 2.405, 2.333, 2.138 -> 1.962, 1.975, 1.860 medians 2.333 s -> 1.962 s (1.19x) Walking that BDD eight times (f & f, f | f, negation, exists; the build is not included): 3.044, 2.588, 2.915 -> 2.168, 2.125, 1.976 medians 2.915 s -> 2.125 s (1.37x) A random mix of and, or, xor, equivalence, not, exists and restrict on a pool of 16 BDDs, up to about 32,000 live nodes, did not move by more than the spread across seeds. A 4096-node pool was faster than deque (medians 1.773 s to build and 1.863 s to walk) but is a new container; deque is the standard one with the required stability. Result checksums match the list implementation. The node operations are the ones covered by unit/solvers/bdd/miniBDD.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #9641 +/- ##
========================================
Coverage 81.34% 81.35%
========================================
Files 1727 1727
Lines 191753 191752 -1
Branches 73 73
========================================
+ Hits 155986 156001 +15
+ Misses 35767 35751 -16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
mini_bdd_mgrt keeps every node in a std::list so that push_back does not
move existing nodes: reverse_map and mini_bddt hold pointers into that
container. Each list node is its own heap allocation, so following a low
or high edge misses the cache. std::deque has the same pointer stability
on push_back, and it packs the 40-byte nodes into blocks (12 per 512-byte
block with libstdc++).
Measured with a stand-alone driver against develop's miniBDD (x86-64,
g++ 11.5 -O2, invariants not checked, pinned to one core, three runs).
Live node counts and result checksums were identical before and after.
Building a 10-bit multiplier, 99,491 live nodes. Seconds, list then deque:
2.405, 2.333, 2.138 -> 1.962, 1.975, 1.860
medians 2.333 s -> 1.962 s (1.19x)
Walking that BDD eight times (f & f, f | f, negation, exists; the build
is not included):
3.044, 2.588, 2.915 -> 2.168, 2.125, 1.976
medians 2.915 s -> 2.125 s (1.37x)
A random mix of and, or, xor, equivalence, not, exists and restrict on a
pool of 16 BDDs, up to about 32,000 live nodes, did not move by more than
the spread across seeds. A 4096-node pool was faster than deque (medians
1.773 s to build and 1.863 s to walk) but is a new container; deque is the
standard one with the required stability.
Result checksums match the list implementation. The node operations are
the ones covered by unit/solvers/bdd/miniBDD.