Skip to main content

Module actor

Module actor 

Source
Expand description

GPU Actor Lifecycle Model

Implements the full actor model lifecycle on GPU hardware:

  • Create: Activate a dormant actor slot from the pool
  • Destroy: Deactivate an actor, return its slot to the pool
  • Restart: Destroy + reinitialize state + Create
  • Supervise: Parent-child tree with failure detection and restart policies

§Architecture

On a GPU, thread blocks are fixed at kernel launch time — you can’t spawn new blocks dynamically. The solution is a pool-based design:

┌─── Persistent Kernel (N blocks pre-allocated at launch) ──────────┐
│                                                                    │
│  Block 0: SUPERVISOR                                               │
│  ├─ Actor registry (who is active, who is dormant)                 │
│  ├─ Free list (available actor slots)                              │
│  ├─ Supervision tree (parent-child relationships)                  │
│  └─ Heartbeat monitor (detect actor failures)                      │
│                                                                    │
│  Block 1: ACTIVE actor "sensor-reader"                             │
│  ├─ Processing messages from H2K queue                             │
│  ├─ Created child: Block 3                                         │
│  └─ Heartbeat: last_seen = 1.2ms ago                               │
│                                                                    │
│  Block 2: DORMANT (in free pool)                                   │
│  └─ Zero cost when idle — just checks is_active flag               │
│                                                                    │
│  Block 3: ACTIVE actor "data-processor" (child of Block 1)         │
│  ├─ Processing K2K messages from Block 1                           │
│  └─ Heartbeat: last_seen = 0.5ms ago                               │
│                                                                    │
│  Block 4-N: DORMANT (in free pool)                                 │
│                                                                    │
│  "Create actor" = supervisor activates dormant block               │
│  "Kill actor"   = supervisor deactivates, returns to free pool     │
│  "Restart"      = destroy + reinit state + create                  │
└────────────────────────────────────────────────────────────────────┘

§Comparison with Erlang/Akka

Erlang/AkkaRingKernel GPU
spawn(Fun)supervisor.create_actor(config) → activates dormant block
Pid ! MessageK2K channel or H2K queue injection
exit(Pid, Reason)supervisor.destroy_actor(id) → deactivates block
Supervisor treeParent-child tree in mapped memory
one_for_one restartHeartbeat timeout → destroy + create
Process isolationSeparate control block + queue per block

Structs§

ActorConfig
Configuration for creating a new GPU actor.
ActorId
Unique identifier for a GPU actor within a persistent kernel.
ActorSupervisor
The supervisor manages the actor pool lifecycle.
SupervisionEntry
Entry in the supervision tree.

Enums§

ActorError
Errors from actor lifecycle operations.
ActorState
State of a GPU actor slot.
RestartPolicy
Restart policy for supervised actors.
SupervisionAction
Action taken by the supervisor in response to a failure.