-
Notifications
You must be signed in to change notification settings - Fork 25
Add more comments and docs #173
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
base: master
Are you sure you want to change the base?
Conversation
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.
Summary of Changes
Hello @siq1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request is a significant documentation effort aimed at improving the clarity and understanding of the Expander Compiler's codebase. It introduces extensive Rustdoc comments across multiple modules, clarifies the purpose of key data structures and functions, and cleans up obsolete inline comments. Additionally, it formally deprecates an older builder module, guiding future development towards more optimized alternatives.
Highlights
- Documentation Improvements: Added comprehensive Rustdoc comments (
//!and///) to modules, structs, enums, traits, and functions across theec_go_lib,macros,builder,circuit,compile,frontend,hints,layering, andutilscrates. These comments explain the purpose, usage, and internal workings of various components, significantly enhancing code readability and maintainability. - Code Cleanup: Removed several outdated or redundant inline comments and block comments, particularly within the
macrosandbuilder/basic.rsfiles, streamlining the codebase. - Deprecation Notices: Marked the
expander_compiler/src/builder/final_build.rsmodule and its associatedBuildertype alias andprocessfunction as#[deprecated], indicating that this part of the code is no longer recommended for use and will be removed in the future. Also added#[allow(deprecated)]where necessary to suppress warnings. - Refined Data Structure Explanations: Enhanced documentation for core data structures like
RootBuilder,Builder,OutVarRef,ConstraintStatus,LinMeta,InsnTransformResult,Coef,InputMapping,VarSpec,Term,Expression,LinComb,Witness,Gate,Segment, andCircuitto provide clearer understanding of their roles and relationships within the compiler's IR and layered circuit representations. - Clarified API and Compilation Steps: Added detailed explanations for API traits (
BasicAPI,UnconstrainedAPI,RootAPI) and their methods, as well as for the various compilation steps and their options (CompileOptions), improving the clarity of the compiler's external interfaces and internal processes.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
|
/gemini review |
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.
Code Review
This pull request adds a significant amount of documentation across the codebase, which greatly improves readability and maintainability. The added comments are clear and helpful. I've found one minor issue with incorrect doc comments for a struct's fields, likely due to a copy-paste error, and have provided a suggestion to fix it. Overall, this is a great contribution to the project's documentation.
| /// The number of expected output ones in the circuit. | ||
| pub segments: Vec<Segment<C, I>>, | ||
| /// The segments in the circuit. | ||
| pub layer_ids: Vec<usize>, |
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.
The documentation for segments and layer_ids appears to be incorrect. The comment for segments seems to be a copy-paste error, and the comment for layer_ids actually describes segments.
| /// The number of expected output ones in the circuit. | |
| pub segments: Vec<Segment<C, I>>, | |
| /// The segments in the circuit. | |
| pub layer_ids: Vec<usize>, | |
| /// The segments in the circuit. | |
| pub segments: Vec<Segment<C, I>>, | |
| /// The IDs of the layers in the circuit, in order of execution. | |
| pub layer_ids: Vec<usize>, |
No description provided.