SCHEDULE · HAND OFF · VERIFY

Cooperative tasks: inspect scheduling and cancellation

Run six local transformations. Watch dependency gates, worker assignments, retries and the exact artifacts produced.

Finite DAG · actual local artifacts

Scroll the dependency board horizontally to inspect every task. The task selector below provides the same states and artifacts as text.

Input and task inspection

Your experiment

Set the deadline to 10 seconds. Inspect the cancelled tasks and missing artifacts. This deterministic scheduler illustrates coordination; it does not execute Java coroutines.

Load takes 2s, filtering 4s, joining 3s and verification 5s. Branch durations are adjustable. Default parallel execution with two workers takes 26 modeled seconds; serial execution or one worker takes 34. Use 0.5× for a slower inspection.

Load → filter → sum/histogram → join → verify. The filter retains values at least as large as the chosen threshold. Sum produces count/total; histogram produces actual bins. Verification recomputes count and weighted sum from the bins. A verified result exists only if they agree.

Scheduler events

Offline deterministic dependency scheduler, not an A2A/ADK protocol implementation, Java coroutine runtime, Airflow/Dagster service or LLM agent. All transformations execute locally without arbitrary code, external tools or network calls. Task durations are fixed teaching inputs independent of input length. Ready tasks take free worker slots in the displayed task order. A failed attempt commits no artifact; retries wait the chosen fixed delay. Exhausted failure blocks descendants, or cancels unfinished work under fail-fast. Tasks completing exactly at the deadline succeed before cancellation of unfinished tasks. No scheduling overhead, durable checkpoint, distributed race, compensation, network latency or persistent resume is modeled. Workflow concepts · DAG dependencies.

Six cooperative tasks on bounded workers

The lab runs a finite dependency graph: load, filter, sum, histogram, join and verify. A task is runnable only when every dependency has succeeded, and a runnable task waits until a worker slot is free, much as suspended coroutines wait for a dispatcher thread. With the default array [3,1,-2,3,7,0], minimum retained value zero and two worker slots, sum runs from six to fourteen seconds and histogram from six to eighteen in parallel. Join and verify finish at twenty-six seconds, accepting count five, sum fourteen and mean 2.8.

Scheduling changes completion time, not the answer

Set Worker slots to one. Histogram can no longer overlap sum and starts at fourteen seconds, so verification ends at thirty-four. Choosing Histogram waits for sum in Branch dependency gives the same thirty-four seconds even with two workers. The artifacts are identical in all three runs. Sum duration and Histogram duration change the schedule the same way. Edit the integer array or the minimum retained value and the artifacts change while the dependency rules stay the same.

Cancellation at a deadline

Set Workflow deadline to twenty seconds. Sum and histogram complete, but join is running from eighteen to twenty-one, so at twenty seconds it is cancelled in flight and verify never starts; the run ends cancelled with no output. With one worker the same deadline cancels histogram mid-run. A deadline of twenty-nine still verifies at twenty-six. Cancellation here discards unfinished work and commits no partial artifact.

Failures, retries and fail-fast

Open Failure and retry controls and set Injected failure task to Sum branch with Failure behavior First attempt only: it fails at fourteen, becomes eligible again after the two-second retry delay, reruns from sixteen to twenty-four, and the workflow still verifies at thirty-two. Change Failure behavior to Every attempt: sum exhausts two attempts, and join and verify are blocked. Choose Cancel unfinished work in Exhausted failure policy: they are reported as cancelled instead. Maximum attempts per task and Retry delay change those timings. Inject one extra zero into histogram counts and the verify task rejects the inconsistent report.

Inspection and scope

Play, Next event, Restart, Speed and Modeled time inspect the schedule; Inspect task shows each task state and artifact as text. The scheduler is deterministic and event driven. It is not Kotlin coroutines, Java virtual threads or an ADK runtime: there is no thread pinning, blocking call, suspension point inside a task, cooperative cancellation check or exception propagation through a coroutine scope. Use it to reason about dependencies, worker limits, deadlines and retry policy.

Views are my own and do not represent any employer, past or present.

Search