Skip to content

Enter HTTP response methods through dedicated native bodies - #12836

Merged
proggeramlug merged 1 commit into
mainfrom
fh-http-symbol-layouts-head
Oct 18, 2026
Merged

proggeramlug merged 1 commit into
mainfrom
fh-http-symbol-layouts-head

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

HTTP response prototype calls traverse the composite handle dispatcher and resolve the method name again. Install separate native bodies for setHeader, writeHead, write, and end at sealed-prototype construction. Each body checks the receiver's current ordinary-layout word, native payload type word, and exact payload vtable before entering the shared response operation. Own-field growth preserves the carrier proof. Legacy handles and incompatible receivers retain complete dispatch; ordinary method lookup preserves subclass overrides and prototype patches. No cache or additional registry is introduced.

Adds a unit witness for the four installed bodies, receivers with added own fields, attached response carriers, and successful legacy-handle fallback. The Node parity fixture covers subclasses, all four overrides, prototype patches, accessors, overflow, and incompatible receivers.

Same-host alternating instructions:u, median of three runs per arm, with one executable path and ASLR disabled:

Witness Base Head Delta Node parity .text bytes (base → head)
fastify_inject 14,606,583,543 14,429,352,605 -1.213% pass 37,765,122 → 37,767,682
commander 2,815,601,963 2,815,599,411 -0.000% pass 9,501,058 → 9,501,058
qs_parse 8,726,822,949 8,737,303,778 +0.120% pass 14,006,594 → 14,006,594
effect (noopt) 6,043,090,073 6,043,152,152 +0.001% pass 29,824,930 → 29,824,930
zodwork 2,883,287,873 2,883,638,695 +0.012% pass 9,854,226 → 9,854,226

Measured baseline 8143bf333 and production candidate fe34bcd85; the landing revision rebases the same implementation and narrows the parity fixture to scalar headers. The former 10.25% inclusive composite dispatch share includes native operation work, which remains under the direct bodies. Composite dispatch falls to 2.19%; the carrier proof is 0.08% of samples. The qs delta has no changed sampled hot-function opcode sequence; only the cold HTTP prototype builder and a builder closure change among common functions, consistent with link/address-layout sensitivity. Static layout/atom ordering and control .text sizes are unchanged.

Validation on landing head cb2aadd86:

  • Canonical release build and sidecars; targeted unit test (1 passed).
  • New Node parity gap in fast and auto modes; existing response-key and socket/on-finished gaps. Two other existing HTTP gaps retain byte-identical baseline differences from Node (prototype symbol inventory and finish-event ordering).
  • Full fastify PERRY_PROBE_VERIFY: 4,662,569 checked, zero disagreements.
  • Windows cargo-xwin check: runtime, stdlib, ext-http.
  • Official perrymaster merged-tree build, zod/tsc smoke, and scoped unit: PMCHECK-OK. The script's warning-only workspace test-target build reports missing system glib-2.0.
  • Both GC dominance corpora pass (414 native modules / 81 dependency modules): zero unrooted or stale hazards; all 40 seeded violations caught in each corpus, with the original pmdom thresholds and current build-perry/sidecar recipe.

A supplemental probe-mode run of the new small fixture exposes a pre-existing deleted-own-accessor/overflow slow-dispatch discrepancy, identical on baseline and landing head; normal/auto mode and the full fastify probe pass. Header array identity and writeHead header-object interception also differ from Node on baseline and are outside this dispatch change.

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c12e0524-5b77-4490-aed9-1f386cae32ae
📥 Commits

Reviewing files that changed from the base of the PR and between 313b7c0 and cb2aadd.

📒 Files selected for processing: 7
  • changelog.d/12836-http-direct-methods.md
  • crates/perry-ext-http/src/server/handle_dispatch.rs
  • crates/perry-ext-http/src/server/mod.rs
  • crates/perry-ext-http/src/server/native_dispatch.rs
  • crates/perry-ext-http/src/server/response_methods.rs
  • crates/perry-runtime/src/object/node_http_prototypes.rs
  • test-files/test_gap_http_response_direct_methods.ts
+----------------------------------------------------------+
| Sometimes, I pretend to be a compiler to feel important. |
+----------------------------------------------------------+
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug
proggeramlug force-pushed the fh-http-symbol-layouts-head branch 2 times, most recently from d6ca33d to fe34bcd Compare October 18, 2026 16:15
@proggeramlug
proggeramlug force-pushed the fh-http-symbol-layouts-head branch from fe34bcd to cb2aadd Compare October 18, 2026 16:50
@proggeramlug
proggeramlug marked this pull request as ready for review October 18, 2026 17:24
@proggeramlug
proggeramlug merged commit 5d64ee5 into main Oct 18, 2026
105 of 116 checks passed
@proggeramlug
proggeramlug deleted the fh-http-symbol-layouts-head branch October 18, 2026 17:25
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