Skip to content

[codegen] Track unanalyzed assembly and include it in docs.#3081

Merged
jswrenn merged 1 commit intomainfrom
Ged67b8f5ad7d38d9f2eb40adebea8894a1a6a008
Mar 6, 2026
Merged

[codegen] Track unanalyzed assembly and include it in docs.#3081
jswrenn merged 1 commit intomainfrom
Ged67b8f5ad7d38d9f2eb40adebea8894a1a6a008

Conversation

@jswrenn
Copy link
Collaborator

@jswrenn jswrenn commented Mar 5, 2026

This is more approachable than the full llvm-mca analysis.


Latest Update: v6 — Compare vs v5

📚 Full Patch History

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

Version v5 v4 v3 v2 v1 Base
v6 vs v5 vs v4 vs v3 vs v2 vs v1 vs Base
v5 vs v4 vs v3 vs v2 vs v1 vs Base
v4 vs v3 vs v2 vs v1 vs Base
v3 vs v2 vs v1 vs Base
v2 vs v1 vs Base
v1 vs Base
⬇️ Download this PR

Branch

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

Checkout

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

Cherry Pick

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

Pull

git pull origin refs/heads/Ged67b8f5ad7d38d9f2eb40adebea8894a1a6a008

Stacked PRs enabled by GHerrit.

This is more approachable than the full llvm-mca analysis.

gherrit-pr-id: Ged67b8f5ad7d38d9f2eb40adebea8894a1a6a008
@codecov-commenter
Copy link

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3081   +/-   ##
=======================================
  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.

@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 enhances the code generation documentation by including raw assembly code alongside the existing machine code analysis. This change provides a more direct and potentially more approachable view of the generated code. The update involves adding new benchmark files containing assembly code, modifying the rustdoc CSS to accommodate a new display column, and updating the test suite to verify the generation of both assembly and machine code analysis outputs.

Highlights

  • Assembly Code Inclusion: This PR introduces the tracking and inclusion of unanalyzed assembly code in documentation, offering a more accessible alternative to full llvm-mca analysis.
  • New Assembly Benchmarks: Several new assembly benchmarks have been added for various reference operations, enhancing the code generation tests.
  • CSS Update: The CSS file has been modified to accommodate an additional column in the codegen tabs, improving the layout for the new assembly code display.
  • Test Logic Modification: The test logic in tests/codegen.rs was modified to test both assembly and mca directives.

🧠 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/ref_from_bytes.x86-64
    • Added a new assembly benchmark for ref_from_bytes.
  • benches/ref_from_bytes_with_elems.x86-64
    • Added a new assembly benchmark for ref_from_bytes_with_elems.
  • benches/ref_from_prefix.x86-64
    • Added a new assembly benchmark for ref_from_prefix.
  • benches/ref_from_prefix_with_elems.x86-64
    • Added a new assembly benchmark for ref_from_prefix_with_elems.
  • benches/ref_from_suffix.x86-64
    • Added a new assembly benchmark for ref_from_suffix.
  • benches/ref_from_suffix_with_elems.x86-64
    • Added a new assembly benchmark for ref_from_suffix_with_elems.
  • benches/transmute_ref.x86-64
    • Added a new assembly benchmark for transmute_ref.
  • benches/try_ref_from_bytes.x86-64
    • Added a new assembly benchmark for try_ref_from_bytes.
  • benches/try_ref_from_bytes_with_elems.x86-64
    • Added a new assembly benchmark for try_ref_from_bytes_with_elems.
  • benches/try_ref_from_prefix.x86-64
    • Added a new assembly benchmark for try_ref_from_prefix.
  • benches/try_ref_from_prefix_with_elems.x86-64
    • Added a new assembly benchmark for try_ref_from_prefix_with_elems.
  • benches/try_ref_from_suffix.x86-64
    • Added a new assembly benchmark for try_ref_from_suffix.
  • benches/try_ref_from_suffix_with_elems.x86-64
    • Added a new assembly benchmark for try_ref_from_suffix_with_elems.
  • benches/try_transmute_ref.x86-64
    • Added a new assembly benchmark for try_transmute_ref.
  • rustdoc/style.css
    • Updated the CSS to support four columns in the codegen tabs.
  • src/util/macros.rs
    • Modified the codegen_tabs macro to include assembly code from new benchmark files.
  • tests/codegen.rs
    • Modified the test logic to test both assembly and mca directives.
Activity
  • New assembly benchmarks were added.
  • CSS was updated to accommodate the new assembly code display.
  • The codegen_tabs macro was modified to include assembly code.
  • Test logic was updated to test both assembly and mca directives.
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 extends the codegen testing and documentation to include raw assembly output, in addition to the existing llvm-mca analysis. This is achieved by refactoring the test runner to handle different output directives (--asm and --mca) and updating the documentation macro to include a new tab for assembly.

The changes are well-structured. I have a few suggestions to improve maintainability and the developer experience when debugging test failures:

  • Use a .asm extension for the generated assembly files for better clarity. This requires changes in two places and renaming the newly added files.
  • Improve the panic message in the codegen tests to show the actual generated output when a mismatch is found, which will make debugging easier.

@jswrenn jswrenn added this pull request to the merge queue Mar 6, 2026
Merged via the queue into main with commit aa1bbf4 Mar 6, 2026
105 checks passed
@jswrenn jswrenn deleted the Ged67b8f5ad7d38d9f2eb40adebea8894a1a6a008 branch March 6, 2026 23:48
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