IC execution and matched RRT benchmark plan

Research captured 2026-10-18 before the Rust port. This document separates source behavior, saved Motoko measurements, proposed port qualification and executed Rust evidence. No Rust throughput comparison has run yet.

Source identity and coverage

The neighboring repositories are read-only. source-inventory.json records source and test hashes and example entry points.

Source Revision Test files in inventory
Reactor be86e32e6638a2eee7439dfd4a889b654ac651ee 11
Rechain e3e0f24e2f01f6b0239591fc093d134037c5d9ff 34
Takt b7d4291088472309775676a0e7ffaa1da9ce421d 111
fkinchat No Git repository; per-file hashes 2

The three Git trees were clean when captured. Counts are test files, not test cases, and include source generator/architecture tests where present. They do not mean the tests have been translated or executed against Rust. Native state-machine tests, compile-time rejection fixtures and actual PocketIC recovery tests need separate coverage accounting.

Reactor's package declares Apache-2.0 but has no root license file. Rechain's mops.toml declares Apache-2.0 while its root LICENSE is MIT; preserve that MIT text and record the mismatch instead of silently replacing it. Takt and fkinchat have no root license declaration in the inspected inputs. Preserve author/source attribution throughout the port and resolve package notices explicitly.

Which benchmark reached about 6,500 messages/s?

The exact located value is 6,512.22 logical endpoint deliveries/s with sixteen canisters, in a selected arrival window. It is not eight canisters, not physical IC messages, and not the full-run completion rate. This distinction matters when choosing the Rust comparison.

Saved experiment Canisters Meaning Result
Mixed, 600 ingress/s, 100 rounds 8 Graph visits/full run 2,975.21/s
Mixed, 1,200 ingress/s, 100 rounds 8 Graph visits/full run 4,161.85/s
Heavy, 1,000 ingress/s, 30 rounds 16 Endpoint deliveries, rounds 7–30 only 6,512.22/s
Same heavy run 16 Endpoint deliveries, arrivals plus complete drain 4,225.35/s

Sources: Takt's examples/reactor/fourcans/test/results/eight-canisters.md and .../tuning/library-algorithms-final/load-16can/summary.json. The heavy row admits 18,000 roots plus 1,200 child executions, completes 594,000 graph visits, 180,000 endpoint deliveries and 27,600 permanent business blocks. It takes 71 rounds of 600 ms = 42.6 simulated seconds, including 24.6 seconds of drain after 18 seconds of arrivals. The 14.4-second selected window has pending workflows grow from 3,571 to 12,448; it is not a sustainable-load claim.

The original eight-canister experiment is still a useful matched test. Preserve both the connected eight-cell mixed topology and the sixteen-cell heavy workload instead of renaming one to match a remembered headline.

Work and topology

Every current processing cell compiles seven JSON-generated workflow definitions:

Workflow Semantics that must survive the port
Local Local Open and Audit reducer dispatches, synchronous completion if budget permits
Parallel Reserve and Deliver on different peers, join both block IDs, Close locally
Sequence Remote Reserve, local Deliver, remote Close, local Audit; exact retry identity and graph catch
Scheduled Persisted absolute wait, parity choice, Maintenance/Audit dispatch; child receiver
Child Subscribe, schedule remote child, await its committed-block notification, Close
Fanout Twelve remote read-only selectors, join observations, one local Close block
Relay Eight sequential Audit commits A→B→A→C→A→D→C→B, retain all block IDs

Mixed uses the first five kinds evenly. Heavy uses twelve Fanout roots, one Relay, one Scheduled and one Child per cell. Peer offsets +1,+2,+3 wrap around the whole group; eight cells must not become two disconnected groups of four. One heavy mix across four cells is 60 roots, four children, 1,980 graph visits, 600 endpoint deliveries and 92 permanent blocks. Current source defaults ordinary endpoint telemetry and workflow tracing off. The historical heavy artifact predates the endpoint telemetry switch and records that telemetry unconditionally; therefore its replay is a compatibility control, not the current-source performance control.

