Skip to content

[codegen] Test and document codegen for FromZeros#3114

Open
jswrenn wants to merge 1 commit intomainfrom
Gea71a24b6b02a2d552b4af3e0980e71a50ab8f52
Open

[codegen] Test and document codegen for FromZeros#3114
jswrenn wants to merge 1 commit intomainfrom
Gea71a24b6b02a2d552b4af3e0980e71a50ab8f52

Conversation

@jswrenn
Copy link
Collaborator

@jswrenn jswrenn commented Mar 13, 2026

Vendors regex to normalize labels.

Makes progress towards #3079.


Latest Update: v19 — Compare vs v18

📚 Full Patch History

Links show the diff between the row version and the column version.

Version v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v8 v7 v6 v5 v4 v3 v2 v1 Base
v7 v6 v5 v4 v3 v2 v1 Base
v6 v5 v4 v3 v2 v1 Base
v5 v4 v3 v2 v1 Base
v4 v3 v2 v1 Base
v3 v2 v1 Base
v2 v1 Base
v1 Base
⬇️ Download this PR

Branch

git fetch origin refs/heads/Gea71a24b6b02a2d552b4af3e0980e71a50ab8f52 && git checkout -b pr-Gea71a24b6b02a2d552b4af3e0980e71a50ab8f52 FETCH_HEAD

Checkout

git fetch origin refs/heads/Gea71a24b6b02a2d552b4af3e0980e71a50ab8f52 && git checkout FETCH_HEAD

Cherry Pick

git fetch origin refs/heads/Gea71a24b6b02a2d552b4af3e0980e71a50ab8f52 && git cherry-pick FETCH_HEAD

Pull

git pull origin refs/heads/Gea71a24b6b02a2d552b4af3e0980e71a50ab8f52

Stacked PRs enabled by GHerrit.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 FromZeros trait by adding extensive benchmarks and updating its documentation. The new benchmarks provide detailed performance data and assembly analysis for various zeroing and allocation methods, covering different data structure types. This enhancement aims to offer clearer insights into the trait's behavior and performance characteristics, making it easier for developers to understand and utilize.

Highlights

  • New Benchmarks for FromZeros Trait: Introduced a comprehensive suite of benchmarks for various methods of the FromZeros trait, including zero, new_zeroed, new_box_zeroed, new_box_zeroed_with_elems, new_vec_zeroed, extend_vec_zeroed, and insert_vec_zeroed.
  • Detailed Performance Analysis: Each new benchmark includes Rust source code, generated x86-64 assembly, and mca (microarchitectural analysis) output, providing deep insights into the performance characteristics of these zeroing and allocation operations.
  • Enhanced Documentation: The documentation for the FromZeros trait methods in src/lib.rs has been updated with codegen_section! macros, linking directly to the newly added benchmarks for better context and understanding.
  • Coverage for Dynamic Types: Benchmarks now cover types with static sizes, dynamic sizes, and dynamic padding, ensuring broad testing of FromZeros functionality across different memory layouts.

