Conversation
Summary of ChangesHello @jswrenn, 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 establishes a new framework for codegen testing within 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
Activity
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
|
There was a problem hiding this comment.
Code Review
This pull request introduces codegen tests, which is a valuable addition for ensuring the quality and performance of the generated code. My review identified a critical bug in the test runner's logic that would prevent the tests from working as intended, along with a minor typo in a data structure. Once these issues are addressed, the PR will be in great shape.
14a9ab8 to
48b0882
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3042 +/- ##
=======================================
Coverage 91.87% 91.87%
=======================================
Files 20 20
Lines 6057 6057
=======================================
Hits 5565 5565
Misses 492 492 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
660b7fb to
b03ee9d
Compare
74b9f2b to
d7bea7f
Compare
f10a345 to
ab80b03
Compare
Introduces a suite of code generation tests to the `benches` folder. Each tests consists of a pair of files: a Rust source containing a function named `codegen_test`, and a `.x86-64.mca` file containing the llvm-mca analysis of `codegen_test`. In practice, these tests operate similarly to UI tests; CI checks a fresh llvm-mca analysis against that in the file, and fails if they mismatch. Changes can be expressly blessed via `BLESS=1`. gherrit-pr-id: G5964d13c9ffb7a47ed4662892ef92c90ddc51e12
ab80b03 to
268f505
Compare
| FEATURES: ${{ matrix.features }} | ||
| run: | | ||
| sudo apt install llvm > /dev/null | ||
| ./cargo.sh +nightly install cargo-show-asm > /dev/null |
There was a problem hiding this comment.
Add this to the generate_cache step so it's pre-installed in the cache? You may need to do sudo apt install llvm first in the generate_cache step.
| sudo apt install llvm > /dev/null | ||
| ./cargo.sh +nightly install cargo-show-asm > /dev/null |
There was a problem hiding this comment.
Instead of >/dev/null, do either of these commands accept a -q flag or similar?
| $FEATURES \ | ||
| --verbose \ | ||
| --test codegen | ||
| if: matrix.crate == 'zerocopy' && matrix.toolchain == 'nightly' && matrix.target == 'x86_64-unknown-linux-gnu' && matrix.features == '--all-features' |
There was a problem hiding this comment.
Given this guard, maybe we can just take this out of the matrix so it can run in parallel? That'd let us be able to hard-code the arguments for +$TOOLCHAIN, --package, --target, and --all-features, and also avoid needing to cache the installation steps at the top.
There was a problem hiding this comment.
Can we name these formats in a way that self-describes what constraints they have (ie, coco::Packet is TryFromBytes but not FromBytes, while loco::Packet is FromBytes)?
| set -eo pipefail | ||
|
|
||
| # Update the `.stderr` reference files used to validate our UI tests. | ||
| # Update the `.stderr` reference files used to validate our UI and codegen tests. |
There was a problem hiding this comment.
| # Update the `.stderr` reference files used to validate our UI and codegen tests. | |
| # Update the `.stderr` reference files used to validate our UI tests and the | |
| # `.x86-64.mca` files used to validate our codegen tests. |
| #[test] | ||
| #[cfg_attr(miri, ignore)] | ||
| fn codegen() { | ||
| let bless = std::env::var("BLESS").ok().filter(|s| s == "1").is_some(); |
There was a problem hiding this comment.
Maybe just check for BLESS to exist? Either that or panic if its value isn't 1.
Introduces a suite of code generation tests to the
benchesfolder.Each tests consists of a pair of files: a Rust source containing a
function named
codegen_test, and a.x86-64.mcafile containingthe llvm-mca analysis of
codegen_test. In practice, these testsoperate similarly to UI tests; CI checks a fresh llvm-mca analysis
against that in the file, and fails if they mismatch. Changes can
be expressly blessed via
BLESS=1.Latest Update: v19 — Compare vs v18
📚 Full Patch History
Links show the diff between the row version and the column version.
⬇️ Download this PR
Branch
git fetch origin refs/heads/G5964d13c9ffb7a47ed4662892ef92c90ddc51e12 && git checkout -b pr-G5964d13c9ffb7a47ed4662892ef92c90ddc51e12 FETCH_HEADCheckout
git fetch origin refs/heads/G5964d13c9ffb7a47ed4662892ef92c90ddc51e12 && git checkout FETCH_HEADCherry Pick
git fetch origin refs/heads/G5964d13c9ffb7a47ed4662892ef92c90ddc51e12 && git cherry-pick FETCH_HEADPull
Stacked PRs enabled by GHerrit.