chipmunk-project / chipmunk

A code generator for packet-processing pipelines based on end-to-end program synthesis
12 stars 5 forks source link

Deterministic compilation results. #181

Closed taegyunkim closed 5 years ago

taegyunkim commented 5 years ago

Addresses #178.

  1. Set random seed for z3 Solver
  2. Use collections.OrderedDict instead of built-in dict().
  3. Use ordered_set.OrderedSet instead of built-in set().

Note that we still need to think carefully not to break this whenever we modify the code that updates sketch.

As commented, we could have avoided this issue if we have used Python 3.6 or later.

taegyunkim commented 5 years ago

Ready for review.

anirudhSK commented 5 years ago

There are a few more places where we need to replace dict/set: https://github.com/chipmunk-project/chipmunk/search?p=1&q=set&unscoped_q=set and https://github.com/chipmunk-project/chipmunk/search?q=dict&unscoped_q=dict

Not all of these might affect us, but let's just use OrderedSet/OrderedDict everywhere for consistency.

taegyunkim commented 5 years ago

There are a few more places where we need to replace dict/set: https://github.com/chipmunk-project/chipmunk/search?p=1&q=set&unscoped_q=set and https://github.com/chipmunk-project/chipmunk/search?q=dict&unscoped_q=dict

Not all of these might affect us, but let's just use OrderedSet/OrderedDict everywhere for consistency.

Yes, I don't think other parts of the repo affect the results, but updated them just in case.