Skip to content

Use Pastva and Henzinger's Unique Node Table (Linear buckets) #697

@ssoelvsten

Description

@ssoelvsten

In #444 , we added a unique node table for Adiar to skip serializing small BDDs to and from the disk. For simplicity, we reused the node table design from BuDDy. Yet, in [Pastva2023] a different design was suggested. This one has multiple benefits:

  • It is much more cache-friendly, i.e. it decreases (in practice) the number of look-ups in RAM. This makes it much faster in practice.
  • The buckets are solely stored in allocated nodes, i.e. it allows for the free chain to be created on-the-fly. This solves BuDDy's high initialization time.
  • The table seems relatively easy to make thread-safe (see also Thread Safety #650). Here, we can also learn quite a bit from the design in [Lovato2014]

The design in [Pastva2023] is based on an extremely interesting insight: the number of BDD nodes with a lot of parents are guaranteed to be very few in practice. In fact, 70% of all nodes have a single parent, 20% have two parents, 3% have three, and so on.

Below we have two ways to change the table. Note, the issues in the simple version here be resolved with #722 , making the proper version in #731 just less space efficient?

Tasks

Based on the observation above, we can do as follows:

  • The hash pointer in entry<T> now points to the start of the bucket of all parent nodes with this as its child. Specifically, where this node is its minimum child (the use of minimum avoids terminals for all but the bottom-most nodes).
  • The next pointer stores a singly-linked list of all other parents with this as its minimum child. Again, whether a new node should be added to the beginning, the end, or should be kept sorted with respect to the nodes and/or the table is up for experiments.

In practice, we should expect the parent pointer to immediately provide the desired node. This leaves the bottom-most nodes with only terminal children. Since they are not explicit nodes in the table (?), then we need to store two additional parent pointers next to the table. Yet, these terminals can have up to 3n parents (for n variables) when we use the table for both BDDs and ZDDs. Here, my simplified linear bucket above would have terrible performance. Yet, #722 might solve this and make this much better than the "proper" solution in #731 .

References

  • [Lovato2014] Alberto Lovato, Damiano Macedonio, and Fausto Spoto. “A Thread-Safe Library for Binary Decision Diagrams”. In: Software Engineering and Formal Methods (2014)

  • [Pastva2023] Samuel Pastva and Thomas Henzinger. “Binary Decision Diagrams on Modern Hardware”. In: Proceedings of the 23rd Conference on Formal Methods in Computer-Aided Design (2023)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions