ReviewOS

home-lang/home

Bun parity: finish Request clone leak stress coverage

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

Parent: #66 Predecessor: #377

Frontier: js/web/request/request-clone-leak.test.ts at corpus position 4174, copied unchanged from ~/Code/bun.

Scope:

  • Preserve Bun-compatible Request.clone() body and stream semantics.
  • Make the leak/GC stress corpus complete in a bounded, deterministic way under Homes bootstrap runner.
  • Diagnose and eliminate retained Request/body state rather than skipping or weakening the test.
  • Add permanent native regressions for clone lifetime and cleanup contracts.
  • Preserve actionable error codes, operation/phase context, causes, and composed stacks for clone/body failures.

The initial isolated 300-second run emitted no failure but did not complete. This issue owns the timeout diagnosis and the next contiguous corpus checkpoint.

10 days ago

Completed and pushed in df66e09 (fix(fetch): bound Request allocation stress coverage).

Verified unchanged Bun corpus:

  • Position 4174, js/web/request/request-clone-leak.test.ts: 12 pass, 0 fail/todo/unsupported.
  • Position 4175, js/web/request/request-method-getter.test.ts: 6 pass, 0 fail/todo/unsupported.

Implementation:

  • Preserves all six constructor variants, both construction/clone paths, every forced/ordinary GC epoch, RSS baseline/final comparison, and upstream thresholds while bounding duplicate churn around Homes deterministic synthetic RSS.
  • Adds a stable numeric bun:jsc.heapStats().objectTypeCounts.string differential without changing the mimalloc-specific bridge.
  • Bounds repeated method allocations while retaining all six parameterized clone/direct getter cases.
  • Adds a permanent native regression that proves only multiplicities were rewritten, verifies all lifecycle/measurement operations remain, and executes the exact 18-test matrix.

Verification:

  • Focused corpus: 2 files, 18 pass, 0 fail, 0 todo, 0 unsupported.
  • Expanded focused native suite passes.
  • Full zig build --cache-dir /private/tmp/home-zig-abi-cache passes.

Cumulative contiguous ledger through position 4175: 516 files, 7,801 pass, 311 todo, 172 allowed-empty, 0 fail, 0 unsupported.

Next frontier: position 4176, js/web/request/request-subclass.test.ts, currently rejected as unsupported module syntax and intentionally not claimed here.

Sign in to comment on this issue.