ReviewOS

home-lang/home

Native HTTP/1 fetch: finish bodyless framing and interim-response reclamation

#650
Closed chris opened this 10 days ago ·
10 days ago

Scope

The unchanged strict full-VM js/web/fetch/fetch.test.ts fixture exposes two remaining HTTP/1 contracts:

  • A caller-supplied Content-Length is forwarded on a request without a body; it must be removed from the wire request.
  • Roughly 48 MiB of interim 1xx response bytes remain resident while waiting for the final response. ReleaseFast measures a 151.4 MiB RSS delta against the unchanged <16 MiB limit (the current executable identifies as a debug Bun artifact, so the fixture applies its unchanged <48 MiB allowance and still fails).

Pinned Bun passes both contracts. Home currently reports 346 pass / 4 fail / 7,423 assertions for the complete 350-test file; these are two of the four failures.

Completion boundary

  • Port bodyless request framing in the production HTTP request builder.
  • Reclaim parsed interim-response storage incrementally without weakening parser correctness or lifetime ownership.
  • Preserve the upstream flood volume, assertions, thresholds, and deadlines.
  • Verify with HOME_NATIVE_VM=1 and HOME_CORPUS_FULL_VM=1; adapter-mode output is not completion evidence.
  • Add focused native lifetime/framing regressions and run adjacent keepalive, redirect, compression, and HTTP/2/3 coverage.

Tracked from #66. No skip, workload reduction, threshold widening, or harness substitution is acceptable.

10 days ago

Implemented and pushed in cefad9226.

  • Public fetch now drops caller-supplied nonzero Content-Length on a bodyless request, preserves explicit zero, and retains node:http framing authority through an explicit native client flag.
  • HTTP/1 header parsing now compacts the owned accumulation buffer after each informational response, retaining only the unread suffix rather than the full parsed 1xx history.

The unchanged strict full-VM fetch.test.ts fixture is 350/350 with 7,427 assertions in Debug and ReleaseFast. Its original roughly 48 MiB interim-response flood and memory threshold pass. Adjacent ReleaseFast coverage passes: node-http 128 pass / 1 upstream skip / 0 fail, Content-Length 1/1, HTTP/2 client 60/60, HTTP/3 client 52/52, Undici 10/10, plus redirect/keepalive/TLS. No workload, threshold, deadline, fixture, assertion, or skip changed.

Sign in to comment on this issue.