IC runtime review of five SDK fixes
The executor and Takt fixes fit the IC execution model. Reactor also needs a bounded business outcome for results that will never fit. Timer retries need their own admission and scheduling rules. A declared query provides the HTTPS outcall transform the IC expects.
The chosen implementation and its measured results are in the qualification note.
This is a source review dated 2026-11-22. The unified repository commit was
d8e99603848d87935b776cdce73b6c2a213aa0c6 and its SDK tree was
869a57055fb45528ab6b424b5402541765310ba1. Replica references pin the
upstream commit ee8086a9773725fd1058832a9400297cf0990112, read from Git
objects in /srv/shared/ic. The published ICP Interface Specification
defines the protocol guarantees. The replica paths show one implementation.
PocketIC behavior and performance require separate execution against an
identified binary.
Executor query wakeups
A plain query must finish polling its ready work during its Wasm entry. The
replica has no Rust waker to resume it after that entry returns. Composite
queries may instead resume on a real callback within the same, nonreplicated
query evaluation. Their private Wasm changes can carry between those callbacks
and are discarded after the evaluation. The replica returns
CanisterDidNotReply when the query call graph runs out of work without a
response. Query calls in the spec ·
Replica query execution ·
Replica query completion
Keep the task's owning method visible while its future is out of the slot.
Route every protected wake to that method and preserve the query's exclusion of
migratory work. Coalesce duplicate wakes so each live task has at most one
queued poll. Correct routing restores the existing priority of protected
work over migratory work in updates. Preserve cancellation, destruction
outside registry borrows and ownership of live callbacks. The generated
wrapper uses spawn, whose drop guard traps if the protected future is
abandoned. The failure can be a trap before the replica's no-reply path.
Polling and wake routing ·
Protected task drop
Exercise a self-wake in both replicated and nonreplicated ordinary queries. Exercise a composite query that self-wakes before its outgoing call and after the reply and reject callbacks. A native test can check wake coalescing and owning-method order, including saved migratory work.
Reactor reply and event admission
Reactor sends its business replies and events as frames in later inter-canister requests. The IC reply to an exchange carries Reactor's acknowledgement. Reactor's configured batch accounting and its encoding limits therefore apply independently of the IC's transport ceilings. The published limits are 2 MiB cross-subnet, 10 MiB for same-subnet requests, and 2 MiB for replicated responses. The SDK caps its configured batch allowance at 1,900,000 bytes and its peer codec at 2,000,000 bytes. Compression does not change the peer's admission accounting. IC message limits · Replica cross-subnet request check · Reactor settings · Reactor Wire bounds
Check the full single-frame allowance before consuming subscriptions or publishing a durable outgoing frame. Make peer compatibility cover both bytes and item counts for complete batches. A shared single-frame ceiling alone leaves multi-frame batches exposed to mismatched receive limits. A fixed versioned budget or explicitly checked matching limits can enforce this contract. Keep the encoded envelope within the IC transport limit. Reactor ordered queues
Have application handlers preflight the result before mutation. Where a handler can commit successfully without delivering its full result, define a bounded terminal result that preserves that distinction. Callers must be able to distinguish a committed effect with an unavailable result from expiry or known non-execution. A typed application result can express this on a route that owns the contract. A shared transport outcome would need a peer protocol and saved-state contract change. A trap rolls back the current replicated execution, including calls queued in it. A normal return, including an explicit reject, can commit writes. Use a trap as an invariant backstop. Repeatedly trapping on the same permanent result restores the inbox head each time. IC message execution · Reactor response types · Typed handler encoding · Reactor ordered queues
Keep the transport acknowledgement separate from the application's outcome.
An application TooLarge acknowledgement supplies no accepted prefix.
SYS_UNKNOWN supplies no evidence of whether the callee acted. Neither should
authorize rewriting saved bytes, skipping a sequence, or assigning a replacement
effect identity. Admission prevents new oversized frames. Existing queues
require a drain check or explicit owner-level recovery before upgrading.
Qualify boundary replies and publications, later progress on the same lane,
and byte-exact retries for both Wire and Tripwire, including a cross-subnet
control. IC call and callback contract ·
Reactor physical delivery contract
Takt parallel branch ownership
Reject overlapping branch ownership in the generator, including edges through
Branches[].StartAt, and admit proper nesting. The same state can belong to a
nested subgraph and its enclosing scope while retaining one immediate branch
owner. A valid graph should emit the same Rust, state IDs and definition
signature. Keep the runtime join check for an invalid saved result. A trap
rolls back only the scheduler message executing the join. Earlier branch
messages and downstream effects may already have committed. Deterministic
time slicing spans rounds within one execution. Takt validation ·
Takt emitter and signature ·
IC execution model ·
Replica pause and finish
Test invalid shared entry points alongside valid nested and disjoint graphs. Compare generated output and signatures for representative accepted graphs. If an installed graph needs to change to pass validation, apply the SDK's existing workflow version and drain or cold-conversion rules. An IC code upgrade is atomic. The SDK still owns interpretation of the saved branch results, and prior committed effects remain in place. IC upgrade contract · SDK workflow evolution
Timer retries
The IC global timer is one-shot. The replica deactivates it before invoking the
hook, and the SDK maintains the periodic deadlines. A failed call_perform
enqueue has no callback. A successful enqueue that commits can later produce a
SYS_UNKNOWN response even for a self-call. The pinned replica expires the
caller's callback and enqueues a timeout response if no response is already
queued. That action does not cancel execution at the callee. Global timer in the spec ·
Replica timer entry ·
Replica timeout response queue
Give a retry the identity of its original tick. Only a regular tick advances the deadline, including when the serial busy rule skips an interval or the concurrent policy reaches its cap. Bound pending retries, back off repeated enqueue failures and preserve the selected skip or deferral behavior. Retrying an uncertain tick can execute its handler again. To suppress duplicate starts within one runtime, carry a tick identity through the self-call and claim it at handler entry, invalidating superseded attempts. Business effects still need their own idempotency.
Callback capacity counts reply reservations. A timeout can release one while the original handler remains active. A limit on active handlers needs accounting at handler entry and exit. Cleanup releases callback bookkeeping. Use the SDK drain checks before upgrade and recreate transient registrations after restoration. Test a declined enqueue separately from a later reject. Check one periodic stream for both policies, bounded rearm under sustained failure, live-handler accounting after a timeout and cancellation of stale retries after clearing a timer. IC call and cleanup contract · SDK timer dispatch and retry · SDK timer executor
HTTPS outcall transforms
Use with_transform with a named, ordinary raw query on the requesting
canister. The system invokes it as the management principal using Candid
TransformArgs and expects the encoded HTTP response. It needs no reserved
SDK method name. Bound both Candid decoding and the final encoded reply,
including Candid overhead in max_response_bytes. The raw endpoint's argument
byte limit and the Candid decoder's work quotas cover different costs. Check
the caller if this method is intended for system use only.
Management HTTP outcall contract ·
SDK management API ·
Raw endpoint metadata ·
Candid decoding quotas
The pinned adapter client invokes the transform by name after the HTTP response arrives. The transform service takes a then-latest certified snapshot. Use deterministic transformation logic with request-specific inputs in the supplied context. A closure registry and the initiating execution's exact heap snapshot are SDK concerns. The pinned replica rejects a composite query as a transform. Remove the unsupported closure feature and retain the SDK's reserved timer entry point. Replica transform invocation · Replica snapshot selection · Replica transform query mode
Build the declared query with the canonical builder and test that an outcall receives its transformed result. Check the transformed response size and management caller. Exercise the existing drain gate before upgrading with an outcall pending, then verify the declared query on the successor after drain. The PocketIC source at the reviewed revision routes mocked successful adapter responses through the transform service. Verify that path against the binary selected for qualification. PocketIC mock transform path
Runtime changes need canister tests on the exact prepared Wasm and selected PocketIC binary. Changes that affect RRT execution also need matched Heavy16 instructions, latency, completed work and memory. Generation-only tightening can first establish byte-identical output for accepted workflows. SDK qualification scopes