Breaking changes:
- WasmEdge C API changes.
- Merged the
WasmEdge_ImportObjectContext
into theWasmEdge_ModuleInstanceContext
.WasmEdge_ImportObjectCreate()
is changed toWasmEdge_ModuleInstanceCreate()
.WasmEdge_ImportObjectDelete()
is changed toWasmEdge_ModuleInstanceDelete()
.WasmEdge_ImportObjectAddFunction()
is changed toWasmEdge_ModuleInstanceAddFunction()
.WasmEdge_ImportObjectAddTable()
is changed toWasmEdge_ModuleInstanceAddTable()
.WasmEdge_ImportObjectAddMemory()
is changed toWasmEdge_ModuleInstanceAddMemory()
.WasmEdge_ImportObjectAddGlobal()
is changed toWasmEdge_ModuleInstanceAddGlobal()
.WasmEdge_ImportObjectCreateWASI()
is changed toWasmEdge_ModuleInstanceCreateWASI()
.WasmEdge_ImportObjectCreateWasmEdgeProcess()
is changed toWasmEdge_ModuleInstanceCreateWasmEdgeProcess()
.WasmEdge_ImportObjectInitWASI()
is changed toWasmEdge_ModuleInstanceInitWASI()
.WasmEdge_ImportObjectInitWasmEdgeProcess()
is changed toWasmEdge_ModuleInstanceInitWasmEdgeProcess()
.
- Used the pointer to
WasmEdge_FunctionInstanceContext
instead of the index in theFuncRef
value type.WasmEdge_ValueGenFuncRef()
is changed to use theconst WasmEdge_FunctionInstanceContext *
as it's argument.WasmEdge_ValueGetFuncRef()
is changed to return theconst WasmEdge_FunctionInstanceContext *
.
- Moved the functions of
WasmEdge_StoreContext
to theWasmEdge_ModuleInstanceContext
.WasmEdge_StoreListFunctionLength()
andWasmEdge_StoreListFunctionRegisteredLength()
is replaced byWasmEdge_ModuleInstanceListFunctionLength()
.WasmEdge_StoreListTableLength()
andWasmEdge_StoreListTableRegisteredLength()
is replaced byWasmEdge_ModuleInstanceListTableLength()
.WasmEdge_StoreListMemoryLength()
andWasmEdge_StoreListMemoryRegisteredLength()
is replaced byWasmEdge_ModuleInstanceListMemoryLength()
.WasmEdge_StoreListGlobalLength()
andWasmEdge_StoreListGlobalRegisteredLength()
is replaced byWasmEdge_ModuleInstanceListGlobalLength()
.WasmEdge_StoreListFunction()
andWasmEdge_StoreListFunctionRegistered()
is replaced byWasmEdge_ModuleInstanceListFunction()
.WasmEdge_StoreListTable()
andWasmEdge_StoreListTableRegistered()
is replaced byWasmEdge_ModuleInstanceListTable()
.WasmEdge_StoreListMemory()
andWasmEdge_StoreListMemoryRegistered()
is replaced byWasmEdge_ModuleInstanceListMemory()
.WasmEdge_StoreListGlobal()
andWasmEdge_StoreListGlobalRegistered()
is replaced byWasmEdge_ModuleInstanceListGlobal()
.WasmEdge_StoreFindFunction()
andWasmEdge_StoreFindFunctionRegistered()
is replaced byWasmEdge_ModuleInstanceFindFunction()
.WasmEdge_StoreFindTable()
andWasmEdge_StoreFindTableRegistered()
is replaced byWasmEdge_ModuleInstanceFindTable()
.WasmEdge_StoreFindMemory()
andWasmEdge_StoreFindMemoryRegistered()
is replaced byWasmEdge_ModuleInstanceFindMemory()
.WasmEdge_StoreFindGlobal()
andWasmEdge_StoreFindGlobalRegistered()
is replaced byWasmEdge_ModuleInstanceFindGlobal()
.
- Updated the
WasmEdge_VMContext
APIs.- Added the
WasmEdge_VMGetActiveModule()
. WasmEdge_VMGetImportModuleContext()
is changed to return theWasmEdge_FunctionInstanceContext *
.WasmEdge_VMRegisterModuleFromImport()
is changed to use theconst WasmEdge_ModuleInstanceContext *
as it's argument.
- Added the
- For upgrading from
0.9.1
to0.10.0
, please refer to the document.
- Merged the
Features:
- Supported the WASM
tail-call
proposal.- Added the
WasmEdge_Proposal_TailCall
for the configuration in WasmEdge C API. - Users can use the
--enable-tail-call
to enable the proposal inwasmedge
andwasmedgec
tools.
- Added the
- Supported the WASM
extended-const
proposal.- Added the
WasmEdge_Proposal_ExtendedConst
for the configuration in WasmEdge C API. - Users can use the
--enable-extended-const
to enable the proposal inwasmedge
andwasmedgec
tools.
- Added the
- Supported thread-safe in
WasmEdge_VMContext
,WasmEdge_ConfigureContext
,WasmEdge_ModuleInstanceContext
, andWasmEdge_StoreContext
APIs. - Supported the gas limit in AOT mode.
- New supporting of the wasi-socket proposal.
- Supported
send_to
. - Supported
resv_from
.
- Supported
- Plugin support
- Add loadable plugin support.
- Move
wasmedge_process
to a loadable plugin.
Fixed issues:
- Fixed wasi-socket proposal issues.
- Fixed wasi-socket on MacOS.
- Fixed error when calling
poll_oneoff
with the samefd
twice. - Fixed error when calling
fd_close
on socket. - Forged zero-terminated string for
::getaddrinfo
. - Checked the socket options enumeration for valid value.
- Fixed the statistics enable/disable routine.
- Fixed the output format by the file extension name detection on multiple platforms.
Known issues:
- Universal WASM format failed on MacOS platforms.
- In current status, the universal WASM format output of the AOT compiler on MacOS platforms will cause bus error when execution.
- We are trying to fix this issue. For working around, please use the shared library format output of the AOT mode.
- Developers can specify the extension name as
.dylib
on MacOS,.so
on Linux, and.dll
on Windows for the shared library format output of the AOT compiler.
Refactor:
- Supported multi-thread execution.
- Changed the
StackManager
inExecutor
as thread local to support the multi-thread. - Used atomic operations for cost measuring.
- Supported multi-thread timer.
- Changed the
- Refactored the enumerations.
- Replaced the
std::unordered_map
of the enumeration strings withDenseMap
andSpareMap
. - Merged the both C and C++ enumeration definitions into the
enum.inc
file. - Updated the
ErrCode
enumeration for the newest spec tests.
- Replaced the
- Refactored the code architecture for supporting
tail-call
proposal.- Split the
call_indirect
execution routine in compiler into AOT and interpreter path. - Updated the pop frame mechanism in the
StackManager
. - Updated the enter function mechanism.
- Split the
- Refined the file manager in
Loader
.- Supported the offset seeking in file and buffer.
- Skipped the instructions parsing in AOT mode for better loading performance.
- Refined the branch mechanism in the
StackManager
for better performance in the interpreter mode.- Pre-calculated the stack offset for branch in the validation phase.
- Removed the label stack in the
StackManager
and used the pre-calculated data for branch. - Removed the dummy frame mechanism in the
StackManager
.
- Supplied the pointer-based retrieving mechanism in the
StoreManager
andModuleInstance
.- Removed the address mechanism for instances in the
StoreManager
. - Added the unsafe getter functions for the instances.
- Removed the address mechanism for instances in the
- Refactored the
StoreManager
,ModuleInstance
, andExecutor
.- Used the
ModuleInstance
-based resource management instead ofStoreManager
-based. - Moved the ownership of instances from the
StoreManager
into theModuleInstance
. - Merged the
ImportObject
into theModuleInstance
. - Invoking functions by
FunctionInstance
rather than the function name inExecutor
.
- Used the
Documentations:
- Updated the WasmEdge C API documentation for the breaking change.
- For upgrading from
0.9.1
to0.10.0
, please refer to the document. - For the old API of
0.9.1
, please refer to the document.
- For upgrading from
- Updated the WasmEdge GO documentation for the breaking change.
- For upgrading from
v0.9.2
tov0.10.0
, please refer to the document. - For the old API of
v0.9.2
, please refer to the document.
- For upgrading from
Tests:
- Updated the spec tests to the date
20220504
. - Added the spec tests for the
tail-call
proposal. - Added the mixed invocation tests between interpreter mode and AOT mode WASM functions.
- Added the thread-safe and multi-thread execution tests.
- Added wasi-socket tests for
poll_oneoff
,send_to
, andrecv_from
.
Thank all the contributors that made this release possible!
朱亚光, Abhinandan Udupa, Ang Lee, Binbin Zhang, Chin Zhi Wei, DarumaDocker, Elon Cheng, FlyingOnion, Hanged Fish, Herschel Wang, JIAN ZHONG, JcJinChen, Jeremy, JessesChou, JieDing, Kodalien, Kunshuai Zhu, LFsWang, LaingKe, Michael Yuan, Nicholas Zhan, 华德禹, O3Ol, Rui Li, Shen-Ta Hsieh, Shreyas Atre, Sylveon, TheLightRunner, Vaniot, Vinson, 罗泽轩, Xin Liu, Yi Huang, YiYing He, YoungLH, abhinandanudupa, border1px, eat4toast, hydai, jerbmarx, luckyJ-nj, meoww-bot, mydreamer4134, situ2001, tpmccallum, treeplus, wangyuan249, 王琦
If you want to build from source, please use WasmEdge-0.10.0-alpha.1-src.tar.gz instead of the zip or tarball provided by GitHub directly.
Features:
- WASI
- Added the
sock_getsockopt
,sock_setsockopt
,sock_getlocaladdr
,sock_getpeeraddr
, andsock_getaddrinfo
host functions for the WASI socket proposal.
- Added the
- Supported the interruptible execution.
- Added the
WasmEdge_Async
struct in WasmEdge C API for the asynchronous execution.- Added the
WasmEdge_AsyncWait
API for waiting an asynchronous execution. - Added the
WasmEdge_AsyncWaitFor
API for waiting an asynchronous execution with timeout. - Added the
WasmEdge_AsyncCancel
API for canceling an asynchronous execution. - Added the
WasmEdge_AsyncGetReturnsLength
API for waiting and getting the return value length of asynchronous execution. - Added the
WasmEdge_AsyncGet
API for waiting and getting the asynchronous execution results. - Added the
WasmEdge_AsyncDelete
API for destroying theWasmEdge_Async
object.
- Added the
- Added the asynchronous mode execution APIs.
- Added the
WasmEdge_VMAsyncRunWasmFromFile
API for executing WASM from a file asynchronously. - Added the
WasmEdge_VMAsyncRunWasmFromBuffer
API for executing WASM from a buffer asynchronously. - Added the
WasmEdge_VMAsyncRunWasmFromASTModule
API for executing WASM from anWasmEdge_ASTModuleContext
asynchronously. - Added the
WasmEdge_VMAsyncExecute
API for invoking a WASM function asynchronously. - Added the
WasmEdge_VMAsyncExecuteRegistered
API for invoking a registered WASM function asynchronously.
- Added the
- Added the option for timeout settings of the AOT compiler.
- Added the
WasmEdge_ConfigureCompilerSetInterruptible
API for setting the interruptibility of the AOT compiler. - Added the
WasmEdge_ConfigureCompilerIsInterruptible
API for getting the interruptibility of the AOT compiler.
- Added the
- Added the
- Supported the WASM
multi-memories
proposal.- Added the
WasmEdge_Proposal_MultiMemories
for the configuration in WasmEdge C API. - Users can use the
--enable-multi-memory
to enable the proposal inwasmedge
andwasmedgec
tools.
- Added the
- Enabled the gas limitation of the
wasmedge
CLI.- Users can use the
--gas-limit
to assign the limitation of costs.
- Users can use the
- Beautified and colorized the WasmEdge CLI help information.
Fixed issues:
- Fixed the memory leak in function instances.
- Reduced the memory usage of the instruction class.
- Fixed the return value of the
fread
andfwrite
WASI functions on Windows.
Refactor:
- Used
assumingUnreachable
instead of__builtin_unreachable
to help the compiler to generate better codes. - Updated the order of the members in the proposal enumeration.
- Refactored the instruction class for reducing the memory usage.
- Refactored the
WasmEdge::BlockType
into a struct. - Categorized the members of the instruction class into a union.
- Refactored the
Documentations:
- Added the build-on-Windows-10 documentation.
- Added the Reference Book.
- Updated the Release process.
Tests:
- Handled the tests for the 32-bit platforms.
- Added the spec tests for the
multi-memories
proposal. - Added the test cases for
getaddrinfo
host function. - Added the interruptible execution tests.
- Added the unit tests of async APIs.
Misc:
- Updated the
blake3
library to1.2.0
. - Added the copyright text.
- Fixed the coding style of the comments.
- Added the Windows installer release CI.
- Added the aarch64 Android support based on r23b.
- Added the Android example for WasmEdge C API.
Thank all the contributors that made this release possible!
2021, Antonio Yang, AvengerMoJo, Hanged Fish, Harinath Nampally, KernelErr, Michael Yuan, MileyFu, O3Ol, Saksham Sharma, Shen-Ta Hsieh(BestSteve), Shreyas Atre, SonOfMagic, Stephan Renatus, Sven Pfennig, Vaughn Dice, Xin Liu, Yi, Yi-Ying He, Yukang Chen, ZefengYu, ZhengX, alabulei1, alittlehorse, baiyutang, 董哲, hydai, javadoors, majinghe, meoww-bot, pasico, peterbi, villanel, wangshishuo, wangyuan249, wby, wolfishLamb, 王琦
If you want to build from source, please use WasmEdge-0.9.1-src.tar.gz instead of the zip or tarball provided by GitHub directly.
Breaking changes:
- Turned on the
SIMD
proposal by default.- The
WasmEdge_ConfigureContext
will turn on theSIMD
proposal automatically. - Users can use the
--disable-simd
to disable theSIMD
proposal inwasmedge
andwasmedgec
.
- The
- For better performance, the Statistics module is disabled by default.
- To enable instruction counting, please use
--enable-instruction-count
. - To enable gas measuring, please use
--enable-gas-measuring
. - To enable time measuring, please use
--enable-time-measuring
. - For the convinence, use
--enable-all-statistics
will enable all available statistics options.
- To enable instruction counting, please use
wasmedgec
AOT compiler tool behavior changes.- For the output file name with extension
.so
,wasmedgec
will output the AOT compiled WASM in shared library format. - For the output file name with extension
.wasm
or other cases,wasmedgec
will output the WASM file with adding the AOT compiled binary in custom sections.wasmedge
runtime will run in AOT mode when it executes the output WASM file.
- For the output file name with extension
- Modulized the API Headers.
- Moved the API header into the
wasmedge
folder. Developers should include thewasmedge/wasmedge.h
for using the WasmEdge shared library after installation. - Moved the enumeration definitions into
enum_errcode.h
,enum_types.h
, andenum_configure.h
in thewasmedge
folder. - Added the
201402L
C++ standard checking if developer includes the headers with a C++ compiler.
- Moved the API header into the
- Adjusted the error code names.
- Please refer to the ErrCode enum definition.
- Renamed the
Interpreter
intoExecutor
.- Renamed the
Interpreter
namespace intoExecutor
. - Moved the headers and sources in the
Interpreter
folder intoExecutor
folder. - Renamed the
Interpreter
APIs and listed below.
- Renamed the
- WasmEdge C API changes.
- Updated the host function related APIs.
- Deleted the data object column in the creation function of
ImportObject
context. - Merged the
HostFunctionContext
intoFunctionInstanceContext
.- Deleted the
WasmEdge_HostFunctionContext
object. Please use theWasmEdge_FunctionInstanceContext
object instead. - Deleted the
WasmEdge_HostFunctionCreate
function. Please use theWasmEdge_FunctionInstanceCreate
function instead. - Deleted the
WasmEdge_HostFunctionCreateBinding
function. Please use theWasmEdge_FunctionInstanceCreateBinding
function instead. - Deleted the
WasmEdge_HostFunctionDelete
function. Please use theWasmEdge_FunctionInstanceDelete
function instead. - Deleted the
WasmEdge_ImportObjectAddHostFunction
function. Please use theWasmEdge_ImportObjectAddFunction
function instead.
- Deleted the
- Added the data object column in the creation function of
FunctionInstance
context. - Instead of the unified data object of the host functions in the same import object before, the data objects are independent in every host function now.
- Deleted the data object column in the creation function of
- Added the WASM types contexts.
- Added the
WasmEdge_TableTypeContext
, which is used for table instances creation. - Added the
WasmEdge_MemoryTypeContext
, which is used for memory instances creation. - Added the
WasmEdge_GlobalTypeContext
, which is used for global instances creation. - Added the member getter functions of the above contexts.
- Added the
- Updated the instances creation APIs.
- Used
WasmEdge_TableTypeContext
for table instances creation.- Removed
WasmEdge_TableInstanceGetRefType
API. - Developers can use the
WasmEdge_TableInstanceGetTableType
API to get the table type instead.
- Removed
- Used
WasmEdge_MemoryTypeContext
for memory instances creation.- Added
WasmEdge_MemoryInstanceGetMemoryType
API.
- Added
- Used
WasmEdge_GlobalTypeContext
for global instances creation.- Removed
WasmEdge_GlobalInstanceGetValType
andWasmEdge_GlobalInstanceGetMutability
API. - Developers can use the
WasmEdge_GlobalInstanceGetGlobalType
API to get the global type instead.
- Removed
- Used
- Refactored for the objects' life cycle to reduce copying.
- Developers should NOT destroy the
WasmEdge_FunctionTypeContext
objects returned fromWasmEdge_VMGetFunctionList
,WasmEdge_VMGetFunctionType
, andWasmEdge_VMGetFunctionTypeRegistered
functions. - Developers should NOT destroy the
WasmEdge_String
objects returned fromWasmEdge_StoreListFunction
,WasmEdge_StoreListFunctionRegistered
,WasmEdge_StoreListTable
,WasmEdge_StoreListTableRegistered
,WasmEdge_StoreListMemory
,WasmEdge_StoreListMemoryRegistered
,WasmEdge_StoreListGlobal
,WasmEdge_StoreListGlobalRegistered
,WasmEdge_StoreListModule
, andWasmEdge_VMGetFunctionList
functions.
- Developers should NOT destroy the
- Renamed the
Interpreter
related APIs.- Replaced
WasmEdge_InterpreterContext
struct withWasmEdge_ExecutorContext
struct. - Replaced
WasmEdge_InterpreterCreate
function withWasmEdge_ExecutorCreate
function. - Replaced
WasmEdge_InterpreterInstantiate
function withWasmEdge_ExecutorInstantiate
function. - Replaced
WasmEdge_InterpreterRegisterImport
function withWasmEdge_ExecutorRegisterImport
function. - Replaced
WasmEdge_InterpreterRegisterModule
function withWasmEdge_ExecutorRegisterModule
function. - Replaced
WasmEdge_InterpreterInvoke
function withWasmEdge_ExecutorInvoke
function. - Replaced
WasmEdge_InterpreterInvokeRegistered
function withWasmEdge_ExecutorInvokeRegistered
function. - Replaced
WasmEdge_InterpreterDelete
function withWasmEdge_ExecutorDelete
function.
- Replaced
- Refactored for statistics options
- Renamed
WasmEdge_ConfigureCompilerSetInstructionCounting
toWasmEdge_ConfigureStatisticsSetInstructionCounting
. - Renamed
WasmEdge_ConfigureCompilerSetCostMeasuring
toWasmEdge_ConfigureStatisticsSetCostMeasuring
. - Renamed
WasmEdge_ConfigureCompilerSetTimeMeasuring
toWasmEdge_ConfigureStatisticsSetTimeMeasuring
. - Renamed
WasmEdge_ConfigureCompilerGetInstructionCounting
toWasmEdge_ConfigureStatisticsGetInstructionCounting
. - Renamed
WasmEdge_ConfigureCompilerGetCostMeasuring
toWasmEdge_ConfigureStatisticsGetCostMeasuring
. - Renamed
WasmEdge_ConfigureCompilerGetTimeMeasuring
toWasmEdge_ConfigureStatisticsGetTimeMeasuring
.
- Renamed
- Simplified the WASI creation and initialization APIs.
- Removed the
Dirs
andDirLen
parameters in theWasmEdge_ImportObjectCreateWASI
. - Removed the
Dirs
andDirLen
parameters in theWasmEdge_ImportObjectInitWASI
.
- Removed the
- Updated the host function related APIs.
Features:
- Applied the old WebAssembly proposals options (All turned on by default).
- Developers can use the
disable-import-export-mut-globals
to disable the Import/Export mutable globals proposal inwasmedge
andwasmedgec
. - Developers can use the
disable-non-trap-float-to-int
to disable the Non-trapping float-to-int conversions proposal inwasmedge
andwasmedgec
. - Developers can use the
disable-sign-extension-operators
to disable the Sign-extension operators proposal inwasmedge
andwasmedgec
. - Developers can use the
disable-multi-value
to disable the Multi-value proposal inwasmedge
andwasmedgec
.
- Developers can use the
- New WasmEdge C API for listing imports and exports from AST module contexts.
- Developers can query the
ImportTypeContext
andExportTypeContext
from theASTModuleContext
. - New object
WasmEdge_ImportTypeContext
. - New object
WasmEdge_ExportTypeContext
. - New AST module context functions to query the import and export types.
WasmEdge_ASTModuleListImportsLength
function can query the imports list length from an AST module context.WasmEdge_ASTModuleListExportsLength
function can query the exports list length from an AST module context.WasmEdge_ASTModuleListImports
function can list all import types of an AST module context.WasmEdge_ASTModuleListExports
function can list all export types of an AST module context.
- New import type context functions to query data.
WasmEdge_ImportTypeGetExternalType
function can get the external type of an import type context.WasmEdge_ImportTypeGetModuleName
function can get the import module name.WasmEdge_ImportTypeGetExternalName
function can get the import external name.WasmEdge_ImportTypeGetFunctionType
function can get the function type of an import type context.WasmEdge_ImportTypeGetTableType
function can get the table type of an import type context.WasmEdge_ImportTypeGetMemoryType
function can get the memory type of an import type context.WasmEdge_ImportTypeGetGlobalType
function can get the global type of an import type context.
- New export type context functions to query data.
WasmEdge_ExportTypeGetExternalType
function can get the external type of an export type context.WasmEdge_ExportTypeGetExternalName
function can get the export external name.WasmEdge_ExportTypeGetFunctionType
function can get the function type of an export type context.WasmEdge_ExportTypeGetTableType
function can get the table type of an export type context.WasmEdge_ExportTypeGetMemoryType
function can get the memory type of an export type context.WasmEdge_ExportTypeGetGlobalType
function can get the global type of an export type context.
- For more details of the usages of imports and exports, please refer to the C API documentation.
- Developers can query the
- Exported the WasmEdge C API for getting exit code from WASI.
WasmEdge_ImportObjectWASIGetExitCode
function can get the exit code from WASI after execution.
- Exported the WasmEdge C API for AOT compiler related configurations.
WasmEdge_ConfigureCompilerSetOutputFormat
function can set the AOT compiler output format.WasmEdge_ConfigureCompilerGetOutputFormat
function can get the AOT compiler output format.WasmEdge_ConfigureCompilerSetGenericBinary
function can set the option of AOT compiler generic binary output.WasmEdge_ConfigureCompilerIsGenericBinary
function can get the option of AOT compiler generic binary output.
- Provided install and uninstall script for installing/uninstalling WasmEdge on linux(amd64 and aarch64) and macos(amd64 and arm64).
- Supported compiling WebAssembly into a new WebAssembly file with a packed binary section.
- Supported the automatically pre-open mapping with the path name in WASI.
Fixed issues:
- Refined the WasmEdge C API behaviors.
- Handle the edge cases of
WasmEdge_String
creation.
- Handle the edge cases of
- Fixed the instruction iteration exception in interpreter mode.
- Forcely added the capacity of instruction vector to prevent from connection of instruction vectors in different function instances.
- Fixed the loader of AOT mode WASM.
- Checked the file header instead of file name extension when loading from file.
- Showed the error message when loading AOT compiled WASM from buffer. For AOT mode, please use the universal WASM binary.
- Fixed the zero address used in AOT mode in load manager.
- Fixed the loading failed for the AOT compiled WASM without intrinsics table.
- Fixed the
VM
creation issue.- Added the loss of intrinsics table setting when creating a VM instance.
- Fixed wasi-socket issues.
- Support wasi-socket on MacOS.
- Remove the port parameter from
sock_accept
.
Refactor:
- Refined headers inclusion in all files.
- Refactor the common headers.
- Removed the unnecessary
genNullRef()
. - Merged the building environment-related definitions into
common
. - Merged the
common/values.h
intocommon/types.h
. - Separated all enumeration definitions.
- Removed the unnecessary
- Refactored the AST nodes.
- Simplified the AST nodes definitions into header-only classes.
- Moved the binary loading functions into
loader
. - Updated the
validator
,executor
,runtime
,api
, andvm
for the AST node changes.
- Refactored the runtime objects.
- Used
AST::FunctionType
,AST::TableType
,AST::MemoryType
, andAST::GlobalType
for instance creation and member handling. - Removed
Runtime::Instance::FType
and usedAST::FunctionType
instead. - Added routines to push function instances into import objects.
- Removed the exported map getter in
StoreManager
. Used the getter fromModuleInstance
instead. - Added the module name mapping in
StoreManager
.
- Used
- Refactored the VM class.
- Returned the reference to function type instead of copying when getting the function list.
- Returned the vector of return value and value type pair when execution.
- Updated the include path for rust binding due to the API headers refactoring.
Documentations:
- Updated the
wasmedge
commands in the Run and SIMD documentation - Updated the examples in the C API documentation.
- Updated the examples in the host function documentation.
- Updated the examples in the external reference documentation.
Bindings:
- Move rust crate from root path to
bindings/rust
.
Tests:
- Updated the core test suite to the newest WASM spec.
- Updated and fixed the value comarison in core tests.
- Added
ErrInfo
unit tests. - Added instruction tests for turning on/off the old proposals.
- Moved and updated the
AST
unit tests intoloader
. - Moved and updated the
Interpreter
tests intoExecutor
folder. - Added the unit tests for new APIs.
- Applied the WasmEdge C API in the
ExternRef
tests.
Misc:
- Enabled GitHub CodeSpaces
- Added
assuming
forassert
checking to help compiler to generate better codes.
Thank all the contributors that made this release possible!
2021, actly, alabulei1, Alex, Antonio Yang, Ashutosh Sharma, Avinal Kumar, blackanger, Chojan Shang, dm4, eee4017, fossabot, hydai, Jayita Pramanik, Kenvi Zhu, luishsu, LuisHsu, MaazKhan711635, Michael Yuan, MileyFu, Nick Hynes, O3Ol, Peter Chang, robnanarivo, Shen-Ta Hsieh, Shreyas Atre, slidoooor, Sylveon, Timothy McCallum, Vikas S Shetty, vincent, Xin Liu, Yi Huang, yiying, YiYing He, Yona, Yukang, 牟展佑
If you want to build from source, please use WasmEdge-0.9.0-src.tar.gz instead of the zip or tarball provided by GitHub directly.
Features:
- WASI:
- Supported WASI on macOS(Intel & M1).
- Supported WASI on Windows 10.
- Supported WASI Socket functions on Linux.
- C API:
- Supported 32-bit environment.
- Added the static library target
libwasmedge_c.a
(OFF
by default). - Added the
ErrCode
to C declarations. - Added the API about converting
WasmEdge_String
to C string. - Added the API to get data pointer from the
WasmEdge_MemoryInstanceContext
.
- AOT:
- Added
--generic-binary
to generate generic binaries and disable using host features.
- Added
- Multi platforms:
- Enabled Ubuntu 20.04 x86_64 build.
- Enabled Ubuntu 21.04 x86_64 build.
- Enabled manylinux2014 aarch64 build.
- Enabled Ubuntu 21.04 arm32 build.
- Rust supports:
- Added the
wasmedge-sys
andwasmedge-rs
crates. - Added the wrapper types to rust.
- Added the
- Removed binfmt support.
Fixed issues:
- Ensured every platform defines is defined.
- Disabled blake3 AVX512 support on old platforms.
- Avoided vector ternary operator in AOT, which is unsupported by clang on mac.
- The preopen should be
--dir guest_path:host_path
. - Fixed usused variables error in API libraries when AOT build is disabled.
- Fixed the WASI function signature error.
wasi_snapshot_preview1::path_read_link
- Fixed the signature error with the lost read size output.
- Added the
Out
comments for parameters with receiving outputs.
wasi_snapshot_preview1::path_filestat_set_times
- Corrected the time signature to the
u64
.
- Corrected the time signature to the
Misc:
- Changed all CMake global properties to target specified properties.
- Added namespace to all cmake options.
- Added the CMake option
WASMEDGE_FORCE_DISABLE_LTO
to forcibly disable link time optimization (OFF
by default).- WasmEdge project enables LTO by default in Release/RelWithDeb build. If you would like to disable the LTO forcibly, please turn on the
WASMEDGE_FORCE_DISABLE_LTO
option.
- WasmEdge project enables LTO by default in Release/RelWithDeb build. If you would like to disable the LTO forcibly, please turn on the
- Installed
dpkg-dev
in docker images to enabledpkg-shlibdeps
when creating the deb release.
Refactor:
- Refactored the WASI VFS architecture.
- Simplified the memory indexing in validator.
- Renamed the file names in interpreter.
- Replaced the instances when registering host instances with existing names.
Documentations:
- Added the Quick Start Javascript document.
- Added the Use Cases document.
- Fixed the wrong
printf
type in the C API document.
Tests:
- Added wasi-test for testing basic WASI interface
- Added C API unit tests.
- Added the
WasmEdge_String
copy tests. - Added the
WasmEdge_MemoryInstanceContext
get data pointer tests.
- Added the
- Removed unnecessary Wagon and Ethereum tests.
Features:
- Exported new functions in C API to import the
wasmedge_process
module.WasmEdge_ImportObjectCreateWasmEdgeProcess()
can create and initialize thewasmedge_process
import object.WasmEdge_ImportObjectInitWasmEdgeProcess()
can initialize the givenwasmedge_process
import object.
- Exported new AOT compiler configuration setting C APIs.
- Users can set the options about AOT optimization level, dump IR, and instruction counting and cost measuring in execution after compilation to the AOT compiler through C APIs.
- Updated error codes according to the newest test suite of WebAssembly.
- Applied the correct error message when trapping in the loading phase.
- Implemented the UTF-8 decoding in file manager.
- Implemented the basic name section parsing in custom sections.
- Added memory-mapped file helper,
MMap
for Linux.- Used
mmap
withMAP_NORESERVE
for overcommited allocation. - Used
MMap
for file loading. - Merged
FileMgr
variants into one class.
- Used
Fixed issues:
- Applied the UTF-8 decoding.
- Check the UTF-8 validation in custom sections, export sections, and import sections.
- Detected the redundant sections in modules.
- Fixed this issue hence the sections rather than the custom section should be unique.
- Corrected the logging of data offset in the file while trap occurred in the loading phase.
- Updated to the correct offset according to the refactored file manager.
Refactor:
- Updated manylinux* dockerfiles.
- Upgraded gcc to
11.1.0
. - Upgraded llvm to
11.1.0
. - Upgraded boost to
1.76
. - Moved environment variables to Dockerfile.
- Used helper scripts to build.
- Upgraded gcc to
- Moved the options of the AOT compiler into the
Configure
class. - Refactor the file manager for supporting the
Unexpected end
loading malformed test cases.- Added the
setSectionSize
function to specify the reading boundary before the end of the file.
- Added the
- Adjusted build scripts.
- Set job pools for ninja generator.
- Checked for newer compilers in
std::filesystem
. - Adjusted library dependency.
Documentations:
- Updated the WasmEdge ecosystem document.
- Renamed the
SSVM
related projects intoWasmEdge
.
- Renamed the
Tools:
- Updated the
wasmedgec
AOT compiler tool for API changes of theConfigure
.
Tests:
- Turn on the
assert_malformed
tests for WASM binary in spec tests.- Apply the interpreter tests.
- Apply the AOT tests.
- Apply the API tests.
- Updated the API unit tests for the new
Configure
APIs. - Updated the AST and loader unit tests.
- Added test cases of file manager to raise the coverage.
- Added test cases of every AST node to raise the coverage.
Breaking changes:
- Renamed this project to
WasmEdge
(formerlyssvm
).- The tool
wasmedge
is the WebAssembly runtime (formerlyssvm
). - The tool
wasmedgec
is the WebAssembly AOT compiler (formerlyssvmc
).
- The tool
- Renamed the CMake options.
- Option
BUILD_AOT_RUNTIME
(formerlySSVM_DISABLE_AOT_RUNTIME
andOFF
by default), which isON
by default, is for enabling the compilation of the ahead-of-Time compiler.
- Option
- Turned on the
reference-types
andbulk-memory-operations
proposals by default in tools.- Users can use the
disable-bulk-memory
to disable thebulk-memory-operations
proposal inwasmedge
andwasmedgec
. - Users can use the
disable-reference-types
to disable thereference-types
proposal inwasmedge
andwasmedgec
.
- Users can use the
Features:
- Added
WasmEdge
C API and shared library.- Developers can include the
wasmedge.h
and link thelibwasmedge_c.so
for compiling and runningWASM
. - Add CMake option
BUILD_SHARED_LIB
to enable compiling the shared library (ON
by default). - The APIs about the ahead-of-time compiler will always return failed if the CMake option
BUILD_AOT_RUNTIME
is set asOFF
.
- Developers can include the
- Added
common/version.h
: define the package version fromcmake
. - Updated
Configure
.- Turned on the
reference-types
andbulk-memory-operations
proposals by default. - Supports memory page limitation for limiting the largest available pages in memory instances.
- Turned on the
- Added a function in
Log
to enable the debug logging level. - Added global options with subcommands into
PO
. - Added an API into
StoreManager
to list the registered module names. - Added an API into
TableInstance
to grow table withref.null
. - Updated
SIMD
implementation with the newest SIMD proposal. - Supported
AOT
compile cache.- Added
blake3
hash calculator to calculate hash for caching files.
- Added
- Added an API into
VM
for loadingWASM
module fromAST::Module
.
Fixed issues:
- Adjusted and fixed cmake issues.
- Used
CMAKE_CURRENT_SOURCE_DIR
in this project for supporting to be as a submodule. - Assigned a default version number (
0.0.0-unreleased
) when getting the version from git describe failed. - Fixed
boost
include variable names.
- Used
- Fixed
WASI
poll_oneoff
.- Allow
SIGINT
andSIGTERM
while waiting for the file descriptor and checkSIGTERM
afterepoll
.
- Allow
- Rearranged variables for CPU feature detection in
AOT
compiler. - Fixed
Validator
errors.- Fixed the error in
br_table
for pushing wrong types into validation stack. - Fixed the error in
global_set
for iterating illegal indices.
- Fixed the error in
- Fixed
Interpreter
errors.- Fixed the failed case that not returned the errors except
ErrCode::ExecutionFailed
when invoking the host functions. - Not to return success when the
ErrCode::Terminated
occurs.
- Fixed the failed case that not returned the errors except
- Fixed the unmapping size in the destructor of
MemoryInstance
.
Refactor:
- Merged the
CostTable
class intoStatistics
.- Simplified the API for getting and setting cost table.
- Initialized the costs for every instruction as
1
by default.
- Merged the
Proposal
andHostRegistration
configurations intoConfigure
.- Adjusted the
Proposal
order.
- Adjusted the
- Applied the copy of
Configure
inLoader
,Validator
,Interpreter
, andVM
instead of passing by reference. - Refactored the functions in the
StoreManager
.- Updated the templates of functions to register instances.
- Forwarded the parameters to reduce moving.
- Refactored and used the
std::variant
to save space inFunctionInstance
. - Applied function parameter type checking when invoking a wasm function in
Interpreter
. - Set the module instantiation as the anonymous active module in
Interpreter
. - Added the
const
quantifier inget
andload
data functions ofMemoryInstance
.
Documentations:
- Added release process document.
- Added contributing document.
- Added code of conduct document.
- Added roadmap document.
- Updated external references document for the VM API changes.
- Updated the WasmEdge ecosystem document.
- Added scripts to generate witx documents.
- Cherry-pick
wasi_ephemeral_sock
APIs fromwasi_snapshot_preview1
.
- Cherry-pick
Tools:
wasmedge
: WebAssembly runtime (formerlyssvm
)- Turned on the
bulk-memory-operations
andreference-types
proposals by default.- Users can use the
disable-bulk-memory
to disable thebulk-memory-operations
proposal. - Users can use the
disable-reference-types
to disable thereference-types
proposal.
- Users can use the
- Updated for the
vm
API changes. - Return the exit code in command mode in forced terminated occurs in
WASI
.
- Turned on the
wasmedgec
: WebAssembly AOT compiler (formerlyssvmc
)- Turned on the
bulk-memory-operations
andreference-types
proposals by default.- Users can use the
disable-bulk-memory
to disable thebulk-memory-operations
proposal when compiling. - Users can use the
disable-reference-types
to disable thereference-types
proposal when compiling.
- Users can use the
- Turned on the
Tests:
- Added AOT cache tests.
- Added memory page size limit tests.
- Updated the WASM spec tests.
- Updated WasmEdge-unittest and check out the newest test suites.
- Updated the
SIMD
test data. - For the
WasmEdge 0.8.0
, we use thewasm-dev-0.8.0
tag for the core tests and theSIMD
proposal tests.
- Updated the
- Adjusted the code architecture for core testing.
- Combined the duplicated functions into the
SpecTest
class. - Split out the
spectest
host function definitions for importing repeatedly.
- Combined the duplicated functions into the
- Updated WasmEdge-unittest and check out the newest test suites.
- Added
WasmEdge
C API tests.- Added unit tests for APIs in the
WasmEdge
shared library. - Applied WASM core tests for the
WasmEdge
shared library in both usingInterpreter
APIs andVM
APIs.
- Added unit tests for APIs in the
Features:
- Updated the
easylogging++
to v9.97.0.- Disabled the file logging.
- Initial supported the
WASI
host functions for old system (CentOS 6).- Updated the
WASI
subscription insterface. - Used
pipe
for oldGLIBC
.
- Updated the
- Added supporting of subcommand in
PO
. - Provided options to toggle white lists of
ssvm_process
inssvm
tool.--allow-command COMMAND
to add a command into white list inssvm_process
host functions.--allow-command-all
to allow all commands inssvm_process
host functions.
- Added the documentation of SSVM ecosystem.
Fixed issues:
- Fixed the loading issues in
file manager
.- Refined performance and added error handling in
readBytes
. - Fixed
LEB128
andULEB128
decoding and error codes.
- Refined performance and added error handling in
- Fixed security issues of executing commands in
ssvm_process
host functions.- Managed a white list for command execution.
Refactor:
- Used vector of instance instead of
std::unique_ptr
in AST nodes. - Merged all instruction node classes.
- Added
OpCode::Else
instruction. - Serialized the instruction sequences. Move out the block body of
If
,Block
, andLoop
instructions.
- Added
- Applied the proposal configuration checking in the loader phase.
- Moved the
OpCode
and value type validation of proposal configuration checking to loader phase. - Fixed the logging message.
- Added helper functions to clean codes of logging.
- Moved the
- Refactored the validator for instruction serialization.
- Removed the duplicated proposal configuration checking done at the loader phase.
- Serialized the instruction iterating when validating.
- Refactored the
Label
instack manager
.Label
will record thefrom
instruction iterator that causes entering this label.- Removed the
next
instruction getter instack manager
.
- Refactored the instruction iterating mechanism in
interpreter
.- Used the
program counter
to iterate and execute the instructions. - Merged all switch cases of
OpCode
.
- Used the
- Moved out
AOT
related proxy codes and helper functions ininterpreter
to dependent files.
Tools:
- Added
binfmt
supporting forWASM
interpreter.- Please use the tool
tools/ssvm/ssvm-static
with the same arguments asssvm
.
- Please use the tool
- Provided
manylinux*
support for legacy operatoring systemsmanylinux1
is based on CentOS 5.9manylinux2010
is based on CentOS 6manylinux2014
is based on CentOS 7
Tests:
- Updated file manager tests for
LEB128
andULEB128
decoding. - Updated AST tests for refactored AST nodes.
- Updated instruction tests for refactored instruction nodes.
- Added
PO
tests. - Added
ssvm_process
tests.
Features:
- Added a cmake option to toggle the compilation of
ssvm
andssvmr
tools.- This option is
ON
in default. cmake -DBUILD_TOOLS=Off
to disable the compilation oftools/ssvm
folder when building.
- This option is
- Applied the Fixed-width SIMD proposal.
- Please refer to the SIMD document for more details.
- Provided options to toggle proposals for the compiler and runtime.
--enable-bulk-memory
to enable bulk-memory operations proposal.--enable-reference-types
to enable reference types proposal.--enable-simd
to enable SIMD proposal.--enable-all
to enable all supported proposals.
- Supported
roundeven
intrinsic in LLVM 11.
Fixed issues:
- Used
std::filesystem::path
for all paths. - Interpreter
- Fixed
call_indirect
table index checking in the validation phase. - Removed redundant
reinterpret_cast
in interpreter.
- Fixed
- AOT compiler
- Forced unalignment in load and store instructions in AOT.
- Not to report error in
terminated
case.
- WASI
- Updated size of
linkcount
tou64
.
- Updated size of
Refactor:
- Added
uint128_t
intoSSVM::ValVariant
.- Added number type
v128
.
- Added number type
- Added
SSVM::RefVariant
for 64bit-width reference variant. - Refactor AOT for better performance.
- Added code attribute in AOT to speed up normal execution.
- Rewrote element-wise boolean operators.
- Used vector type in stack and function for better code generation.
- Rewrite
trunc
instructions for readability.
Tools:
- Deprecated
ssvmr
tool, since the functionalities are the same asssvm
tool.- Please use the tool
tools/ssvm/ssvm
with the same arguments.
- Please use the tool
- Combined the tools folder. All tools in
tools/ssvm-aot
are moved intotools/ssvm
now.
Tests:
- Added Wasi test cases.
- Added test cases for
args
functions. - Added test cases for
environ
functions. - Added test cases for
clock
functions. - Added test cases for
proc_exit
andrandom_get
.
- Added test cases for
- Updated test suites and categorized them into proposals.
- Added SIMD proposal test suite.
- Official test suite
- SSVM unit test in proposals
Features:
- Applied the reference types and bulk memory operations proposal for AOT.
- Support LLVM 11.
Refactor:
- Refactor symbols in AOT.
- Removed the symbols in instances.
- Added instrinsics table for dynamic linking when running a compiled wasm.
- Merged the program counter into
stack manager
. - Added back the
OpCode::End
instruction. - Refactored the validator workflow of checking expressions.
- Used
std::bitset
for VM configuration. - Used
std::array
for cost table storage. - Conbined
include/support
intoinclude/common
.- Merged
support/castng.h
intocommon/types.h
. - Merged
Measurement
intoStatistics
. - Renamed
support/time.h
intocommon/timer.h
. Used standard steady clock instead. - Renamed
common/ast.h
intocommon/astdef.h
. - Moved
common/ast/
toast/
. - Removed the
SSVM::Support
namespace.
- Merged
Tests:
- Applied new test suite of the reference types and bulk memory operation proposal for AOT.
Features:
- Applied the reference types and bulk memory operations proposal.
- Added the definition of reference types.
- Added helper functions for function index to
funcref
conversions. - Added helper functions for reference to
externref
conversions.
- Added helper functions for function index to
- Added the following new instructions.
- Reference instructions:
- ref.null
- ref.is_null
- ref.func
- Table instructions:
- table.get
- table.set
- table.init
- elem.drop
- table.copy
- table.grow
- table.size
- table.fill
- Memory instructions:
- memory.init
- data.drop
- memory.copy
- memory.fill
- Parametric instructions:
- select t
- Reference instructions:
- Updated implementation of the following instructions.
- call_indirect
- select
- Applied the new definition of
data count section
,data segment
, andelement segment
. - Applied validation for
data segment
andelement segment
. - Added the
data instance
andelement instance
. - Applied the new instantiation flow.
- Added the definition of reference types.
Refactor:
- Completed the enumeration value checking in the loading phase.
- Updated the value type definition.
ValType
is updated to includeNumType
andRefType
.NumType
is updated to includei32
,i64
,f32
, andf64
.RefType
is updated to includefuncref
andexternref
, which replaced theElemType
.
- Updated error codes according to the test suite for the reference types proposal.
- Extended validation context for recording
datas
,elements
, andrefs
. - Updated runtime structures.
- Fixed minimum pages definition in
memory instance
. - Applied new definitions of
table instance
. - Extended
module instance
for placingdata instance
andelement instance
. - Extended
store
for owningdata instance
andelement instance
.
- Fixed minimum pages definition in
- Updated template typename aliasing in
interpreter
.
Tests:
- Applied new test suite for the proposal.
- Supported
funcref
andexternref
types parameters in core tests. - Added
externref
tests for testing object binding and samples.- Please see the document for detail.
Features:
- Added gas and instruction count measurement in AOT.
Features:
- Supported loop parameters in AOT.
- Added optimization level settings in the AOT compiler.
Refactor:
- Applied page based allocation in
memory instance
, instead of preserving 4G at once.
Fixed Issues:
- Fixed error marking stdin, stdout, and stderr file descriptor as pre-opened when initializing WASI environment.
- Fixed
ssvm_process
error handling when execution commands.- Print error message when command not found or permission denied.
- Fixed casting of return codes.
Tests:
- Split the core test to helper class for supporting AOT core tests in the future.
This is a bug-fix release for the ssvm_process component.
Fixed Issues:
- Handle the large size writing to pipe in
ssvm_process
.
Features:
- Add option for dumping LLVM IR in
ssvmc
. - Add
SSVM_Process
configuration.- VM with this option will import
ssvm_process
host modules. ssvm_process
host functions are SSVM extension for executing commands.- This host module is to support wasm compiled from rust with
rust_process_interface_library
crate..
- VM with this option will import
- Turn on
SSVM_Process
configuration in bothssvmr
andssvm
.
Refactor:
- Apply
mprotect
memory boundary checking inmemory instance
.
Fixed Issues:
- Prevent undefined behavior on shift operations in interpreter and file manager.
Features:
- Support WebAssembly reactor mode in both
ssvmr
andssvm
.
Refactor:
- Use
vector
instead ofdeque
inValidator
.
Fixed Issues:
- Fixed cost table to support 2-byte instructions.
- Resolved warnings about signed and unsigned comparing.
- Fixed printing error about hex strings in error messages.
- Corrected memory boundary logging in error messages.
- Ignore
SIGINT
whenssvm
is forced interrupted.
Tests:
- Add ssvm-aot tests.
Tools:
- Updated
ssvm
interpreter.ssvm
provides interpreter mode of executing wasm.- The usage of
ssvm
is the same asssvmr
. - Added
STATIC_BUILD
mode for linking std::filesystem statically.
This is a bug-fix release for the warnings.
Fixed Issues:
- Resolved warnings with compilation flag
-Wall
. - Add
-Wall
flag in CMakeFile.
Refactor:
- Refactored instruction classes for supporting 2-byte instructions.
- Refined corresponding switch cases in validator, interpreter, and AOT.
This is a bug-fix release for the wasi component.
Fixed Issues:
- Change the fd number remap mechanism from static offset to dynamic map.
Features:
- New target support:
- Add aarch64 target support for both ssvm-interpreter and ssvm-aot tools.
- Wasm spec 1.1 support:
- Implement
multi-value return
proposal. - Implement
signed extension
andsaturated convert
instructions.- i32.extend8_s
- i32.extend16_s
- i64.extend8_s
- i64.extend16_s
- i64.extend32_s
- i32.trunc_sat_f32_s
- i32.trunc_sat_f32_u
- i32.trunc_sat_f64_s
- i32.trunc_sat_f64_u
- i64.trunc_sat_f32_s
- i64.trunc_sat_f32_u
- i64.trunc_sat_f64_s
- i64.trunc_sat_f64_u
- Implement
- Wasm spec test suites support:
- Add ssvm-unittest toolkit for integrating wasm spec test suites.
- Enable
assert_invalid
tests
- Wasi support:
- Enable environ variables support:
- add
--env
option for environment variables. - allow developers to append more environment variables from a given env list, e.g.
PATH=/usr/bin
,SHELL=ZSH
.
- add
- Enable preopens support:
- add
--dir
option for preopens directories. - allow developers to append more preopens directories from a given dir list, e.g.
/sandbox:/real/path
,/sandbox2:/real/path2
.
- add
- Enable environ variables support:
- New Statistics API:
- With statistics class, developers can get the following information after each execution:
- Total execution time in
us
. (=Wasm instruction execution time
+Host function execution time
) - Wasm instruction execution time in
us
. - Host function execution time in
us
. A host function can be a evmc function likeevmc::storage_get
, a wasi function likerandom_get
, or any customized host function. - Instruction count. (Total executed instructions in the previous round.)
- Total gas cost. (Execution cost by applying ethereum-flavored wasm cost table.)
- Instruction per second.
- Total execution time in
- With statistics class, developers can get the following information after each execution:
- Validator:
- Support Wasm 1.1 instructions validation.
- Support blocktype check which is used in multi-value return proposal.
- Logging system:
- Support 2-byte instructions.
Refactor:
- Remove redundant std::move in return statements.
Fixed Issues:
- Fix std::filesystem link issue in ssvm-aot tool.
- Fix
-Wreorder
warnings in errinfo.h - Fix several implementation errors in wasi functions.
Tools:
- CI: Update base image from Ubuntu 18.04 to Ubuntu 20.04
Features:
- Error Logging System
- Add information structures to print information when an error occurs.
- Apply error logging in every phase.
Refactor:
- Internal tuple span mechanism
- Apply C++20
span
features instead ofstd::vector &
.
- Apply C++20
- Internal string passing mechanism
- Apply C++17
std::string_view
for passing strings.
- Apply C++17
- Move enumeration definitions
- Add string mapping of types, instructions, and AST nodes.
- Move enumerations to SSVM top scope.
- Memory instance passing in host functions
- Pass pointer instead of reference of memory instance to allow
nullptr
.
- Pass pointer instead of reference of memory instance to allow
Fixed Issues:
- Instantiation Phase
- Fixed boundary checking bugs when initializing data sections.
- Function invocation
- Add dummy frame when invoking function from VM.
Features:
- Building System
- Add CMake option
SSVM_DISABLE_AOT_RUNTIME
to disable building ahead of time compilation mode.
- Add CMake option
- Wasm AST
- Add support of multiple partitions of sections in wasm module.
- AOT
- Add SSVM-AOT tools.
Tools:
- SSVM-AOT
- Enable to compile and run separately.
- Enable to run compiled module and normal module with the interpreter.
Refactor:
- Internal tuple span mechanism
- Apply C++20
span
features in host functions.
- Apply C++20
- Internal error handling mechanism
- Apply non-exception version of
expected
.
- Apply non-exception version of
- Refine CMake files
- Update file copying macro in
CMakeFile
to support recursively copying. - Refine include paths and dependencies in every static library.
- Modularize static libraries to be included as submodules easier.
- Update file copying macro in
- Interpreter
- Use function address in
Store
for invoking instead of the exported function name. - Support invocation of a host function.
- Use function address in
- Host functions
- Return
Expect
instead ofErrCode
in host functions. - Return function return values in
Expect
class rather than in function parameter.
- Return
- New VM APIs
- Add routine to invoke a function of registered and named module in
Store
. - Removed old
executor
and useinterpreter
instead. - Renamed
ExpVM
toVM
and removed the old one. - Apply new
VM
to all tools.
- Add routine to invoke a function of registered and named module in
- AOT
- Integrated into new VM API and HostFunctions
- Generate minimum machine code for
nearestint
instructions.
Fixed Issues:
- Loader
- Add checking Wasm header and version when loading.
- Validation
- Fix
export section
checking to support""
function name. - Fix type transforming when function invocation and return.
- Fix
- Runtime Data Structure
- Fix the wrong table resizing when initialization in
table instance
.
- Fix the wrong table resizing when initialization in
- Interpreter
- Instantiation
- Fix instantiation steps of
data
andelement sections
. - Check
memory
andtable instances
boundary according to Wasm spec. - Not to replace data in
memory
andtable instances
until all checkings were done.
- Fix instantiation steps of
- Engine
- Fix wrong arity assignment in
loop
instruction. - Fix wrong answer issue in
trunc
andclz
instructions. - Fix logic of
div
instruction in both integer and floating-point inputs. - Fix wrong handling of
NaN
operand inmin
andmax
instructions. - Add dummy frame before function invocation according to Wasm spec.
- Add memory boundary checking when loading value in
memory
instructions.
- Fix wrong arity assignment in
- Instantiation
- AOT
- Fix wrong handling of the minimum operand in
mod
instructions. - Fix wrong handling of
NaN
operand inmin
andmax
instructions.
- Fix wrong handling of the minimum operand in
Tests:
- Remove
ssvm-evmc
tests. - (Experimental) Add unit tests for C++
span
feature.
Deprecated:
- SSVM-Proxy is removed.
- SSVM-EVMC is removed.
- SSVM-EVMC is separated from this project as an independent repository.
SSVM 0.5.1 is a bug-fix release from 0.5.0.
- Issues:
- Set correct reset timing of the interpreter.
- Fix data copying in table instance in the instantiation phase.
- Fix label popping in stack manager.
Features:
- Ethereum environment interface
- Implemented all EEI functions.
- For more details, please refer to Ewasm functions design document
- Validation
- Completed validations for wasm sections.
- Completed checkings in const expressions.
- Runtime Wasm module registering
- WASM modules can be registered into
Store
for importing. - Host modules, which may contain host functions and
global
s, can be registered intoStore
.
- WASM modules can be registered into
- (Experimental) New VM APIs
- New VM is refactoring from legacy’s VM and provides a rapidly running process for WASM.
- Export
Store
for external access.
- Node.js addon
- Integrate SSVM with Node.js Addon API.
- SSVM Node.js addon is separated from this project as an independent repository.
Refactor:
- Code structure layout
- Create
common
namespace for cross-component data structures and type definitions. - Extract AST structures from ast to
common
. - Extract duplicate enumerations to
common
. - Collects all error code classes into
common
.
- Create
- Internal error handling mechanism
- Apply C++ p0323r9
expected
features - Add several helper functions for wrapping return values with error code.
- Apply C++ p0323r9
- Wasm loader
- Simplify workflow.
- Take a wasm input and return an
AST
object directly.
- Wasm validator
- Simplify workflow.
- Take an
AST
object and return the results. - Rename
validator/vm
toformchecker
.
- Refine runtime data structure
- Extract
instance
s,host function
s,stack manager
, andstore manager
classes toruntime
folder. - Extract
frame
,label
, andvalue
entry classes intostack manager
. - Delete redundant checks in
stack manager
. All of these checks are verified in the validation stage. - Add
ImportObj
class for handling the host modules registration.
- Extract
- Interpreter
- Create
interpreter
namespace. - Extract
executor
class tointerpreter
. - Add instantiation methods for registering host modules.
- Create
- Host functions
- Create
host
namespace. - Extract
EEI
,Wasi-core
, andONNC
host functions tohost
. - Make host functions construction in host modules.
- Extract
host environment
s fromenvironment manager
to respectivehost module
s.
- Create
- Refactoring from legacy VM.
- Simplify workflow. Provide two approaches for invoking a wasm function.
- All-in-one way: Calling
runWasmFile
can instantiate and invoke a wasm function directly. - Step-by-step way: Calling
loadWasm
,validate
,instantiate
,execute
sequentially can make developers control the workflow manually.
- All-in-one way: Calling
- External access APIs
- Access
export
ed wasm functions. - Export
Store
. - Export measurement data class including instruction counter, timer, and cost meter.
- Access
- Provide registration API for wasm modules and host modules.
- Extract
host environment
s ofEEI
andWasi-core
into respectivehost module
s. - Apply experimental VM to
ssvm-proxy
andssvm-evmc
tools.
- Simplify workflow. Provide two approaches for invoking a wasm function.
Tools:
- Remove unused ssvm-evm
ssvm-evm
is replaced byssvm-evmc
.
- (Experimental) Add sub-project
ssvm-aot
ssvm-aot
provides ahead-of-time(AOT) compilation mechanism for general wasm applications.
Tests:
- Remove redundant
ssvm-evm
tests. - (Experimental) Add integration tests for
ssvm-aot
. - (Experimental) Add unit tests for C++
expected
feature. - Move
AST
tests to the test top folder.
Fixed issues:
- Ethereum Environment Interface
- Fix function signatures.
- Return
fail
instead ofrevert
when the execution state isout of gas
. - Handle memory edge case when loading and storing from memory instance.
- Add missing check for evmc flags.
- Set running code to evmc environment.
- Complete import matching when instantiation in the interpreter.
- Fix lost of validation when importing
global
s.
Features:
- Ethereum environment interface implementation
- Add EVMC library.
- Ewasm functions implemented
- Update gas costs of Ewasm functions.
Refactor:
- Host functions:
- Use the template to generate wasm function type of host function body.
- Move function module name and function name to host function class.
Tools:
- Sub-project EVM with evmc
- SSVM-EVMC integrates EVMC and Ethereum Environment Interface(EEI).
- SSVM-EVMC is a shared library for EVMC-compatible clients.
Tests:
- ERC20 contracts for SSVM-EVMC
- Create an example VM for testing.
- Test the following functionalities of ERC20 contracts:
- Deploy ERC20 contract
- Check balance
- Check total supply
- Transfer
- Approve
- Check allowance
Fixed issues:
- Handle empty length of memory in
vm_snapshot
. - Correct error message when execution failed in SSVM proxy mode.
Fixed issues:
- Change the naming style of JSON format in SSVM proxy mode
- Use snake case for the keys of JSON files instead
- Change the arguments and return value formats.
- Add
argument_types
andreturn_types
in input JSON format.
- Add
- Expand home directory path
- Accept ~ in the file path
Features:
- WebAssembly Validation
- Implement the Wasm Validation mechanism. SSVM will validate wasm modules before execution.
- Snapshot and restore execution state
- SSVM provides restore mechanism from the previous execution state.
- SSVM provides a snapshot mechanism to dump the current execution state.
- JSON interface Spec
- Initialize and set up SSVM via input JSON format.
- Retrieve execution results via output JSON format.
Tools:
- Sub-project RPC service proxy mode
- SSVM-PROXY is a component of SSVMRPC service.
- SSVM-PROXY can archive current execution states and serialize these data into output JSON format.
- SSVM-PROXY can restore previous program states from input JSON format.
Features:
- Native Cost Metering
- SSVM provides CostTab for each instruction including Wasm, Wasi, Ewasm.
- With this feature, users can set the cost limit for measuring the execution cost.
- Built-in performance timer
- TimeRecord collects execution time for the performance analysis.
- TimeRecord supports multiple timers.
- SSVM also provides Wasi timer API for developers to customize TimeRecord.
- Multiple Virtual Machine Environment
- Wasm mode: Support general Wasm program.
- Wasi mode: In addition to Wasm mode, this mode contains basic Wasi functions like print.
- QITC mode: In addition to Wasi mode, this mode is designed for ONNC runtime to execute AI models by leveraging Qualcomm Hexagon SDK.
- Ewasm mode: In addition to Wasm mode, this mode is designed for Ethereum flavor WebAssembly.
- Start functions enhancement
- Support start function assignment. This makes users invoke an exported function with a given function name.
- Support start function arguments and return value. This makes users can insert arguments and retrieve result after execution.
- Simple statistics output
- Dump total execution time and instruction per second for benchmarking.
- Print used gas costs for Ewasm mode.
- Print storage and return values.
Tools:
- Sub-project Qualcomm Innovate in Taiwan Challenge(a.k.a QITC) 2019
- SSVM-QITC enables AI model execution by integrating ONNC runtime and Qualcomm Hexagon SDK.
- With this tool, users can run AI model inference within a WebAssembly Virtual Machine.
- Sub-project Ethereum
- SSVM-EVM integrates the Ethereum Environment Interface(EEI) as a WebAssembly extension.
- With this tool, users can run blockchain applications, which are compiled into Ewasm bytecodes.
- Sub-project General Wasi Support
- SSVM tool provides basic Wasi functions support, such as print function.
Features:
- Lexer: Support full wasm bytecode format
- AST: Be able to load a wasm module
- Instantiate: Support wasm module instantiation
Runtime:
- Support Wasi-core functions
- Support Ewasm functions
Test:
- Support ERC20 token contracts