Skip to content

fix(node:vm): reject empty cached data and cover execution modes - #121

Merged
steipete merged 3 commits into
mainfrom
claude/w160-vm-cached-data-modes
Oct 5, 2026
Merged

steipete merged 3 commits into
mainfrom
claude/w160-vm-cached-data-modes

Conversation

@steipete

@steipete steipete commented Oct 5, 2026 •

Copy link
Copy Markdown

The vm.Script constructor now distinguishes explicitly empty cachedData from an omitted option. Empty data reports cachedDataRejected === true, executes the source normally, and still supports produceCachedData regeneration, matching Node 24.

This extends the standalone JIT-unavailable fix in #118 (adapted from oven-sh#41769, thanks @robobun). That fix removes a synchronous baseline compilation of a decoded block that cannot execute. This follow-up preserves decode-only acceptance and owned payload lifetime, and depends only on fork main: no WebKit artifact or private-cache promotion changes.

Fresh-process regressions cover default, interpreter, baseline, DFG, and FTL configurations. Each exercises produceCachedData, createCachedData() before/after execution, consumption in a separate process, execution in all three context forms after buffer mutation/GC, empty/junk/truncated/source-mismatched data, regeneration, and rejection of a real Bun 1.4.2 payload. The identical assertion fixture passes under Node 24.21.0.

The requested broader Node VM run also exposed three stale column expectations from the earlier stack-position fix. This PR corrects those specific expected columns while retaining the filename, line-offset, column-offset, and caret checks. The corrected tests pass on unchanged main, the candidate, and Node 24.

Native Linux release/no-LTO proof against the published WebKit artifact:

  • Pre-fix 4540c115f3: interpreter repro exits 139. LLDB shows constructScript → JIT::compileSync → emitSlow_op_enter → JITThunks::ctiStub(this=null) → RecursiveLockAdapter::lock(this=0x4e0).
  • Unchanged main a852955d800: the crash repro passes; all five new empty-cache cases fail as expected.
  • Candidate: 363 VM tests pass, with the existing 3 skips and 60 TODOs unchanged; all five mode regressions pass; all 47 fork-selection results pass.
  • Node-derived VM suite: all 99 result rows pass for both unchanged main and candidate with the corrected fixtures (original fixtures had the same three failures in both arms).
  • OpenClaw Code Mode consumer checks pass under Bun in both arms, with isolated HOME/state/temp directories.
  • Complete final diff: scoped-clean Codex P2 autoreview. Formatting and JavaScript lint pass.

Native runtime proof uses ca9b13163ff; subsequent changes only reposition the changelog and correct the three independently re-run Node fixtures. Hosted CI is green in both fork lanes on exact final head a915fd1ed072d03f009c1049c2958b6df2dcc8b5: https://github.com/openclaw/bun/actions/runs/37255516055 (attempt 1). Formatting, JavaScript lint, and source lints are green too. The valid-cache repro also passes under a 2 GiB address-space limit and systemd MemoryDenyWriteExecute=yes; both restrictions abort the pre-fix binary. Upstream proof update: oven-sh#41769 (comment).

Extend the cachedData regression from oven-sh#41769 and #118 with per-tier round trips, invalid input, and Bun 1.4.2 cache rejection. Keep source fallback and cache regeneration working without JIT dependence.
The earlier source-position fix now reports constructor columns matching Node. Preserve the existing filename, line-offset, column-offset, and caret checks while replacing old JSC-only column expectations. These corrections pass on unchanged fork main as well as the cached-data candidate, and under Node 24.
@steipete
steipete merged commit c84f8e3 into main Oct 5, 2026
7 checks passed
@steipete
steipete deleted the claude/w160-vm-cached-data-modes branch October 5, 2026 02:45
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