-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[experimental] Ask copilot to check perf profile degradation #146271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We can optionally add copilot as a reviewer. As per [documentation](https://docs.github.com/en/copilot/how-tos/agents/copilot-code-review/using-copilot-code-review#customizing-copilots-reviews-with-custom-instructions), we can customize the review. This PR asks it to pay attention to the kind of code that might corrupt performance data, or, in the case of sampel profiling, result in poor profiles by dropping debug info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces custom instructions for Copilot to focus on performance profile integrity and debug information when reviewing code changes.
- Adds guidance to the Copilot instructions file to watch for control-flow modifications that may corrupt profiling or debug data.
- Emphasizes checking for invalid debug information on branches and calls.
Comments suppressed due to low confidence (1)
.github/copilot-instructions.md:1
- [nitpick] The phrase 'modifying a function control flow' is ambiguous; consider rephrasing to 'modifying a function's control flow' for greater clarity.
When performing a code review, pay close attention to code modifying a function
Note to reviewers: I didn't want to make the prompt too stuffy, in some local experiments, something this short ended up being reasonably good. I'd rather get going, start experimenting with this for a while by selectively adding it to PRs and seeing what mileage we get, and we can wordsmith it if needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(It looks like you meant to request reviewers rather than assign people to the PR?)
This seems reasonable enough to me. This does seem a bit specific to one specific problem though. I'm hoping Copilot is good enough to ignore these instructions when analyzing changes that don't modify function control flow?
Ugh. yes, fixed.
That's what I'm reading from the example in the documentation, yes - I'm guessing whatever we place in this file is appended to a base prompt. Let's see. |
.github/copilot-instructions.md
Outdated
@@ -0,0 +1,4 @@ | |||
When performing a code review, pay close attention to code modifying a function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/function/function's
?
I'll land it, and if folks don't mind trying to ask copilot to review on various PRs they see - let's get a feel for its usefulness? |
We can optionally add copilot as a reviewer. As per documentation, we can customize the review. This PR asks it to pay attention to the kind of code that might corrupt performance data, or, in the case of sample profiling, result in poor profiles by dropping debug info.