[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-92737":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":16,"starSnapshotCount":16,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},92737,"spacewasm","nasa\u002Fspacewasm","nasa","A flight-compliant WebAssembly interpreter for safety-critical execution","",null,"Rust",463,13,3,6,0,310,53.44,"Apache License 2.0",false,"main",[],"2026-07-22 04:02:07","# SpaceWasm\n\n[![CI](https:\u002F\u002Fgithub.com\u002Fnasa\u002Fspacewasm\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fnasa\u002Fspacewasm\u002Factions\u002Fworkflows\u002Fci.yml)\n[![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fnasa\u002Fspacewasm\u002Fbranch\u002Fmain\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fnasa\u002Fspacewasm)\n\nSpaceWasm is an implementation of the [Wasm 1.0](https:\u002F\u002Fwebassembly.github.io\u002Fspec\u002Fversions\u002Fcore\u002FWebAssembly-1.0.pdf)\nspecification meant to interpret Wasm binary on-board spacecraft. This software comes with two major components:\n\n1. Decoder\u002FValidator:\n\n   Reads the Wasm binary in [chunks](#streaming) and decodes it to an executable form. The decoder will use a fixed\n   amount of memory and can be measured per-Wasm binary using the `spacewasm-check` executable on the ground.\n\n   WebAssembly is validated during the decoding process and does not require another pass of the bytecode.\n\n2. Interpreter:\n\n   A Wasm interpreter that can operate on linear memory and interface with\n   hooks from the [embedding](#embedding).\n\nSpaceWasm does not execute direct WebAssembly bytecode. Wasm bytecode is meant to be small and structured in a way to\nvalidate easily. These properties however make it slow to execute in-place. During the decoding process of Wasm\ninstructions, SpaceWasm converts bytecode into another intermediate representation (IR) which includes properties better\nsuited for interpretation. Read more about the IR in the [specification](src\u002FSPEC.md).\n\n## Requirements\n\nThe requirements of SpaceWasm are levied from similar work produced by [DLR](https:\u002F\u002Fgithub.com\u002FDLR-FT\u002Fwasm-interpreter).\n\nSee [requirements](.\u002FREQUIREMENTS.md).\n\n## Embedding\n\nEmbedding the interpreter refers to instantiating it and providing implementations for the functions that are imported\ninto the module. Typically, the set of functions imported by the module are fixed and should be specified at compile\ntime both for the Wasm module and the embedder.\n\n## Dynamic Allocation\n\nSpaceWasm has a unique dynamic memory allocation model. All of its design choices stem requirements levied by common\nflight-software standards. Dynamic allocation follows the following rules:\n\n1. All allocations occur over a discrete number of fixed size blocks called _pages_.\n2. Deallocation cannot precede allocation.\n3. Sub-regions inside pages cannot grow or shrink, sizes should be fixed ahead of time.\n4. Memory usage must be deterministic.\n5. Any allocation failures must _not_ result in panic.\n\nThe standard Rust [allocation](https:\u002F\u002Fdoc.rust-lang.org\u002Falloc\u002F) does not meet these constraints even with custom\nallocators. To that end, SpaceWasm provides its own data structures that guarantee these properties. You will find these\ndata-structures contain the only usage of `unsafe` Rust semantics.\n\n## Streaming\n\n_Peak_ memory usage is often an important constraint on small systems found on spacecraft. Many Wasm interpreters\nrequire the Wasm binary to be given in one linear blob to the interpreter. This is typically fine for systems where the\nsame regions of memory may be reused for different purposes. Flight software on spacecraft generally assign fixed\nportions of memory for certain purposes. Therefore, requiring the entire Wasm binary to fit into a single chunk of\nmemory is not feasible.\n\nSpaceWasm is highly optimized to reduce peak memory usage and not require deallocation after allocation required for\nstreaming. To this end there are certain [constraints](#interpreter-limitations) imposed on the WebAssembly\nspecification.\n\nSpaceWasm supports decoding and compiling Wasm binary in a single pass via a streaming mechanism. Chunks of the Wasm\nbinary may be provided to the interpreter as they are read\u002Frequested from the filesystem. The stream must provide chunks\nsynchronously.\n\n## Interpreter Limitations\n\nThis Wasm interpreter imposes additional constraints beyond the WebAssembly 1.0 specification to support\nresource-constrained spacecraft environments:\n\n### Module & Store Limits\n\n- **Modules in store**: Maximum 256 modules\n- **Host modules**: Maximum 256 host modules\n- **Function parameters**: Maximum 255 32-bit words\n- **Local variables**: Maximum 65,535 32-bit words total per function\n\n### IR Code Pages\n\n- **Code pages**: Configurable via generic parameter `MAX_PAGES`, typically set at module instantiation\n- **Page size**: 256 16-bit words (512 bytes)\n- **Maximum page address**: 24-bit (16,777,216 pages)\n- **Word offset in page**: 8-bit (0-255)\n\n### Control Flow\n\n- **Nesting depth**: Configurable via generic parameter `MAX_CONTROL_FRAMES` (blocks\u002Floops\u002Fif-else)\n- **Value stack**: Configurable via generic parameter `MAX_STACK_DEPTH`, values per function\n- **Label jumps**: 22-bit signed offset (±2,097,151 instructions)\n- **Stack truncation depth**: Maximum 255 32-bit words per label jump\n\n### Instruction Encoding\n\n- **8-bit or 16-bit indexes**: 0-65,535\n- **8-bit or 32-bit immediate**: 0-254 inline, 255+ extended\n- **8-bit or 64-bit immediate**: 0-254 inline, 255+ extended\n\nThese constraints enable deterministic memory usage and efficient execution in resource-constrained environments while\nmaintaining compatibility with most standard WebAssembly modules.\n\n## Benchmarking\n\nSpaceWasm is tested against the Coremark benchmark to trace performance regression.\nSee [coremark](crates\u002Fspacewasm_std\u002Fbenches)\nfor more information.\n\n## Testing\n\n### Unit & Integration Tests\n\n```bash\ncargo test\n```\n\nThe unit tests check for regressions on the `unsafe` container abstractions provided by SpaceWasm due to unique `alloc`\nusage. There are also simple unit tests that cover all Wasm instructions without needing full WAST execution.\n\nThe integration tests are spectests from the Wasm 1.0 MVP suite\nwhich was curated in https:\u002F\u002Fgithub.com\u002FWasmEdge\u002Fwasmedge-spectest.\nThese tests validate the integriy of the Wasm interpreter against\nthe specification.\n\n### Fuzzing\n\nSpaceWasm includes a comprehensive fuzzing infrastructure using libfuzzer\nand [wasm-smith](https:\u002F\u002Fgithub.com\u002Fbytecodealliance\u002Fwasm-tools\u002Ftree\u002Fmain\u002Fcrates\u002Fwasm-smith).\n\n```bash\n# Run fuzzer\nmake fuzz\n\n# Analyze crashes with execution traces\nmake trace CRASH=fuzz\u002Fartifacts\u002Fno_traps\u002Fcrash-xxx\n```\n\n## Proposals\n\nCurrently SpaceWasm implements exactly WebAssembly 1.0 which is:\n\n- Wasm MVP\n- Mutable Globals\n\nAdditional Wasm extensions\u002Fproposals could be developed later.\n\n## Copyright\n\nCopyright (c) 2026 California Institute of Technology (“Caltech”). U.S. Government\nsponsorship acknowledged.\nAll rights reserved.\nRedistribution and use in source and binary forms, with or without modification, are permitted provided\nthat the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this list of conditions and\nthe following disclaimer.\n* Redistributions in binary form must reproduce the above copyright notice, this list of conditions\nand the following disclaimer in the documentation and\u002For other materials provided with the\ndistribution.\n* Neither the name of Caltech nor its operating division, the Jet Propulsion Laboratory, nor the\nnames of its contributors may be used to endorse or promote products derived from this software\nwithout specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\nIS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\nOR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\nWHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\nOTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\nADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nPortions of this interpreter have been based on code and insite from Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR) and OxidOS Automotive SRL.\n\nCopyright © 2024-2026 Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR) Copyright © 2024-2025 OxidOS Automotive SRL\n","SpaceWasm 是一个面向航天任务的、符合飞行安全要求的 WebAssembly 解释器，专为资源受限、高可靠性要求的星载系统设计。其核心功能包括流式解码与即时验证 Wasm 二进制、转换为适合解释的中间表示（IR），以及基于固定页内存模型的确定性动态内存管理，全程避免 panic 和非确定性分配。项目采用 Rust 实现，所有 unsafe 代码均严格受限于自定义内存结构，满足航天软件对可预测性、内存上限可控和故障隔离的严苛要求。适用于卫星、深空探测器等嵌入式航天平台上的安全关键型应用部署。",2,"2026-07-10 02:30:20","CREATED_QUERY"]