Skip to content

add add_mul_imm component#46

Open
giladchase wants to merge 1 commit intogilad/addap-restfrom
gilad/add-mul-imm
Open

add add_mul_imm component#46
giladchase wants to merge 1 commit intogilad/addap-restfrom
gilad/add-mul-imm

Conversation

@giladchase
Copy link

@giladchase giladchase commented Jan 26, 2025

This change is Reviewable

Copy link
Contributor

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 4 files at r1, all commit messages.
Reviewable status: 2 of 4 files reviewed, 5 unresolved discussions (waiting on @giladchase)


crates/prover/src/utils/component.rs line 23 at r1 (raw file):

}

/// Create a constraint asserting that `flag` is a bit.

Nit

Suggestion:

/// Constrain that `flag` is a bit.

crates/prover/src/utils/component.rs line 28 at r1 (raw file):

    // f^2 - f
    f() * f() - f()
}

very nice :)

Code quote:

/// Create a constraint asserting that `flag` is a bit.
pub fn is_bit<E: EvalAtRow>(flag: &E::F) -> E::F {
    let f = || flag.clone();
    // f^2 - f
    f() * f() - f()
}

crates/prover/src/components/add_mul_imm_opcode/component.rs line 50 at r1 (raw file):

    }

    fn evaluate<E: EvalAtRow>(&self, mut eval: E) -> E {

Can you document what this opcode should do?

Code quote:

    fn evaluate<E: EvalAtRow>(&self, mut eval: E) -> E {

crates/prover/src/components/add_mul_imm_opcode/component.rs line 116 at r1 (raw file):

        let rhs_val = E::combine_ef(rhs_val_arr);

        // Apply operation.

Don't you need to lookup the result to the memory relation?
shouldn't be dst here somewhere?

Code quote:

        // Apply operation.

crates/prover/src/components/add_mul_imm_opcode/component.rs line 168 at r1 (raw file):

    pub log_size: u32,
    pub logup_sums: LogupSums,
}

Wrote on another pr as well but we removed LogupSums, we need to think how we want to handle it here

Code quote:

pub struct InteractionClaim {
    pub log_size: u32,
    pub logup_sums: LogupSums,
}

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

Successfully merging this pull request may close these issues.

2 participants