# isekaishy-jpg/solworker architecture

> Architecture diagram of the GitHub repository isekaishy-jpg/solworker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/isekaishy-jpg/solworker
- Repository: https://github.com/isekaishy-jpg/solworker

## Overview

Solworker is a Rust CPU-work runtime. Callers configure and start a runtime, then submit borrowed parallel work or owned jobs; the runtime executes accepted work and exposes completion, progress, and shutdown. Owned jobs add admission, dependencies, and work groups. Separate host-thread owner phases deliver callbacks, while external-provider access distinguishes logical task outcomes from proof that physical resources are safe to reclaim. The README was empty, so product capabilities and relationships are based on crate-level documentation and sampled source; unsampled subsystem links are omitted where wiring is uncertain.

Main entry points: [`src/scheduler.rs`](https://github.com/isekaishy-jpg/solworker/blob/master/src/scheduler.rs) (Owned scheduler), [`src/execution.rs`](https://github.com/isekaishy-jpg/solworker/blob/master/src/execution.rs) (Parallel APIs), [`src/runtime.rs`](https://github.com/isekaishy-jpg/solworker/blob/master/src/runtime.rs) (Runtime API), [`src/backend/micropool.rs`](https://github.com/isekaishy-jpg/solworker/blob/master/src/backend/micropool.rs) (Worker pools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_runtime_api["Runtime API<br/>[runtime.rs]"]
  node_runtime_config["Configuration<br/>[config.rs]"]
  node_lifecycle["Lifecycle control<br/>[lifecycle.rs]"]
  node_backend["Worker pools<br/>[micropool.rs]"]
  node_progress["Progress snapshots<br/>[progress.rs]"]
end

subgraph group_execution["CPU execution"]
  node_execution_api["Parallel APIs<br/>[execution.rs]"]
  node_execution_batch["Indexed batches<br/>[batch.rs]"]
  node_execution_scope["Scoped work<br/>[scope.rs]"]
  node_execution_delivery["Owner overlap<br/>[delivery.rs]"]
end

subgraph group_owned["Owned work"]
  node_scheduler["Owned scheduler<br/>[scheduler.rs]"]
  node_admission["Admission policy<br/>[admission.rs]"]
  node_task_api["Task results<br/>[task.rs]"]
  node_completion["Completion state<br/>[completion.rs]"]
  node_dependency["Dependencies<br/>[dependency.rs]"]
  node_groups["Work groups<br/>[group.rs]"]
end

subgraph group_interop["Host and providers"]
  node_owner_api["Owner phases<br/>[owner.rs]"]
  node_owner_delivery["Delivery transport<br/>[delivery.rs]"]
  node_notification["Notifications<br/>[notification.rs]"]
  node_external_api["External access<br/>[external.rs]"]
  node_physical["Physical retention<br/>[physical.rs]"]
end

node_caller(("Caller"))

node_caller -->|"builds runtime"| node_runtime_api
node_runtime_api -->|"uses settings"| node_runtime_config
node_runtime_api -->|"starts and closes"| node_lifecycle
node_lifecycle -->|"builds and stops"| node_backend
node_caller -->|"submits work"| node_execution_api
node_execution_api -->|"invokes batches"| node_execution_batch
node_execution_api -->|"runs scoped work"| node_execution_scope
node_execution_api -->|"runs owner branch"| node_execution_delivery
node_execution_batch -->|"dispatches work"| node_backend
node_execution_scope -->|"joins work"| node_backend
node_caller -->|"submits owned jobs"| node_scheduler
node_scheduler -->|"checks capacity"| node_admission
node_scheduler -->|"dispatches jobs"| node_backend
node_scheduler -->|"publishes outcomes"| node_completion
node_scheduler -->|"tracks group work"| node_groups
node_task_api -->|"observes results"| node_completion
node_task_api -->|"registers continuations"| node_dependency
node_dependency -->|"submits successors"| node_scheduler
node_caller -->|"services phases"| node_owner_api
node_scheduler -->|"reserves delivery"| node_owner_delivery
node_owner_api -->|"receives notifications"| node_owner_delivery
node_caller -->|"prepares access"| node_external_api
node_external_api -->|"admits provider work"| node_scheduler
node_external_api -->|"activates resource"| node_physical
node_caller -->|"binds routes"| node_notification
node_completion -->|"publishes changes"| node_notification
node_caller -->|"reads snapshots"| node_progress
node_progress -->|"observes runtime"| node_runtime_api

click node_runtime_api "https://github.com/isekaishy-jpg/solworker/blob/master/src/runtime.rs"
click node_runtime_config "https://github.com/isekaishy-jpg/solworker/blob/master/src/runtime/config.rs"
click node_lifecycle "https://github.com/isekaishy-jpg/solworker/blob/master/src/runtime/lifecycle.rs"
click node_backend "https://github.com/isekaishy-jpg/solworker/blob/master/src/backend/micropool.rs"
click node_execution_api "https://github.com/isekaishy-jpg/solworker/blob/master/src/execution.rs"
click node_execution_batch "https://github.com/isekaishy-jpg/solworker/blob/master/src/execution/batch.rs"
click node_execution_scope "https://github.com/isekaishy-jpg/solworker/blob/master/src/execution/scope.rs"
click node_execution_delivery "https://github.com/isekaishy-jpg/solworker/blob/master/src/execution/delivery.rs"
click node_scheduler "https://github.com/isekaishy-jpg/solworker/blob/master/src/scheduler.rs"
click node_admission "https://github.com/isekaishy-jpg/solworker/blob/master/src/scheduler/admission.rs"
click node_task_api "https://github.com/isekaishy-jpg/solworker/blob/master/src/task.rs"
click node_completion "https://github.com/isekaishy-jpg/solworker/blob/master/src/task/completion.rs"
click node_dependency "https://github.com/isekaishy-jpg/solworker/blob/master/src/task/dependency.rs"
click node_groups "https://github.com/isekaishy-jpg/solworker/blob/master/src/execution/group.rs"
click node_owner_api "https://github.com/isekaishy-jpg/solworker/blob/master/src/owner.rs"
click node_owner_delivery "https://github.com/isekaishy-jpg/solworker/blob/master/src/owner/delivery.rs"
click node_notification "https://github.com/isekaishy-jpg/solworker/blob/master/src/notification.rs"
click node_external_api "https://github.com/isekaishy-jpg/solworker/blob/master/src/external.rs"
click node_physical "https://github.com/isekaishy-jpg/solworker/blob/master/src/external/physical.rs"
click node_progress "https://github.com/isekaishy-jpg/solworker/blob/master/src/progress.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_runtime_api,node_runtime_config,node_lifecycle,node_backend,node_progress toneBlue
class node_execution_api,node_execution_batch,node_execution_scope,node_execution_delivery toneAmber
class node_scheduler,node_admission,node_task_api,node_completion,node_dependency,node_groups toneMint
class node_owner_api,node_owner_delivery,node_notification,node_external_api,node_physical toneRose
class node_caller toneIndigo
```

## Components

### Runtime

- [Runtime API](https://github.com/isekaishy-jpg/solworker/blob/master/src/runtime.rs): `src/runtime.rs`
- [Configuration](https://github.com/isekaishy-jpg/solworker/blob/master/src/runtime/config.rs): `src/runtime/config.rs`
- [Lifecycle control](https://github.com/isekaishy-jpg/solworker/blob/master/src/runtime/lifecycle.rs): `src/runtime/lifecycle.rs`
- [Worker pools](https://github.com/isekaishy-jpg/solworker/blob/master/src/backend/micropool.rs): `src/backend/micropool.rs`
- [Progress snapshots](https://github.com/isekaishy-jpg/solworker/blob/master/src/progress.rs): `src/progress.rs`

### CPU execution

- [Parallel APIs](https://github.com/isekaishy-jpg/solworker/blob/master/src/execution.rs): `src/execution.rs`
- [Indexed batches](https://github.com/isekaishy-jpg/solworker/blob/master/src/execution/batch.rs): `src/execution/batch.rs`
- [Scoped work](https://github.com/isekaishy-jpg/solworker/blob/master/src/execution/scope.rs): `src/execution/scope.rs`
- [Owner overlap](https://github.com/isekaishy-jpg/solworker/blob/master/src/execution/delivery.rs): `src/execution/delivery.rs`

### Owned work

- [Owned scheduler](https://github.com/isekaishy-jpg/solworker/blob/master/src/scheduler.rs): `src/scheduler.rs`
- [Admission policy](https://github.com/isekaishy-jpg/solworker/blob/master/src/scheduler/admission.rs): `src/scheduler/admission.rs`
- [Task results](https://github.com/isekaishy-jpg/solworker/blob/master/src/task.rs): `src/task.rs`
- [Completion state](https://github.com/isekaishy-jpg/solworker/blob/master/src/task/completion.rs): `src/task/completion.rs`
- [Dependencies](https://github.com/isekaishy-jpg/solworker/blob/master/src/task/dependency.rs): `src/task/dependency.rs`
- [Work groups](https://github.com/isekaishy-jpg/solworker/blob/master/src/execution/group.rs): `src/execution/group.rs`

### Host and providers

- [Owner phases](https://github.com/isekaishy-jpg/solworker/blob/master/src/owner.rs): `src/owner.rs`
- [Delivery transport](https://github.com/isekaishy-jpg/solworker/blob/master/src/owner/delivery.rs): `src/owner/delivery.rs`
- [Notifications](https://github.com/isekaishy-jpg/solworker/blob/master/src/notification.rs): `src/notification.rs`
- [External access](https://github.com/isekaishy-jpg/solworker/blob/master/src/external.rs): `src/external.rs`
- [Physical retention](https://github.com/isekaishy-jpg/solworker/blob/master/src/external/physical.rs): `src/external/physical.rs`

### Other components

- **Caller**

## Connections

- Caller → Runtime API: builds runtime
- Runtime API → Configuration: uses settings
- Runtime API → Lifecycle control: starts and closes
- Lifecycle control → Worker pools: builds and stops
- Caller → Parallel APIs: submits work
- Parallel APIs → Indexed batches: invokes batches
- Parallel APIs → Scoped work: runs scoped work
- Parallel APIs → Owner overlap: runs owner branch
- Indexed batches → Worker pools: dispatches work
- Scoped work → Worker pools: joins work
- Caller → Owned scheduler: submits owned jobs
- Owned scheduler → Admission policy: checks capacity
- Owned scheduler → Worker pools: dispatches jobs
- Owned scheduler → Completion state: publishes outcomes
- Owned scheduler → Work groups: tracks group work
- Task results → Completion state: observes results
- Task results → Dependencies: registers continuations
- Dependencies → Owned scheduler: submits successors
- Caller → Owner phases: services phases
- Owned scheduler → Delivery transport: reserves delivery
- Owner phases → Delivery transport: receives notifications
- Caller → External access: prepares access
- External access → Owned scheduler: admits provider work
- External access → Physical retention: activates resource
- Caller → Notifications: binds routes
- Completion state → Notifications: publishes changes
- Caller → Progress snapshots: reads snapshots
- Progress snapshots → Runtime API: observes runtime
