Repository navigation
Description
Context
Implementation child of #15, following #25, and required by #13 and #14. Add a checked-in real Rust guest and owned thread bootstrap so ordinary threaded Rust runs as one shared-memory Wasm sketch rather than a native substitute.
Depends on
- feat(wasm): add engine policy and strict module admission validation #25 for pinned engine policy and strict module admission.
- feat(wasm): establish threaded sketch build, import validation, and lifecycle substrate #15 for the parent lifecycle contract.
Proposal
Add a checked-in Rust 1.95.0 guest package compiled by Soldr to wasm32-wasip1-threads (or the owned target/sysroot selected by #15). Load exactly its produced module.
Implement owned thread-spawn compatibility or import rewriting so ordinary std::thread code works without ambient WASI authority. Compile/prelink once. Each guest thread gets private Store, Instance, stack, TLS, and execution state, while all threads in one logical sketch share linear memory/heap, allocator state, compiled code, capability set, resource registry, and one kernel runtime.
Invariants
- Guest thread bootstrap is kernel-owned and validated by feat(wasm): add engine policy and strict module admission validation #25; it grants no filesystem/network/process/clock/random/environment authority.
- Thread startup clones facade-owned references only and never creates another Tokio/kernel runtime.
- Backend, generated, Store/Instance/Memory/thread types are private.
default = []remains isolated from the guest target/build/engine dependency tree.
Non-goals
- Async resource ABI, streams/blobs/output, quotas/fuel/epoch policy, worker-process containment, Tauri, or screenshots.
- Requiring third-party sources to replace
std::threadwith a custom product API.
Acceptance criteria
- RED: a checked-in guest using
std::threadcannot currently compile/load/run under the owned policy. - RED: a guest with ambient thread or forbidden authority imports is rejected by the feat(wasm): add engine policy and strict module admission validation #25 validator.
- GREEN: Soldr/Rust 1.95.0 compiles the checked-in guest to one validated threaded module and the host loads that exact artifact.
- GREEN: guest
std::threadstartup routes through the owned bootstrap/import rewrite and creates no ambient authority. - GREEN: concurrent guest threads verify shared-memory visibility using Arc/atomics/mutexes/channels and a DashMap-class synchronization proof.
- GREEN: instrumentation proves compiled module/prelink, memory/heap, capabilities/resources, and one kernel runtime are shared; Store/Instance/stack/TLS/execution state are per thread.
- GREEN: configured thread count and shared-memory maxima reject excess spawn/growth deterministically.
- GREEN: all focused commands use Soldr, and
--no-default-featuresremains free of guest/engine dependencies. - GREEN: build coverage includes Linux, macOS, and Windows x86-64/ARM64; runtime evidence identifies native hosts actually exercised.
Deliverables
- Checked-in guest package, target/build documentation, and artifact-loading harness.
- Owned thread-spawn compatibility/import-rewrite implementation and regression tests.
- Shared/private-state instrumentation and limit tests.
Decisions
- Use the standard threaded target first unless feat(wasm): establish threaded sketch build, import validation, and lifecycle substrate #15 records an owned alternative required by strict import policy.
- Prove real
std::threadcompatibility before adding any application capability.
Related issues
- feat(wasm): establish threaded sketch build, import validation, and lifecycle substrate #15 owns the threaded sketch substrate.
- feat(wasm): add engine policy and strict module admission validation #25 owns admission policy.
- feat(wasm): prove a streamed kernal-api Rust sketch runtime with zccache and extension2 cores #13 owns threaded-runtime requirements.
- feat(wasm): drive a Tauri screenshot task through the async kernal API #14 will use this exact guest path for its screenshot orchestration.
Activity
zackees commentedon Sep 16, 2026
Implemented; closing with the evidence, checked against the artifacts rather than the issue's own status.
kernal-api —
guests/threaded-smoke/is the checked-in Rust guest built forwasm32-wasip1-threads, andscripts/build-threaded-smoke.{sh,ps1}build it through Soldr. The worker boundary and owned bootstrap it asks for are exercised bytests/wasm_worker_containment.rs.The guest is built in CI by the
threaded-rust-artifactlane before the proof lanes run.These four are a dependency chain (#15 → #26 → #32, with #14 as the end-to-end proof), and the chain is present end to end, which is why they close together rather than one at a time.
🤖 Generated with Claude Code