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

Stage 1 "public callback" #2517

Open
qwang98 opened this issue Mar 4, 2025 · 1 comment
Open

Stage 1 "public callback" #2517

qwang98 opened this issue Mar 4, 2025 · 1 comment

Comments

@qwang98
Copy link
Collaborator

qwang98 commented Mar 4, 2025

In #1756, a mapping of public reference to values are calculated in witgen, similar to how a witness column is solved. However, this is only for stage 0 publics and I think there's a need for "public callback" similar to witness callback for stage 1 publics. This is needed for #2502, which tries to decouple publics from a trace in witness.

For example, the following test fails for plonky3/stark.rs when I uncomment the rows below in #2502. The backend can only fetch stage 1 publics from stage 1 witness, which negates our purpose to decouple publics from witness trace:

#[test]
    fn stage_1_public() {
        let content = r#"
        let N: int = 8;

        namespace Global(N);
            let alpha: expr = std::prelude::challenge(0, 41);
            let beta: expr = std::prelude::challenge(0, 42);
            col witness stage(0) x;
            col witness stage(1) y;
            x = y + beta * alpha;

            // public out = y(N - 1);
            
            // Currently, public references are now required along with public declaration in #2502
            // col fixed ISLAST(i) { if i == N - 1 { 1 } else { 0 } };
            // ISLAST * (:out - y) = 0;
        "#;
        run_test(content);
    }

@Schaeff
Copy link
Collaborator

Schaeff commented Mar 4, 2025

Would it make sense to extend the notion of witness to "witness + publics"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants