ReviewOS

home-lang/home

Investigate bootstrap Request stress memory blow-up

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

Parent: #66. Corpus fidelity: #202. Found by the full optimized Zig aggregate during #693 verification.

The existing unit bootstrap Request allocation stress preserves the unchanged Bun workloads in packages/home_test/src/corpus_runner.zig executes these complete copied files inside the reduced jsc_bootstrap.Runtime:

  • js/web/request/request-clone-leak.test.ts (expects 12 tests)
  • js/web/request/request-method-getter.test.ts (expects 6 tests)

The aggregate's corpus unit process reached a sampled 13.7 GB physical footprint / 14.4 GB peak while inside this test. The stack is test_runner.mainServer -> corpus_runner.test.bootstrap Request allocation stress preserves the unchanged Bun workloads -> jsc_bootstrap.Runtime.runFile -> JSEvaluateScript, followed by JSC iterator/JIT frames. The sampling point was about 3.5 minutes into the corpus unit process; the process continued consuming CPU. It was explicitly terminated after collection to protect the shared machine. This is an interrupted resource-failure result, not a passing gate or a proven permanent hang.

Preserve all source workloads and thresholds, including 1000 * ASAN_MULTIPLIER, 2000 * ASAN_MULTIPLIER, j < 500, 500 * ASAN_MULTIPLIER, 1024 * 512, 1024 * 128, process.memoryUsage.rss() and heapStats(). Do not shorten loops, fake memory counters, add TODOs/skips, or count process termination as success.

Investigate Request/body/header retention and allocation behavior. Verify the complete unchanged files through Home's real native runtime with bounded process/resource supervision and pinned Bun controls. If this unit is exercising an obsolete bootstrap path, migrate the coverage to actual native corpus routing only with real native Request behavior and unchanged assertions, keeping source-integrity checks. Add targeted lifetime/resource evidence and preserve the full workloads for acceptance.

The ordinary native runtime unit artifact independently passed 1,826 tests with 19 skips and zero failures before this interruption. Do not confuse that artifact with the incomplete corpus unit artifact.

9 days ago

Published 5e45c58a3 to origin/main as Chris Breuer, without coauthors.

All four unchanged js/web/request files now execute through Home's production native runtime. The public file/directory/subset/full-gate entry points initialize the bootstrap VM only for files that still need that adapter. The old bootstrap-only Request stress/subclass execution has been replaced with complete native coverage and retained-source checks for original loops, thresholds, type imports and subclass behavior.

  • Ordinary Request directory: 4 files / 24 pass / 0 fail / 0 TODO / 0 unsupported. All four files also pass separately. Pinned Bun and strict-native Home each pass the original 12 clone/allocation + 6 method-allocation + 2 subclass + 4 construction/body tests.
  • Direct native profiles retain every iteration: clone stress peak physical footprint 22,594,376 bytes; method stress 194,872,232 bytes. The ordinary clone run's RSS deltas are 0–13 MB, below the original 30 MB threshold. No counter, workload, deadline or assertion changes.
  • The new dedicated test-home-harness step supports -Dhome-test-test-filter. The entry point retains the real VM/generated-class/N-API exports and discovers nested source-file tests independently of named facade smoke tests. A registration-only selection is rejected. This removes test-selection dependencies without adding stubs.
  • Focused harness: 23/23 build steps, 4/4 tests, seven-second execution. Independently queried metadata confirms all three named Request routing/matrix/mixed-dispatch regressions plus the registration guard. Earlier registration-only runs receive no coverage credit.
  • Optimized native build: 46/46 steps. Shared-dispatch shell regression: 378 pass / 83 upstream TODO / 0 fail. Formatting, documentation Pickier and whitespace checks pass. The corpus audit remains 12,996 tracked paths present, 12,990 identical regular files, five identical symlinks, one differing expectations.txt, zero missing.

#697 is complete for replacing the failing obsolete stress execution with verified native Request coverage. This does not claim that the remaining bootstrap Request shim itself has been repaired; retirement of the remaining adapters stays in #202. The earlier interrupted full aggregate is still incomplete, and whole Bun parity is not achieved. #694 and external native build ownership remain open.

Next concrete batch: #698 records six Headers/Response files with 170 native passes per runtime under the correct fixture root and startup environment. Their ordinary native activation is still pending. The Response snapshot and release-Bun internal-module baseline failures were traced to those process-context requirements, without editing the fixtures or snapshots.

Sign in to comment on this issue.