Skip to content

feature/explore#116

Merged
p14c31355 merged 8 commits intodevelopfrom
docs/explore
Sep 3, 2025
Merged

feature/explore#116
p14c31355 merged 8 commits intodevelopfrom
docs/explore

Conversation

@p14c31355
Copy link
Owner

🚀 Pull Request

Overview

Change details

  • New feature
  • Refactoring
  • Bug fix
  • CI / Build settings correction
  • Documentation update

@p14c31355 p14c31355 self-assigned this Sep 3, 2025
@p14c31355 p14c31355 added the documentation Improvements or additions to documentation label Sep 3, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 @p14c31355, 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 primarily updates the documentation for the I2C Initialization Sequence Explorer feature. It provides a clearer, API-focused guide for users, along with minor adjustments to the main README.

Highlights

  • Documentation Restructuring: The docs/USAGE_EXPLORE.md file has been completely rewritten to provide a more concise and API-centric guide for the I2C Initialization Sequence Explorer, detailing key structures, functions, and new convenience macros.
  • README Update: The main README.md now includes a direct link to the updated I2C explorer documentation and incorporates minor build profile optimizations for release builds.
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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 updates the documentation for the explore feature. The changes in README.md improve the release profile recommendations, though I've suggested re-adding strip = true for optimal binary size reduction. The USAGE_EXPLORE.md file has been significantly rewritten to be more of a user-facing API guide. I've found a few issues in the new documentation: a duplicated heading, an incorrect description of the CmdNode struct, and the use of unexplained magic numbers in a code example. My review includes suggestions to fix these to improve clarity and correctness.

README.md Outdated
Comment on lines 86 to 89
panic = "abort"
codegen-units = 1
lto = true
strip = true
opt-level = "z"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The new release profile settings are great for optimizing binary size. However, you've removed strip = true. For maximum binary size reduction, which is the goal of this section, stripping symbols is crucial. Was the removal intentional? I'd recommend adding it back to provide the most effective optimization settings for users.

Suggested change
panic = "abort"
codegen-units = 1
lto = true
strip = true
opt-level = "z"
panic = "abort"
codegen-units = 1
lto = true
strip = true
opt-level = "z"

Comment on lines 1 to 2
# API\_EXPLORE.md

Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This document has two H1 headings (on line 1 and line 3), which is not ideal for markdown structure. The first heading seems to be the filename, which is redundant. I recommend removing it to have a single, clear title for the document.

]
};

let _ = pruning_sort!(explorer_instance.0, &mut i2c, &mut serial, PREFIX, 23, 256, 22);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The example usage of pruning_sort! uses magic numbers for the const generic parameters (23, 256, 22). This can be confusing for users, as it's not clear where these numbers come from, especially since the nodes! definition uses ....

It would be more helpful to either explain how to determine these values or show a complete, self-contained example where these values are derived. Since the macro requires them, the example should be clearer about them.

p14c31355 and others added 2 commits September 3, 2025 17:27
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@p14c31355
Copy link
Owner Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 significantly improves the documentation for the explore feature by rewriting USAGE_EXPLORE.md to be a more user-friendly API guide and updating the README.md. The changes are a great step forward in making the feature easier to understand and use. I've added a few review comments with suggestions to further enhance the clarity and consistency of the documentation and code examples.


### Returns
```rust,no_run
pruning_sort!(explorer_instance, &mut i2c, &mut serial, PREFIX, 23, 256, 22);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The examples for pruning_sort!, get_one_sort!, and in the 'Example Usage' section use magic numbers for the const generic parameters. This makes the examples difficult to understand without cross-referencing the function/macro definitions. To improve clarity and make the documentation more self-contained, please use named constants.

Additionally, there's a slight inconsistency in how explorer_instance is used. The Example Usage section correctly shows that nodes! returns a tuple and explorer_instance.0 should be passed to the macro. The examples in the Macros section just use explorer_instance, which might be confusing.

Here is a revised example for pruning_sort! that addresses both points:

// Assuming `explorer` is a reference to an Explorer instance
const N: usize = 23;
const CMD_BUFFER_SIZE: usize = 256;
const MAX_DEPS: usize = 22;
pruning_sort!(explorer, &mut i2c, &mut serial, PREFIX, N, CMD_BUFFER_SIZE, MAX_DEPS);

Please apply this pattern to the other examples in this document as well.

p14c31355 and others added 3 commits September 3, 2025 17:37
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@p14c31355
Copy link
Owner Author

/gemini summary

@gemini-code-assist
Copy link
Contributor

Summary of Changes

This pull request primarily focuses on enhancing the documentation for the I2C Initialization Sequence Explorer feature. It clarifies the API usage and structure, making it easier for users to understand and implement. Additionally, it updates recommended build configurations for optimized embedded Rust binaries.

Highlights

  • Documentation Restructuring: The docs/USAGE_EXPLORE.md file has been significantly rewritten to provide a clearer, API-focused description of the Initialization Sequence Explorer, moving away from internal algorithm details.
  • README Update: The README.md now includes a dedicated "Explore" section linking to the updated usage documentation and incorporates optimized Cargo.toml release profile settings for embedded applications.
Changelog
  • README.md
    • Added a new "Explore" section with a direct link to docs/USAGE_EXPLORE.md.
    • Updated the [profile.release] section in the Cargo.toml example to include opt-level = "z", codegen-units = 1, and panic = "abort" for better binary size optimization.
  • docs/USAGE_EXPLORE.md
    • Renamed the document title from "I2C Command Sequence Explorer" to "Initialization Sequence Explorer API".
    • Completely restructured the content, shifting focus from the internal algorithm to a clear API description.
    • Introduced new sections: "Key Structures" (describing Explorer and CmdNode), "Key Functions" (detailing pruning_explorer and one_topological_explorer), "Macros" (pruning_sort!, get_one_sort!), and "Notes & Caveats".
    • Removed previous sections like "Key Features", "Typical Use Case", and the detailed example, replacing them with more concise and API-relevant information.
Activity
  • p14c31355 initiated a review and requested a summary.
  • gemini-code-assist[bot] provided several review comments:
  • Suggested correcting the CmdNode documentation in docs/USAGE_EXPLORE.md to match the actual struct definition.
  • Recommended re-adding strip = true to the Cargo.toml release profile settings for optimal binary size reduction.
  • Pointed out that docs/USAGE_EXPLORE.md has two H1 headings and suggested removing the redundant one.
  • Advised against using magic numbers for const generic parameters in macro examples within docs/USAGE_EXPLORE.MD and suggested using named constants for clarity.
  • Suggested reordering [profile.release] settings in README.md for better readability.
  • Recommended explicitly listing parameters for one_topological_explorer instead of stating they are "Same as pruning_explorer" due to differing const generic parameters.
  • Further elaborated on the magic numbers and inconsistent explorer_instance usage in examples, providing a revised example.

@p14c31355 p14c31355 merged commit 0bee88a into develop Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments