Kyron Runtime Component Requirements#
Kyron Runtime Component Requirements
|
status: draft
security: YES
safety: QM
|
||||
The component requirements (comp_req) of this component are derived from the orchestration
executor feature requirements of the S-CORE platform. They are added area by area. Each one
carries safety: QM and is satisfied by Kyron Runtime (comp__kyron_runtime).
Some areas have no fitting platform feature requirement yet. Their requirements are listed
under Requirements Without a Platform Parent without a derived_from link, until the
platform adds parents
(eclipse-score/score#2029). This is a
recorded deviation of the module safety plan.
Component Requirements#
Executor Core#
Cooperative Async Task Execution
|
status: valid
security: NO
safety: QM
|
||||
The runtime shall execute tasks provided as Rust futures ( |
|||||
Fixed Async Worker Pool
|
status: valid
security: NO
safety: QM
|
||||
An execution engine shall run its async tasks on a fixed number of async worker threads. The number is configured when the engine is built, in the range 1 to 128, and does not change while the engine runs. A configuration outside this range shall be rejected when the engine is built. |
|||||
Multiple Isolated Execution Engines
|
status: valid
security: NO
safety: QM
|
||||
The runtime shall support multiple execution engines, each with its own async worker threads. A task shall run only on the worker threads of the execution engine it was spawned into. |
|||||
Blocking Work#
Dedicated Workers
|
status: valid
security: NO
safety: QM
|
||||
An execution engine shall support dedicated workers. Each dedicated worker runs on its own OS thread outside the async worker pool and is identified by a unique worker ID. A blocking call on a dedicated worker shall not block the async workers, and a blocking call on an async worker shall not block the dedicated workers. Registering the same worker ID twice shall be rejected when the engine is built. |
|||||
Dedicated Worker Task Locality
|
status: valid
security: NO
safety: QM
|
||||
A task spawned on a dedicated worker shall run only on the thread of that dedicated worker, including after it yields. |
|||||
Spawn on Unregistered Dedicated Worker
|
status: valid
security: NO
safety: QM
|
||||
Spawning a task on a dedicated worker ID that is not registered in the execution engine shall be reported as a non-recoverable error. |
|||||
Worker Threads#
Uniform Async Worker Priority
|
status: valid
security: NO
safety: QM
|
||||
All async workers of an execution engine shall run with the same OS thread priority and scheduler type, configured once per execution engine. If only one of the two is configured, both shall be inherited from the thread that starts the execution engine. |
|||||
Async Worker Affinity
|
status: valid
security: NO
safety: QM
|
||||
The CPU core affinity of the async workers shall be configurable per execution engine. A CPU core outside the range supported by the system shall be reported as a non-recoverable error. |
|||||
Task Scheduling#
No Task Priorities
|
status: valid
security: NO
safety: QM
|
||||
The operations that spawn a task on the async workers shall not take a task priority, and the scheduler shall not order the tasks of an execution engine by priority. |
|||||
FIFO Task Queues
|
status: valid
security: NO
safety: QM
|
||||
Each async worker shall take the tasks of its local task queue in FIFO order. It shall also take tasks from the global queue of its execution engine at regular intervals, so that a busy local queue does not starve the tasks in the global queue. |
|||||
Task Queue Size
|
status: valid
security: NO
safety: QM
|
||||
The size of the local task queue of the async workers shall be configurable per execution engine. A size that is smaller than 2 or not a power of two shall be rejected as a non-recoverable error when the execution engine is configured. |
|||||
Task Queue Overflow
|
status: valid
security: NO
safety: QM
|
||||
When the local task queue of an async worker is full, tasks shall move to the global queue of the execution engine. When the global queue is also full, spawning a task shall be reported as a non-recoverable error. |
|||||
Cooperative Yielding#
Yield Operation
|
status: valid
security: NO
safety: QM
|
||||
The runtime shall provide an operation with which a task gives control back to its worker, so that other queued tasks can run before the task continues. |
|||||
Yielding Guideline
|
status: valid
security: NO
safety: QM
|
||||
The user manual shall describe how to divide long-running operations into cooperatively yielding segments, and when to use a dedicated worker instead. |
|||||
Timers and Channels#
Async Sleep
|
status: valid
security: NO
safety: QM
|
||||
The runtime shall provide an asynchronous sleep that completes no earlier than the requested duration and does not block its worker thread, so that other tasks run while a task sleeps. |
|||||
Single-Producer Single-Consumer Channel
|
status: valid
security: NO
safety: QM
|
||||
The runtime shall provide a bounded single-producer single-consumer channel that delivers values in the order they were sent. Sending into a full channel shall fail without blocking. After the receiver is dropped, sending shall fail. After the sender is dropped, receiving shall report the closed channel once all values sent before are received. |
|||||
Broadcast Channel
|
status: valid
security: NO
safety: QM
|
||||
The runtime shall provide a bounded single-producer broadcast channel that delivers every value to every receiver. The maximum number of receivers is set when the channel is created: adding a receiver beyond it shall fail, and a maximum of zero shall be rejected. Sending shall report an overflow for a receiver whose buffer is full, without blocking the sender or the other receivers. |
|||||
Dedicated Worker Threads#
Dedicated Worker Affinity
|
status: valid
security: NO
safety: QM
|
||||
The CPU affinity of each dedicated worker shall be configurable. An affinity that names a CPU core outside the supported range shall be rejected with an error. |
|||||
Requirements Without a Platform Parent#
The platform has no feature requirement yet that these requirements can be derived from
(eclipse-score/score#2029). They have no
derived_from link until it does. The safety worker requirements are QM like the rest of
Kyron: no safety goal may rely on them (see Kyron Safety Plan).
Worker Thread Parameters
|
status: valid
security: NO
safety: QM
|
||||
The thread stack size of the async workers, and the thread priority, scheduler and stack size of each dedicated worker, shall be configurable. A stack size below the minimum of the operating system shall be rejected with an error. |
|||||
Spawn From Reusable Futures
|
status: valid
security: NO
safety: QM
|
||||
The runtime shall spawn tasks from a pool of reusable futures, on the async workers and on a dedicated worker. Taking a future from an exhausted pool shall fail with an error, and a future shall be available again after its task completes. |
|||||
TCP Networking
|
status: valid
security: YES
safety: QM
|
||||
The runtime shall provide asynchronous TCP listeners and streams for IPv4 and IPv6: bind, accept, connect, read, write, and reading and setting the IP time-to-live. Setting an invalid time-to-live shall be reported as an error. |
|||||
UDP Networking
|
status: valid
security: YES
safety: QM
|
||||
The runtime shall provide asynchronous UDP sockets for IPv4 and IPv6: bind, connect, send and receive, send to and receive from an address, and reading and setting the IP time-to-live. Sending on an unconnected socket without a destination address, and setting an invalid time-to-live, shall be reported as errors. |
|||||
Safety API Availability
|
status: valid
security: NO
safety: QM
|
||||
Without a safety worker in the execution engine, the safety API shall run tasks like the
regular API. |
|||||
Safety Worker Error Handling
|
status: valid
security: NO
safety: QM
|
||||
When a safety task completes with an error, and the task awaiting its result is waiting for it at that moment, the runtime shall continue the awaiting task on the safety worker thread. |
|||||
Overview#
ID |
Title |
Safety |
Security |
Status |
Derived From |
|---|---|---|---|---|---|
Cooperative Async Task Execution |
QM |
NO |
valid |
||
Broadcast Channel |
QM |
NO |
valid |
||
Dedicated Worker Affinity |
QM |
NO |
valid |
||
Dedicated Worker Task Locality |
QM |
NO |
valid |
||
Spawn on Unregistered Dedicated Worker |
QM |
NO |
valid |
||
Dedicated Workers |
QM |
NO |
valid |
||
FIFO Task Queues |
QM |
NO |
valid |
||
Fixed Async Worker Pool |
QM |
NO |
valid |
||
Multiple Isolated Execution Engines |
QM |
NO |
valid |
feat_req__orchestration__exec_pool_isolation; feat_req__orchestration__exec_scale_instances |
|
No Task Priorities |
QM |
NO |
valid |
||
Spawn From Reusable Futures |
QM |
NO |
valid |
||
Safety API Availability |
QM |
NO |
valid |
||
Safety Worker Error Handling |
QM |
NO |
valid |
||
Async Sleep |
QM |
NO |
valid |
||
Single-Producer Single-Consumer Channel |
QM |
NO |
valid |
||
Task Queue Overflow |
QM |
NO |
valid |
||
Task Queue Size |
QM |
NO |
valid |
||
TCP Networking |
QM |
YES |
valid |
||
Worker Thread Parameters |
QM |
NO |
valid |
||
UDP Networking |
QM |
YES |
valid |
||
Async Worker Affinity |
QM |
NO |
valid |
||
Uniform Async Worker Priority |
QM |
NO |
valid |
||
Yielding Guideline |
QM |
NO |
valid |
||
Yield Operation |
QM |
NO |
valid |
Parent Feature Requirements#
ID |
Title |
Safety |
Status |
|---|---|---|---|
Async Cooperative Task Runtime |
QM |
valid |
|
Dedicated Threads for Blocking Operations |
QM |
valid |
|
FIFO or Fairness Scheduling |
QM |
valid |
|
Fixed-Size Thread Pool |
QM |
valid |
|
No Internal Priorities for Cooperative Tasks |
QM |
valid |
|
Uniform OS Priority for Non-Safety Threads |
QM |
valid |
|
Isolated Thread Pools |
QM |
valid |
|
Scale via Additional Executors |
QM |
valid |
|
Configurable Thread Affinity |
QM |
valid |
|
Yielding Guidelines for Long Operations |
QM |
valid |