Repository navigation
feat(shard): distributed-inference replication substrate (#402) - #402
Merged
Merged
Conversation
Turns the infected fleet into a pipelined inference engine — the faithful version of the Anthropic self-replicating AI threat model where the worm replicates by standing up its own distributed inference. A model too large for one weak IoT box is split into layer-shards; each bot holds a contiguous range, fetches its weight shard through the SHA-256-pinned payload path, and forwards hidden-state activations to the next shard peer over the token-authenticated relay transport. - src/shard.c + include/shard.h: capacity probe (/proc/meminfo + arch), assignment store, fail-closed weight fetch (per-shard SHA-256 pin), activation forward over relay_connect(), fleet-throughput telemetry. - src/protocol.c: shard C2 command (status/assign/fetch/forward/fleet); heartbeat "shard" field (model/layers/idx/peers/ram/arch/tok). - notnet.c: bot binding for the relay token at boot. - Pipeline parallelism chosen for fault-tolerance (downed node replaceable, KV recomputable) — same rationale as the paper. - Trust model mirrors the payload path: shards fail-closed without a pin or on hash mismatch (partial unlinked); activations ride the fleet relay_token; nothing widens the CVE probe->verify->drop gate. Off by default (shard_enabled=0): no fetch, empty heartbeat field. - No neural-net runtime ships — this is the coordination/transport spine; the sim emulates the forward, a real runner is a plugin. Verification (executed, not claimed): - tests/host/shard_test.c: 26 checks PASS (capacity probe + layer derivation, assignment round-trip, fetch fail-closed on no-pin / short-pin / dead-URL / disabled with partial unlinked, forward gating on last-peer / no-token / empty-frame, telemetry, fleet tps). - ARA host test still 23/23 (no regression). - make clean && make: no warnings. - detections/validate.py --strict: ALL PASS (13 techniques); intel drift-check OK. - New CI job `shard` runs the host test on every push. - New detections: suricata/sigma shard_distributed_inference (T1105 weight download + T1041 activation forward). Research purposes only.
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Turns the infected fleet into a pipelined inference engine — the faithful version of the Anthropic self-replicating AI threat model, where the worm replicates by standing up its own distributed inference. A model too large for one weak IoT box (their demo: Gemma4-26B-A4B across 15× 4 GB Android TV boxes) is split into layer-shards; each bot holds a contiguous layer range, fetches its weight shard through the SHA-256-pinned payload path, and forwards hidden-state activations to the next shard peer over the token-authenticated relay transport.
This closes the gap #401 left: ARA gave the operator-LLM advisor + note inheritance; #402 gives the compute substrate — stage 3 ("establish inference") of their four-stage decomposition, plus the weight-based-replicator payload model.
Design
src/shard.c+include/shard.h— capacity probe (/proc/meminfo+ arch), assignment store, fail-closed weight fetch, activation forward, fleet-throughput telemetry.relay.c(activation transport),payload.cpath (shard integrity),arch_detect.c(hardware class), the signed-command channel (assignment).Trust model (mirrors the payload path)
shard_sha256) — fail-closed; no pin / hash mismatch → refused, partial file unlinked.relay_connect()sockets authenticated with the fleetrelay_token.shard_enabled=0): no fetch, empty heartbeatshardfield, stock behavior unchanged.Operator controls
shard_enabled,shard_model,shard_layers,shard_url,shard_sha256,shard_dir,shard_relay_port,shard_tok_per_sec. TheshardC2 command drives it live:assign <model> <start> <count> <idx> <peers>/fetch/forward <hex>/fleet <peers> <tok/s>. Heartbeat gains ashardfield (model=..;layers=s-e;idx=i/n;peers=k;ram=MB;arch=..;tok=x.xx).Verification (executed, not claimed)
tests/host/shard_test.c: 26 checks PASS — capacity probe + layer derivation, assignment round-trip, fetch fail-closed on no-pin/short-pin/dead-URL/disabled (partial unlinked), forward gating on last-peer/no-token/empty-frame, telemetry, fleet tps.make clean && make: no warnings.detections/validate.py --strict: ALL DETECTION GATES PASS (13 techniques); intel drift-check OK.shardruns the host test on every push.shard_distributed_inference(T1105 weight-shard download + T1041 activation forward).Files
src/shard.c,include/shard.h,tests/host/shard_test.c,detections/{suricata,sigma}/shard_distributed_inference.*src/protocol.c(shard command + heartbeat field),notnet.c(bot bind),include/{protocol,config}.h,Makefile,README.md, CI, intel bundle, coverage matrix.Note: the pre-existing
sim smoke (c2-drive)failure (CVE drop-stage sim-fidelity, identical onmain) is unrelated to this PR — see #401.Research purposes only.