differential-datalog icon indicating copy to clipboard operation
differential-datalog copied to clipboard

Custom `Ord` trait for DDlog values.

Open ryzhyk opened this issue 4 years ago • 0 comments

The default Ord implementation for Intern relies on pointer comparison and is therefore non-deterministic across DDlog runs. This is necessary to speedup sorting inside DD. We still want DDlog outputs to be deterministic, though, which requires a different, less efficient, but predictable comparison trait. DDlog expressions should be evaluated using this trait. DDlog sets should also use this trait to order things internally.

This is even more important in distributed settings, as we will end up with inconsistent across hosts, potentially compromising correctness.

ryzhyk avatar May 14 '20 20:05 ryzhyk