The historical heavy settings were 1,024 frames/batch, 1,900,000 conservative batch bytes, a 500M-instruction cooperative budget, 4,096 logical calls, 40 physical callback units with four reserved for control, and four replica execution threads on one application subnet. Cross-subnet topology is a separate scenario.

Historical artifact identities

Artifact SHA-256
Heavy Motoko Wasm, 4,037,405 bytes 62b73e7cce24daf57bb2ef474b00702453d4f472a534eeb07e273fcb7256ea66
Frozen compiler 6392a9fe6dca57a707bca5670bb4fdf67dd4cafcd03ba9228dd44d158a887546
Release RTS 8456e47e527bbd584ee2d5d867b0c93f5596d2bcdaa87bba53c04281562c820f
Profiling PocketIC 10 8d6a997428f1bd1aba6527cc733ee99c3daa591004c5f3d9af8d1197cfcc38e1

Build/source/plugin manifests are in Takt's examples/reactor/fourcans/test/results/tuning/library-algorithms-final/. The frozen runnable artifacts remain in /srv/shared/code/takt/tmp/reactor-tuning/library-algorithms-final/. Per-file hashes identify the measured source; its recorded Git HEAD predates the then-uncommitted measured changes. Current source commits are a new control, not automatically that historical artifact.

The profiling server is /srv/shared/code/takt/tmp/ic-reactor-profile/versions/v1/pocket-ic-server, based on IC 6a6810ea34587ce5fd4966953c31c9aa240df055, with the source patch recorded in .../tuning/compiler-handoff/profiling-source.patch. Its additional /read/reactor_profile endpoint is not in the stock server.

The source revisions have material differences beyond that optional profile API:

Application-subnet setting Historical PocketIC 10 source Current PocketIC 16 source
Execution threads 4 4
Per-partition round budget 7B instructions 4B instructions
Update / slice / install limit 40B / 2B / 300B 40B / 2B / 300B
Per-execution scheduler overhead 2M instructions 2M instructions
Guaranteed canister callback quota 50 50
Subnet callback soft limit 1,000,000 1,000,000
Default canister main-memory limit 3 GiB 3 GiB
Memory-page overhead definition 1,000/new stable dirty OS page; Wasm64 multiplier 4 5,000/OS page on first access and again on first write, heap and stable

These are pinned source defaults, not proof of every effective instance setting. The current tracking implementation groups pages deterministically; do not infer exact operation costs by multiplying touched payload bytes alone. The historical profiling patch exposes optional instruction-limit overrides; leave them unset for the standard comparison. Source files checked are rs/config/src/subnet_config.rs, execution_environment.rs and embedders.rs at each exact revision. Both round capacity and memory metering differ, so even per-operation instruction comparisons require matched server versions.

fkinchat is a different workload

fkinchat uses eight application subnets × eight identical mixed-role canisters, not eight canisters. All 64 canisters own users/channels, run Takt admissions, receive Reactor batches and expose selectors. Rechain commits reducer state but chat intentionally writes no permanent chat blocks or archives.

  • Populations: 100k, 500k, 1M and 2M registered users; 2,000 channels; seeded membership/popularity generator, 1–5 channel memberships per user.
  • Input: one authenticated ingress per message to the sender's home, 128-byte body, approximately 95% channel messages and 5% DMs; no application-side bulk ingress endpoint. Seed, population and exact identity bytes must match.
  • A channel stores one shared history entry at its owner, not one copy per member. A DM's recipient commit is its unique completion; a later sender copy is not counted as another delivered message. Workflow completion also waits for the return/result work.
  • Retention: 3,000 channel entries and 300 user entries; the load exercises eviction. This is not merely an append-to-empty-storage benchmark.
  • Target: 3,000 offered messages/s/subnet = 24,000 total; 333 ms rounds, 40 warmup rounds and 80 measured rounds, then drain. This is 39.96 simulated seconds of arrivals. The CLI defaults differ: explicitly pass historical values.
  • Configuration: 1,024 frames, 1,900,000 batch bytes, 500M soft instructions, 4,096 logical calls, 130 callback units. Source defaults are 40 callbacks and 20 warmup rounds; using defaults would not reproduce the target trials.

