Skip to content

Add Objective-C EPContext data callbacks - #32309

Open
Gopalakrishnan Nallasamy (GopalakrishnanN) wants to merge 7 commits into
GopalakrishnanN/stable-epcontext-data-apifrom
gnallasamy-microsoft-objc-epcontext-bindings
Open

Add Objective-C EPContext data callbacks#32309
Gopalakrishnan Nallasamy (GopalakrishnanN) wants to merge 7 commits into
GopalakrishnanN/stable-epcontext-data-apifrom
gnallasamy-microsoft-objc-epcontext-bindings

Conversation

@GopalakrishnanN

Copy link
Copy Markdown
Contributor

Summary

  • add ORTEpContextDataReadBlock and ORTSessionOptions registration/clear APIs for stable EPContext reads
  • bridge callback results through the supplied ORT allocator with size limits and Objective-C/C++ exception containment
  • retain atomic callback/native-options snapshots for ORTSession and ORTTrainingSession lifetimes
  • add focused XCTest coverage for data, empty payloads, invalid/oversized results, errors, exceptions, replacement, clearing, and lifetime

Validation

  • clang-format --dry-run --Werror on all changed Objective-C/Objective-C++ files
  • git diff --check
  • high-confidence code-review pass

Objective-C compilation and XCTest execution were not available in the Windows workspace because Apple Clang, Foundation/XCTest SDKs, Xcode, and Jazzy are unavailable.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@GopalakrishnanN
Gopalakrishnan Nallasamy (GopalakrishnanN) force-pushed the gnallasamy-microsoft-objc-epcontext-bindings branch from 3952652 to 8d0bb02 Compare August 29, 2026 05:46
Gopalakrishnan Nallasamy and others added 6 commits August 29, 2026 12:22
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Release the local block temporary before checking whether session options and sessions retain or release callback registration state.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Clear the tests' explicit strong block references before checking option and session ownership so ARC cannot extend an unnamed block temporary through the test method.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Create callback captures in a helper frame that ends before ownership assertions, preventing ARC from retaining the stack block for the entire XCTest method.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Run each ownership lifecycle inside a dedicated autorelease pool so Debug builds release ARC temporaries before the final weak-reference assertion.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant