<mxfile host="Electron" modified="2026-07-02T18:00:00.000Z" agent="draw.io/30.2.6" version="30.2.6">
  <diagram id="energon-fork-flow" name="Asynchronous worker lifecycle">
    <mxGraphModel dx="1800" dy="1720" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1800" pageHeight="1720" background="#FFFFFF" math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />

        <mxCell id="title" value="DataLoader lifecycle with asynchronous workers" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;fontFamily=Helvetica;fontSize=27;fontStyle=1;fontColor=#17365D;" parent="1" vertex="1">
          <mxGeometry x="40" y="20" width="1220" height="45" as="geometry" />
        </mxCell>
        <mxCell id="legend" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#AAB2BD;" parent="1" vertex="1">
          <mxGeometry x="1285" y="12" width="475" height="68" as="geometry" />
        </mxCell>
        <mxCell id="legend-call" value="" style="edgeStyle=none;html=1;strokeColor=#6C8EBF;strokeWidth=2;endArrow=block;endFill=1;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1305" y="31" as="sourcePoint" /><mxPoint x="1345" y="31" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="legend-call-label" value="caller-side call" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;fontFamily=Helvetica;fontSize=11;fontColor=#34495E;" parent="1" vertex="1"><mxGeometry x="1355" y="23" width="145" height="16" as="geometry" /></mxCell>
        <mxCell id="legend-command" value="" style="edgeStyle=none;html=1;strokeColor=#0097A7;strokeWidth=3;endArrow=block;endFill=1;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1510" y="31" as="sourcePoint" /><mxPoint x="1550" y="31" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="legend-command-label" value="RPC command" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;fontFamily=Helvetica;fontSize=11;fontColor=#34495E;" parent="1" vertex="1"><mxGeometry x="1560" y="23" width="120" height="16" as="geometry" /></mxCell>
        <mxCell id="legend-result" value="" style="edgeStyle=none;html=1;strokeColor=#0097A7;strokeWidth=2;dashed=1;dashPattern=6 4;endArrow=open;endFill=0;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1305" y="55" as="sourcePoint" /><mxPoint x="1345" y="55" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="legend-result-label" value="future / RPC result" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;fontFamily=Helvetica;fontSize=11;fontColor=#34495E;" parent="1" vertex="1"><mxGeometry x="1355" y="47" width="145" height="16" as="geometry" /></mxCell>
        <mxCell id="legend-shutdown" value="" style="edgeStyle=none;html=1;strokeColor=#CC0000;strokeWidth=3;endArrow=block;endFill=1;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1510" y="55" as="sourcePoint" /><mxPoint x="1550" y="55" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="legend-shutdown-label" value="shutdown" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;fontFamily=Helvetica;fontSize=11;fontColor=#34495E;" parent="1" vertex="1"><mxGeometry x="1560" y="47" width="100" height="16" as="geometry" /></mxCell>

        <mxCell id="parent-process" value="RANK PROCESS · CALLER SIDE" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#DCE6F1;strokeColor=#6C8EBF;fontColor=#17365D;fontFamily=Helvetica;fontSize=13;fontStyle=1;" parent="1" vertex="1"><mxGeometry x="35" y="95" width="980" height="42" as="geometry" /></mxCell>
        <mxCell id="worker-process" value="ASYNC WORKER CONTEXT · ONE LANE PER WORKER" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#F8CECC;strokeColor=#B85450;fontColor=#6B1D1D;fontFamily=Helvetica;fontSize=13;fontStyle=1;" parent="1" vertex="1"><mxGeometry x="1035" y="95" width="730" height="42" as="geometry" /></mxCell>

        <mxCell id="phase-instantiate" value="1  INSTANTIATE" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#DCE6F1;fillOpacity=22;strokeColor=#6C8EBF;strokeOpacity=45;align=left;verticalAlign=top;spacingTop=7;spacingLeft=10;fontFamily=Helvetica;fontSize=12;fontStyle=1;fontColor=#17365D;" parent="1" vertex="1"><mxGeometry x="30" y="245" width="1740" height="115" as="geometry" /></mxCell>
        <mxCell id="phase-load" value="2  LOAD CHECKPOINT" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#FFF2CC;fillOpacity=30;strokeColor=#D6B656;strokeOpacity=55;align=left;verticalAlign=top;spacingTop=7;spacingLeft=10;fontFamily=Helvetica;fontSize=12;fontStyle=1;fontColor=#5D4700;" parent="1" vertex="1"><mxGeometry x="30" y="360" width="1740" height="115" as="geometry" /></mxCell>
        <mxCell id="phase-iterate" value="3  ITER DATA" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#D5E8D4;fillOpacity=20;strokeColor=#82B366;strokeOpacity=45;align=left;verticalAlign=top;spacingTop=7;spacingLeft=10;fontFamily=Helvetica;fontSize=12;fontStyle=1;fontColor=#274E13;" parent="1" vertex="1"><mxGeometry x="30" y="475" width="1740" height="645" as="geometry" /></mxCell>
        <mxCell id="phase-save" value="4  SAVE CHECKPOINT" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#FFF2CC;fillOpacity=30;strokeColor=#D6B656;strokeOpacity=55;align=left;verticalAlign=top;spacingTop=7;spacingLeft=10;fontFamily=Helvetica;fontSize=12;fontStyle=1;fontColor=#5D4700;" parent="1" vertex="1"><mxGeometry x="30" y="1120" width="1740" height="245" as="geometry" /></mxCell>
        <mxCell id="phase-shutdown" value="5  SHUTDOWN" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#F8CECC;fillOpacity=24;strokeColor=#B85450;strokeOpacity=50;align=left;verticalAlign=top;spacingTop=7;spacingLeft=10;fontFamily=Helvetica;fontSize=12;fontStyle=1;fontColor=#6B1D1D;" parent="1" vertex="1"><mxGeometry x="30" y="1365" width="1740" height="315" as="geometry" /></mxCell>

        <mxCell id="app" value="Training code" style="shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;fillColor=#DCE6F1;strokeColor=#6C8EBF;fontColor=#17365D;fontFamily=Helvetica;fontSize=13;fontStyle=1;size=55;" parent="1" vertex="1"><mxGeometry x="65" y="155" width="170" height="1510" as="geometry" /></mxCell>
        <mxCell id="parent-dataset" value="SavableDataset&#xa;(loader-owned object)" style="shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;fillColor=#FFF2CC;strokeColor=#D6B656;fontColor=#5D4700;fontFamily=Helvetica;fontSize=13;fontStyle=1;size=55;" parent="1" vertex="1"><mxGeometry x="265" y="155" width="180" height="1510" as="geometry" /></mxCell>
        <mxCell id="loader" value="DataLoader&#xa;(coordinator)" style="shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;fillColor=#23497D;strokeColor=#17365D;fontColor=#FFFFFF;fontFamily=Helvetica;fontSize=13;fontStyle=1;size=55;" parent="1" vertex="1"><mxGeometry x="495" y="155" width="200" height="1510" as="geometry" /></mxCell>
        <mxCell id="proxy" value="Async worker object&#xa;(caller-side interface)" style="shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;fillColor=#E1D5E7;strokeColor=#9673A6;fontColor=#4A235A;fontFamily=Helvetica;fontSize=13;fontStyle=1;size=55;" parent="1" vertex="1"><mxGeometry x="750" y="155" width="235" height="1510" as="geometry" /></mxCell>
        <mxCell id="worker" value="Worker loop&#xa;(fork process or thread)" style="shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;fillColor=#F4B7B4;strokeColor=#B85450;fontColor=#6B1D1D;fontFamily=Helvetica;fontSize=13;fontStyle=1;size=55;" parent="1" vertex="1"><mxGeometry x="1110" y="155" width="245" height="1510" as="geometry" /></mxCell>
        <mxCell id="worker-dataset" value="Dataset execution&#xa;(copy for fork, shared for threads)" style="shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;dropTarget=0;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest;fillColor=#D5E8D4;strokeColor=#82B366;fontColor=#274E13;fontFamily=Helvetica;fontSize=13;fontStyle=1;size=55;" parent="1" vertex="1"><mxGeometry x="1450" y="155" width="250" height="1510" as="geometry" /></mxCell>

        <mxCell id="m01" value="construct dataset + WorkerConfig" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#6C8EBF;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#17365D;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="150" y="278" as="sourcePoint" /><mxPoint x="355" y="278" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m02" value="get_savable_loader(dataset, worker_type=&quot;fork&quot; or &quot;thread&quot;)" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#6C8EBF;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#17365D;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="150" y="315" as="sourcePoint" /><mxPoint x="595" y="315" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m03" value="Wrap and store dataset; workers start later" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#6C8EBF;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#17365D;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="595" y="337" as="sourcePoint" /><mxPoint x="595" y="352" as="targetPoint" /><Array as="points"><mxPoint x="715" y="337" /><mxPoint x="715" y="352" /></Array></mxGeometry></mxCell>

        <mxCell id="m04" value="restore_state_rank(rank_state)" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#D79B00;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#5D4700;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="150" y="393" as="sourcePoint" /><mxPoint x="595" y="393" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m05" value="Validate checkpoint and batch settings" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#D79B00;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#5D4700;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="595" y="414" as="sourcePoint" /><mxPoint x="595" y="429" as="targetPoint" /><Array as="points"><mxPoint x="750" y="414" /><mxPoint x="750" y="429" /></Array></mxGeometry></mxCell>
        <mxCell id="m06" value="Stage rank state for startup" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#D79B00;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#5D4700;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="595" y="445" as="sourcePoint" /><mxPoint x="595" y="460" as="targetPoint" /><Array as="points"><mxPoint x="745" y="445" /><mxPoint x="745" y="460" /></Array></mxGeometry></mxCell>
        <mxCell id="restore-note" value="Stage rank state before iteration.&#xa;Workers apply it during startup." style="shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fillColor=#FFF2CC;strokeColor=#D6B656;fontColor=#5D4700;fontFamily=Helvetica;fontSize=11;align=left;spacing=6;" parent="1" vertex="1"><mxGeometry x="1110" y="382" width="300" height="68" as="geometry" /></mxCell>

        <mxCell id="m07" value="with loader  -&amp;gt;  __enter__()" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#6C8EBF;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#17365D;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="150" y="505" as="sourcePoint" /><mxPoint x="595" y="505" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m08" value="start(): create one object per async worker" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#6C8EBF;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#17365D;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="595" y="527" as="sourcePoint" /><mxPoint x="595" y="542" as="targetPoint" /><Array as="points"><mxPoint x="735" y="527" /><mxPoint x="735" y="542" /></Array></mxGeometry></mxCell>
        <mxCell id="m09" value="Construct worker and call start()" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#6C8EBF;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#17365D;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="595" y="570" as="sourcePoint" /><mxPoint x="868" y="570" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m10" value="Start process or thread; read command queue" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#0097A7;strokeWidth=3;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#006064;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="868" y="603" as="sourcePoint" /><mxPoint x="1233" y="603" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="parallel-note" value="Both backends match replies by future ID.&#xa;Fork: a pipe and a lazy receiver in the rank process.&#xa;Thread: the worker completes futures directly." style="shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fillColor=#F8CECC;strokeColor=#B85450;fontColor=#6B1D1D;fontFamily=Helvetica;fontSize=11;align=left;spacing=6;" parent="1" vertex="1"><mxGeometry x="1380" y="495" width="330" height="75" as="geometry" /></mxCell>

        <mxCell id="m11" value="dataset_init(worker_state) [for each worker]" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#6C8EBF;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#17365D;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="595" y="638" as="sourcePoint" /><mxPoint x="868" y="638" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m12" value="_worker_call(dataset_init) -&amp;gt; WorkerCommand(future_id)" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#0097A7;strokeWidth=3;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#006064;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="868" y="672" as="sourcePoint" /><mxPoint x="1233" y="672" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m13" value="Initialize or restore dataset state and iterator" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#82B366;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#274E13;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1233" y="706" as="sourcePoint" /><mxPoint x="1575" y="706" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m14" value="WorkerResult(future_id)" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#0097A7;strokeWidth=2;dashed=1;dashPattern=6 4;endArrow=open;endFill=0;fontFamily=Helvetica;fontSize=11;fontColor=#006064;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1233" y="742" as="sourcePoint" /><mxPoint x="868" y="742" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m15" value="Future completes; dataset_init() returns" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#0097A7;strokeWidth=2;dashed=1;dashPattern=6 4;endArrow=open;endFill=0;fontFamily=Helvetica;fontSize=11;fontColor=#006064;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="868" y="772" as="sourcePoint" /><mxPoint x="595" y="772" as="targetPoint" /></mxGeometry></mxCell>

        <mxCell id="m16" value="Replay pending keys and wait for results" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#6C8EBF;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#17365D;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="595" y="810" as="sourcePoint" /><mxPoint x="868" y="810" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m17" value="_worker_call(_wrk_restore_sample)" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#0097A7;strokeWidth=3;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#006064;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="868" y="842" as="sourcePoint" /><mxPoint x="1233" y="842" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m18" value="dataset.restore_sample(key.inner)" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#82B366;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#274E13;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1233" y="874" as="sourcePoint" /><mxPoint x="1575" y="874" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m19" value="WorkerResult(sample)" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#0097A7;strokeWidth=2;dashed=1;dashPattern=6 4;endArrow=open;endFill=0;fontFamily=Helvetica;fontSize=11;fontColor=#006064;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1233" y="904" as="sourcePoint" /><mxPoint x="868" y="904" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m19b" value="Sample future completes" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#0097A7;strokeWidth=2;dashed=1;dashPattern=6 4;endArrow=open;endFill=0;fontFamily=Helvetica;fontSize=11;fontColor=#006064;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="868" y="927" as="sourcePoint" /><mxPoint x="595" y="927" as="targetPoint" /></mxGeometry></mxCell>

        <mxCell id="prefetch-frame" value="loop" style="shape=umlFrame;whiteSpace=wrap;html=1;pointerEvents=0;fillColor=none;strokeColor=#808080;fontColor=#333333;fontFamily=Helvetica;fontSize=11;fontStyle=1;align=left;verticalAlign=top;" parent="1" vertex="1"><mxGeometry x="470" y="940" width="1260" height="165" as="geometry" /></mxCell>
        <mxCell id="m20" value="prefetch_next() -&amp;gt; Future [non-blocking]" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#6C8EBF;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#17365D;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="595" y="960" as="sourcePoint" /><mxPoint x="868" y="960" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m21" value="WorkerCommand(_wrk_prefetch_next, future_id)" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#0097A7;strokeWidth=3;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#006064;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="868" y="991" as="sourcePoint" /><mxPoint x="1233" y="991" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m22" value="next(dataset_iter); wrap WorkerSampleRestoreKey" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#82B366;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#274E13;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1233" y="1022" as="sourcePoint" /><mxPoint x="1575" y="1022" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m23" value="WorkerResult (sample or error)" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#0097A7;strokeWidth=2;dashed=1;dashPattern=6 4;endArrow=open;endFill=0;fontFamily=Helvetica;fontSize=11;fontColor=#006064;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1233" y="1053" as="sourcePoint" /><mxPoint x="868" y="1053" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m24" value="Yield next sample in round-robin order" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#0097A7;strokeWidth=2;dashed=1;dashPattern=6 4;endArrow=open;endFill=0;fontFamily=Helvetica;fontSize=11;fontColor=#006064;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="595" y="1082" as="sourcePoint" /><mxPoint x="150" y="1082" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m24-complete" value="Matching future completes" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#0097A7;strokeWidth=2;dashed=1;dashPattern=6 4;endArrow=open;endFill=0;fontFamily=Helvetica;fontSize=11;fontColor=#006064;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="868" y="1070" as="sourcePoint" /><mxPoint x="595" y="1070" as="targetPoint" /></mxGeometry></mxCell>

        <mxCell id="m25" value="save_state_rank()" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#D79B00;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#5D4700;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="150" y="1153" as="sourcePoint" /><mxPoint x="595" y="1153" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m26" value="Wait for delivery; collect pending restore keys" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#D79B00;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#5D4700;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="595" y="1175" as="sourcePoint" /><mxPoint x="595" y="1190" as="targetPoint" /><Array as="points"><mxPoint x="795" y="1175" /><mxPoint x="795" y="1190" /></Array></mxGeometry></mxCell>
        <mxCell id="m27" value="worker.save_state() [for each worker]" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#D79B00;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#5D4700;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="595" y="1215" as="sourcePoint" /><mxPoint x="868" y="1215" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m28" value="_worker_call(save_state)" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#0097A7;strokeWidth=3;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#006064;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="868" y="1244" as="sourcePoint" /><mxPoint x="1233" y="1244" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m29" value="Capture dataset state and any worker RNG state" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#82B366;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#274E13;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1233" y="1273" as="sourcePoint" /><mxPoint x="1575" y="1273" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m30" value="WorkerResult(WorkerState)" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#0097A7;strokeWidth=2;dashed=1;dashPattern=6 4;endArrow=open;endFill=0;fontFamily=Helvetica;fontSize=11;fontColor=#006064;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1233" y="1300" as="sourcePoint" /><mxPoint x="868" y="1300" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m30b" value="Snapshot future completes" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#0097A7;strokeWidth=2;dashed=1;dashPattern=6 4;endArrow=open;endFill=0;fontFamily=Helvetica;fontSize=11;fontColor=#006064;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="868" y="1322" as="sourcePoint" /><mxPoint x="595" y="1322" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m31" value="Build and return RankState" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#D79B00;strokeWidth=2;dashed=1;dashPattern=6 4;endArrow=open;endFill=0;fontFamily=Helvetica;fontSize=11;fontColor=#5D4700;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="595" y="1347" as="sourcePoint" /><mxPoint x="150" y="1347" as="targetPoint" /></mxGeometry></mxCell>

        <mxCell id="m32" value="__exit__() -&amp;gt; shutdown()" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#CC0000;strokeWidth=3;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#990000;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="150" y="1395" as="sourcePoint" /><mxPoint x="595" y="1395" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m33" value="Begin shutdown for all workers" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#CC0000;strokeWidth=3;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#990000;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="595" y="1427" as="sourcePoint" /><mxPoint x="868" y="1427" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m34" value="Cancel queued prefetch and request cleanup" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#CC0000;strokeWidth=3;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#990000;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="868" y="1459" as="sourcePoint" /><mxPoint x="1233" y="1459" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m35" value="Run cleanup after the active command" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#CC0000;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#990000;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1233" y="1480" as="sourcePoint" /><mxPoint x="1233" y="1495" as="targetPoint" /><Array as="points"><mxPoint x="1390" y="1480" /><mxPoint x="1390" y="1495" /></Array></mxGeometry></mxCell>
        <mxCell id="m36" value="Release worker-owned dataset resources" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#CC0000;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#990000;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1233" y="1520" as="sourcePoint" /><mxPoint x="1575" y="1520" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m37" value="Send terminal reply" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#CC0000;strokeWidth=2;dashed=1;dashPattern=6 4;endArrow=open;endFill=0;fontFamily=Helvetica;fontSize=11;fontColor=#990000;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1233" y="1548" as="sourcePoint" /><mxPoint x="868" y="1548" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m38" value="Wait for shutdown under a shared deadline" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#CC0000;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#990000;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="868" y="1565" as="sourcePoint" /><mxPoint x="868" y="1580" as="targetPoint" /><Array as="points"><mxPoint x="1030" y="1565" /><mxPoint x="1030" y="1580" /></Array></mxGeometry></mxCell>
        <mxCell id="shutdown-backends" value="&lt;b&gt;Fork&lt;/b&gt;: acknowledge reply, reap child, and kill on timeout.&#xa;&lt;b&gt;Thread&lt;/b&gt;: join the thread and report a timeout if it is still live." style="shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fillColor=#F8CECC;strokeColor=#B85450;fontColor=#6B1D1D;fontFamily=Helvetica;fontSize=11;align=left;spacing=6;" parent="1" vertex="1"><mxGeometry x="1265" y="1555" width="460" height="74" as="geometry" /></mxCell>
        <mxCell id="m39" value="Close loader-owned dataset" style="edgeStyle=none;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#CC0000;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#990000;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="595" y="1640" as="sourcePoint" /><mxPoint x="355" y="1640" as="targetPoint" /></mxGeometry></mxCell>
        <mxCell id="m40" value="Join pin-memory helper" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;verticalAlign=bottom;labelBackgroundColor=#FFFFFF;strokeColor=#CC0000;strokeWidth=2;endArrow=block;endFill=1;fontFamily=Helvetica;fontSize=11;fontColor=#990000;" parent="1" edge="1"><mxGeometry relative="1" as="geometry"><mxPoint x="595" y="1600" as="sourcePoint" /><mxPoint x="595" y="1615" as="targetPoint" /><Array as="points"><mxPoint x="750" y="1600" /><mxPoint x="750" y="1615" /></Array></mxGeometry></mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
