[codegen] Test and document codegen under different layouts#3085
[codegen] Test and document codegen under different layouts#3085
Conversation
Summary of ChangesHello, 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 significantly improves the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe 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 by creating a comment using either
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 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
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request introduces a significant refactoring of the benchmark tests and their documentation to showcase codegen under different data layouts. The changes are extensive, renaming and adding many files to create separate benchmarks for static_size, dynamic_size, and dynamic_padding layouts. The documentation macros have been completely overhauled for better modularity and to support these new tabbed examples. While the changes are generally excellent, I've found a minor issue in the CSS and a potential improvement in the new macro definitions.
There was a problem hiding this comment.
Code Review
This pull request is a significant and well-executed refactoring of the code generation documentation. It introduces a more flexible and powerful macro-based system for generating documentation with tabbed examples for different memory layouts. This greatly improves the documentation's utility for understanding the relationship between type complexity and codegen complexity. The addition of new benchmark variants for static size, dynamic size, and dynamic padding is also a valuable improvement to the test suite's robustness. The changes are consistent and well-structured. I have one suggestion to improve the documentation further.
There was a problem hiding this comment.
Code Review
This pull request refactors the code generation benchmark documentation within the zerocopy crate. The changes involve replacing the existing codegen_tabs! macro with a new, more flexible suite of macros (tabs!, codegen_example!, codegen_example_suite!, codegen_preamble!, and codegen_section!). This new macro system allows for the documentation of multiple benchmark variants (static size, dynamic size, and dynamic padding) using HTML tabs in rustdoc, providing a more organized and detailed view of code generation. Consequently, numerous benchmark definitions in src/lib.rs and src/macros.rs have been updated to utilize the new codegen_section! macro, and new benchmark files, along with their assembly and machine code analysis outputs, have been added for these variants. The rustdoc/style.css file was also updated to support the new tabbed layout. Review comments indicate issues with the new documentation macros, specifically that the tabs! macro incorrectly generates the open HTML attribute, contains a stray backslash in its output, and has a mismatch in how it expects the open argument from codegen_example_suite!. The reviewer suggests using helper arms in the tabs! macro to correctly handle the optional open attribute.
Note: Security Review did not run due to the size of the PR.
6f24e9a to
efab483
Compare
89ab1c2 to
a9921b5
Compare
11a76fa to
57741d2
Compare
a9921b5 to
87f0c90
Compare
57741d2 to
5eafa06
Compare
87f0c90 to
95834fc
Compare
95834fc to
1662134
Compare
This improves the robustness of our suite to different code paths, and illustrates in our documentation the relationship between type complexity and codegen complexity. gherrit-pr-id: G39e297d5b891f5115ef9607b090c5fbe95427d68
1662134 to
f5a1f81
Compare
This improves the robustness of our suite to different code paths, and
illustrates in our documentation the relationship between type
complexity and codegen complexity.
Latest Update: v8 — Compare vs v7
📚 Full Patch History
Links show the diff between the row version and the column version.
⬇️ Download this PR
Branch
git fetch origin refs/heads/G39e297d5b891f5115ef9607b090c5fbe95427d68 && git checkout -b pr-G39e297d5b891f5115ef9607b090c5fbe95427d68 FETCH_HEADCheckout
git fetch origin refs/heads/G39e297d5b891f5115ef9607b090c5fbe95427d68 && git checkout FETCH_HEADCherry Pick
git fetch origin refs/heads/G39e297d5b891f5115ef9607b090c5fbe95427d68 && git cherry-pick FETCH_HEADPull
Stacked PRs enabled by GHerrit.