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

PIL LogUp implementation: Generate multiplicity column #2042

Merged
merged 6 commits into from
Nov 6, 2024

Conversation

georgwiese
Copy link
Collaborator

No need to have the user create the multiplicity column anymore.

@@ -174,7 +174,7 @@ impl<T: FieldElement> IndexedColumns<T> {
}
}

const MULTIPLICITY_LOOKUP_COLUMN: &str = "m_logup_multiplicity";
const MULTIPLICITY_LOOKUP_COLUMN: &str = "multiplicities";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Planning to remove this ASAP (prototype in #1958) and get this from the phantom lookups.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@georgwiese georgwiese marked this pull request as ready for review November 5, 2024 10:07
let column = columns.remove(&name).unwrap();
let column = columns
.remove(&name)
.unwrap_or_else(|| panic!("No machine generated witness for column: {name}"));
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this, in which situations can this fail?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think the culprit is this line, no one feels responsible for it. Hoping to fix this soon in #2043.

/// - lookup_constraint: The lookup constraint
/// - multiplicities: A multiplicities column which shows how many times each row of the RHS value appears in the LHS
let lookup: Constr, expr -> () = constr |lookup_constraint, multiplicities| {
/// - lookup_constraint: The lookup constraint
Copy link
Member

Choose a reason for hiding this comment

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

Quite redundant, I would just remove it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -75,6 +74,7 @@ let lookup: Constr, expr -> () = constr |lookup_constraint, multiplicities| {

let lhs_denom = sub_ext(beta, fingerprint(lhs, alpha));
let rhs_denom = sub_ext(beta, fingerprint(rhs, alpha));
let multiplicities = std::prover::new_witness_col_at_stage("multiplicities", 0);
Copy link
Member

Choose a reason for hiding this comment

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

Why specify the stage explicitly?

Copy link
Member

Choose a reason for hiding this comment

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

If you use let multiplicities, it will be create at the "current stage".

Copy link
Member

Choose a reason for hiding this comment

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

Right, if we use capture_stage, then we might already be at a higher stage, but I think there should still be a better way around that than just setting the stage to zero explicitly. I think I would just use let multiplicites now until we reach that problem.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

Copy link
Member

@chriseth chriseth left a comment

Choose a reason for hiding this comment

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

I still don't understand the panic message but it's fine.

@georgwiese georgwiese added this pull request to the merge queue Nov 6, 2024
Merged via the queue into main with commit b8cfbca Nov 6, 2024
14 checks passed
@georgwiese georgwiese deleted the lookup-generate-multiplicities branch November 6, 2024 16:34
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.

3 participants