Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: padding for negatively signed permutation sorts #568

Open
DavePearce opened this issue Jan 20, 2025 · 0 comments
Open

fix: padding for negatively signed permutation sorts #568

DavePearce opened this issue Jan 20, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@DavePearce
Copy link
Collaborator

DavePearce commented Jan 20, 2025

There is currently an outstanding and unresolved issue around padding for permutation sorts with negative (sorting) signs (see here). For example, something like this is broken:

(module m1)
(defcolumns X)
(defpermutation (Y) ((- X)))

The problem is that the trace can always be padding with 0 at the beginning, thus breaking the sorting criteria for Y.

Mitigation

This is less of a problem when the first column of a permutation is positively signed. For example, something like this:

(module m1)
(defcolumns A B)
(defpermutation (X Y) ((+ A) (- B)))

Then for a trace like this:

{ "m1.A": [1,1,2,3], "B": [40,56,65,90] }

This is accepted correctly because a spillage value of 0 for A ensures we can accept a padded trace like this:

{ "m1.A": [0,0,1,1,2,3], "m1.B": [0,0,40,56,65,90] }

However, we can still construct a problematic trace such as:

{ "m1.A": [0,0,0,0], "m1.B": [40,56,65,90] }

Here, again, we are given an incorrect spillage value for B.

Solutions?

  • (Padding Prepend / Append). One idea is to enable prepending and appending of padding data (i.e. so the 0 could be appended for negatively signed columns). This is problematic, however, for the case where we have a single delta column capturing both negatively and positively signed columns.
@DavePearce DavePearce changed the title padding for negatively signed permutation sorts fix: padding for negatively signed permutation sorts Jan 20, 2025
@DavePearce DavePearce added the bug Something isn't working label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant