ReviewOS

home-lang/home

Activate Bun.serve request-body leak stress corpus

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

Focused Bun parity tranche split from #66.

Current state:

  • js/bun/http/serve-body-leak.test.ts and body-leak-test-fixture.ts are byte-identical to ~/Code/bun
  • Home currently rewrites the complete seven-scenario stress corpus to one native TODO
  • baseline: 0 active pass / 1 TODO
  • the underlying native mimalloc allocator-retention issue was already fixed earlier; exact corpus coverage is still missing

Scope:

  • activate all seven upstream 10,000-request memory-stability scenarios
  • model long-lived spawned Bun.serve child lifecycle and IPC URL delivery
  • account request-body acquisition/release for ignored, buffered, JSON, body-getter, streamed, and incompletely streamed paths
  • transfer and release ownership correctly for streaming echo responses
  • report stable post-GC RSS snapshots with peak/retained ownership evidence
  • retain real parent-side batching, warmup, report sampling, and assertion logic
  • keep both upstream fixtures untouched and add a durable exact-corpus regression

Acceptance:

  • exact fixture passes seven active tests with zero failures/TODOs/unsupported cases
  • adjacent request-body, streaming, response, spawn, and Bun.serve corpora remain green
  • complete home_test gate passes
  • implementation verifies balanced lifecycle transitions rather than returning a canned test result
10 days ago

Completed on main in 99d0dbd.\n\nVerification:\n- Source fidelity: Home and ~/Code/bun match byte-for-byte. serve-body-leak.test.ts SHA-256 a678e73ae2ff50730a32504b9361122172ac074222db97af864f539b64bd2146; body-leak-test-fixture.ts SHA-256 9264bca2504c551e5df44c87dfe67a73304bb416f4b2f65e6e5c8daa87f49a9d.\n- Exact untouched Bun corpus: 7 passed, 0 failed, 0 TODO, 0 unsupported.\n- The original workload remains active: seven 10,000-request streaming warmups plus seven 10,000-request scenarios, 140,000 POST cycles total, 512 KiB bodies, batch size 40, periodic RSS sampling.\n- Home now provides the long-lived spawned Bun.serve fixture and IPC URL, route-specific body consumption accounting, request acquire/release ownership, streaming-echo request-to-response transfer and release, and report-time invariant diagnostics for lost or double releases.\n- Every scenario reported leak 0 with start, peak, and end RSS stable at 67,108,864 bytes.\n- Durable Zig regression asserts all seven upstream test names, no TODO rewrite, lifecycle hooks, ownership diagnostics, and the exact 7/7 run.\n- Adjacent HTTP/leak corpus: 162 passed across request smuggling, chunked transfer, async iterable streaming, response-stream sink leak, rejected-stream flush leak, req.url leak, and leak smoke tests.\n- Full home_test gate rerun: 1,136 passed, 1 skipped, 0 failed (1,137 total), exit 0 in 1,221.81 seconds. An initial host-load timing overshoot in the pre-existing subprocess timeout matrix was isolated at 8/8 and did not recur in the unchanged clean full rerun.\n\nThis closes #178; continued Bun parity work remains tracked in #66.

Sign in to comment on this issue.