Commit graph

67 commits

Author SHA1 Message Date
Claude
84911869c8 test: Cycle 12 — stack overflow, bulk memory, self-amplification, double stop, fix flaky MT
Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 21:07:59 +07:00
Claude
a6391816aa test: Cycle 11 — message budget fairness, data segments, outbox isolation, combined fuzz
Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 21:07:59 +07:00
Claude
c4a40953ca test: Cycle 10 — multi-dest sends, outbox copy safety, large payload, alloc-with-grow
Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 21:07:59 +07:00
Claude
1387bce562 test: Cycle 9 — send overflow/boundary, cross-thread relay, property fuzz all send args
Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 21:07:59 +07:00
Claude
8ae620ebbb test: Cycle 8 — off-by-one boundary, spawn-stop lifecycle, 3-hop + 10-hop chain, memory.grow exhaust
Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 21:07:59 +07:00
Claude
2806227376 test: Cycle 7 — alloc trap recovery, memory.grow, send overflow, exact-fit boundary
Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 21:07:59 +07:00
Claude
a171faaad2 test: Cycle 6 — bounded mailbox backpressure + alloc fuzzing property test
Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 21:07:59 +07:00
Claude
4bc6f6077d test: Cycle 5 — type mismatch, state persistence, dynamic spawn
- Non-ByteMessage to WASM actor is silently ignored (type mismatch)
- Guest mutable global state persists across handle() calls (counter)
- Native handler can spawn WASM actor dynamically via ctx.spawn()

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 21:07:59 +07:00
Claude
06aadeb911 test: Cycle 4 — start trap, self-send, amplification, overlapping send
- Module with trapping start function correctly rejected by builder
- Self-send feedback loop works (echo to own address, relay on next tick)
- Guest sending 10 messages in one handle: all 10 delivered via outbox
- Overlapping dest_ptr and payload_ptr in send: reads are independent

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 21:07:59 +07:00
Claude
1be0281056 fix: clear outbox when guest handle traps
When a guest calls swactor.send() then traps, the outbox entries from
the incomplete operation survived and leaked into the next successful
handle() call, delivering messages from a failed context. Now clears
the outbox on trap, consistent with the "drop everything from failed
operations" semantics.

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 21:07:59 +07:00
Claude
148edb9ac5 test: stale outbox leak on trap — failing test (#[ignore])
When a guest calls swactor.send then traps, the outbox entry survives
and leaks into the next successful handle() call. The outbox should be
cleared when handle traps, since the guest's operation was incomplete.

Also adds: invalid WASM bytes test, zero-length payload send test,
multiple sequential traps test (all passing).

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 21:07:59 +07:00
Claude
e7efab4157 test: complete WASM runner scenario coverage
Adds 15 new tests (26 total) covering the full WASM binary runner:

Scenario tests:
- P0: alloc OOB, empty msg, allocator exhaustion, oversized msg
- P1: nonexistent address, wrong exports, graceful stop, negative
  payload_len, independent stores, watch integration
- P2: WASM-to-WASM relay, multi-worker runtime

Property tests (proptest):
- Arbitrary bytes round-trip through echo (identity property)
- Double always produces exactly 2 copies (algebraic property)

Found and fixed 2 bugs:
- actor.rs: missing bounds check on alloc pointer before copy_from_slice
- worker.rs: StopSignal didn't emit watch death notification

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 21:07:59 +07:00
Claude
a9835f27ad fix: emit watch notification when StopSignal stops an actor
StopSignal interception in tick_all set stopping=true but did not push
to the deaths vector, so phase 5b watch notifications never fired for
externally-stopped actors (via rt.stop_actor()). Now pushes
(addr, ExitReason::Stopped) to deaths, consistent with the
ctx.stop_self() path.

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 21:07:59 +07:00
Claude
27f417754b test: watch notification + stop_actor bug — failing test (#[ignore])
Native watcher watching a WASM actor does not receive ActorExited when
the target is stopped via rt.stop_actor(). Root cause: StopSignal
interception in tick_all (worker.rs:734) sets stopping=true but does
not push to the deaths vector, so phase 5b watch notifications never
fire for externally-stopped actors.

Also adds P0-2 through P1-7 test scenarios (all passing):
- empty message, oversized message, allocator exhaustion
- nonexistent address send, wrong export signature/name
- graceful stop, negative payload_len, independent stores
- WASM-to-WASM relay

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 21:07:59 +07:00
Claude
dfc9e6a392 fix: bounds-check alloc pointer before copy_from_slice
Guest alloc could return a pointer where ptr+len exceeds linear memory
size, causing a Rust panic that permanently poisoned the actor. Now
validates ptr+len <= memory.len() before writing, dropping the message
on OOB (consistent with other allocation failure handling).

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 21:07:59 +07:00
Claude
22f6860d6d test: P0-1 alloc OOB bounds check — failing test (#[ignore])
Guest alloc returning a pointer near the end of linear memory
(ptr + msg_len > memory_size) causes a Rust panic in copy_from_slice,
which poisons the actor permanently instead of dropping the message
and keeping the actor alive.

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 21:07:59 +07:00
78cbd80803 skeleton of wasm runner actors (#32) 2026-02-13 07:42:44 +00:00