From 8ea1fed38b29d90553fcfd8b79bf1475dde3ab04 Mon Sep 17 00:00:00 2001 From: udo Date: Thu, 16 Jul 2026 19:09:11 +0000 Subject: [PATCH] Document cached unit import metadata --- docs/wasm-runtime-architecture.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/wasm-runtime-architecture.md b/docs/wasm-runtime-architecture.md index 16a7d78..6143bae 100644 --- a/docs/wasm-runtime-architecture.md +++ b/docs/wasm-runtime-architecture.md @@ -131,6 +131,12 @@ available. If an artifact is cold or stale, dispatch compiles it on demand via Workers identify cached unit artifacts by nanosecond mtime, ctime, and size. Whole-second mtime alone is insufficient because a dependency-triggered rebuild can replace a wasm artifact within the same second as its prior build. +The worker also classifies each compiled module's immutable import descriptors +once when that artifact enters the module cache. Each request still creates its +own import vector, memory/table-base globals, GOT globals and function-table +slots, then runs relocations, constructors, and request-pointer binding. This +removes repeated Wasmtime import-type traversal without sharing request state or +changing core-first, unit-load-order symbol resolution. Cold module compilation and deserialization are host work, so `load_unit()` refreshes the epoch deadline before its first guest call. Otherwise a component whose compilation outlasted the guest CPU budget would immediately trap in the