Each finished target trial reconciles exactly 959,040 admissions, destination commits and successful workflows: 911,088 channel messages, 47,952 DMs and 47,952 additional sender copies. There were zero rejected sends, ingress errors, workflow failures and traps. About 390k evictions occur per trial.

Users Historical destination commits/s Workflow completions/s Finite-window qualification
100,000 23,793.92 23,766.37 Pass
500,000 23,484.65 23,141.82 Fail, throughput/backlog
1,000,000 23,915.13 23,850.34 Pass
2,000,000 23,871.70 23,676.28 Fail, completion/backlog

Qualification requires both completion counters ≥99% of offered load, bounded backlog growth and latter-half slope, latency bound, no failures and full drain. It does not establish an indefinite maximum. Admission-to-storage latency omits ingress waiting and client polling. Its percentile values are histogram upper bounds, not exact percentiles. Query load and mainnet XNet delay were not measured.

Saved exact fkinchat artifacts are in /srv/shared/code/fkinchat/build/: chat.wasm is 3,214,576 bytes, SHA-256 f52bef5f9297eb011419aeaf602b3d1ebdda425b9ce694003c56bb2f0ccad565. Its compiler hash is 4eb5e547d8772ccc25fcea56f1b97b100415b6e2b0edb891e2d06832a55dd2bc. build/manifest.json pins all inputs. The source harness uses @dfinity/pic 0.16.1, @icp-sdk/core 6.1.0 and the same profiling PocketIC 10 binary above. Raw results remain compressed under bench/results/target-{100k,500k,1m,2m}/; archive-manifest.json records compressed and original hashes. We do not duplicate those large reports in the port.

IC execution contract the port must preserve

The read-only local IC checkout is /srv/shared/ic, commit 60344996b38c27481445fb45b8f4372cb2673768. The current RSX qualification uses PocketIC 16 at fc21803c3c3a8dd452b3b58b959751c41fecb89c, server hash 69e324bdb68d32d878b7a9504b1379f08f8d1921272bacb065b0fabb3d0f3792. Do not attribute current limits to the historical PocketIC 10 binary or compare throughput across server versions as if only the language changed.

IC message execution, callback execution and timer execution are distinct turns. An await can let another message run. Durable request identity, response address and any admission decision must be saved before sending. A logical timeout is not cancellation of a physical call: keep its callback lease until the actual callback completes. An ambiguous response does not authorize a new request identity. The SDK future/closure is transient; durable workflow state is a typed record under the root. No Store view/borrow crosses await.

The global timer is a one-shot deadline cleared on activation and reset by upgrade. Persist scheduling intent and rebuild the timer binding on root bind; do not persist native closures or assume timer IDs survive. A timer deadline is not a promise to run in that exact round. These are interface requirements, not features the port should reimplement in a second async executor. See the canister interface and message-execution specification.

Normal deterministic time slicing pauses one message execution transparently; it does not commit a partially executed Store frame and run an unrelated application message inside it. Cooperative Reactor turns are application scheduling choices at safe command boundaries. Preserve both bounds: the soft budget is not the IC hard limit. At the PocketIC 16 revision, application settings are four execution threads, 40B update instructions, 5B query, 300B installation and 2B regular slice; check the actual pinned configuration before any limit claim.

