MaCH repo

This commit is contained in:
2025-07-24 12:46:01 -05:00
committed by Nick Ricketts
commit d01e8e50b1
105 changed files with 5976 additions and 0 deletions

View File

@@ -0,0 +1,156 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 880 530" font-family="'SF Mono', 'Cascadia Code', 'Fira Code', monospace" font-size="12">
<defs>
<marker id="arrow" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#64748b"/>
</marker>
<marker id="arrow-blue" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#3b82f6"/>
</marker>
<marker id="arrow-amber" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#d97706"/>
</marker>
<marker id="arrow-green" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#16a34a"/>
</marker>
</defs>
<!-- Background -->
<rect width="880" height="530" fill="#0f172a" rx="8"/>
<!-- Title -->
<text x="440" y="32" text-anchor="middle" fill="#e2e8f0" font-size="15" font-weight="600">Multi-Reactor Architecture</text>
<!-- HTTP Clients -->
<rect x="30" y="56" width="120" height="36" rx="4" fill="#1e293b" stroke="#334155" stroke-width="1"/>
<text x="90" y="79" text-anchor="middle" fill="#94a3b8" font-size="11">HTTP Clients</text>
<!-- Arrow from clients down -->
<line x1="90" y1="92" x2="90" y2="118" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrow)"/>
<!-- Request Reactors group -->
<rect x="16" y="118" width="530" height="340" rx="6" fill="none" stroke="#334155" stroke-width="1" stroke-dasharray="6,3"/>
<text x="32" y="138" fill="#64748b" font-size="10" letter-spacing="1">REQUEST REACTORS</text>
<!-- Reactor 0 -->
<rect x="32" y="152" width="244" height="140" rx="5" fill="#1e293b" stroke="#3b82f6" stroke-width="1"/>
<text x="154" y="172" text-anchor="middle" fill="#3b82f6" font-size="11" font-weight="600">Reactor 0 · Core 0</text>
<rect x="48" y="184" width="212" height="28" rx="3" fill="#172554" stroke="#1e3a5f" stroke-width="1"/>
<text x="154" y="203" text-anchor="middle" fill="#60a5fa" font-size="10">Event Loop</text>
<rect x="48" y="220" width="100" height="24" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="98" y="236" text-anchor="middle" fill="#94a3b8" font-size="9">Pipeline</text>
<rect x="160" y="220" width="100" height="24" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="210" y="236" text-anchor="middle" fill="#94a3b8" font-size="9">Pipeline</text>
<rect x="48" y="252" width="100" height="24" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="98" y="268" text-anchor="middle" fill="#94a3b8" font-size="9">Pipeline</text>
<rect x="160" y="252" width="100" height="24" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="210" y="268" text-anchor="middle" fill="#94a3b8" font-size="9">Arena Pool</text>
<!-- Reactor 1 -->
<rect x="292" y="152" width="244" height="140" rx="5" fill="#1e293b" stroke="#3b82f6" stroke-width="1"/>
<text x="414" y="172" text-anchor="middle" fill="#3b82f6" font-size="11" font-weight="600">Reactor 1 · Core 1</text>
<rect x="308" y="184" width="212" height="28" rx="3" fill="#172554" stroke="#1e3a5f" stroke-width="1"/>
<text x="414" y="203" text-anchor="middle" fill="#60a5fa" font-size="10">Event Loop</text>
<rect x="308" y="220" width="100" height="24" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="358" y="236" text-anchor="middle" fill="#94a3b8" font-size="9">Pipeline</text>
<rect x="420" y="220" width="100" height="24" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="470" y="236" text-anchor="middle" fill="#94a3b8" font-size="9">Pipeline</text>
<rect x="308" y="252" width="100" height="24" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="358" y="268" text-anchor="middle" fill="#94a3b8" font-size="9">Pipeline</text>
<rect x="420" y="252" width="100" height="24" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="470" y="268" text-anchor="middle" fill="#94a3b8" font-size="9">Arena Pool</text>
<!-- Reactor N -->
<rect x="32" y="304" width="244" height="140" rx="5" fill="#1e293b" stroke="#3b82f6" stroke-width="1"/>
<text x="154" y="324" text-anchor="middle" fill="#3b82f6" font-size="11" font-weight="600">Reactor N · Core N</text>
<rect x="48" y="336" width="212" height="28" rx="3" fill="#172554" stroke="#1e3a5f" stroke-width="1"/>
<text x="154" y="355" text-anchor="middle" fill="#60a5fa" font-size="10">Event Loop</text>
<rect x="48" y="372" width="100" height="24" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="98" y="388" text-anchor="middle" fill="#94a3b8" font-size="9">Pipeline</text>
<rect x="160" y="372" width="100" height="24" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="210" y="388" text-anchor="middle" fill="#94a3b8" font-size="9">Pipeline</text>
<rect x="48" y="404" width="100" height="24" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="98" y="420" text-anchor="middle" fill="#94a3b8" font-size="9">Pipeline</text>
<rect x="160" y="404" width="100" height="24" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="210" y="420" text-anchor="middle" fill="#94a3b8" font-size="9">Arena Pool</text>
<!-- Ellipsis between reactor 1 and N -->
<text x="414" y="340" text-anchor="middle" fill="#475569" font-size="20">···</text>
<!-- Worker Reactor group -->
<rect x="570" y="118" width="294" height="340" rx="6" fill="none" stroke="#334155" stroke-width="1" stroke-dasharray="6,3"/>
<text x="586" y="138" fill="#64748b" font-size="10" letter-spacing="1">WORKER REACTOR</text>
<rect x="586" y="152" width="262" height="292" rx="5" fill="#1e293b" stroke="#d97706" stroke-width="1"/>
<text x="717" y="172" text-anchor="middle" fill="#d97706" font-size="11" font-weight="600">Worker · Tasks</text>
<!-- Event Loop -->
<rect x="602" y="184" width="230" height="28" rx="3" fill="#422006" stroke="#713f12" stroke-width="1"/>
<text x="717" y="203" text-anchor="middle" fill="#fbbf24" font-size="10">Event Loop</text>
<!-- Thread Pool -->
<rect x="602" y="224" width="230" height="80" rx="3" fill="none" stroke="#713f12" stroke-width="1" stroke-dasharray="4,2"/>
<text x="717" y="242" text-anchor="middle" fill="#d97706" font-size="10">Thread Pool</text>
<rect x="614" y="252" width="64" height="24" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="646" y="268" text-anchor="middle" fill="#94a3b8" font-size="9">Thread</text>
<rect x="686" y="252" width="64" height="24" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="718" y="268" text-anchor="middle" fill="#94a3b8" font-size="9">Thread</text>
<rect x="758" y="252" width="64" height="24" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="790" y="268" text-anchor="middle" fill="#94a3b8" font-size="9">Thread</text>
<!-- Task queue -->
<rect x="602" y="316" width="230" height="56" rx="3" fill="none" stroke="#713f12" stroke-width="1" stroke-dasharray="4,2"/>
<text x="717" y="334" text-anchor="middle" fill="#d97706" font-size="10">Task Queue</text>
<rect x="614" y="344" width="64" height="20" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="646" y="358" text-anchor="middle" fill="#94a3b8" font-size="8">task()</text>
<rect x="686" y="344" width="76" height="20" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="724" y="358" text-anchor="middle" fill="#94a3b8" font-size="8">task_async()</text>
<rect x="770" y="344" width="52" height="20" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="796" y="358" text-anchor="middle" fill="#94a3b8" font-size="8">cron</text>
<!-- Arena -->
<rect x="602" y="384" width="230" height="24" rx="3" fill="#0f172a" stroke="#334155" stroke-width="1"/>
<text x="717" y="400" text-anchor="middle" fill="#94a3b8" font-size="9">Arena Pool</text>
<!-- task() flow: request reactor -> worker -> back -->
<!-- Arrow: request reactor to worker (dispatch) -->
<line x1="546" y1="260" x2="582" y2="354" stroke="#d97706" stroke-width="1.5" marker-end="url(#arrow-amber)"/>
<text x="556" y="300" fill="#d97706" font-size="8" transform="rotate(69, 556, 300)" text-anchor="middle">dispatch</text>
<!-- Arrow: worker back to request reactor (resume) -->
<path d="M 586 420 C 566 420, 400 458, 280 458" fill="none" stroke="#16a34a" stroke-width="1.5" marker-end="url(#arrow-green)"/>
<text x="440" y="472" text-anchor="middle" fill="#16a34a" font-size="9">task() → yield reactor → resume on complete</text>
<!-- Legend -->
<rect x="30" y="496" width="10" height="10" rx="2" fill="none" stroke="#3b82f6" stroke-width="1.5"/>
<text x="46" y="505" fill="#94a3b8" font-size="9">Request Reactor (per core)</text>
<rect x="260" y="496" width="10" height="10" rx="2" fill="none" stroke="#d97706" stroke-width="1.5"/>
<text x="276" y="505" fill="#94a3b8" font-size="9">Worker Reactor (single)</text>
<line x1="490" y1="501" x2="510" y2="501" stroke="#d97706" stroke-width="1.5"/>
<text x="516" y="505" fill="#94a3b8" font-size="9">Dispatch</text>
<line x1="590" y1="501" x2="610" y2="501" stroke="#16a34a" stroke-width="1.5"/>
<text x="616" y="505" fill="#94a3b8" font-size="9">Resume</text>
</svg>

After

Width:  |  Height:  |  Size: 9.2 KiB