revise October 2021 D runtime articles
Build and deploy / deploy (push) Successful in 14s

This commit is contained in:
2026-07-31 13:15:12 +03:00
parent 8e078b92ea
commit f6058fbbca
7 changed files with 1053 additions and 1 deletions
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="720" height="1320" viewBox="0 0 720 1320" role="img" aria-labelledby="title desc">
<title id="title">Сравнение учебных allocation units для двух вариантов одного request</title>
<desc id="desc">Две колонки сравнивают allocation-heavy и reuse для decode, validation, compute и encode. Heavy получает 12 units и пересекает условный порог 8, reuse получает 3 units. У обоих одинаковый result и 9 work units. Числа не являются байтами, временем или benchmark.</desc>
<defs>
<style>
.title { font: 700 30px system-ui, sans-serif; fill: #f8fafc; }
.subtitle { font: 400 19px system-ui, sans-serif; fill: #cbd5e1; }
.head { font: 700 24px system-ui, sans-serif; fill: #f8fafc; }
.label { font: 600 20px system-ui, sans-serif; fill: #dbeafe; }
.value { font: 700 22px ui-monospace, SFMono-Regular, Menlo, monospace; fill: #f8fafc; }
.small { font: 400 18px system-ui, sans-serif; fill: #cbd5e1; }
.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="1320" fill="#0b1220"/>
<rect x="24" y="24" width="672" height="110" rx="20" fill="#172842" stroke="#818cf8" stroke-width="3"/>
<text x="52" y="68" class="title">Allocation profile учебной модели</text>
<text x="52" y="100" class="subtitle">один result, одинаковая работа, разные заданные units</text>
<rect x="36" y="174" width="304" height="84" rx="18" fill="#4a2734" stroke="#fb7185" stroke-width="3"/>
<text x="64" y="210" class="head">allocation-heavy</text>
<text x="64" y="239" class="subtitle">только учебный вариант</text>
<rect x="380" y="174" width="304" height="84" rx="18" fill="#1f4d43" stroke="#5eead4" stroke-width="3"/>
<text x="408" y="210" class="head">reuse</text>
<text x="408" y="239" class="subtitle">тот же handler contract</text>
<text x="54" y="316" class="label">decode</text>
<rect x="54" y="338" width="140" height="44" rx="12" fill="#be425d"/>
<rect x="398" y="338" width="47" height="44" rx="12" fill="#2da98d"/>
<text x="205" y="369" class="value">3</text>
<text x="456" y="369" class="value">1</text>
<text x="54" y="448" class="label">validation</text>
<rect x="54" y="470" width="47" height="44" rx="12" fill="#be425d"/>
<rect x="398" y="470" width="2" height="44" rx="1" fill="#2da98d"/>
<text x="112" y="501" class="value">1</text>
<text x="416" y="501" class="value">0</text>
<text x="54" y="580" class="label">compute</text>
<rect x="54" y="602" width="234" height="44" rx="12" fill="#be425d"/>
<rect x="398" y="602" width="47" height="44" rx="12" fill="#2da98d"/>
<text x="299" y="633" class="value">5</text>
<text x="456" y="633" class="value">1</text>
<text x="54" y="712" class="label">encode</text>
<rect x="54" y="734" width="140" height="44" rx="12" fill="#be425d"/>
<rect x="398" y="734" width="47" height="44" rx="12" fill="#2da98d"/>
<text x="205" y="765" class="value">3</text>
<text x="456" y="765" class="value">1</text>
<line x1="54" y1="836" x2="666" y2="836" stroke="#475569" stroke-width="2"/>
<text x="54" y="882" class="head">Итог allocation units</text>
<rect x="54" y="908" width="234" height="60" rx="14" fill="#7f1d3b"/>
<text x="80" y="948" class="value">12</text>
<text x="132" y="946" class="danger">выше budget 6</text>
<rect x="398" y="908" width="234" height="60" rx="14" fill="#166b5b"/>
<text x="424" y="948" class="value">3</text>
<text x="478" y="946" class="good">внутри budget 6</text>
<rect x="54" y="1010" width="612" height="82" rx="16" fill="#3b3520" stroke="#facc15" stroke-width="3"/>
<text x="82" y="1045" class="head">Порог GC = 8 units</text>
<text x="82" y="1074" class="warn">heavy пересекает model boundary; это не измеренная pause</text>
<rect x="54" y="1130" width="612" height="112" rx="16" fill="#183550" stroke="#60a5fa" stroke-width="3"/>
<text x="82" y="1168" class="head">Общее у двух вариантов</text>
<text x="82" y="1199" class="small">work units: 9 · response status: 200 · body: total 42</text>
<text x="82" y="1227" class="small">FFI и I/O boundaries видимы, но invocation = not-performed</text>
<text x="54" y="1265" class="small">units — детерминированные счётчики fixture, не bytes / CPU</text>
<text x="54" y="1293" class="small">и не latency / benchmark</text>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="720" height="1600" viewBox="0 0 720 1600" role="img" aria-labelledby="title desc">
<title id="title">Безопасная диагностика учебного request в D-сервисе</title>
<desc id="desc">Вертикальный маршрут диагностики начинает с сохранения результата, error route и trace. Затем он проверяет contract handler, allocation budget, условную границу GC и неисполняемые FFI/I/O boundaries. Каждый шаг задаёт обратимое действие и запрещает менять runtime глобально без отдельного evidence.</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; }
.question { font: 700 24px 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; }
.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="1600" fill="#0b1220"/>
<rect x="24" y="24" width="672" height="112" rx="20" fill="#172842" stroke="#60a5fa" stroke-width="3"/>
<text x="52" y="69" class="title">Диагностика одного request</text>
<text x="52" y="101" class="subtitle">сначала evidence, затем обратимое действие</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="question">0. Сохранить evidence</text>
<text x="86" y="253" class="body">input · success/error body · stages · budget</text>
<text x="86" y="280" class="small">units модели не записываются как latency</text>
<path d="M360 302 L360 344" stroke="#7dd3fc" stroke-width="5" marker-end="url(#arrow)"/>
<rect x="54" y="358" width="612" height="124" rx="18" fill="#1d3b50" stroke="#a5b4fc" stroke-width="3"/>
<text x="86" y="401" class="question">1. Contract handler сохранён?</text>
<text x="86" y="433" class="body">success body равен; invalid идёт в encode-error?</text>
<text x="86" y="462" class="danger">нет → остановить правку, восстановить validation/encode</text>
<path d="M360 494 L360 536" stroke="#7dd3fc" stroke-width="5" marker-end="url(#arrow)"/>
<rect x="54" y="550" width="612" height="124" rx="18" fill="#3b3520" stroke="#facc15" stroke-width="3"/>
<text x="86" y="593" class="question">2. Allocation выше budget?</text>
<text x="86" y="625" class="body">heavy 12 &gt; 6; reuse 3 ≤ 6</text>
<text x="86" y="654" class="warn">сравнивать только при равном result и work</text>
<path d="M360 686 L360 728" stroke="#7dd3fc" stroke-width="5" marker-end="url(#arrow)"/>
<rect x="54" y="742" width="612" height="124" rx="18" fill="#3b3520" stroke="#facc15" stroke-width="3"/>
<text x="86" y="785" class="question">3. Что означает gc-boundary?</text>
<text x="86" y="817" class="body">только threshold 8 units в модели</text>
<text x="86" y="846" class="warn">это не pause: нужен отдельный profile и условия</text>
<path d="M360 878 L360 920" stroke="#7dd3fc" stroke-width="5" marker-end="url(#arrow)"/>
<rect x="54" y="934" width="612" height="124" rx="18" fill="#3b3520" stroke="#facc15" stroke-width="3"/>
<text x="86" y="977" class="question">4. FFI / I/O выполнялись?</text>
<text x="86" y="1009" class="body">trace: invocation = not-performed</text>
<text x="86" y="1038" class="warn">нет → не обвинять dependency; описать отдельный contract test</text>
<path d="M360 1070 L360 1112" stroke="#7dd3fc" stroke-width="5" marker-end="url(#arrow)"/>
<rect x="54" y="1126" width="612" height="130" rx="18" fill="#193450" stroke="#60a5fa" stroke-width="3"/>
<text x="86" y="1169" class="question">5. Есть фактический профиль границы?</text>
<text x="86" y="1201" class="body">версия tool · вход · среда · один метод</text>
<text x="86" y="1230" class="small">нет → сначала собрать evidence, не менять runtime глобально</text>
<path d="M360 1268 L360 1310" stroke="#7dd3fc" stroke-width="5" marker-end="url(#arrow)"/>
<rect x="54" y="1324" width="612" height="130" rx="18" fill="#1f4d43" stroke="#5eead4" stroke-width="3"/>
<text x="86" y="1367" class="question">Rollback-safe действие</text>
<text x="86" y="1399" class="body">один temporary-state change; valid + invalid traces</text>
<text x="86" y="1428" class="good">внешняя граница станет реальной → отдельный contract test</text>
<rect x="54" y="1484" width="612" height="100" rx="16" fill="#442b37" stroke="#fb7185" stroke-width="3"/>
<text x="82" y="1518" class="question">Стоп-критерий</text>
<text x="82" y="1546" class="small">исчез success/error contract → сначала восстановить его</text>
<text x="82" y="1573" class="small">и только затем снова сравнивать units</text>
</svg>

After

Width:  |  Height:  |  Size: 5.7 KiB

@@ -0,0 +1,72 @@
<?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>

After

Width:  |  Height:  |  Size: 4.9 KiB