subspace icon indicating copy to clipboard operation
subspace copied to clipboard

Make sort robust to invalid Ord impl

Open danakj opened this issue 2 years ago • 2 comments

https://research.swtch.com/ub Points out std::sort can OOB if the Ord impl is invalid. We don’t want that!! So get off std::sort and std::unstable_sort

danakj avatar Aug 19 '23 11:08 danakj

https://github.com/Voultapher/sort-research-rs/blob/main/writeup/sort_safety/text.md#safety-vs-performance-a-case-study-of-c-c-and-rust-sort-implementations

danakj avatar Oct 05 '23 16:10 danakj

From this we can see for safety and performance we can just port the rust sort algorithms over directly.

danakj avatar Oct 05 '23 16:10 danakj