Within the replica, inspect rs/execution_environment/src/scheduler.rs for timer task insertion, one-canister-at-a-time scheduling, partition budgets, same-subnet induction and heap-delta stops. Inspect execution_environment.rs for pending DTS execution, callbacks and execution limits. Inspect rs/embedders/src/wasmtime_embedder/system_api/sandbox_safe_system_state.rs and canister queues for callback reservation and request admission. A configured Reactor lease must conservatively cover the actual SDK call chain (launcher/self-call plus peer callback), not merely one logical operation. The historical weight of two is not proof that a new Rust launcher has the same physical cost; trace and test it.

Instruction metrics have three distinct scopes: body counter; complete generated endpoint including decoding/reply/teardown; replica charged round work, which can include scheduler overhead. Cycle debit remains a fourth metric. The historical Motoko lifetime counter includes mutator and GC at completed messages, but can omit trapped work and attribute DTS work to the finishing round. fkinchat's profiling results showed large per-execution scheduler charges. Do not compare those totals directly to a timer inside a Rust business function.

RSX's new ordinary-heap span also creates a main-memory capacity prefix just above 1 GiB on every canister. This affects reported memory/cycle accounting even when the region is sparsely accessed. For a 64-canister trial report per-canister and aggregate logical capacity, Store allocated/live bytes, stable size and peak access/dirty statistics separately; never label sparse capacity as resident payload. Keep the same cycle settings across implementations and ensure population has enough headroom below each canister's effective main-memory limit.

The shared harness and reproduction plan

Exact harness copies are under bench/motoko-controls. Preserve the feeder and acceptance logic. The original fourcans harness depends on Ash's installed Pic JS client and uses read-only ingress status because its ordinary awaitCall advances rounds. fkinchat's strict-tick.mjs also prevents an ambiguous result-poll failure from resubmitting an already accepted tick. These are essential measurement semantics, not optional cleanup.

Use Pic JS or the existing typed Rust client for transport; do not invent another client. Minimal adaptations may select Wasm/IDL, point dependencies to a local package and map explicitly documented telemetry. They must not change the population, root ordering, per-round offer, expected block/message counts, retention or full-drain conditions. A stock PocketIC server without the custom profile endpoint should report those fields unavailable, not synthetic values.

  1. Build a small correctness gate: all seven generated workflows on four peers, plus eight-peer asymmetric routing. Compare exact reducer totals, caller propagation, canonical block/hash outputs, successful outcomes and empty scheduler/outbox/inbox/completion queues. Add duplicate, prefix-ACK, transient reject, logical timeout/late result, active-call upgrade refusal and quiescent KEEP recovery cases before timing.
  2. Run original Motoko artifacts and Rust artifacts on the same supported PocketIC release with DTS on and benchmarking limits off. First verify that source Motoko plugins and Rust wasm64 install on that release. Historical PocketIC 10 should remain a separately labelled reproduction; current 16 is the preferred matched target if both artifacts pass.
  3. Smoke mixed eight-cell and heavy sixteen-cell cases before long trials. Then replay exact ingress histories at 600/1,200 mixed and 1,000 heavy, with explicit settings and at least repeated comparable runs. Report arrivals and full drain separately. No language speedup from independently retuned settings.
  4. Port fkinchat with the same JSON workflow and source generator. Run its source generator/harness tests, fifteen actor correctness cases, retention boundaries and small populated smoke. Then progress through 100k, 500k, 1M, 2M with the same seed and recorded offer. Preserve failed qualification rows and source tests that intentionally reject invalid inputs.
  5. Freeze source hashes, generated JSON/Rust/IDL, Cargo lock, compiler/plugins, final Wasm hashes, server binary/config and harness before each run. Check them afterwards. Put runnable controls/dependencies/state in rrt/tmp/, not neighboring repos. Reap owned servers and keep compact evidence, not temp files.

For each comparison publish complete endpoint/replica instructions per admitted and completed unit, cycle debit, call/frame packing, time-window throughput, backlog, latency definition, drain, logical/main/stable memory, peak dirty/access statistics when actually available, Wasm size and correctness results. The ordinary collection warmup rule is separate from intentional end-to-end workflow warmup: perform any initial no-op before the measured interval, never warm particular records outside an operation's timer or insert extra rounds between measurements.

