Repository navigation
Route net and HTTP through native Socket payloads - #12267
Merged
Merged
Conversation
added 17 commits
October 9, 2026 08:44
Bring net transport P0 (#12064, #11919) onto 8476086. Keep current PayloadVTable, PayloadBuffer support, stream state record, native-this alias and ServerResponse payload ABI; extend that ABI rather than add P0's older duplicate implementation. TransportCore is inline at offset zero of TransportPayload<E>. Tokens carry route/op/cell, terminal driver completions retain the cell, close hands the handle to the driver, and generational handles and resolver ops protect reopen. Link teardown discards completions before heap teardown. Keep id routes for subsystems that have not migrated; add no id/cell alias. Use MaybeUninit words for opaque FFI storage and check its ABI before initialization. Expose binding owner links, lifecycle and typed reopen through the shared cell/vtable. A checked route store preserves the live multishot read. Runtime witnesses cover N1, N5, N6, N7, N9, N10, N11, and the runtime half of N8, with nine sabotages that turn them red. Phase A's ext-net and HTTP connection conversion remains separate work.
…ted transports perry-ext-net's sockets and servers are TransportPayload native payloads: completions route by link token through the payload cell, so the id-keyed socket, server and event tables are gone (ledger: ext-net 19 tables and 10 producers, now 0 and 0). A closed, dropped Socket is collected and its WeakRefs clear. Class ids live in perry-abi; codegen drops the net id rows.
…route store ext-http's server and client HTTP/1 connections are net.Socket payloads (decision 77), so an HTTP upgrade is one store to the connection's route: the listener receives the same Socket, with head bytes and every later byte as its own data. The HIR no longer tags an upgrade listener's socket parameter as a ws Client (the static tag sent its data listener to a ws id table that never fired); ws client handles keep their own dynamic dispatch. The HTTP/2 client gets its own id-routed slot 16; the driver keeps 32 sink slots, and link routes use the 16 that fit the link token's route field.
N2-N4 binding witnesses with sabotages (late_close, churn_backlog, early_unref), N8 server and client upgrade tests (route/head sabotages), the typed upgrade gap fixture, and the HIR test that the upgrade socket parameter lowers to ordinary method calls.
…ield Registry census drops 249 to 225 (shrinking maps 167 to 146) because phase A deletes 24 net/HTTP/TLS tables and adds none. Adjust parser liveness floors 250/170 to 220/140 for the deleted population.
Remove the unused direct bytes dependency and the stale main VERDICT_CLASSES registry exemption exposed by the corrected census floor. Simplify the no-op promise pointer cast and the two HTTP Clippy findings without changing transport behavior.
Canonical native exports capture their class identity in a distinct constructor layout. Both explicit receiver calls and dynamic super read that fact, with no constructor-name comparisons or new side table. Ordinary bound methods skip native receiver validation. The fixture mutates function names and prototype constructor properties before call, Reflect.apply and aliased super.
Use callback-free own-data record reads and barriered overwrites instead of allocating field keys. Project each data completion once and batch parser and native write/deadline effects within that proof. Share the emitter/provider dispatch scope, keep short argument spans inline, and avoid JS buffers when no listener can receive them or provider work for empty write acknowledgements. End every native borrow before JS, close or reopen. Add moving inline/overflow-edge and borrowed-handle-scope witnesses; keep the issuer-owned HTTP pending-event scanner custody accurate after the main rebase.
Resolve a bound parent to either its immutable native class fact or the existing export metadata in one shared closure validation. Ordinary dynamic super calls no longer run two receiver probes and two fallback registry lookups. Constructor family selection still compares only static info identity and the numeric class capture.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
⛔ Files ignored due to path filters (5)
📒 Files selected for processing (199)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
proggeramlug
marked this pull request as ready for review
October 9, 2026 12:07
This was referenced Oct 9, 2026
Open
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.
Move
net.Socketandnet.Serverownership into native payloads whose completions route through retained owner links. HTTP/1 client/server parsers now sit above the actual Socket; upgrade changes its route and delivers the same Socket plus the head bytes. The inherited P0 prerequisite was previously posted as draft #12064.The requested flat-micro/RSS target remains unmet. Against the measured base, HTTP 10k instructions increase 4.877% and net echo 1.097%. With THP disabled, their median RSS increases persist: HTTP +2,604 KiB, net +964 KiB. This PR is ready for review with those residual costs retained, not performance acceptance.
Round 2 selects constructor families from immutable class captures instead of mutable function names/prototype properties. Completion paths share validated payload windows and emitter/provider roots; all native borrows end before JS, close or reopen. Callback-free record reads/overwrites avoid allocating keys and retain inline/overflow write barriers. No new cache, latch or identity table is added. Socket open state has one
SocketFields.openedfield, with live connect/accept/adopted transitions and a mutation-tested gate.Validation retained from Linux, pinned Node 26.5.1, measured base
678ab79517aa3c3ef939d5c9610af2596bd54be2, production head0f981f054dd25e80a01308d4c0ee41934cb0dc3a:large_const_arraysfailure; changed-crate comparison has zero added warning/file pairs. Fresh read-only socket-open gate, mutation self-tests, Node pin consistency and diff whitespace checks pass.Performance evidence uses n=5 interleaved on qb6, CPUs 0–55,
setarch -R, separate coherent compiler/runtime/stdlib targets and output/exit checks against Node for every retained trial. Instructions and RSS were measured; no cycles claim. Full-GC companion counts are retained. Upgrade/churn are correctness witnesses only because the baseline times out or differs from Node. Main advanced afterwards; these results do not compare against its later tip.Residual follow-ups:
net-capability-carry: carry proven Socket/response capabilities across callback-free Agent/request/response helpers.http-app-record-lifetime: compact/reclaim ClientRequest/IncomingMessage/response records with traced JS lifetimes while preservingreq.socketand delayed-generation guards. ClientRequest and response records each grow 40 bytes; existing app registries retain them, explaining proportional native-memory growth.net-cold-constructor-dispatchandnet-code-residency: isolate the remaining Hello startup instruction offset and reduce duplicated inlined proof/dispatch bodies. THP-off and smaps evidence shows persistent resident code-page costs; sampled percentages do not exactly apportion the instruction deltas.ws-unused-client-row-cleanup: remove seven unused ws Client codegen/manifest rows. The baseline buffer ledger path and raw-socket ws limitations also remain documented; no green full-workspace claim.The verified source bundle, raw profiles/results, normalized gap outputs, GC companions, THP/smaps controls and build fingerprints are retained offhost. The evidence archive contains fingerprints, not executable binaries; all seven owned targets were deleted and the namespace is inactive. Production source is frozen; the publication changelog is the only added metadata.