﻿# ONNX Runtime 1.32 OrtMemoryInfo: opaque C objects must cross plugin boundaries through the API

The 1.32 OrtMemoryInfo repair uses C API conversion across plugin boundaries; matching concepts do not make private C++ layouts interchangeable.

Author: Retrivium team
Updated: 2026-11-15
Canonical URL: https://retrivium.ai/journal/week46-engine-ort-memoryinfo-opaque-plugin-abi/
Language: en

ONNX Runtime 1.32.0 includes a repair for OrtMemoryInfo crossing the plugin execution-provider boundary. Upstream explains that code copied the opaque object as a C++ structure and read fields directly. The correction reconstructs information through C API accessors, preserving the interface boundary instead of assuming identical internal object layout.

## Opaque means layout is not the contract

An opaque C API type exposes supported operations without promising its private C++ representation. Copying that representation across independently built components bypasses the boundary. The PR repairs conversions in both directions, including a WebGPU plugin allocator path. A review should inspect every crossing, because repairing only the host-to-plugin direction leaves the return direction vulnerable to the same assumption about internal layout.

## Reconstruction preserves exposed semantics

Using accessors and factory functions copies what the public interface actually exposes. Upstream also documents limitations where an internal property is not available through the C API. That matters when evaluating equivalence: recreating an object is not necessarily a byte-for-byte clone. Qualification should compare the memory-device and allocator semantics required by the consumer, and should not invent guarantees for properties absent from the supported interface.

## Test allocator identity at the boundary

A proposed integration test obtains memory information through the plugin allocator, passes it through the supported host API and exercises allocation or binding that uses it. Include the reverse direction as a distinct case. A plugin that merely registers without allocating cannot cover the repaired conversion. Preserve build provenance because an ABI-sensitive test loses explanatory value if the loaded library differs from the one that was just compiled.

## This is infrastructure correctness

The release repairs a plugin interoperability mechanism, not a model arithmetic operator. A successful local check supports the exercised allocator path and API properties; it does not prove that every plugin is binary-compatible with every core. This article reports the upstream boundary repair and a verification approach, without claiming new model-quality or throughput results from an object-conversion change.

## Sources

- [ONNX Runtime v1.32.0 release](https://github.com/microsoft/onnxruntime/releases/tag/v1.32.0)
- [ONNX Runtime pull request #33571](https://github.com/microsoft/onnxruntime/pull/33571)

## Related reading

- [ONNX Runtime I/O binding: a device pointer needs an owner and a valid lifetime](/journal/fg2-onnxruntime-io-binding-device-buffer-lifetime/)
- [ONNX Runtime custom operators: the graph names a dependency, not its implementation](/journal/fg2-onnxruntime-custom-op-domain-runtime-registration/)
