Skip to content

Add a copilot prompt file for JIT-EE interface modifications #115889

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

Merged
merged 10 commits into from
May 26, 2025

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented May 22, 2025

Adding new APIs to the JIT-EE interface is time-consuming and is difficult to automate: 15-16 files need to be updated with a complex (de)serialization logic in SPMI. So far, we’ve managed to automate generation for only 7 of those files; the rest still require manual edits. This prompt file (see Prompt Files feature) is designed to help with it. The typical workflow looks like this:

  • Open VSCode Chat Window (in dotnet/runtime repository, root folder)
  • Switch to the Agent mode and Claude Sonnet 4 model (or gpt-4.1, for some reason I've got bad experience with others)
  • Type /add-new-jit-ee-api.prompt (there should be suggestions) and hit enter

image

It is supposed to ask for the signature (e.g. CORINFO_METHOD_HANDLE getHelperHandle(int helperId)) and perform all the modifications (including the gen.sh script).

Alternatively, you can type the signature right away /add-new-jit-ee-api.prompt CORINFO_METHOD_HANDLE getHelperHandle(int helperId)

It managed to successfully generate simple APIs for me (sometimes not from the first try). If it lands, I presume we can improve the prompt to handle more complex cases if it fails on them.

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 22, 2025
@EgorBo
Copy link
Member Author

EgorBo commented May 22, 2025

@stephentoub @mrsharm @dotnet/jit-contrib opinions?

@jakobbotsch
Copy link
Member

@stephentoub @mrsharm @dotnet/jit-contrib opinions?

Sounds cool, LGTM 🙂

@jkotas jkotas added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels May 22, 2025
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
@EgorBo EgorBo marked this pull request as ready for review May 23, 2025 12:19
@omariom
Copy link
Contributor

omariom commented May 23, 2025

I would add "please" in a couple of places. Just in case..

@EgorBo
Copy link
Member Author

EgorBo commented May 24, 2025

I would add "please" in a couple of places. Just in case..

Any hints where/study? 🙂

@EgorBo
Copy link
Member Author

EgorBo commented May 26, 2025

@stephentoub @mrsharm @dotnet/jit-contrib opinions?

Sounds cool, LGTM 🙂

@jakobbotsch could you then approve it? 🙂

@EgorBo EgorBo enabled auto-merge (squash) May 26, 2025 17:15
@EgorBo
Copy link
Member Author

EgorBo commented May 26, 2025

/ba-g "build analysis stuck"

@EgorBo EgorBo merged commit 961d3bb into dotnet:main May 26, 2025
14 of 15 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants