Skip to content

fix(ocap-kernel): run a vat's out-of-delivery syscalls in cranks of their own - #1323

Open
sirtimid wants to merge 4 commits into
mainfrom
sirtimid/inbox-vat-late-syscalls
Open

sirtimid wants to merge 4 commits into
mainfrom
sirtimid/inbox-vat-late-syscalls

Conversation

@sirtimid

@sirtimid sirtimid commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

A vat can make a syscall outside a delivery, from a timer or a fetch callback. The kernel applied it in whatever crank was open, so if that crank aborted, the resolve, send or dropImports was lost.

Such a syscall now goes through the inbox and gets a crank of its own, before the vat's next delivery and in the order the vat made it. An illegal one, or an exit, terminates the vat. One still waiting when its vat is terminated or restarted is dropped.

Tested by the crank-isolation matrix: its three vat rows now assert the rule, and a new row covers an illegal late syscall.

Known gaps: a late syscall after stop has begun is refused and logged. Before the run loop starts, a late syscall is applied at once, and an illegal one does not terminate the vat (#1165). A late send followed by a late exit can kill the run loop, as on main (#1324).

Closes #1177

🤖 Generated with Claude Code

sirtimid and others added 3 commits November 24, 2026 16:42
…heir own

A syscall that arrives while its vat has no delivery to answer goes
through the inbox, so it no longer joins whatever crank is open.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ver the inbox routing

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 75.65%
⬆️ +0.04%
11257 / 14879
🔵 Statements 75.38%
⬆️ +0.03%
11420 / 15148
🔵 Functions 74.73%
⬆️ +0.02%
2659 / 3558
🔵 Branches 71.82%
⬆️ +0.06%
4963 / 6910
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/ocap-kernel/src/KernelQueue.ts 99.06%
🟰 ±0%
94.67%
🟰 ±0%
98.18%
🟰 ±0%
99.37%
🟰 ±0%
260, 422, 1229
packages/ocap-kernel/src/types.ts 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
packages/ocap-kernel/src/vats/VatHandle.ts 92.85%
⬆️ +0.81%
90%
⬆️ +1.37%
100%
🟰 ±0%
92.85%
⬆️ +0.81%
227-230, 459-464, 473-479
packages/ocap-kernel/src/vats/VatSupervisor.ts 75.51%
🟰 ±0%
54.76%
🟰 ±0%
53.33%
🟰 ±0%
75.51%
🟰 ±0%
153, 165, 188, 259, 297-301, 312, 321-322, 344-346, 349, 353-355, 384-385, 392-398, 426, 443-451
packages/ocap-kernel/src/vats/VatSyscall.ts 100%
🟰 ±0%
96.29%
⬆️ +1.56%
100%
🟰 ±0%
100%
🟰 ±0%
Generated in workflow #5909 for commit a0b0bb9 by the Vitest Coverage Report Action

@sirtimid
sirtimid marked this pull request as ready for review November 24, 2026 16:20
@sirtimid
sirtimid requested a review from a team as a code owner November 24, 2026 16:20
…and cover an idle ping and a terminated worker

A crank-isolation row replaces the mock-only KernelQueue test of an inbox
outcome's terminate, and the send row makes two sends to pin their order.
Three comments that said a syscall is always applied on receipt now say
where a late one goes, and a syscall dropped for a vat that is gone is
logged at debug.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run a vat's out-of-delivery syscalls in cranks of their own

1 participant