Apply suggestions from code review (changelog and comments only)

Co-authored-by: Greg Pfeil <greg@technomadic.org>
This commit is contained in:
Daira Hopwood 2023-03-11 00:21:03 +00:00 committed by GitHub
parent 8231d8ffab
commit ab1cae34e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -11,7 +11,7 @@ and this project adheres to Rust's notion of
standard library's [`slice::sort_unstable_by_key`]; while it is deterministic,
it is not stable across targets or compiler versions. In particular, an edge
case within the sorting algorithm differed between 32-bit and 64-bit targets.
This meant that some circuits (like the [Orchard circuit]) would be layed out
This meant that some circuits (like the [Orchard circuit]) would be laid out
differently, resulting in incompatible verifying keys. This release makes a
**breaking change** to the behaviour of `floor_planner::V1` to instead use a
stable sort.

View File

@ -213,8 +213,9 @@ pub fn slot_in_biggest_advice_first(
advice_cols * shape.row_count()
};
// This used to incorrectly use `sort_unstable_by_key` with non-unique keys, which is
// nondeterministic (in particular, it differs between 32-bit and 64-bit platforms).
// This used to incorrectly use `sort_unstable_by_key` with non-unique keys, which gave
// output that differed between 32-bit and 64-bit platforms, and potentially between Rust
// versions.
// We now use `sort_by_cached_key` with non-unique keys, and rely on `region_shapes`
// being sorted by region index (which we also rely on below to return `RegionStart`s
// in the correct order).