Add: VMM_SHAREABLE canonical Buffer substrate - #2194
Conversation
- Add BackendKind.VMM_SHAREABLE=6 with DEVICE-only 24-byte body validation - Add a module-private 88-byte fieldwise BufferDescriptor wire codec - Add private _wrap_vmm_shareable() that uses a supplied identity
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds the ChangesVMM shareable buffer support
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to The new backend contract, codec, wrapper, and validation paths have focused coverage with no confirmed merge-blocking issue. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit reads each line, Comment |
Summary
This change adds the canonical Buffer substrate that #2198 consumes.
It introduces
BackendKind.VMM_SHAREABLE, a module-private 88-bytefieldwise
BufferDescriptorcodec, and private_wrap_vmm_shareable().It does not change Region, endpoint identity, delegated-region control,
or worker-chip materialization. Those land in #2198.
Ordinary CommDomain
VMM_WINDOWidentity is unchanged. ExistingBackendKindvalues 0–5 and the 88-byteBufferDescriptorlayout areunchanged.
Why This Exists
Shareable-handle VMM is not the same importer contract as owner-chip
VMM_WINDOW. Region needs a precise actual-backend tag and a singlecanonical descriptor encoding so PAYLOAD and COUNTER can be real
Buffers instead of a second private export schema.
The codec and wrapper have to exist before Region can adopt them. This
PR is that substrate only: it can be reviewed and tested as Buffer ABI,
without mixing in the Region cutover.
What This Lands
BackendKind.VMM_SHAREABLE = 6, DEVICE-only, with a fixed 24-bytebody:
device_id:i32 | reserved0:u32 | shareable_handle:u64 | mapping_bytes:u64The generic validator checks structure: nonzero handle, zero
reserved/tail, and
mapping_bytes >= nbytes. It does not queryruntime granularity or mapped addresses.
A module-private fieldwise 88-byte
BufferDescriptorwire codec:and unused body tail
.pack()API and does not enterbuffer.__all__Private
_wrap_vmm_shareable():CanonicalIdentity; it does not mint anew one
Focused Buffer tests cover malformed VMM bodies, codec round-trip,
wrapper close/visibility, and the C++ ABI layout.
Breaking Change
None for Region or delegated-region wire. Those remain on the previous
export schema until #2198.
Callers that assume
BackendKindhas only values 0–5 must accept thenew enumerator. Descriptor size and existing backend encodings do not
change.
Non-Goals
This change intentionally does not add:
wrap_vmm_shareable()/wrap_existing_posix_shm()ResourceBundle, genericImportRegistry, Buffer escape, orretain/release
VMM_WINDOWidentitymerging to
mainStacking
Merge this before #2198. #2198 is stacked on this head and must rebase
onto
mainafter this merge SHA is available.