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
Add a new Engine::serialization_compatibility_hash method that returns a hash of the "compiler info" appended to precompiled Wasm binaries.
Benefit
This would allow precompiled Wasm from multiple configurations/versions of Wasmtime to be safely and efficiently stored together by, for example, keying its storage on (Hash(wasm), serialization_compat_hash). This may still be a little pessimistic compared with Wasmtime's actual compatibility checks but would be better than the conservative approach of only reusing precompiled binaries on a single host.
Implementation
Extract the following section from append_compiler_info and reuse it to compute a sha-256 digest of the "compiler info":
There is some overlap between the features this would be used for and Wasmtime's cache system, but the cache system is currently somewhat opaque and difficult to reason about wrt shared storage and the cache "worker"'s performance characteristics.
This could be done today without changes to Wasmtime by precompiling a dummy module and hashing its .wasmtime.engine section, which seems fragile.
Feature
Add a new
Engine::serialization_compatibility_hashmethod that returns a hash of the "compiler info" appended to precompiled Wasm binaries.Benefit
This would allow precompiled Wasm from multiple configurations/versions of Wasmtime to be safely and efficiently stored together by, for example, keying its storage on
(Hash(wasm), serialization_compat_hash). This may still be a little pessimistic compared with Wasmtime's actual compatibility checks but would be better than the conservative approach of only reusing precompiled binaries on a single host.Implementation
Extract the following section from
append_compiler_infoand reuse it to compute a sha-256 digest of the "compiler info":wasmtime/crates/wasmtime/src/engine/serialization.rs
Lines 50 to 64 in c3c16eb
Alternatives
.wasmtime.enginesection, which seems fragile.