🧠 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
  • benches/extend_vec_zeroed.rs
    • Added a Rust benchmark for FromZeros::extend_vec_zeroed.
  • benches/extend_vec_zeroed.x86-64
    • Added x86-64 assembly output for the extend_vec_zeroed benchmark.
  • benches/extend_vec_zeroed.x86-64.mca
    • Added mca analysis for the extend_vec_zeroed benchmark.
  • benches/insert_vec_zeroed.rs
    • Added a Rust benchmark for FromZeros::insert_vec_zeroed.
  • benches/insert_vec_zeroed.x86-64
    • Added x86-64 assembly output for the insert_vec_zeroed benchmark.
  • benches/insert_vec_zeroed.x86-64.mca
    • Added mca analysis for the insert_vec_zeroed benchmark.
  • benches/new_box_zeroed.rs
    • Added a Rust benchmark for FromZeros::new_box_zeroed.
  • benches/new_box_zeroed.x86-64
    • Added x86-64 assembly output for the new_box_zeroed benchmark.
  • benches/new_box_zeroed.x86-64.mca
    • Added mca analysis for the new_box_zeroed benchmark.
  • benches/new_box_zeroed_with_elems_dynamic_padding.rs
    • Added a Rust benchmark for FromZeros::new_box_zeroed_with_elems for dynamically padded types.
  • benches/new_box_zeroed_with_elems_dynamic_padding.x86-64
    • Added x86-64 assembly output for the new_box_zeroed_with_elems_dynamic_padding benchmark.
  • benches/new_box_zeroed_with_elems_dynamic_padding.x86-64.mca
    • Added mca analysis for the new_box_zeroed_with_elems_dynamic_padding benchmark.
  • benches/new_box_zeroed_with_elems_dynamic_size.rs
    • Added a Rust benchmark for FromZeros::new_box_zeroed_with_elems for dynamically sized types.
  • benches/new_box_zeroed_with_elems_dynamic_size.x86-64
    • Added x86-64 assembly output for the new_box_zeroed_with_elems_dynamic_size benchmark.
  • benches/new_box_zeroed_with_elems_dynamic_size.x86-64.mca
    • Added mca analysis for the new_box_zeroed_with_elems_dynamic_size benchmark.
  • benches/new_vec_zeroed.rs
    • Added a Rust benchmark for FromZeros::new_vec_zeroed.
  • benches/new_vec_zeroed.x86-64
    • Added x86-64 assembly output for the new_vec_zeroed benchmark.
  • benches/new_vec_zeroed.x86-64.mca
    • Added mca analysis for the new_vec_zeroed benchmark.
  • benches/new_zeroed.rs
    • Added a Rust benchmark for FromZeros::new_zeroed.
  • benches/new_zeroed.x86-64
    • Added x86-64 assembly output for the new_zeroed benchmark.
  • benches/new_zeroed.x86-64.mca
    • Added mca analysis for the new_zeroed benchmark.
  • benches/zero_dynamic_padding.rs
    • Added a Rust benchmark for FromZeros::zero for dynamically padded types.
  • benches/zero_dynamic_padding.x86-64
    • Added x86-64 assembly output for the zero_dynamic_padding benchmark.
  • benches/zero_dynamic_padding.x86-64.mca
    • Added mca analysis for the zero_dynamic_padding benchmark.
  • benches/zero_dynamic_size.rs
    • Added a Rust benchmark for FromZeros::zero for dynamically sized types.
  • benches/zero_dynamic_size.x86-64
    • Added x86-64 assembly output for the zero_dynamic_size benchmark.
  • benches/zero_dynamic_size.x86-64.mca
    • Added mca analysis for the zero_dynamic_size benchmark.
  • benches/zero_static_size.rs
    • Added a Rust benchmark for FromZeros::zero for statically sized types.
  • benches/zero_static_size.x86-64
    • Added x86-64 assembly output for the zero_static_size benchmark.
  • benches/zero_static_size.x86-64.mca
    • Added mca analysis for the zero_static_size benchmark.
  • src/lib.rs
    • Updated documentation for FromZeros trait methods to include codegen_section! macros.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 introduces benchmark tests and documentation generation for methods within the FromZeros trait. New benchmark files are added for methods such as zero, new_zeroed, new_box_zeroed, and new_vec_zeroed. Correspondingly, src/lib.rs is updated with #[doc = codegen_section!(...)] attributes on these methods to incorporate the benchmark results into the documentation. The changes appear to follow the existing patterns for codegen documentation within the project. I have reviewed the changes and found no issues.

@codecov-commenter
Copy link

codecov-commenter commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.87%. Comparing base (e4f2484) to head (01dd996).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3114   +/-   ##
=======================================
  Coverage   91.87%   91.87%           
=======================================
  Files          20       20           
  Lines        6057     6057           
=======================================
  Hits         5565     5565           
  Misses        492      492           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jswrenn jswrenn force-pushed the Gea71a24b6b02a2d552b4af3e0980e71a50ab8f52 branch from 7c3d2c0 to a3e3507 Compare March 14, 2026 14:32
@jswrenn jswrenn force-pushed the G09ea59a47925616837b859b2c3cdf7f0f919232e branch from 355fd79 to 8679ffd Compare March 16, 2026 18:41
@jswrenn jswrenn force-pushed the Gea71a24b6b02a2d552b4af3e0980e71a50ab8f52 branch from a3e3507 to 99d63b7 Compare March 16, 2026 18:41
@jswrenn jswrenn force-pushed the G09ea59a47925616837b859b2c3cdf7f0f919232e branch from 8679ffd to 7577a0f Compare March 16, 2026 19:09
@jswrenn jswrenn force-pushed the Gea71a24b6b02a2d552b4af3e0980e71a50ab8f52 branch from 99d63b7 to 24287c9 Compare March 16, 2026 19:09
@jswrenn jswrenn force-pushed the G09ea59a47925616837b859b2c3cdf7f0f919232e branch from 7577a0f to f811111 Compare March 16, 2026 20:17
@jswrenn jswrenn force-pushed the Gea71a24b6b02a2d552b4af3e0980e71a50ab8f52 branch from 24287c9 to 955cf5c Compare March 16, 2026 20:17
@jswrenn jswrenn force-pushed the G09ea59a47925616837b859b2c3cdf7f0f919232e branch from f811111 to c2cc179 Compare March 17, 2026 13:12
@jswrenn jswrenn force-pushed the Gea71a24b6b02a2d552b4af3e0980e71a50ab8f52 branch 2 times, most recently from 9692318 to c184959 Compare March 17, 2026 13:14
@jswrenn jswrenn requested a review from joshlf March 17, 2026 13:16
Base automatically changed from G09ea59a47925616837b859b2c3cdf7f0f919232e to main March 17, 2026 14:21
@jswrenn jswrenn enabled auto-merge March 17, 2026 14:58
@jswrenn
Copy link
Collaborator Author

jswrenn commented Mar 17, 2026

@joshlf any idea what's going on with failing CI here?

@joshlf
Copy link
Member

joshlf commented Mar 17, 2026

@joshlf any idea what's going on with failing CI here?

Yeah, it's a silly and thankfully transient bug I need to fix. Just rebase on main and re-push.

Vendors `regex` to normalize labels.

Makes progress towards #3079.

gherrit-pr-id: Gea71a24b6b02a2d552b4af3e0980e71a50ab8f52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants