Skip to content

[typemap] Mark generated JNI debugger boundaries - #13154

Merged
simonrozsival merged 4 commits into
mainfrom
simonrozsival-generated-jni-debugger-boundaries
Nov 9, 2026
Merged

simonrozsival merged 4 commits into
mainfrom
simonrozsival-generated-jni-debugger-boundaries

Conversation

@simonrozsival

@simonrozsival simonrozsival commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Generated constructor and export/direct-dispatch UCOs already own inline JNI exception boundaries. Their catches delegate the user-unhandled decision to JniRuntime, but the boundary methods do not carry DebuggerDisableUserUnhandledExceptionsAttribute. Add the attribute so the debugger does not infer user-unhandled behavior from those generated catches instead of the runtime's policy decision.

Cache the parameterless System.Diagnostics.DebuggerDisableUserUnhandledExceptionsAttribute constructor and attribute blob, and emit one attribute on each boundary-owning constructor/export method. Cover matching managed constructors, invokers, leaf/inherited handle and Java.Interop activation, and open-generic rejection. No method-body IL, activation/marshalling, ABI defaults, runtime policy, transition ordering, legacy n_* forwarding, bridge waits, or exception publication behavior changes. This does not add Debugger.Break or duplicate BreakForUserUnhandledException notifications.

Add 19 emitted-metadata/IL cases covering attribute identity/constructor/blob, all constructor branches, static/instance export dispatch, the existing System.Exception catch/finally shape, marshalling/copy-back placement, and ABI defaults. Extend the existing device fixtures with the distinctive GeneratedJniDebuggerBoundary category, original exception identity, successful calls after failures, and exactly-once handled policy/default-return checks on CoreCLR and NativeAOT. Document the category and acceptance limitations in the test catalog.

The review follow-up keeps the exception handlers in two representative device tests in user code instead of NUnit's external Assert.Catch. This preserves their original identity/message assertions while separating the generated boundary's debugger notification from the later managed JNI rethrow into external test code. It changes no production code.

Local validation

Tested source: e0b8cddb0034fab75565683563f5635a8eaec734, including the existing main merge bff9ca60f810c08e961c93877d82d40dafb45484. The merged NativeAOT application-event policy fix from #13153 is included; the two obsolete NativeAOTIgnore exclusions have been removed, without adding a runtime override here. The PR remains independently based on main, with no stack or retargeting.

Commands below ran in this worktree on October 29 using its freshly rebuilt Release SDK (12.0.100-alpha.1.26523.103). Device projects target net11.0-android; ARM64 runtime packages are 11.0.0-preview.7.26381.103. Runs use this session's dedicated API 35 ARM64 emulator, emulator-5580.

SDK preparation/build — both passed, 0 errors.

make prepare CONFIGURATION=Release
make all CONFIGURATION=Release

Focused and adjacent host tests — 56 passed, 0 failed/skipped. This builds the affected host projects before testing.

./dotnet-local.sh test src/Microsoft.Android.Build.Tasks/Tests/Microsoft.Android.Build.Tasks.Tests/Microsoft.Android.Build.Tasks.Tests.csproj \
  -c Release --no-restore -v minimal \
  --filter 'FullyQualifiedName~GeneratedJniDebuggerBoundaryTests|FullyQualifiedName~GenerateTrimmableTypeMapTests|FullyQualifiedName~TransferredReferenceActivationTests'

ARM64 CoreCLR Release — rebuild/install passed; 66 device tests passed, 0 failed/skipped.

./dotnet-local.sh build -t:Rebuild,Install -m:1 -c Release \
  -p:RuntimeIdentifier=android-arm64 '-p:AdbTarget=-s emulator-5580' \
  -p:IncludeCategories=GeneratedJniDebuggerBoundary -p:PublishAot=false \
  tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj
(
  cd tests/Mono.Android-Tests/Mono.Android-Tests
  ANDROID_SERIAL=emulator-5580 ../../../dotnet-local.sh test Mono.Android.NET-Tests.csproj \
    --no-build -c Release -p:RuntimeIdentifier=android-arm64 \
    '-p:AdbTarget=-s emulator-5580' -p:IncludeCategories=GeneratedJniDebuggerBoundary \
    -p:PublishAot=false --device emulator-5580 --report-trx \
    --results-directory ../../../bin/TestRelease/TestResults/GeneratedJniDebuggerBoundaryReviewCoreCLR
)

ARM64 NativeAOT Release — rebuild/install passed; 66 device tests passed, 0 failed/skipped. Both commands explicitly use PublishAot=true. The installed ARM64 split APK contains libMono.Android.NET-Tests.so and no libcoreclr.so. Coverage includes both handled-policy cases, original exception identity, exactly-once events, six export ABI defaults, and subsequent successful JNI calls.

./dotnet-local.sh build -t:Rebuild,Install -m:1 -c Release \
  -p:RuntimeIdentifier=android-arm64 '-p:AdbTarget=-s emulator-5580' \
  -p:IncludeCategories=GeneratedJniDebuggerBoundary -p:PublishAot=true \
  tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj
(
  cd tests/Mono.Android-Tests/Mono.Android-Tests
  ANDROID_SERIAL=emulator-5580 ../../../dotnet-local.sh test Mono.Android.NET-Tests.csproj \
    --no-build -c Release -p:RuntimeIdentifier=android-arm64 \
    '-p:AdbTarget=-s emulator-5580' -p:IncludeCategories=GeneratedJniDebuggerBoundary \
    -p:PublishAot=true --device emulator-5580 --report-trx \
    --results-directory ../../../bin/TestRelease/TestResults/GeneratedJniDebuggerBoundaryReviewNativeAOT
)

Existing trim/AOT analysis and duplicate debugger-library warnings remain visible. Intermediate fixture AARs contain unused scratch profiler libraries; the ordinary CoreCLR/NativeAOT builds used no scratch debugger import, their generated __environment__.txt is empty, and debug.coreclr.enabled was reset to 0. No SDK, runtime-policy, or callback-forwarder changes were added for the review follow-up.

Attached-debugger evidence and evaluation limitation

Supported-client CoreCLR stop/Continue and handled-policy suppression are observed for this PR's own constructor/export cases. Successful Java evaluation at their user-unhandled stops is not claimed. Additional controls reproduce function-evaluation failure on the pre-existing non-ctor/export JniMarshal.SafeInvokeFunc path, including a pure-managed expression. These controls use unchanged main-sourced methods within the PR build, not a separately built unchanged-main baseline. Static assertions and ordinary device runs are not substituted for attached-debugger evidence.

The main attached runs used isolated VS Code Insiders 1.144.0-insider, C# 11.7.18 / vsdbg 18.13.11021.6, and MAUI 11.0.114's paired ARM64 host/target profiler resources. The installed target profiler's SHA-256 matched the extension's binary. The supported C# coreclr_mobile client was used through VS Code's normal debug API/handshake, with request=launch, justMyCode=true, and the user-unhandled filter confirmed before execution. The MAUI auto-build launch provider was disabled for the prebuilt non-MAUI test app. The adapter sent its launch request before instrumentation; earlier startup crashes are not evidence of general debugger/runtime incompatibility.

The debugger app was rebuilt/installed successfully with:

./dotnet-local.sh build -t:Rebuild,Install -m:1 -c Release \
  -p:RuntimeIdentifier=android-arm64 '-p:AdbTarget=-s emulator-5580' \
  -p:IncludeCategories=GeneratedJniDebuggerBoundary -p:PublishAot=false \
  -p:Optimize=false -p:AndroidDebuggable=true -p:AndroidIncludeDebugSymbols=true \
  -p:DebuggerSupport=true -p:AndroidAttachDebugger=true -p:AndroidSdbTargetPort=56121 \
  -p:NdkBuildPath=/Users/simon/android-toolchain/ndk/ndk-build \
  -p:CustomAfterMicrosoftCSharpTargets=/Users/simon/.copilot/session-state/def21f4f-fd5a-456e-a083-1cb6507976b4/files/review-debugger-build.targets \
  tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj

The scratch targets import MAUI's Custom.After.Microsoft.CSharp.targets and add its ARM64 target profiler, both conditioned on MSBuildProjectName == Mono.Android.NET-Tests. The launch configuration uses the own-worktree obj/Release/net11.0-android/android-arm64/linked/Mono.Android.NET-Tests.dll, TCP 127.0.0.1:56121, platform android;arm64, isServer=false, and an assets path containing the linked directory and paired VsdbgRemoteCoreclrHost/osx-arm64 directory. The linked-directory entry must end in /, matching MAUI's provider: adding that separator fixed the earlier host metadata FileNotFoundException. Constants now evaluate successfully, superseding the earlier claim that even 1 + 1 fails.

Instrumentation was started after the adapter's launch request:

adb -s emulator-5580 forward tcp:56121 tcp:56121
adb -s emulator-5580 shell setprop debug.coreclr.enabled 1
adb -s emulator-5580 shell am instrument -w \
  -e include GeneratedJniDebuggerBoundary \
  Mono.Android.NET_Tests/xamarin.android.runtimetests.TestInstrumentation

Complete stop/Continue run: 66 passed, 0 failed/skipped, target exit 0. Complete DAP logs, per-test instrumentation/logcat, and device TRX were retained. No sibling results are used as constructor/export acceptance evidence.

Own test Observed debugger behavior
JavaSideThrowingConstructorPropagatesException Exactly one userUnhandled stop at the original constructor throw, ConstructorActivationTests.cs:722; Continue succeeded and original-exception assertions passed.
Export_Method_Throws_PrimitiveReturn_SurfacesAsManagedException Exactly one userUnhandled stop at the original export throw, ExportTests.cs:400; Continue succeeded and original-exception assertions passed.
JavaSideHandledConstructorExceptionDeliversPolicyOnce No user-unhandled stop; exactly-once event/identity assertions passed.
HandledExportExceptionsReturnAbiDefaultsAndDeliverPolicyOnce No user-unhandled stop; all six ABI defaults, original exception identity, and exactly-once events passed.

That complete run recorded 11 stops and 11 successful Continue responses (review-debugger-user-catch-probe.jsonl). Other tests exercise nested JNI boundaries or rethrows caught by external NUnit code; their traces distinguish later rethrows from generated-boundary notifications. Only the two representative catch sites changed to make the one-stop acceptance result unambiguous.

Constructor/export evaluation probes: the debugger build command was repeated with additional -p:PublishReadyToRun=false — rebuild/install passed, 0 errors. expressionEvaluationOptions.allowFastEvaluate=false ensured actual invocation instead of debugger simulation. At the ordinary source breakpoint before the constructor JNI call (ConstructorActivationTests.cs:146), 1 + 1 returned 2 and Java.Lang.JavaSystem.CurrentTimeMillis() returned a timestamp (for example 1793279952877), followed by successful Continue. At its user-unhandled stop, constants still worked but Java func-eval did not complete: the engine started eval, later aborted it, and reported target exit 0 while evaluation remained pending. The response was canceled/process-terminated. Selecting the live user caller, generated UCO catch frame, or physical Debugger.BreakForUserUnhandledException frame did not fix it. A separate export-only probe reproduced this after successful normal-breakpoint Java evaluation in the same process. Each instrumentation run passed 66/66, but the incomplete eval is not successful final Continue. Disabling ReadyToRun did not fix it. The other installed supported C# client, 11.5.15 / vsdbg 18.12.10930.3, also reproduced the constructor-stop failure with the unchanged app.

Pre-existing-path comparison within the PR build: JniRuntimeExceptionPolicyTests.FailedFunctionReturnsDefault(false) calls JniMarshal.SafeInvokeFunc<int> directly, with no generated constructor/export UCO in its failing stack. Both fixture and JniMarshal.SafeInvoke.cs are byte-identical to the incorporated main base 9d70f2f9934ccf67e277ca4fd55f159e988818b9. The same installed PR-built app and supported current client were used—not an independently built main app:

adb -s emulator-5580 shell am instrument -w \
  -e include JniRuntimeExceptionPolicy \
  Mono.Android.NET_Tests/xamarin.android.runtimetests.TestInstrumentation

