Repository navigation
Invoke debugger function evaluations through managed UCO - #133659
Merged
Merged
Conversation
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
This was referenced Sep 11, 2026
Contributor
|
Tagging subscribers to this area: @agocke |
3 tasks
Member
This was referenced Sep 11, 2026
jkoritzinsky
force-pushed
the
dev/jkoritzinsky/func-eval-uco
branch
2 times, most recently
from
September 13, 2026 15:15
08c8a1d to
2c9232c
Compare
This was referenced Sep 13, 2026
Closed
jkoritzinsky
force-pushed
the
dev/jkoritzinsky/func-eval-uco
branch
from
September 15, 2026 00:28
2c9232c to
84969d7
Compare
Member
Author
jkoritzinsky
force-pushed
the
dev/jkoritzinsky/func-eval-uco
branch
from
September 15, 2026 21:55
84969d7 to
ce9480a
Compare
jkoritzinsky
force-pushed
the
dev/jkoritzinsky/func-eval-uco
branch
from
September 15, 2026 22:57
ce9480a to
10d25d9
Compare
This reverts commit cc83a28cb5e01c0c58ff4b73bef5423681110560. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Use InternalAlloc and GC-aware raw nullable copying while preserving heap-backed argument storage. Remove the dedicated EnsureInstanceActive QCall. Co-authored-by: Copilot App <[email protected]>
Fix temporary result ownership and external-field lifetimes, including helper-thread cleanup. Preserve receiver semantics, correct floating-register handling and restrict raw reference inputs to pointer-sized integers. Make cDAC root parity validation duplicate-safe, add targeted coverage, clarify argument storage, and restore the original unchecked allocation fast path. Co-authored-by: Copilot App <[email protected]>
Hide debugger invocation thunks consistently in native and cDAC stack walks. Validate argument counts before managed entry and preserve abstract-class initialization requests by returning null without instance construction. Co-authored-by: Copilot App <[email protected]>
Move the debugger invocation MethodDesc global into the always-linked VM exception-handling implementation. Preserve debugger publication and allow the WASM comparison to remain a null no-op without linking the debugger EE. Co-authored-by: Copilot App <[email protected]>
Add matching native DAC and cDAC classifications requiring both LCG and explicit diagnostics-hidden flags. Suppress only that class in synchronous stack walks, preserving interop stitching and older shim/async hiding behavior. Update contract documentation and regression coverage. Co-authored-by: Copilot App <[email protected]>
Drop the stale debug-only assignment to removed argument-location bookkeeping while preserving the interpreter raw-slot object-reference handling. Co-authored-by: Copilot App <[email protected]>
Use DEBUGGING_SUPPORTED consistently for debugger layouts, native declarations and QCall registrations. Provide explicit PORTABILITY_ASSERT-only WASM stubs until its debugger EE implementation is built. Co-authored-by: Copilot App <[email protected]>
Move func-eval QCalls into the VM and narrow the debugger interface to metadata decoding, argument/register access, and persistent result ownership. Use VM loaders directly and keep temporary value-type result buffers and ExternalMemoryHandle cleanup VM-owned. Co-authored-by: Copilot App <[email protected]>
Fold object roots into the interior array and pass precomputed native argument descriptors through the UCO context instead of per-argument QCalls. Preserve reference-handle aliasing in managed storage and copy targets back in a finally block using GCHandle. Check handle width as nuint before converting its bit pattern to nint. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Generate browser and WASI tables with the upstream managed-closure QCall generator. Include the func-eval imports and updated diagnostics-hidden GetDynamicMethod signature. Co-authored-by: Copilot App <[email protected]>
jkoritzinsky
force-pushed
the
dev/jkoritzinsky/func-eval-uco
branch
from
November 3, 2026 05:31
7ca5d2b to
64eb73f
Compare
jkotas
approved these changes
Nov 3, 2026
stacked auto-merge was automatically disabled
November 3, 2026 16:35
Auto-merge was disabled for another pull request in the stack
jkoritzinsky
added a commit
that referenced
this pull request
Nov 3, 2026
## Summary Layer 4 of the stack for #123864, following #133659. Remove the native machinery whose final callers disappeared in the preceding reflection, custom-attribute, and func-eval layers. - Delete `MethodDescCallSite`, `CallDescrData`, `CallDescrWorker`, `DispatchCallSimple`, and their argument/return-value copying closure. - Remove the dedicated per-architecture workers, integrated x86/ARM assembly blocks, build entries, offsets, and return-address identification. - Remove unreachable EH branches and simplify the affected prestub/VSD/interpreter dispatcher paths without changing the surviving native-rethrow behavior. - Remove orphaned multicore-JIT diagnostic state and its now-unused holder; avoid computing a dead return address/PAC strip in Release builds. - Update VM-to-managed calling documentation to describe typed UCO entrypoints. **Retained:** live `InvokeUtil` field/pointer/conversion/exception helpers, `UnmanagedCallersOnlyCaller`, default-constructor dispatch, `ArgDestination` GC reporting, profiler/calling-convention logic, and debugger raw-result storage. Historical stack traces are left intact. The layer removes about **2,900 net lines across 49 files**. ## Validation - Windows **x64 and x86 Checked native builds** succeeded. The x86 binary was verified as I386 and executed with an architecture-matched CoreLib. - The initial cleanup passed 5,956 x64 reflection/emit/extensions/invocation cases. After the final dead-state/guard refinements, both x64 and x86 forced invocation suites passed **631 + 631** cases, and both multicore-JIT profile tests passed. - Independent native review covered EH/SEH, GC/DAC reporting, live helpers, and assembly/build wiring; identified cleanup advisories were addressed. - The unchanged MDbg frozen20 ran once against the final snapshot: **18 passed, 0 failed, 2 existing skips**, with all exact outcomes and abort/nullable recovery markers preserved. Six binary hashes and actual loaded modules matched the supplied runtime. The tested binaries were built from the identical final working tree before the cleanup commit, so their embedded native version identifies the parent commit. Actual Linux, ARM/ARM64, and WebAssembly runtime execution was not performed. --- <sub>Stack created with <a href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub> > [!NOTE] > This PR description and cleanup were prepared with GitHub Copilot. --------- Co-authored-by: Copilot App <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Layer 3 of the stack for #123864, following #133658. The prior func-eval-specific proposal is #126809.
This layer started as replacing the final native managed-call dispatch with a managed UnmanagedCallersOnly entrypoint. It now moves most debugger function-evaluation preparation, invocation, storage, and copy-back into managed CoreLib while retaining the debugger-specific control flow and GC-safe bootstrap in native code.
Managed invocation and storage
Debugger.FunctionEvaluation, a runtime-owned UCO entrypoint that resolves the exact target method from its declaringRuntimeTypeand rootedIRuntimeMethodInfo.newobjfor debugger object construction instead of preallocating an object and calling its constructor as an ordinary method. Existing-object constructor calls remain supported, and abstract/interface allocation is rejected.GCFrameRegistration, using exact typed locals for memory-backed by-value ref structs so their managed byrefs are reported by normal JIT GC info.Native debugger and GC integration
ExternalMemoryHandleregistrations so collections during managed preparation relocate their contents correctly.TypeHandle, allowing the runtime and cDAC to distinguish inline value types, object-reference slots, managed-byref slots, and unmanaged pointer/function-pointer locals.debug/ee.Correctness fixes included
ref structwith overlappingreffields is reported to the GC twice, so a compacting GC relocates the byref twice #135245).Validation
Validation used the existing internal MDbg/xUnit debugger-test harness with a private CoreRun and ProjectK/CoreCLR-only configuration:
GCStress=0x3: 1/1 passed.Coverage includes moving GC, overlapping and nested byrefs, memory and register homes, non-leaf registers, receiver mutation, constructors, primitive/native-endian copy-back, nullable memory homes, byref/byref-like/value-type results, collectible generics and layouts, nested and exception-time eval, safe/rude/exception-unwind aborts, and post-eval inspection. Runtime hashes and loaded modules were audited; each abort scenario completed the callback, successfully evaluated
Echo(42), detached, and exited MDbg with code 100. Test configurations were restored and no debugger/test processes survived the runs.These results were recorded on the validated pre-refresh candidate. The final stack rebase preserved the layer's net diff; builds and tests were not repeated after the history rewrite at the user's request.
The final native invocation cleanup layer is #133660.
Stack created with GitHub Stacks CLI • Give Feedback 💬
Resolves #135245
Resolves #135247
Resolves #135249
Resolves #135251
Resolves #135252
Note
This PR description and implementation were prepared with GitHub Copilot. Commits that reuse am11's code retain the requested co-author attribution.