runtime: native-payload transport core and link tokens (net P0) - #12064
Draft
proggeramlug wants to merge 1 commit into
Draft
proggeramlug wants to merge 1 commit into
proggeramlug wants to merge 1 commit into
Conversation
…d the payload C ABI (#11919 net P0) NET-TRANSPORT-DESIGN prerequisite P0. A link-routed socket keeps its turnloop state in a TransportCore at offset 0 of its payload (TransportPayload<E>); tokens carry route|op|cell, dispatch goes cell -> link_event_owner -> core with no map. Each terminal completion the driver owes (handle Closed, resolve, deadline) holds one link_ref, so a payload naming a live descriptor is never swept and Drop only frees memory. close moves the handle into the driver close; a completion mutates the core only on a generational handle match, so a stale Closed after reopen delivers its close once and touches nothing else. Teardown discards link completions. Id routes keep their maps (transitional fork). perry-ffi gains native_payload (PayloadFamily descriptor, alloc/alloc_closed/ payload_mut/close/attach/lifecycle/owner_link/link_ref/unref/link_event_owner/ js_state, prototype builder) over native_payload_abi.rs, and the link_* net surface with TransportCore as an opaque 39-word block folded into the net ABI digest (version 3). Witnesses N1, N5, N6, N7, N10, N11 and the digest, each with a sabotage that turns it red.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
This branch has not been deployed
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.
Refs #11919, Refs #11196
Phase P0 of the net transport ownership design. It adds runtime and perry-ffi support for native payloads that own a socket transport, so
perry-ext-netcan drop its id-keyed tables in phase A.TransportCoresits first inTransportPayload<E>.link_event_owner, then to the core, then through a generational handle check. There is no id map.link_ref, so a payload holding a driver handle cannot be swept until the handle'sClosedhas been dispatched.Dropnever reaches the driver.Closedarriving after a reopen delivers only its close event and its unref.js_perry_payload_*andjs_perry_net_link_*, with a layout digest that covers the opaque core block (39 words; 48 on Windows). The net ABI version is now 3.Tests:
Programs, n=3: hello, tsc and Zod produce identical output on both arms. Instructions are within +0.11% / −0.05%, and RSS is within ±1.5 MB.
Not covered: the Windows paths are written but were not compiled on any host. A compile-time size assert guards the core block size.