lsils / mockturtle

C++ logic network library
MIT License
208 stars 138 forks source link

Non-deterministic behavior in ESOP computation #617

Open aletempiac opened 1 year ago

aletempiac commented 1 year ago

Describe the bug Non-deterministic behavior in ESOP computation in Kitty. Functions esop_from_optimum_pkrm, and esop_from_pprm_slow use an unordered_set data structure to store the cubes. That content is moved to a vector later. Since the order of the cubes in the vector dependents on the compiler, it leads to a non-deterministic behavior.

Environment

Check list

lee30sonia commented 12 months ago

Are the results wrong, or just non-deterministic? In my opinion, producing non-deterministic but correct results is not counted as a "bug", although it is not preferred in an experiment setting. I'm not even sure if non-deterministic is the correct word, if you said the result depends on the compiler. I think non-deterministic means if you run it multiple times on the same machine, the results are different (e.g. when time is used as the random seed, or memory-related bugs depending on the memory address or content being allocated each time). Also, maybe we should put this issue in kitty, not in mockturtle.