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

Do not treat constants specially during parsing. #647

Merged
merged 3 commits into from
Oct 10, 2023

Conversation

chriseth
Copy link
Member

No description provided.

@chriseth chriseth force-pushed the do_not_parse_constant_refs_differently branch 2 times, most recently from 4937a78 to 0bbac00 Compare October 2, 2023 12:26
@@ -38,7 +39,8 @@ pub(crate) fn analyzed_to_circuit<T: FieldElement>(

let query = |column, rotation| Expr::Var(PlonkVar::Query(ColumnQuery { column, rotation }));

let mut cd = CircuitData::from(fixed.to_owned(), witness, &analyzed.constants);
let constants = compute_constants(analyzed);
Copy link
Member Author

Choose a reason for hiding this comment

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

TOOD: use optimize_mildly instead.

Copy link
Collaborator

@georgwiese georgwiese left a comment

Choose a reason for hiding this comment

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

OK, I'll have to look at it again after a good night of sleep!

ast/src/analyzed/mod.rs Outdated Show resolved Hide resolved
}
});
self.definitions
.retain(|name, (poly, _def)| match poly.kind {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe the poly variables should be renamed to symbol? Also in the rest of the file.

backend/Cargo.toml Outdated Show resolved Hide resolved
backend/src/pilstark/json_exporter/mod.rs Outdated Show resolved Hide resolved
pilopt/src/lib.rs Outdated Show resolved Hide resolved
pil_analyzer/src/pil_analyzer.rs Outdated Show resolved Hide resolved
pub enum SymbolKind {
/// Fixed, witness or intermediate polynomial
Poly(PolynomialType),
/// A constant value.
Constant(),
/// Other symbol, could be a constant, depends on the type.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Other symbol, could be a constant, depends on the type.
/// Other symbol

Can't be a constant anymore, right?

I think it would also be nice to list some examples of what it could be. I think array of numbers or lambda functions?

pil_analyzer/src/pil_analyzer.rs Outdated Show resolved Hide resolved
pil_analyzer/src/pil_analyzer.rs Outdated Show resolved Hide resolved
pil_analyzer/src/pil_analyzer.rs Outdated Show resolved Hide resolved
@chriseth chriseth force-pushed the do_not_parse_constant_refs_differently branch from 2a1b9d4 to e48d5fc Compare October 4, 2023 11:04
@chriseth chriseth force-pushed the do_not_parse_constant_refs_differently branch from e48d5fc to 7ff4bd6 Compare October 4, 2023 13:30
@chriseth chriseth force-pushed the do_not_parse_constant_refs_differently branch 4 times, most recently from e70c51b to f433b1e Compare October 4, 2023 16:15
@chriseth
Copy link
Member Author

chriseth commented Oct 4, 2023

Ok I think this is almost ready.

@chriseth chriseth force-pushed the do_not_parse_constant_refs_differently branch 6 times, most recently from c2eef6b to ee0781a Compare October 10, 2023 12:51
Copy link
Collaborator

@georgwiese georgwiese left a comment

Choose a reason for hiding this comment

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

Just went through again, it's a lot clearer to me now!

@@ -49,6 +46,14 @@ impl<T: Display> Display for Analyzed<T> {
writeln!(f, ";")?
}
}
SymbolKind::Constant() => {
let indentation = if is_local { " " } else { "" };
Copy link
Collaborator

Choose a reason for hiding this comment

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

👌

@chriseth chriseth force-pushed the do_not_parse_constant_refs_differently branch from ee0781a to 5d080ed Compare October 10, 2023 14:38
@chriseth chriseth changed the base branch from main to pull-out-wrapping-handling October 10, 2023 14:40
@chriseth chriseth force-pushed the do_not_parse_constant_refs_differently branch from 5d080ed to 764ef2d Compare October 10, 2023 14:40
georgwiese
georgwiese previously approved these changes Oct 10, 2023
Base automatically changed from pull-out-wrapping-handling to main October 10, 2023 15:01
@georgwiese georgwiese dismissed their stale review October 10, 2023 15:01

The base branch was changed.

@chriseth chriseth enabled auto-merge October 10, 2023 15:07
@chriseth chriseth added this pull request to the merge queue Oct 10, 2023
Merged via the queue into main with commit 5ea3ba5 Oct 10, 2023
@chriseth chriseth deleted the do_not_parse_constant_refs_differently branch October 10, 2023 17:04
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