Skip to content

fix(inspector): return integral heap sampling byte sizes - #140

Merged
steipete merged 1 commit into
mainfrom
fix/inspector-heap-sampling-byte-sizes
Oct 8, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/inspector-heap-sampling-byte-sizes

Conversation

@steipete

@steipete steipete commented Oct 8, 2026 •

Copy link
Copy Markdown

Heap allocation profiles currently expose fractional selfSize and sample size values from JSC's weighted allocation sampler. Consumers expecting Node's whole-byte output reject otherwise valid profiles: a retained-array workload returns a node size of 9600384.107102856 and sample sizes of 1200048.013387857.

Round finite, nonnegative byte estimates at the existing node:inspector JSON adapter. Preserve the actual allocation sampler, allocation-site attribution, profile structure, and independent node/sample totals. Do not coerce invalid values or clamp sizes to 32 bits. Document the representation and add a native regression requiring allocation attribution and integral byte sizes in both live and stopped profiles.

Node's V8 implementation rounds estimated allocation counts and emits integer byte products. The protocol schema declares these fields as numbers; this change follows observed Node behavior without claiming the schema requires integers. Node totals and individual samples are estimated separately and need not sum identically. JSC's existing statistical estimator remains unchanged.

Validation completed:

  • Linux baselines 667c4ab22cbf6b101b3376c550b81cabc8c00518 and fc53bf8c0fccd0dcbcccfcf75e2c306ab8953cae both reproduce fractional bytes; Node 24.19.0 reports integral bytes for the same workload.
  • The added standalone native regression passes on Node 24.21.0.
  • Changed TypeScript/docs formatting, lint, whitespace checks, and independent scoped P2 review pass; CI formatting and JavaScript lint also pass. The changelog retains an unrelated pre-existing formatting discrepancy under the append-only policy.
  • Native CI passes on Linux x64 and macOS arm64 for head b7b37442f2f174cd7cd71bd6305a726c30644f74. GitHub merge commit 3e0fdaf6358795071c08be63236e8e37119449f5 has an identical source tree to the branch head. Each native inspector suite passes all 79 tests, including the new regression. Linux also passes all 15 selected files and all 17 result rows.
  • The Linux candidate is available as CI artifact bun-linux-x64-3e0fdaf6358795071c08be63236e8e37119449f5-attempt1; its archive SHA-256 is f26a632f059cd47bf1d54c3098da1e3e1d4333664ad1418a42ce1a2f45969b05.

This PR remains a draft pending OpenClaw consumer validation. The ancillary issue-finding action fails because its provider credential is unavailable; the native build/test and formatting/lint jobs pass.

Upstream searches found no equivalent fractional-byte fix. Related oven-sh#35483 and oven-sh#35486 concern CLI heap-profile generation rather than this allocation sampler.

@steipete
steipete marked this pull request as ready for review October 8, 2026 01:26
@steipete
steipete merged commit 44c72c0 into main Oct 8, 2026
6 of 7 checks passed
@steipete
steipete deleted the fix/inspector-heap-sampling-byte-sizes branch October 8, 2026 01:26
steipete added a commit to openclaw/openclaw that referenced this pull request Oct 8, 2026
Advance the shared Bun pin from fc53 to 42bd for deferred VM bytecode generation, integral heap-sampling sizes, and inspector snapshot cleanup (openclaw/bun#137, openclaw/bun#140, openclaw/bun#141). Keep WebKit cb8d6f202b and update the four verified Darwin/Linux artifact pins and CI documentation.

Gate A passed: 35 paired selections, 270 targeted cells, no candidate regressions, ten Node-hidden smoke steps with zero Node attempts, and supplemental JSC checks. Both Darwin architecture gates passed. Preserve the baseline-only UI palette intermittent in #167000; #166780 is not claimed fixed. No new admissions qualified. Pin staging tests, changed checks, independent P2 review, exact-head CI, and ClawSweeper passed without a CI rerun.
steipete added a commit to openclaw/openclaw that referenced this pull request Oct 8, 2026
Use the native profiling owner on Node and Bun while preserving admission, redaction, bounds, and cleanup. Exercise CPU, heap, and snapshot captures on the selected runtime, retain a genuine Node oracle for V8 tracking, and reject Bun environment-started debugger conflicts.

The consumer cutover depends on the shared Bun pin including openclaw/bun#140 and openclaw/bun#141. Node 24 and the combined fixed Bun pass all 112 targeted cases; the previous pin still fails the integral heap-profile contract.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 9, 2026
Advance the shared Bun pin from fc53 to 42bd for deferred VM bytecode generation, integral heap-sampling sizes, and inspector snapshot cleanup (openclaw/bun#137, openclaw/bun#140, openclaw/bun#141). Keep WebKit cb8d6f202b and update the four verified Darwin/Linux artifact pins and CI documentation.

Gate A passed: 35 paired selections, 270 targeted cells, no candidate regressions, ten Node-hidden smoke steps with zero Node attempts, and supplemental JSC checks. Both Darwin architecture gates passed. Preserve the baseline-only UI palette intermittent in openclaw#167000; openclaw#166780 is not claimed fixed. No new admissions qualified. Pin staging tests, changed checks, independent P2 review, exact-head CI, and ClawSweeper passed without a CI rerun.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant