# ayaanz30/task-greedy-minions architecture

> Architecture diagram of the GitHub repository ayaanz30/task-greedy-minions, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ayaanz30/task-greedy-minions
- Repository: https://github.com/ayaanz30/task-greedy-minions

## Overview

Greedy Minions is an educational C++ task scheduler and benchmark app. Its main workflow runs benchmark work through a JobSystem: tasks are submitted, workers execute ready tasks and steal work when idle, and completion releases dependent tasks until wait_all() returns. The graph also preserves the dependency-graph API, both deque implementations, and all documented workloads. Runtime links are supported by the excerpts and README; benchmark internals were not sampled, so their connections are limited to documented relationships.

Main entry points: [`src/worker.cpp`](https://github.com/ayaanz30/task-greedy-minions/blob/main/src/worker.cpp) (Worker Threads), [`benchmarks/benchmark.hpp`](https://github.com/ayaanz30/task-greedy-minions/blob/main/benchmarks/benchmark.hpp) (Benchmark Interface), [`apps/main.cpp`](https://github.com/ayaanz30/task-greedy-minions/blob/main/apps/main.cpp) (Benchmark App), [`include/jobsys/task.hpp`](https://github.com/ayaanz30/task-greedy-minions/blob/main/include/jobsys/task.hpp) (Task)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and Benchmarks"]
  node_app["Benchmark App<br/>[main.cpp]"]
  node_benchmark["Benchmark Interface<br/>[benchmark.hpp]"]
  node_raytrace["Raytrace Workload"]
  node_mandelbrot["Mandelbrot Workload"]
  node_nbody["N-body Workload"]
  node_transcendental["Transcendental Workload"]
end

subgraph group_runtime["Scheduler Runtime"]
  node_jobsystem["JobSystem<br/>[job_system.cpp]"]
  node_worker["Worker Threads<br/>[worker.cpp]"]
  node_job_api["JobSystem API<br/>[job_system.hpp]"]
end

subgraph group_tasks["Task Graph"]
  node_task["Task<br/>[task.hpp]"]
  node_completion["Completion Handling<br/>[job_system.cpp]"]
end

subgraph group_queues["Work Queues"]
  node_lockfree["Lock-free Deque<br/>[lockfree_deq.hpp]"]
  node_mutexdeque["Mutex Deque"]
  node_deque_api["Mutex Deque API"]
end

node_caller(("App User"))

node_caller -->|"runs"| node_app
node_app -->|"runs benchmarks"| node_benchmark
node_app -->|"selects default"| node_raytrace
node_app -->|"can enable"| node_mandelbrot
node_app -->|"can enable"| node_nbody
node_benchmark -->|"runs parallel work"| node_jobsystem
node_benchmark -->|"measures workload"| node_raytrace
node_benchmark -->|"measures workload"| node_mandelbrot
node_benchmark -->|"measures workload"| node_nbody
node_benchmark -->|"measures workload"| node_transcendental
node_job_api -->|"implements API"| node_jobsystem
node_jobsystem -->|"starts workers"| node_worker
node_jobsystem -->|"submits ready tasks"| node_task
node_worker -->|"executes tasks"| node_task
node_worker -->|"reports completion"| node_completion
node_completion -->|"releases successors"| node_task
node_worker -->|"uses queue"| node_lockfree
node_worker -->|"steals from peers"| node_worker
node_worker -.->|"alternative queue"| node_deque_api
node_deque_api -->|"implemented by"| node_mutexdeque
node_task -->|"adds dependencies"| node_task

click node_app "https://github.com/ayaanz30/task-greedy-minions/blob/main/apps/main.cpp"
click node_benchmark "https://github.com/ayaanz30/task-greedy-minions/blob/main/benchmarks/benchmark.hpp"
click node_raytrace "https://github.com/ayaanz30/task-greedy-minions/blob/main/benchmarks/benchmarks/raytrace_benchmark.hpp"
click node_mandelbrot "https://github.com/ayaanz30/task-greedy-minions/blob/main/benchmarks/benchmarks/mandelbrot_benchmark.hpp"
click node_nbody "https://github.com/ayaanz30/task-greedy-minions/blob/main/benchmarks/benchmarks/nbody_benchmark.hpp"
click node_transcendental "https://github.com/ayaanz30/task-greedy-minions/blob/main/benchmarks/benchmarks/transcedental_benchmark.hpp"
click node_jobsystem "https://github.com/ayaanz30/task-greedy-minions/blob/main/src/job_system.cpp"
click node_worker "https://github.com/ayaanz30/task-greedy-minions/blob/main/src/worker.cpp"
click node_job_api "https://github.com/ayaanz30/task-greedy-minions/blob/main/include/jobsys/job_system.hpp"
click node_task "https://github.com/ayaanz30/task-greedy-minions/blob/main/include/jobsys/task.hpp"
click node_completion "https://github.com/ayaanz30/task-greedy-minions/blob/main/src/job_system.cpp"
click node_lockfree "https://github.com/ayaanz30/task-greedy-minions/blob/main/include/jobsys/lockfree_deq.hpp"
click node_mutexdeque "https://github.com/ayaanz30/task-greedy-minions/blob/main/src/work_stealing_deq.cpp"
click node_deque_api "https://github.com/ayaanz30/task-greedy-minions/blob/main/include/jobsys/work_stealing_deq.hpp"

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_app,node_benchmark,node_raytrace,node_mandelbrot,node_nbody,node_transcendental,node_caller toneBlue
class node_jobsystem,node_worker,node_job_api toneAmber
class node_task,node_completion toneMint
class node_lockfree,node_mutexdeque,node_deque_api toneRose
```

## Components

### Application and Benchmarks

- [Benchmark App](https://github.com/ayaanz30/task-greedy-minions/blob/main/apps/main.cpp): `apps/main.cpp`
- [Benchmark Interface](https://github.com/ayaanz30/task-greedy-minions/blob/main/benchmarks/benchmark.hpp): `benchmarks/benchmark.hpp`
- [Raytrace Workload](https://github.com/ayaanz30/task-greedy-minions/blob/main/benchmarks/benchmarks/raytrace_benchmark.hpp): `benchmarks/benchmarks/raytrace_benchmark.hpp`
- [Mandelbrot Workload](https://github.com/ayaanz30/task-greedy-minions/blob/main/benchmarks/benchmarks/mandelbrot_benchmark.hpp): `benchmarks/benchmarks/mandelbrot_benchmark.hpp`
- [N-body Workload](https://github.com/ayaanz30/task-greedy-minions/blob/main/benchmarks/benchmarks/nbody_benchmark.hpp): `benchmarks/benchmarks/nbody_benchmark.hpp`
- [Transcendental Workload](https://github.com/ayaanz30/task-greedy-minions/blob/main/benchmarks/benchmarks/transcedental_benchmark.hpp): `benchmarks/benchmarks/transcedental_benchmark.hpp`

### Scheduler Runtime

- [JobSystem](https://github.com/ayaanz30/task-greedy-minions/blob/main/src/job_system.cpp): `src/job_system.cpp`
- [Worker Threads](https://github.com/ayaanz30/task-greedy-minions/blob/main/src/worker.cpp): `src/worker.cpp`
- [JobSystem API](https://github.com/ayaanz30/task-greedy-minions/blob/main/include/jobsys/job_system.hpp): `include/jobsys/job_system.hpp`

### Task Graph

- [Task](https://github.com/ayaanz30/task-greedy-minions/blob/main/include/jobsys/task.hpp): `include/jobsys/task.hpp`
- [Completion Handling](https://github.com/ayaanz30/task-greedy-minions/blob/main/src/job_system.cpp): `src/job_system.cpp`

### Work Queues

- [Lock-free Deque](https://github.com/ayaanz30/task-greedy-minions/blob/main/include/jobsys/lockfree_deq.hpp): `include/jobsys/lockfree_deq.hpp`
- [Mutex Deque](https://github.com/ayaanz30/task-greedy-minions/blob/main/src/work_stealing_deq.cpp): `src/work_stealing_deq.cpp`
- [Mutex Deque API](https://github.com/ayaanz30/task-greedy-minions/blob/main/include/jobsys/work_stealing_deq.hpp): `include/jobsys/work_stealing_deq.hpp`

### Other components

- **App User**

## Connections

- App User → Benchmark App: runs (evidence: `README.md`)
- Benchmark App → Benchmark Interface: runs benchmarks (evidence: `apps/main.cpp`)
- Benchmark App → Raytrace Workload: selects default (evidence: `apps/main.cpp`)
- Benchmark App → Mandelbrot Workload: can enable (evidence: `apps/main.cpp`)
- Benchmark App → N-body Workload: can enable (evidence: `apps/main.cpp`)
- Benchmark Interface → JobSystem: runs parallel work (evidence: `README.md`)
- Benchmark Interface → Raytrace Workload: measures workload (evidence: `README.md`)
- Benchmark Interface → Mandelbrot Workload: measures workload (evidence: `README.md`)
- Benchmark Interface → N-body Workload: measures workload (evidence: `README.md`)
- Benchmark Interface → Transcendental Workload: measures workload (evidence: `README.md`)
- JobSystem API → JobSystem: implements API (evidence: `include/jobsys/job_system.hpp`)
- JobSystem → Worker Threads: starts workers (evidence: `src/job_system.cpp`)
- JobSystem → Task: submits ready tasks (evidence: `src/job_system.cpp`)
- Worker Threads → Task: executes tasks (evidence: `src/worker.cpp`)
- Worker Threads → Completion Handling: reports completion (evidence: `src/worker.cpp`)
- Completion Handling → Task: releases successors (evidence: `src/job_system.cpp`)
- Worker Threads → Lock-free Deque: uses queue
- Worker Threads → Worker Threads: steals from peers (evidence: `src/worker.cpp`)
- Worker Threads → Mutex Deque API: alternative queue (evidence: `README.md`)
- Mutex Deque API → Mutex Deque: implemented by (evidence: `src/work_stealing_deq.cpp`)
- Task → Task: adds dependencies (evidence: `include/jobsys/task.hpp`)
