You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"notes": "create_snapshot() registers all 38 stub bridge functions via register_stub_bridge_fns(), injects default _processConfig and _osConfig via inject_snapshot_defaults(), runs the bridge IIFE, then snapshots the fully-initialized context. Tests verify: stubs and config globals present during IIFE execution (Part 15), getter facade + closures + config reads work through create_snapshot() and are preserved in restored context (Part 16), SnapshotCache works with new create_snapshot (Part 17)."
- Static bridge code can be cached at module level since it's identical across all driver instances and sessions
449
449
- Pre-existing test failures: test-suite/node (4 fails from `__name` conflict), runtime-driver/node (228 fails from `__name` conflict), V8 crash/process isolation (3 OOM timeouts)
450
450
---
451
+
452
+
## 2026-03-19 - US-063
453
+
- Updated `create_snapshot()` in `snapshot.rs` to create fully-initialized context snapshots
454
+
- Added `register_stub_bridge_fns(scope, &SYNC_BRIDGE_FNS, &ASYNC_BRIDGE_FNS)` call before running bridge IIFE
455
+
- Added `inject_snapshot_defaults(scope)` to inject default `_processConfig` (cwd="/", env={}, timing_mitigation="off") and `_osConfig` (homedir="/root", tmpdir="/tmp", platform="linux", arch="x64") as frozen, read-only globals
456
+
- Default config globals are injected via inline JS evaluation + Object.freeze + define_own_property(READ_ONLY | DONT_DELETE)
457
+
- Added 3 new test parts (15-17):
458
+
- Part 15: Verifies all 38 stub bridge functions and default config globals are present during bridge IIFE execution
459
+
- Part 16: Verifies getter facade, closures, require-like functions, and config reads work through create_snapshot(); verifies restored default context preserves all bridge infrastructure
460
+
- Part 17: Verifies SnapshotCache works with the updated create_snapshot()
- V8 snapshot_creator MUST call `create_blob()` before being dropped — early returns (via `?`) cause SIGSEGV in the destructor
464
+
- Error handling in `create_snapshot()` must collect errors and return them AFTER `create_blob()`, not via early return
465
+
- Bridge IIFE setup code does NOT call bridge functions at the top level (only creates closures/wrappers), so stub functions are safe for snapshot creation
466
+
- `_loadPolyfill` is only called inside `require()` at runtime, not during IIFE setup — stubs don't need to handle it
467
+
- Pre-existing SIGSEGV when running execution::tests AND snapshot::tests in the same process (V8 inter-test state issue) — run them separately: `cargo test execution::tests -- --test-threads=1` and `cargo test snapshot::tests -- --test-threads=1`
0 commit comments