ReviewOS

home-lang/home

HTTP/1: finish malformed stream pipeline settlement

#547
Closed chris opened this 9 days ago ·
9 days ago

Follow-up to #66 and #514 after the internal stream-wrapper checkpoint.

The byte-identical pinned Node file js/node/test/parallel/test-stream-pipeline.js is the only remaining failure in the 252-file test-stream* scan. Its HTTP/1 case beginning near line 271 sends unframed follow-up bytes after a keep-alive response. Node rejects the malformed continuation with a 400 response and closes, allowing the pipeline to settle. Home waits for more bytes in the method token and the parent times out.

The pinned local Bun release (1.4.0-canary.1+4982b91e3, source 4982b91e3702094330f3be3883354c52b8c01323) reproduces the same timeout and empty response sequence. That control establishes that this is not a Home-only regression, but it remains a failing Bun/Node compatibility boundary and cannot count toward 100% logical suite parity.

Current checkpoint 0be19c718 advances the exact 252-file scan to 251/252 by implementing the three wrapper fixtures. No upstream source, assertion, workload, deadline, retry, skip, or fallback changed.

Acceptance criteria:

  • the complete unchanged test-stream-pipeline.js exits naturally within its original behavior/deadline;
  • the isolated malformed HTTP/1 case matches Node's terminal response/close and pipeline settlement semantics;
  • valid keep-alive and pipelined requests retain their existing behavior;
  • the full byte-identical 252-file stream scan reaches 252/252;
  • lifecycle, VM-destruction, JSC exception-check, native build and scoped runtime-unit verification pass;
  • any divergence from the pinned Bun parser is documented as an intentional Node-compatibility repair rather than hidden by a timeout adjustment or test bypass.

Prior diagnostics: zig-out/http1-pipeline-{lifecycle,pinned}-results.json, http1-wrap-flag-results.json, pipeline-blocks-results.json, and http-pipeline-chunks-results.json.

9 days ago

Completed on codex/runtime-port in 26b5a8b9165d8c65488c512d90d6d8cd58de8872 (fix(runtime): settle malformed HTTP pipelines).

The native build now owns the pinned uWebSockets unified object instead of linking the prebuilt external copy. That makes Home's tracked parser source authoritative and enables Node-compatible strict method validation: a malformed lowercase request following a valid keep-alive request receives 400 Bad Request, closes the connection, and settles both ends of stream.pipeline with ERR_STREAM_PREMATURE_CLOSE. Fragmented valid methods and valid same-buffer HTTP/1 pipelining remain accepted.

This strict early rejection is the one deliberate compatibility divergence from Bun pin 4982b91e3702094330f3be3883354c52b8c01323; the pinned Bun binary reproduces the old timeout. The rest of the refreshed uWebSockets sources are either byte-identical to that pin or contain only Home-relative include paths.

Verification:

  • unchanged Bun stream corpus scan: 252/252 files pass, including test-stream-pipeline.js
  • new native parser regression: normal mode, JSC exception validation, and VM destruction all pass
  • request-smuggling suite: 59/59 tests, 90 assertions
  • HTTP server chunking: 11/11 tests, 34 assertions
  • destroy/pipelined serve regression: 1/1 test, 3 assertions
  • runtime publication regression set: 64/64 files, including 33 native files and the full spawn and child-process suites
  • scoped Zig units: 1,828 pass, 19 skip, 0 fail; 20/20 build steps
  • clean native build: 18/18 steps; cached rebuild: 18/18 cached
  • Pickier, Zig formatting, whitespace, source-integrity, and linked-object ownership checks pass

The broader node-http.test.ts file was not counted: it cannot start in this checkout because its tunnel package fixture is unavailable. No upstream test, timeout, or workload was changed to obtain these results.

Sign in to comment on this issue.