Files
progcode/web/public/assets/editorial/2021/d-runtime-request-path-2021.svg
T
huncode f6058fbbca
Build and deploy / deploy (push) Successful in 14s
revise October 2021 D runtime articles
2026-07-31 13:15:12 +03:00

73 lines
4.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="720" height="1532" viewBox="0 0 720 1532" role="img" aria-labelledby="title desc">
<title id="title">Один учебный request в D-сервисе: основной путь, модельные allocations и внешние границы</title>
<desc id="desc">Вертикальная схема показывает путь decode, validation, compute и encode для одного учебного request. На пути видны model allocation units, условная граница GC и неисполняемые FFI и I/O boundaries. Ошибка validation уходит в encode-error и не доходит до compute.</desc>
<defs>
<marker id="arrow" markerWidth="12" markerHeight="12" refX="10" refY="6" orient="auto">
<path d="M0 0 L12 6 L0 12 Z" fill="#7dd3fc"/>
</marker>
<style>
.title { font: 700 30px system-ui, sans-serif; fill: #f8fafc; }
.subtitle { font: 400 19px system-ui, sans-serif; fill: #bfdbfe; }
.step { font: 700 26px system-ui, sans-serif; fill: #f8fafc; }
.body { font: 400 20px system-ui, sans-serif; fill: #dbeafe; }
.small { font: 600 18px system-ui, sans-serif; fill: #cbd5e1; }
.mono { font: 600 17px ui-monospace, SFMono-Regular, Menlo, monospace; fill: #e0f2fe; }
.good { font: 700 18px system-ui, sans-serif; fill: #86efac; }
.warn { font: 700 18px system-ui, sans-serif; fill: #fde68a; }
.danger { font: 700 18px system-ui, sans-serif; fill: #fda4af; }
</style>
</defs>
<rect width="720" height="1510" fill="#0b1220"/>
<rect x="24" y="24" width="672" height="114" rx="20" fill="#172842" stroke="#60a5fa" stroke-width="3"/>
<text x="54" y="69" class="title">Один request: видимые границы</text>
<text x="54" y="101" class="subtitle">модель units, а не профиль D runtime</text>
<rect x="54" y="178" width="612" height="112" rx="18" fill="#193450" stroke="#60a5fa" stroke-width="3"/>
<text x="86" y="221" class="step">Вход: sum(19, 23)</text>
<text x="86" y="254" class="body">requestId · operation · ffiIntent · ioIntent</text>
<path d="M360 302 L360 344" stroke="#7dd3fc" stroke-width="5" marker-end="url(#arrow)"/>
<rect x="54" y="358" width="612" height="126" rx="18" fill="#163c58" stroke="#67e8f9" stroke-width="3"/>
<text x="86" y="402" class="step">1. decode</text>
<text x="86" y="434" class="body">shape request → normalized object</text>
<text x="86" y="463" class="mono">heavy +3 units · reuse +1 unit</text>
<path d="M360 496 L360 538" stroke="#7dd3fc" stroke-width="5" marker-end="url(#arrow)"/>
<rect x="54" y="552" width="612" height="126" rx="18" fill="#1d3b50" stroke="#a5b4fc" stroke-width="3"/>
<text x="86" y="596" class="step">2. validation</text>
<text x="86" y="628" class="body">operation = sum? operands are integers?</text>
<text x="86" y="657" class="mono">heavy +1 unit · reuse +0 units</text>
<path d="M360 690 L360 732" stroke="#7dd3fc" stroke-width="5" marker-end="url(#arrow)"/>
<text x="382" y="718" class="good">valid</text>
<text x="522" y="592" class="danger">invalid</text>
<rect x="54" y="746" width="612" height="144" rx="18" fill="#244132" stroke="#86efac" stroke-width="3"/>
<text x="86" y="790" class="step">3. compute</text>
<text x="86" y="822" class="body">19 + 23 = 42; result ещё локальный</text>
<text x="86" y="851" class="mono">heavy +5 units · reuse +1 unit</text>
<text x="442" y="851" class="warn">8 units → model GC boundary</text>
<path d="M360 902 L360 944" stroke="#7dd3fc" stroke-width="5" marker-end="url(#arrow)"/>
<rect x="54" y="958" width="612" height="108" rx="18" fill="#3b3520" stroke="#facc15" stroke-width="3"/>
<text x="86" y="1001" class="step">FFI boundary</text>
<text x="86" y="1034" class="body">normalize-scalar · invocation: not-performed</text>
<path d="M360 1078 L360 1120" stroke="#7dd3fc" stroke-width="5" marker-end="url(#arrow)"/>
<rect x="54" y="1134" width="612" height="108" rx="18" fill="#3b3520" stroke="#facc15" stroke-width="3"/>
<text x="86" y="1177" class="step">I/O boundary</text>
<text x="86" y="1210" class="body">write-audit-record · invocation: not-performed</text>
<path d="M360 1254 L360 1296" stroke="#7dd3fc" stroke-width="5" marker-end="url(#arrow)"/>
<rect x="54" y="1310" width="612" height="118" rx="18" fill="#1f4d43" stroke="#5eead4" stroke-width="3"/>
<text x="86" y="1354" class="step">4. encode</text>
<text x="86" y="1386" class="mono">{"requestId":"runtime-d-training-42","total":42}</text>
<text x="86" y="1415" class="body">heavy +3 units · reuse +1 unit</text>
<rect x="54" y="1450" width="612" height="66" rx="14" fill="#442b37" stroke="#fb7185" stroke-width="2"/>
<text x="78" y="1477" class="small">invalid path: validation-error → encode-error</text>
<text x="78" y="1502" class="small">compute, FFI и I/O не выполняются</text>
</svg>