chore: universal handling for coord constancy in cycle_group#18253
Merged
ledwards2225 merged 3 commits intomerge-train/barretenbergfrom Nov 7, 2025
Merged
chore: universal handling for coord constancy in cycle_group#18253ledwards2225 merged 3 commits intomerge-train/barretenbergfrom
ledwards2225 merged 3 commits intomerge-train/barretenbergfrom
Conversation
ledwards2225
commented
Nov 6, 2025
| _is_standard_res = predicate.get_value() ? lhs._is_standard : rhs._is_standard; | ||
| } | ||
|
|
||
| // AUDITTODO: Talk to Sasha. Comment seems to be unrelated and its not clear why the logic is needed. |
Contributor
Author
There was a problem hiding this comment.
This AUDITTODO was outdated - this is exactly handling the case in question that is now solved by the constructor updates
guipublic
reviewed
Nov 7, 2025
| // For the simplicity of methods in this class, we ensure that the coordinates of a point always have the same | ||
| // constancy. If they don't, we convert the non-constant coordinate to a fixed witness. | ||
| if (_x.is_constant() != _y.is_constant()) { | ||
| info("Warning: cycle_group constructed with inconsistent coordinate constancy - converting to fixed witness"); |
Contributor
There was a problem hiding this comment.
I think we should remove this warning. If cycle_group does not handle mixed 'constancy', then it's his problem and it should not warn about it because it has a workaround.
This makes the blackbox interface in Noir cleaner and removes complexity by not having to take care of constant/witness inputs to the blackbox. Furthermore, 'DSL' can introduce this inconsistency by itself and getting such warning depending on the inputs looks strange.
Merged
5 tasks
Removed warning message for inconsistent coordinate constancy in cycle_group.
github-merge-queue bot
pushed a commit
that referenced
this pull request
Nov 7, 2025
BEGIN_COMMIT_OVERRIDE chore: remove more pg references and leftovers (#18260) refactor: Migrate --update_inputs flag to --vk_policy option (#18237) chore: stdlib byte_array and bool external audit fixes (#17838) chore: update naming in bb_proof_verification lib (#18269) chore: cycle group 13 (#18200) chore: universal handling for coord constancy in cycle_group (#18253) END_COMMIT_OVERRIDE
ludamad
pushed a commit
that referenced
this pull request
Dec 16, 2025
Its been noted in a few locations that use of field_t::conditional_assign with a non-constant predicate on the individual coordinates of a cycle_group element prior to construction can result in mixed constancy. E.g. if trying to conditionally assign between two points whose coordinates are constant but agree in only one or the other coordinate. In this case the coordinate that agrees will produce a constant, while the two that disagree will produce a witness. To avoid the need to handle this in disparate locations, we opt to handle it once and for all at the single interface for cycle_group. In particular, if we encounter mixed constancy, we convert the constant coordinate to a fixed witness. Closes #17514
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Its been noted in a few locations that use of field_t::conditional_assign with a non-constant predicate on the individual coordinates of a cycle_group element prior to construction can result in mixed constancy. E.g. if trying to conditionally assign between two points whose coordinates are constant but agree in only one or the other coordinate. In this case the coordinate that agrees will produce a constant, while the two that disagree will produce a witness. To avoid the need to handle this in disparate locations, we opt to handle it once and for all at the single interface for cycle_group. In particular, if we encounter mixed constancy, we convert the constant coordinate to a fixed witness.
Closes #17514