Result: 76 passed, 0 failed/skipped, exit 0 (the instrumentation category is combined with the app's configured 66-case category). At the ordinary breakpoint before InvokeManagedInt (JniRuntimeExceptionPolicyTests.cs:59), Java evaluation succeeded. At the later BreakForUserUnhandledException stop in SafeInvoke, Java func-eval again did not complete. In a separate control, pure-managed System.GC.GetTotalMemory(false) returned 1982736 at the ordinary breakpoint but did not complete at that SafeInvoke exception stop; target exit 0 canceled it. That run also passed 76/76. Its stack contains the callback throw, JniMarshal.SafeInvokeFunc, runtime policy, and the direct managed test caller—not the constructor/export emitter's UCOs. Thus the failure also occurs on a pre-existing non-ctor/export path and with managed-only func-eval. This is not a clean-main A/B comparison and establishes no specific debugger/runtime/JNI cause.

One pure-managed-control attempt ended before NUnit with an Android process-startup ANR; its logs were retained and no test success is attributed to it. Declaring the owned app with adb -s emulator-5580 shell am set-debug-app Mono.Android.NET_Tests before retry avoided that startup termination. The debug-app setting was subsequently cleared with adb -s emulator-5580 shell am clear-debug-app.

Review disposition: original-throw stops, Continue, and handled-policy behavior are verified. Both review threads are addressed: the optional legacy-forwarder assertion was declined because it would freeze behavior owned by #13155; requiring an additional general function-evaluation fix is declined as outside this attribute-only PR, based on the bounded controls above. Successful exception-stop Java evaluation remains explicitly unverified, not silently counted as passing. No speculative runtime-policy or exception-publication changes were added, and no NativeAOT managed-debugger acceptance result is claimed.

Evidence is retained in review-debugger-{jit,leaf,export-eval,csharp115-ready,safeinvoke-control,managed-eval-ready}-probe.jsonl, corresponding instrumentation logs, and the final control TRX/logcat. These diagnostic runs are separate from the complete 11-stop/11-Continue acceptance run. Debugger property, debug-app setting, and forwarding were reset; only this session's IDE/emulator processes were stopped.


Pull Request
title and
description
should follow the
commit-messages.md workflow documentation, and in particular should include:

  • Useful description of why the change is necessary.
  • Links to issues fixed
  • Unit tests

Copilot AI balanced review requested due to automatic review settings October 15, 2026 12:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Attached-debugger stopping, handled-event suppression, Continue, and Java evaluation remain unverified and require human acceptance review.

0 open findings

What changed in this PR

Marks generated JNI constructor and export exception boundaries so debugger handling follows runtime policy, without changing method-body IL.

Changes:

  • Caches and emits the debugger attribute on generated boundaries.
  • Adds metadata/IL tests and strengthens device exception-policy coverage.
  • Documents test selection and attached-debugger validation limitations.
File Description
tests/​Mono.Android-Tests/​Mono.Android-Tests/​Java.Interop/​TrimmableTypeMapExportTests.cs Tests handled export failures and default returns.
tests/​Mono.Android-Tests/​Mono.Android-Tests/​Java.Interop/​ExportTests.cs Adds the debugger-boundary test category.
tests/​Mono.Android-Tests/​Mono.Android-Tests/​Java.Interop/​ConstructorActivationTests.cs Tests exception identity, policy delivery, and recovery.
src/​Microsoft.Android.Sdk.TrimmableTypeMap/​Generator/​TypeMapAssemblyEmitter.cs Annotates generated constructor boundaries.
src/​Microsoft.Android.Sdk.TrimmableTypeMap/​Generator/​PEAssemblyBuilder.cs Caches and emits debugger attribute metadata.
src/​Microsoft.Android.Sdk.TrimmableTypeMap/​Generator/​ExportMethodDispatchEmitter.cs Annotates generated export boundaries.
src/​Microsoft.Android.Build.Tasks/​Tests/​Microsoft.Android.Build.Tasks.Tests/​GeneratedJniDebuggerBoundaryTests.cs Adds 19 metadata and IL test cases.
.github/​skills/​tests/​references/​test-catalog.md Documents coverage and acceptance-test limitations.

🧠 Review effort: Balanced

@simonrozsival simonrozsival changed the title [TrimmableTypeMap] Mark generated JNI debugger boundaries [Unsafe][TrimmableTypeMap] Mark generated JNI debugger boundaries Oct 15, 2026
@simonrozsival simonrozsival changed the title [Unsafe][TrimmableTypeMap] Mark generated JNI debugger boundaries [typemap] Mark generated JNI debugger boundaries Oct 15, 2026
@simonrozsival
simonrozsival force-pushed the simonrozsival-generated-jni-debugger-boundaries branch from 83c13f6 to 0645475 Compare October 16, 2026 08:40
@simonrozsival

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Android PR Reviewer completed successfully!

Generated by Android PR Reviewer for #13154

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Needs Changes — debugger acceptance evidence remains outstanding

0 errors · 1 warning · 1 suggestion, posted inline. I found no concrete implementation defect: the parameterless attribute constructor/blob are cached per PE builder, all constructor branches reach the annotated shared emitter, and export dispatch receives the same annotation without changing method-body IL. The existing managed activation and legacy forwarding paths remain unannotated. The new tests provide substantial metadata/IL and transport coverage, including original exception identity and handled-policy delivery.

The remaining warning is specifically about validating the debugger-facing behavior: as the description correctly acknowledges, neither attached-client attempt reached a constructor/export test. Successful no-debugger runs do not establish stop suppression, runtime-directed stopping, Continue, or Java evaluation at the stop. This verdict reflects that acceptance gap, not an observed runtime regression.

CI: All 41 GitHub checks on head bff9ca60f810c08e961c93877d82d40dafb45484 report completed/success, including the aggregate dotnet-android check for Azure build 1650661. Direct Azure build-result verification was blocked by the CLI requiring authentication, so I cannot independently confirm the Azure result. The host/device execution results in the description are author-reported; I did not rerun them in this review.

Generated by Android PR Reviewer for #13154 · copilot · gpt61 · 41.8 AIC · ⌖ 4.75 AIC · ⊞ 20K
Comment /review to run again

simonrozsival and others added 3 commits October 29, 2026 16:20
Generated constructor and export UCOs already catch managed exceptions
and delegate the user-unhandled decision to JniRuntime.  Annotate those
boundary-owning methods so their catches do not override that policy.
Keep activation, marshalling, transitions, ABI defaults, and runtime
notification/publication behavior unchanged.

Cover emitted attribute identity and constructor, all constructor paths,
static/instance export dispatch, exception regions, and ABI defaults.
Exercise original exception identity, subsequent successful JNI calls,
and exactly-once handled CoreCLR application policy on device.  Keep
NativeAOT application-event parity outside this independent change.

Co-authored-by: Copilot App <[email protected]>
NativeAOT now honors Android application exception policy on main.
Remove the two exclusions that existed only until that parity landed,
and cover handled constructor and export failures on both runtimes.

Verify original exception identity, exactly-once application events,
default ABI returns, and subsequent successful JNI calls against the
rebuilt SDK after rebasing onto the merged policy fix.

Co-authored-by: Copilot App <[email protected]>
Keep representative constructor/export exception handlers in user code instead of NUnit Assert.Catch. This separates the generated JNI boundary notification from a later managed rethrow into external test code, allowing exactly-once attached-debugger acceptance without changing runtime policy or generated IL.

Document the representative stop/Continue probes and keep Java evaluation as a separate acceptance check.

Co-authored-by: Copilot App <[email protected]>
@simonrozsival
simonrozsival force-pushed the simonrozsival-generated-jni-debugger-boundaries branch from e0b8cdd to dd88d1e Compare October 29, 2026 15:20
@simonrozsival

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

✅ Android PR Reviewer completed successfully!

Generated by Android PR Reviewer for #13154

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code assessment: no blocking findings. 0 ❌ errors, 0 ⚠️ warnings, 1 💡 non-blocking testing suggestion posted inline. Overall verification remains limited as noted below; this is not an unconditional CI-green verdict.

Reviewed all eight changed files at dd88d1efba0f86f2c044a4ee7310eb3ca970973b, including their full source and the shared runtime-policy implementations. The cached parameterless attribute reference/blob is correctly scoped to the PE builder, and both emission sites annotate the boundary-owning methods without changing their IL, ABI signatures, or transition ordering. Constructor variants and static/instance exports have substantial metadata/IL coverage. Keeping the two representative JNI-rethrow catches in user code makes the documented debugger acceptance cases clearer.

The description now reports successful constructor/export stop-and-Continue and handled-policy suppression, while explicitly separating the remaining function-evaluation limitation and the absence of a clean-main A/B comparison. I found no demonstrated production defect warranting expanding this attribute-only change into a runtime-policy fix. Those attached-debugger observations were not independently reproduced here.

CI: All 41 GitHub check runs report success, including the aggregate dotnet-android check for Azure build 1654454. Independent Azure build/timeline confirmation was unavailable because the CLI required authentication and public HTTP access was denied; I therefore cannot independently certify the underlying Azure result.

Local validation: Attempted dotnet test src/Microsoft.Android.Build.Tasks/Tests/Microsoft.Android.Build.Tasks.Tests/Microsoft.Android.Build.Tasks.Tests.csproj --no-restore -v minimal --filter 'FullyQualifiedName~GeneratedJniDebuggerBoundaryTests|FullyQualifiedName~GenerateTrimmableTypeMapTests'. The CLI failed during first-run configuration with a NuGet-Migrations mutex IOException, before build or test discovery. No local test results are claimed. No repository files were changed by this review.

Generated by Android PR Reviewer for #13154 · copilot · gpt61 · 53.2 AIC · ⌖ 7.91 AIC · ⊞ 19.3K
Comment /review to run again

Check the cumulative notification count immediately after each throwing export so duplicate and missing policy events cannot cancel out across ABI return kinds.

Co-authored-by: Copilot App <[email protected]>
@simonrozsival simonrozsival added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Nov 6, 2026
@simonrozsival

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Android PR Reviewer completed successfully!

Generated by Android PR Reviewer for #13154

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM on code — CI verification limited

Findings: 0 errors, 0 warnings, 1 optional inline testing suggestion. Reviewed all eight changed files in full, the emitted metadata/exception regions, generator invalidation, and the CoreCLR/NativeAOT policy implementations. The attribute is correctly scoped to constructor and export/direct-dispatch boundaries, its constructor/blob cache is emitter-local, and the production diff changes no method-body IL, ABI, transition ordering, or legacy forwarding. The constructor branch matrix and per-call notification assertions provide useful regression coverage.

The earlier feedback is reflected in the current code and documented evidence. The description reports successful attached CoreCLR original-throw stops, Continue, and handled-policy suppression; I did not independently reproduce those runs. Exception-stop function evaluation remains explicitly unverified, and the documented controls do not establish this attribute change as its cause. I found no basis to require a broader runtime/debugger fix in this PR.

CI: GitHub reports all 41 head-commit checks successful, including the aggregate dotnet-android check for Azure build 1655619. Independent Azure build/timeline confirmation was unavailable because the CLI encountered tooling/authentication errors and the public REST read was not permitted. Thus this review does not independently certify the underlying Azure result. The focused dotnet test src/Microsoft.Android.Build.Tasks/Tests/Microsoft.Android.Build.Tasks.Tests/Microsoft.Android.Build.Tasks.Tests.csproj -v minimal --filter 'FullyQualifiedName~GeneratedJniDebuggerBoundaryTests|FullyQualifiedName~GenerateTrimmableTypeMapTests' attempt failed during NuGet first-use initialization, before compilation or test execution. No local test pass is claimed.

Generated by Android PR Reviewer for #13154 · copilot · gpt61 · 55.7 AIC · ⌖ 7.49 AIC · ⊞ 19.4K
Comment /review to run again

{
[Test]
public void HandledExportExceptionsReturnAbiDefaultsAndDeliverPolicyOnce ()
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 💡 Testing — Consider adding a throwing static [Export] case alongside this instance-only handled-policy test. The host matrix verifies the annotation and IL for both static and instance dispatch, but the existing static device test only exercises successful dispatch. Calling a throwing static export through JNIEnv.CallStaticIntMethod and checking the zero return plus exactly one notification containing the original exception would extend the runtime-policy coverage to the static JNI entry path on CoreCLR and NativeAOT. This is optional additional coverage, not a demonstrated defect.

{Rule: Test edge cases across supported dispatch variants}

@simonrozsival

Copy link
Copy Markdown
Member Author

@dalexsoto review

@simonrozsival
simonrozsival enabled auto-merge (squash) November 9, 2026 09:46

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all eight changed files and the generator fingerprint/emitter, CoreCLR/NativeAOT policy, JNI transition/pending-exception, and device-filter integration at this head against the pinned current target. The debugger annotation stays on the boundary-owning constructor/export methods without changing the boundary IL/ABI or policy contract, and the per-call notification assertions cover counts 1 through 6. No actionable blocking issue remained after a separate final pass.

This is a static source review. The documented attached-debugger observations remain author-reported; the accepted exception-stop function-evaluation limitation is not claimed resolved. No builds, tests, generators or devices were executed for this review.

@simonrozsival
simonrozsival merged commit 598780a into main Nov 9, 2026
41 checks passed
@simonrozsival
simonrozsival deleted the simonrozsival-generated-jni-debugger-boundaries branch November 9, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants