Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Automatic plaf instance - Issue #129 #133

Conversation

jae-cuz
Copy link
Contributor

@jae-cuz jae-cuz commented Sep 16, 2023

Resolves #129. Implemented automatic plaf instance generation.
use chiquito::plonkish::backend::plaf::PlafInstance would enable plaf_circuit.instance().

Ready for review @leolara @qwang98

  • Collect copy constraints btw witness_column & public_column, and index and offset of them
  • instance_with_offsets: vector of pair (witness value, public offset), where public offset indicates the order to be returned
  • sort the vector instance_with_offsets with public offset
  • instance_values: convert witness values in instance_with_offsets to field
  • and return the instance vector

See along with example :

// when we use expose, plaf.copys is assigned like
[
    CopyC {
        columns: (
            Column {
                kind: Public,
                index: 0,
            },
            Column {
                kind: Witness,
                index: 1,
            },
        ),
        offsets: [
            (
                0,
                10,
            ),
        ],
    },
    CopyC {
        columns: (
            Column {
                kind: Public,
                index: 0,
            },
            Column {
                kind: Witness,
                index: 2,
            },
        ),
        offsets: [
            (
                1,
                10,
            ),
        ],
    },
]
// which means that values to be exposed are "witness[column 1][row 10]" and "witness[column 2][row 10]"
// in order 0, 1, respectively.

@jae-cuz
Copy link
Contributor Author

jae-cuz commented Sep 18, 2023

Tried generalizaiton with reference to https://github.com/Dhole/polyexen/blob/master/src/plaf/backends/halo2.rs#L346-L367

@leolara
Copy link
Collaborator

leolara commented Sep 22, 2023

So, actually this is better if we do in plaf codebase, because it is in their responsability boundary,. So I would send this as a PR there. But keep this open in case they don't accept it we can add it here.

@leolara
Copy link
Collaborator

leolara commented Sep 25, 2023

Please, paste here the link to the PR to plaf when you have sent it, so we can track if it gets merged.

@jae-cuz
Copy link
Contributor Author

jae-cuz commented Sep 25, 2023

Here is my PR to plaf : Dhole/polyexen#3

I would make a new issue if it is merged :) Thanks

@jae-cuz
Copy link
Contributor Author

jae-cuz commented Oct 2, 2023

Move to #144.

@jae-cuz jae-cuz closed this Oct 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable automatic generation of instance for Plaf backend
2 participants