-
Notifications
You must be signed in to change notification settings - Fork 7
refactor: reorganize reconsensus #164
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
Conversation
This is an idea for improving code structure in reconsensus module: - split away blocks requiring realignment early - separate logic for mutation-only reconsensus and full reconsensus Additionally: - make `find_majority*` functions into methods of `Block` - they look very much like fancy accessors
- Use iterator count instead of collecting to vector for performance - Only create vector when needed for error message formatting - Reduces heap allocations in common case paths
- Improves consistency with field name 'subs' - More concise while maintaining clarity - Follows existing naming patterns in codebase
args: &PangraphBuildArgs, | ||
) -> Result<(), Report> { | ||
// First apply mutations | ||
apply_mutation_reconsensus(block, &majority_edits.subs)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might be redundant, edits are already applied later...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where? Cannot figure it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit hidden, but if I'm not mistaken here all mutations get applied to the consensus, including substitutions, and then everything gets realigned to it anyways, so we won't need to deal with mutation separately.
Targets #158
Updated version of #163 (on top of new changes in #158)
This is an idea for improving code structure in reconsensus module:
Additionally:
find_majority*
functions into methods ofBlock
- they look very much like fancy accessorsNOTE: This is simply an idea, with large portions of code generated by AI. Needs some verification.