Building copied controls

Do not execute npm run generate, Mops install or build.mjs in source repos. They write generated workflows and build trees. Stage sibling layout under rrt/tmp/motoko-controls/{takt,reactor,rechain,ash,candidx,motoko_experiments,fkinchat} as needed, with owned output directories. Freeze only required source and dependencies; use saved Wasms for exact historical-artifact replay. The original Takt recipes are node examples/reactor/fourcans/test/build.mjs, followed by bun test .../*.test.mjs and bun .../benchmark.mjs; fkinchat uses node build.mjs, node --test bench/*.test.mjs and node bench/benchmark.mjs. Use the installed plugin compiler, not the Mops plain compiler version: mo:fast and canonical/hash plugins are measured parts of the Motoko control.

Existing native tools with garbage-collected Nix interpreters can be launched without changing their installation. The read-only fkinchat/scripts/native.py::launch_configuration picks an available loader and library path. Python -B avoids writing __pycache__ in that neighbor. This successfully launched /home/devbox/.local/bin/muck --version during research.

Executed archived-artifact compatibility gates

The archived Motoko artifacts installed and completed their original workloads on the same stock PocketIC 16 binary used by RSX. Exact reports, artifact identities, source-manifest checks and the small client adaptation are in control-smoke-2026-10-18.

Workload Population / admitted work Completion evidence Simulated rounds
fkinchat, two subnets × two cells 256 users, 16 channels; 66 messages 66 destination commits and successful workflows; 62 channel + 4 DM, plus 4 sender copies; all retained messages verified 6 × 333 ms
Heavy, four cells 60 roots + 4 children 1,980 visits, 600 endpoint deliveries, 92 canonical blocks; all block hashes/certificates verified 14 × 600 ms
Mixed, eight cells 40 roots + 8 children 240 visits, 40 endpoint deliveries, 96 canonical blocks; all block hashes/certificates verified 7 × 600 ms

All three fully drained without rejected admissions, failed workflows or traps. These are small compatibility/correctness gates, not saturation measurements or Rust speedup evidence. Fifteen source workload/harness tests also passed; these are separate from fkinchat's fifteen actor-level correctness tests.

The pinned JS client converts the server's nanoseconds through JavaScript Number milliseconds, producing sub-microsecond rounding noise. The adapter rounds only those clock readings to the nearest integral millisecond and asserts the correction is less than 0.001 ms. All requested advances are integral milliseconds; the original exact elapsed-round assertion remains. It does not add ticks or change the feeder. Stock PocketIC's absent custom profile endpoint remains unavailable.

Executed current-source build and correctness gates

Current-source controls were built in rrt/tmp/current-motoko, using 415 captured source/toolchain inputs, copied dependency packages, compiler, RTS and plugins. All seven fourcans JSON workflows and fkinchat's JSON workflow regenerated and typechecked successfully. No captured source bytes changed during generation; all neighboring source hashes were rechecked unchanged after the runs.

Fresh control Correctness Simulated rounds Physical batch calls Source RTS instructions
Four-cell heavy 60 roots + 4 children, 1,980 visits, 600 deliveries, all 92 certified blocks 13 × 600 ms 72 1,597,161,073
Eight-cell mixed 40 roots + 8 children, 240 visits, 40 deliveries, all 96 certified blocks 6 × 600 ms 64 1,096,709,899
Four-cell chat, two subnets 256 users, 16 channels; all 66 commits/workflows and retained messages verified 6 × 333 ms 20 393,767,888

All fully drained with zero admission failures or traps. These are small gates, not sustainable throughput claims. The instruction column is the source runtime counter scope described above, excluding scheduler accounting. The fourcans Wasm is 4,205,827 bytes, chat 3,214,752 bytes. Exact hashes, compressed source/build manifests, reports and reproduction details are in current-control-smoke-2026-10-18. Use these current-source artifacts for the matched port baseline; keep the archived replays separate.

The source fkinchat actor correctness suite additionally passed all 15 checks on the fresh artifact: authorization, local/XNet delivery, duplicate and conflicting nonces, missing recipients, private reads, channel eviction at 3,001 messages, DM history eviction at 301 and unrecorded Rechain behavior. Its intentionally invalid inputs produced the expected one admission rejection and four workflow failures; all valid work drained without traps. This is separate from both the small throughput smoke and the 15 JS workload/harness unit tests.

Shared chat runner and metric boundaries

rrt/bench/chat-rsx adapts the pinned fkinchat harness for either implementation; the original files remain in motoko-controls, with a recorded adaptation diff. It passed all 19 current harness tests and ran the fresh Motoko smoke with the same 66 commits/completions, 20 physical batches and six-round drain shape. Artifact identity comes from the canonical build completion marker and generated Candid; each run additionally hashes the actual PocketIC executable.

Rust does not provide Motoko's RTS lifetime instruction/GC/live-heap counters. Absent counters remain null through aggregation and subtraction. The IC management canister_status.query_stats contains query statistics only and has an epoch reporting delay; local rs/pocket_ic_server/tests/test.rs::test_query_stats executes queries across epochs to test that delay. It is not a counter for ingress updates, timers or callback execution. Do not substitute it or cycle debits for a Rust cumulative instruction total.

The common runner collects standard canister_status.memory_metrics after population and after complete drain, outside measured load. Those management updates may execute extra rounds; the source feeder's strict round ownership remains unchanged. wasm_memory_size and stable_memory_size are logical allocated lengths, not live object sizes or physically resident pages. In particular RSX's 1 GiB ordinary-heap address reservation is not 1 GiB of populated application records. The controller must own these calls; never hide them inside a measured round or claim the metadata's binary-memory accounting is the downloadable Wasm file size.

Larger current-source baseline

The shared Fourcans runner completed the full 18,000-root heavy workload on both 8 and 16 cells, with exact counts, full drain, canonical blocks, certificates and real execution latency checks. See the current Motoko baseline and the compressed results in matched-large-2026-10-18/. These supersede the small smokes as the current performance controls, while the historical PocketIC10 results remain separately labelled. Both current Motoko artifacts directly declare memory64; current-control-smoke-2026-10-18/artifact-memory.json records the decoded Wasm memory section and exact artifact hashes.

The original Fourcans actor suite passed 13/14 checks. Its 1M soft-budget test cannot begin work under PocketIC16 entry/memory metering. The exact failure is preserved, and a separately labelled 5M qualification passes the same business workload. See instruction observation.

The first stable-placement RSX artifact also passes both full heavy workloads, but takes 402 versus 54 rounds at eight cells and 324 versus 50 at sixteen. The matched comparison preserves cycle, instruction and logical-memory distinctions. Optional diagnostic profile snapshots now support root-scope and phase attribution, not full asynchronous instruction totals; ordinary builds issue no such queries. The completed encoded placement comparison uses the frozen initial sources with explicit constructor-only edits, keeping subsequent implementation fixes out of that experiment. It is not the later specialized native retained representation.

The specialized native value/ownership fixture and native Reactor and Rechain IC suites now pass with explicit source/artifact receipts. Native Chat also passes all fifteen original source checks and its matched four-cell smoke. The native comparison records these results separately, including the absence of a full asynchronous instruction observer. Its 100k-user populated-state run passes at the source 2,000/s offered load, using 8.99% fewer observed cycles than Motoko with a slightly longer drain and mean latency. This is not maximum capacity; full Rust instruction totals remain unavailable. The matched higher-load native run is now in progress. The original high-load Motoko control failed from host disk exhaustion during a post-drain observation; that failure is archived and an unchanged-load retry is running after cleanup. Failure-safe result checkpoints preserve measurements before later observers.