From 780e9ef8a2e6ee45434c6bc702ae3bfe95baee2a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Jun 2026 13:13:35 +0000 Subject: [PATCH 1/3] Add JIT-EE method placement guidance to jit.instructions.md Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com> --- .github/instructions/jit.instructions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/instructions/jit.instructions.md b/.github/instructions/jit.instructions.md index 3ee6dd7426d244..b68eb6b22e249f 100644 --- a/.github/instructions/jit.instructions.md +++ b/.github/instructions/jit.instructions.md @@ -7,3 +7,4 @@ applyTo: "src/coreclr/jit/**" ## Code Review Guidelines - **Do not routinely request new targeted tests for pure refactors, mechanical cleanups, or other non-behavioral JIT codebase improvements.** JIT changes alter global codegen and are often validated by existing end-to-end suites and differential testing, so additional per-PR regression tests may not be needed for changes that do not affect observable behavior. However, targeted tests are appropriate and should be encouraged for bug fixes, changes with a clear repro, observable behavior changes, and previously untested edge cases that are not already covered by existing tests. +- **Do not request that new JIT-EE (JIT-VM) interface methods be added at a specific position or in a particular ordering.** New JIT-EE methods can be added anywhere in the interface with any ordering without issues, so do not ask for them to be placed at the end, near similar signatures, or in any other particular location. From 9c99d0181aab34fe0871f74ab420846bfc3d0f39 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Jun 2026 13:26:38 +0000 Subject: [PATCH 2/3] Clarify JIT-EE API position/ordering in add-new-jit-ee-api skill; revert instructions change Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com> --- .github/instructions/jit.instructions.md | 1 - .github/skills/add-new-jit-ee-api/SKILL.md | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/instructions/jit.instructions.md b/.github/instructions/jit.instructions.md index b68eb6b22e249f..3ee6dd7426d244 100644 --- a/.github/instructions/jit.instructions.md +++ b/.github/instructions/jit.instructions.md @@ -7,4 +7,3 @@ applyTo: "src/coreclr/jit/**" ## Code Review Guidelines - **Do not routinely request new targeted tests for pure refactors, mechanical cleanups, or other non-behavioral JIT codebase improvements.** JIT changes alter global codegen and are often validated by existing end-to-end suites and differential testing, so additional per-PR regression tests may not be needed for changes that do not affect observable behavior. However, targeted tests are appropriate and should be encouraged for bug fixes, changes with a clear repro, observable behavior changes, and previously untested edge cases that are not already covered by existing tests. -- **Do not request that new JIT-EE (JIT-VM) interface methods be added at a specific position or in a particular ordering.** New JIT-EE methods can be added anywhere in the interface with any ordering without issues, so do not ask for them to be placed at the end, near similar signatures, or in any other particular location. diff --git a/.github/skills/add-new-jit-ee-api/SKILL.md b/.github/skills/add-new-jit-ee-api/SKILL.md index f0440e3afcfb37..52d12b3c5cf869 100644 --- a/.github/skills/add-new-jit-ee-api/SKILL.md +++ b/.github/skills/add-new-jit-ee-api/SKILL.md @@ -27,13 +27,13 @@ CORINFO_METHOD_HANDLE getUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresI +CORINFO_METHOD_HANDLE getUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg); ``` -Insert the new API definition without removing any existing entries, placing it near similar signatures. +Insert the new API definition without removing any existing entries. The position and ordering of the new entry does not matter, so place it wherever is convenient (e.g. near similar signatures). 2. Invoke `/src/coreclr/tools/Common/JitInterface/ThunkGenerator/gen.sh` script (or `/src/coreclr/tools/Common/JitInterface/ThunkGenerator/gen.bat` on Windows) to update auto-generated files. Use the correct directory for the script to run. -3. Open `/src/coreclr/inc/corinfo.h` and add the new API inside `class ICorStaticInfo` class as the last member. Example: +3. Open `/src/coreclr/inc/corinfo.h` and add the new API inside `class ICorStaticInfo` class. The position and ordering of the new method does not matter; adding it as the last member is fine. Example: ```diff + virtual CORINFO_METHOD_HANDLE getUnboxedEntry( @@ -42,7 +42,7 @@ Use the correct directory for the script to run. + ) = 0; ``` -4. Open `/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs` and add the new API in the end of `class CorInfoImpl` class declaration. Use `/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs` to inspect how type parameters look like for C# for the newly added API since it is expected to be auto-generated there by the gen.sh(bat) script. Example: +4. Open `/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs` and add the new API to `class CorInfoImpl` class declaration. The position and ordering of the new method does not matter; adding it at the end is fine. Use `/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs` to inspect how type parameters look like for C# for the newly added API since it is expected to be auto-generated there by the gen.sh(bat) script. Example: ```diff + private CORINFO_METHOD_STRUCT_* getUnboxedEntry(CORINFO_METHOD_STRUCT_* ftn, ref bool requiresInstMethodTableArg) @@ -55,7 +55,7 @@ Use the correct directory for the script to run. Implement the API if asked, leave the NotImplementedException() otherwise. -5. Open `/src/coreclr/vm/jitinterface.cpp` and add a dummy implementation at the file's end. Example: +5. Open `/src/coreclr/vm/jitinterface.cpp` and add a dummy implementation. The position and ordering of the new method does not matter; adding it at the file's end is fine. Example: ```diff +CORINFO_METHOD_HANDLE CEEInfo::getUnboxedEntry( @@ -106,10 +106,10 @@ Add a new entry to the `LWM` list. Example: ``` NOTE: Use upper-case for the first letter of the API name here. -Add the new record after the very last LWM one. +The position and ordering of the new record does not matter; adding it after the last LWM one is fine. * `/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h`: -Define 3 methods in this header file inside `class MethodContext` class (at the end of its definition). +Define 3 methods in this header file inside `class MethodContext` class. The position and ordering of the new methods does not matter; adding them at the end of its definition is fine. The methods are prefixed with `rec*` (record), `dmp*` (dump to console) and `rep*` (replay). Example @@ -125,7 +125,7 @@ Now add a new element to `enum mcPackets` enum in the same file. Example: ``` * `/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp`: -Add the implementation of the 3 methods to `methodcontext.cpp` at the end of it. +Add the implementation of the 3 methods to `methodcontext.cpp`. The position and ordering of the new methods does not matter; adding them at the end of it is fine. Consider other similar methods in the file for reference. Do not change implementations of other methods in the file. Example: ```diff From 93d87d83cd4ffe784794038f2e19e9c565adaddc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Jun 2026 13:33:00 +0000 Subject: [PATCH 3/3] Consolidate JIT-EE position/ordering note into a single statement in skill Co-authored-by: EgorBo <523221+EgorBo@users.noreply.github.com> --- .github/skills/add-new-jit-ee-api/SKILL.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/skills/add-new-jit-ee-api/SKILL.md b/.github/skills/add-new-jit-ee-api/SKILL.md index 52d12b3c5cf869..54fa01995b19a6 100644 --- a/.github/skills/add-new-jit-ee-api/SKILL.md +++ b/.github/skills/add-new-jit-ee-api/SKILL.md @@ -21,19 +21,21 @@ CORINFO_METHOD_HANDLE getUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresI #### 3 — Implementation steps (must be completed in order) +NOTE: When inserting new entries/methods into any of the files below, their position and ordering does not matter. Any suggested placement (e.g. "at the end" or "near similar signatures") is just a convenient default, not a requirement. + 1. Update the `ThunkInput.txt` file with the new API definition. Example: ```diff +CORINFO_METHOD_HANDLE getUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg); ``` -Insert the new API definition without removing any existing entries. The position and ordering of the new entry does not matter, so place it wherever is convenient (e.g. near similar signatures). +Insert the new API definition without removing any existing entries, placing it near similar signatures. 2. Invoke `/src/coreclr/tools/Common/JitInterface/ThunkGenerator/gen.sh` script (or `/src/coreclr/tools/Common/JitInterface/ThunkGenerator/gen.bat` on Windows) to update auto-generated files. Use the correct directory for the script to run. -3. Open `/src/coreclr/inc/corinfo.h` and add the new API inside `class ICorStaticInfo` class. The position and ordering of the new method does not matter; adding it as the last member is fine. Example: +3. Open `/src/coreclr/inc/corinfo.h` and add the new API inside `class ICorStaticInfo` class as the last member. Example: ```diff + virtual CORINFO_METHOD_HANDLE getUnboxedEntry( @@ -42,7 +44,7 @@ Use the correct directory for the script to run. + ) = 0; ``` -4. Open `/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs` and add the new API to `class CorInfoImpl` class declaration. The position and ordering of the new method does not matter; adding it at the end is fine. Use `/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs` to inspect how type parameters look like for C# for the newly added API since it is expected to be auto-generated there by the gen.sh(bat) script. Example: +4. Open `/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs` and add the new API in the end of `class CorInfoImpl` class declaration. Use `/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs` to inspect how type parameters look like for C# for the newly added API since it is expected to be auto-generated there by the gen.sh(bat) script. Example: ```diff + private CORINFO_METHOD_STRUCT_* getUnboxedEntry(CORINFO_METHOD_STRUCT_* ftn, ref bool requiresInstMethodTableArg) @@ -55,7 +57,7 @@ Use the correct directory for the script to run. Implement the API if asked, leave the NotImplementedException() otherwise. -5. Open `/src/coreclr/vm/jitinterface.cpp` and add a dummy implementation. The position and ordering of the new method does not matter; adding it at the file's end is fine. Example: +5. Open `/src/coreclr/vm/jitinterface.cpp` and add a dummy implementation at the file's end. Example: ```diff +CORINFO_METHOD_HANDLE CEEInfo::getUnboxedEntry( @@ -106,10 +108,10 @@ Add a new entry to the `LWM` list. Example: ``` NOTE: Use upper-case for the first letter of the API name here. -The position and ordering of the new record does not matter; adding it after the last LWM one is fine. +Add the new record after the very last LWM one. * `/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h`: -Define 3 methods in this header file inside `class MethodContext` class. The position and ordering of the new methods does not matter; adding them at the end of its definition is fine. +Define 3 methods in this header file inside `class MethodContext` class (at the end of its definition). The methods are prefixed with `rec*` (record), `dmp*` (dump to console) and `rep*` (replay). Example @@ -125,7 +127,7 @@ Now add a new element to `enum mcPackets` enum in the same file. Example: ``` * `/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp`: -Add the implementation of the 3 methods to `methodcontext.cpp`. The position and ordering of the new methods does not matter; adding them at the end of it is fine. +Add the implementation of the 3 methods to `methodcontext.cpp` at the end of it. Consider other similar methods in the file for reference. Do not change implementations of other methods in the file. Example: ```diff