Skip to content

sort_via triggers a constraint failure on arrays with any equal elementsΒ #5780

@jfecher

Description

@jfecher

Aim

Sorting any array with 2 identical elements in sort_via with the < comparison function

Expected Behavior

The resulting array to be sorted

Bug

The ordering assertion afterward causes a constraint failure:

        // Ensure the array is sorted
        for i in 0..N - 1 {
            assert(ordering(result[i], result[i + 1]));
        }

If the ordering function that was provided returns false for equal elements, such as < or >.

To Reproduce

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Nargo Version

No response

NoirJS Version

No response

Proving Backend Tooling & Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

Metadata

Metadata

Assignees

Labels

stdlibStandard library shipped with Noir tooling

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions