Updated a figure in chapter 16

This commit is contained in:
Zeljko Hrcek
2026-02-26 10:19:42 +01:00
parent c990d0037e
commit 81e9c34ba7

View File

@@ -271,35 +271,303 @@ To see this cycle of mutual constraint in action, trace the flow in @fig-invaria
::: {#fig-invariants-cycle fig-env="figure" fig-pos="htb" fig-cap="**The Cycle of ML Systems (The 12 Invariants)**: The complete systems engineering lifecycle. The meta-principle of *Conservation of Complexity* (center) unifies the process: complexity is neither created nor destroyed, only shifted between Data, Model, Hardware, and Operations. Each transition is governed by specific quantitative invariants that constrain valid engineering decisions." fig-alt="Circular diagram with four phases: Foundations (Data) in green, Build (Model) in blue, Optimize (Hardware) in orange, and Deploy (Operations) in violet. Arrows connect each phase in a cycle, with the 12 invariants labeled on each transition. Conservation of Complexity is shown in the center as a dashed circle."}
```{.tikz}
\begin{tikzpicture}[
node distance=3.5cm,
font=\small\usefont{T1}{phv}{m}{n},
main/.style={rectangle, rounded corners=10pt, draw, ultra thick, minimum width=2.8cm, minimum height=1.4cm, align=center},
inv/.style={font=\scriptsize\usefont{T1}{phv}{m}{n}, align=center, fill=white, fill opacity=0.9, text opacity=1, inner sep=2.5pt}
]
\begin{tikzpicture}[line join=round,font=\usefont{T1}{phv}{m}{n}]
% Colors
\definecolor{GreenLine}{HTML}{008F45}
\definecolor{BlueLine}{HTML}{006395}
\definecolor{OrangeLine}{HTML}{E67817}
\definecolor{VioletLine}{HTML}{7E317B}
\tikzset{
Box/.style={align=flush center,
inner sep=4pt,
node distance=1.4,
draw=OrangeLine,
line width=0.75pt,
rounded corners,
fill=OrangeL!30,
text width=25mm,
minimum width=25mm, minimum height=10mm
},
Box2/.style={Box, draw=VioletLine, fill=VioletL2!70,align=left,
text width=36mm, minimum width=36mm, minimum height=10mm
},
}
% Main Nodes
\node[main, draw=GreenLine, fill=GreenLine!10] (Data) at (-4.5, 0) {\normalsize \textbf{Foundations}\\\scriptsize (Data)};
\node[main, draw=BlueLine, fill=BlueLine!10] (Model) at (0, 3.5) {\normalsize \textbf{Build}\\\scriptsize (Model)};
\node[main, draw=OrangeLine, fill=OrangeLine!10] (Hardware) at (4.5, 0) {\normalsize \textbf{Optimize}\\\scriptsize (Hardware)};
\node[main, draw=VioletLine, fill=VioletLine!10] (Ops) at (0, -3.5) {\normalsize \textbf{Deploy}\\\scriptsize (Operations)};
\tikzset{%
planet/.style = {circle, draw=yellow!50!red!90,semithick, fill=yellow!30,line width=1.5pt,
font=\usefont{T1}{phv}{m}{n}\bfseries,
minimum size=24mm, inner sep=1mm,align=flush center},
satellite/.style = {circle, draw=none, semithick, fill=#1!10,
text width=26mm, inner sep=1pt, align=flush center,minimum size=20mm,minimum height=12mm},
TxtC/.style = {font=\small\usefont{T1}{phv}{m}{n},text width=44mm,align=flush center},
arr/.style = {-{Triangle[length=3mm,width=6mm]}, color=#1!60,
line width=3mm, shorten <=1mm, shorten >=1mm},
LineA/.style = {violet!60,{Circle[line width=1.5pt,fill=white,length=7.5pt]}-,line width=2.0pt,shorten <=-4pt},
LineAA/.style={violet!30,dashed, line width=1.0pt,{-{Triangle[width=1.0*6pt,length=1.6*6pt]}},shorten <=3pt,shorten >=2pt}
}
% Center
\node[circle, draw=gray, dashed, ultra thick, align=center, inner sep=10pt, fill=gray!5] (Center) at (0,0) {\small \textbf{Conservation}\\\small \textbf{of}\\\small \textbf{Complexity}};
\tikzset{pics/brain/.style = {
code = {
\pgfkeys{/channel/.cd, #1}
\begin{scope}[local bounding box=BRAIN,scale=\scalefac, every node/.append style={transform shape}]
\draw[fill=\filllcolor,line width=\Linewidth](-0.3,-0.10)to(0.08,0.60)
to[out=60,in=50,distance=3](-0.1,0.69)to[out=160,in=80](-0.26,0.59)to[out=170,in=90](-0.46,0.42)
to[out=170,in=110](-0.54,0.25)to[out=210,in=150](-0.54,0.04)
to[out=240,in=130](-0.52,-0.1)to[out=300,in=240]cycle;
\draw[fill=\filllcolor,line width=\Linewidth]
(-0.04,0.64)to[out=120,in=0](-0.1,0.69)(-0.19,0.52)to[out=120,in=330](-0.26,0.59)
(-0.4,0.33)to[out=150,in=280](-0.46,0.42)
%
(-0.44,-0.03)to[bend left=30](-0.34,-0.04)
(-0.33,0.08)to[bend left=40](-0.37,0.2) (-0.37,0.12)to[bend left=40](-0.45,0.14)
(-0.26,0.2)to[bend left=30](-0.24,0.13)
(-0.16,0.32)to[bend right=30](-0.27,0.3)to[bend right=30](-0.29,0.38)
(-0.13,0.49)to[bend left=30](-0.04,0.51);
\draw[rounded corners=0.8pt,line width=1.5*\Linewidth,\drawcircle,-{Circle[fill=\filllcolor,length=4.15pt]}](-0.23,0.03)--(-0.15,-0.03)--(-0.19,-0.18)--(-0.04,-0.28);
\draw[rounded corners=0.8pt,line width=1.5*\Linewidth,\drawcircle,-{Circle[fill=\filllcolor,length=4.15pt]}](-0.17,0.13)--(-0.04,0.05)--(-0.06,-0.06)--(0.14,-0.11);
\draw[rounded corners=0.8pt,line width=1.5*\Linewidth,\drawcircle,-{Circle[fill=\filllcolor,length=4.15pt]}](-0.12,0.23)--(0.31,0.0);
\draw[rounded corners=0.8pt,line width=1.5*\Linewidth,\drawcircle,-{Circle[fill=\filllcolor,length=4.15pt]}](-0.07,0.32)--(0.06,0.26)--(0.16,0.33)--(0.34,0.2);
\draw[rounded corners=0.8pt,line width=1.5*\Linewidth,\drawcircle,-{Circle[fill=\filllcolor,length=4.15pt]}](-0.01,0.43)--(0.06,0.39)--(0.18,0.51)--(0.31,0.4);
\end{scope}
}
}
}
% Paths with refined curves and labels
\draw[->, line width=2.5pt, GreenLine, bend left=40] (Data) to node[inv, pos=0.5] {\textbf{1. Data as Code}\\\textbf{2. Data Gravity}} (Model);
\draw[->, line width=2.5pt, BlueLine, bend left=40] (Model) to node[inv, pos=0.5] {\textbf{3. Iron Law}\\\textbf{4. Silicon Contract}} (Hardware);
\draw[->, line width=2.5pt, OrangeLine, bend left=40] (Hardware) to node[inv, pos=0.5] {\textbf{5. Pareto Frontier}\\\textbf{6. Arith. Intensity}\\\textbf{7. Energy-Movement}\\\textbf{8. Amdahl's Law}} (Ops);
\draw[->, line width=2.5pt, VioletLine, bend left=40] (Ops) to node[inv, pos=0.5] {\textbf{9. Verification Gap}\\\textbf{10. Stat. Drift}\\\textbf{11. Skew Law}\\\textbf{12. Latency Budget}} (Data);
%brick
\tikzset{
cigla/.style={ inner sep=0pt,anchor=west,
node distance=1.4pt,
draw=none,
line width=0.1pt,
rounded corners=1pt,
fill=\filllcolor,
minimum width=4mm, minimum height=2mm
},
cigla1/.style={cigla,fill=\filllcirclecolor},
pics/brick/.style = {
code = {
\pgfkeys{/channel/.cd, #1}
\begin{scope}[shift={($(0,0)+(0,0)$)},scale=\scalefac,every node/.append style={transform shape}]
\path[clip] (-1.05,-0.52)rectangle (0.71,0.45);
\node[cigla](C1) at (-1.03,-0.4){};
\node[cigla1,right= of C1](C2){};
\node[cigla,right= of C2](C3){};
\node[cigla1,right= of C3](C4){};
%
\node[cigla,above right= of C1,anchor=south](C11){};
\node[cigla1,right= of C11](C12){};
\node[cigla,right= of C12](C13){};
\node[cigla1,right= of C13](C14){};
%
\node[cigla,above right= of C11,anchor=south](C21){};
\node[cigla1,right= of C21](C22){};
\node[cigla,right= of C22](C23){};
%
\node[cigla,above right= of C21,anchor=south](C31){};
\node[cigla1,right= of C31](C32){};
\node[cigla,right= of C32](C33){};
\end{scope}
}
}
}
%vaga
\tikzset{
pics/vaga/.style = {
code = {
\pgfkeys{/channel/.cd, #1}
\begin{scope}[shift={($(0,0)+(0,0)$)},scale=\scalefac,every node/.append style={transform shape}]
\node[rectangle,minimum width=2mm,minimum height=22mm,
draw=none, fill=\filllcolor,line width=\Linewidth](1R) at (0,-0.95){};
\fill[fill=\filllcolor!60!black](230:2.8)arc(230:310:2.8)--cycle;%circle(2.9);
%LT
\node [semicircle, shape border rotate=180, anchor=chord center,
minimum size=11mm, draw=none, fill=\filllcirclecolor](LT) at (-2,-0.5) {};
\node [circle, minimum size=4mm, draw=none, fill=\filllcirclecolor](T1) at (-2,1.25) {};
\draw[draw=\drawcolor,,line width=1.2*\Linewidth,shorten <=3pt,shorten >=3pt](T1)--(LT);
\draw[draw=\drawcolor,,line width=1.2*\Linewidth,shorten <=3pt,shorten >=3pt](T1)--(LT.30);
\draw[draw=\drawcolor,,line width=1.2*\Linewidth,shorten <=3pt,shorten >=3pt](T1)--(LT.150);
%DT
\node [semicircle, shape border rotate=180, anchor=chord center,
minimum size=11mm, draw=none, fill=\filllcirclecolor!70!black](DT) at (2,-0.5) {};
\node [circle, minimum size=4mm, draw=none, fill=\filllcirclecolor!70!black](T2) at (2,1.25) {};
\draw[draw=\drawcolor,line width=1.2*\Linewidth,shorten <=3pt,shorten >=3pt](T2)--(DT);
\draw[draw=\drawcolor,,line width=1.2*\Linewidth,shorten <=3pt,shorten >=3pt](T2)--(DT.30);
\draw[draw=\drawcolor,,line width=1.2*\Linewidth,shorten <=3pt,shorten >=3pt](T2)--(DT.150);
%
\node[draw=none,rectangle,minimum width=32mm,minimum height=1.5mm,inner sep=0pt,
fill=\filllcolor!60!black]at(0,1.25){};
\node[draw=white,fill=\filllcolor,line width=2*\Linewidth,ellipse,minimum width=9mm, minimum height=15mm](EL)at(0,0.85){};
\node[draw=white,fill=\filllcolor!60!black,line width=2*\Linewidth,,circle,minimum size=10mm](2C)at(0,2.05){};
\end{scope}
}
}
}
%llm
\tikzset{
pics/llm/.style = {
code = {
\pgfkeys{/channel/.cd, #1}
\begin{scope}[shift={($(0,0)+(0,0)$)},scale=\scalefac,every node/.append style={transform shape}]
\node[circle,minimum size=12mm,draw=\drawcolor, fill=\filllcolor!70,line width=0.5*\Linewidth](C\picname) at (0,0){};
\def\startangle{90}
\def\radius{1.15}
\def\radiusI{1.1}
\foreach \i [evaluate=\i as \j using \i+1] [count =\k] in {0,2,4,6,8} {
\pgfmathsetmacro{\angle}{\startangle - \i * (360/8)}
\draw[draw=black,-{Circle[black ,fill=\filllcirclecolor,length=5.5pt,line width=0.5*\Linewidth]},line width=1.5*\Linewidth](C\picname)--++(\startangle - \i*45:\radius) ;
\node[circle,draw=black,fill=\filllcirclecolor!80!red!50,inner sep=3pt,line width=0.5*\Linewidth](2C\k)at(\startangle - \j*45:\radiusI) {};
}
\draw[line width=1.5*\Linewidth](2C1)--++(-0.5,0)|-(2C2);
\draw[line width=1.5*\Linewidth](2C3)--++(0.5,0)|-(2C4);
\node[circle,,minimum size=12mm,draw=\drawcolor, fill=\filllcolor!70,line width=0.5*\Linewidth]at (0,0){};
\end{scope}
}
}
}
%battery
\tikzset{
pics/battery/.style = {
code = {
\pgfkeys{/channel/.cd, #1}
\begin{scope}[shift={($(0,0)+(0,0)$)},scale=\scalefac,every node/.append style={transform shape}]
\node[rectangle,minimum width=35mm,minimum height=8mm,draw=\drawcolor,
rounded corners=4pt,fill=\filllcirclecolor,line width=\Linewidth](2R\picname) at (1,0){};
\node[rectangle,minimum width=45mm,minimum height=22mm,draw=\drawcolor,
rounded corners=4pt,fill=\filllcolor,line width=\Linewidth](R\picname) at (0,0){};
\node[rectangle,minimum width=5mm,minimum height=18mm,draw=none,
fill=green,line width=\Linewidth](3R\picname) at ($(R\picname.west)!0.5!(R\picname.east)$){};
\node[rectangle,minimum width=5mm,minimum height=18mm,draw=none,
fill=green,line width=\Linewidth](3R\picname) at ($(R\picname.west)!0.33!(R\picname.east)$){};
\node[rectangle,minimum width=5mm,minimum height=18mm,draw=none,
fill=green,line width=\Linewidth](3R\picname) at ($(R\picname.west)!0.16!(R\picname.east)$){};
\end{tikzpicture}
\end{scope}
}
}
}
%rocket
\tikzset{
pics/rocket/.style = {
code = {
\pgfkeys{/channel/.cd, #1}
\begin{scope}[shift={($(0,0)+(0,0)$)},scale=\scalefac,every node/.append style={transform shape},line cap = round]
%vrh
\draw[fill=\filllcolor,draw=\drawcolor,line width=\Linewidth](-0.26,0.5)to[bend right=12](0.26,0.5)to[bend right=7] (0,0.85)to[bend right=7] cycle;
%krila
\draw[fill=\filllcolor!70!red,,draw=\drawcolor,line width=\Linewidth,rounded corners=1pt](-0.2,-0.7)--(-0.45,-0.9)--(-0.567,-0.4)--(-0.3,-0.17)--cycle;
\draw[fill=\filllcolor!70!red,draw=\drawcolor,line width=\Linewidth,rounded corners=1pt](0.2,-0.7)--(0.45,-0.9)--(0.567,-0.4)--(0.3,-0.17)--cycle;
%rep
\draw[fill=\filllcolor!70!green,draw=\drawcolor,line width=\Linewidth](0.16,-0.76)--(0.22,-0.9)--(-0.2,-0.9)--(-0.15,-0.76)--cycle;
%body
\draw[fill=\filllcolor,draw=\drawcolor,line width=\Linewidth](-0.2,-0.7)--(0.2,-0.7)to[out=75,in=320](0,0.85)to[out=220,in=105] cycle;
%krug
\node[circle,draw=\drawcolor,minimum size=4mm,fill=\filllcirclecolor,line width=\Linewidth]{};
\draw[draw=\drawcolor,line width=1.5*\Linewidth](0,-0.99)--(0,-1.3);
\draw[draw=\drawcolor,line width=1.5*\Linewidth](-0.11,-0.99)--(-0.11,-1.2);
\draw[draw=\drawcolor,line width=1.5*\Linewidth](0.11,-0.99)--(0.11,-1.2);
\end{scope}
}
}
}
\pgfkeys{
/channel/.cd,
Depth/.store in=\Depth,
Height/.store in=\Height,
Width/.store in=\Width,
filllcirclecolor/.store in=\filllcirclecolor,
filllcolor/.store in=\filllcolor,
drawcolor/.store in=\drawcolor,
drawcircle/.store in=\drawcircle,
scalefac/.store in=\scalefac,
Linewidth/.store in=\Linewidth,
picname/.store in=\picname,
filllcolor=BrownLine,
filllcirclecolor=violet!20,
drawcolor=black,
drawcircle=violet,
scalefac=1,
Linewidth=0.5pt,
Depth=1.3,
Height=0.8,
Width=1.1,
picname=C
}
\def\radius{3.9}
\def\startangle{90}
\foreach \i/\j/\sho [count=\k from 0] in {
%green!79!black
white/{\textbf{}\\ }/15pt,
%magenta!60!
white/{\textbf{}\\ }/15pt,
%gray
white/{\textbf{}\\}/15pt,
%cyan
white/{\textbf{}\\ }/15pt
}
{
%Satelit
\pgfmathsetmacro{\angle}{\startangle - \k * (360/4)}
\node (s\k) [satellite=\i, font=\footnotesize\usefont{T1}{phv}{m}{n}] at (\angle:\radius) {};
\node[TxtC,below=0pt of s\k]{\j};
}
%logos
%brick
\pic[shift={(0.15,0.15)}] at (s3) {brick={scalefac=1.1,picname=1,filllcolor=red!70!black!80,Linewidth=1.0pt,filllcirclecolor=red!90!black!50}};
%llm
\pic[shift={(0,0)}] at (s0){llm={scalefac=0.9,drawcolor=BlueLine,filllcolor=BlueLine!10!, Linewidth=1.25pt,filllcirclecolor=red}};
%brain
\pic[shift={(0.1,-0.16)}] at (s0){brain={scalefac=0.8,picname=1,filllcolor=orange!30!, filllcirclecolor=cyan!55!black!60, Linewidth=0.5pt}};
%battery
\pic[shift={(0,0)}] at (s1){battery={scalefac=0.38,picname=1, drawcolor=BrownLine,filllcolor=BrownLine!10!, Linewidth=1.5pt,filllcirclecolor=BrownLine}};
%rocket
\pic[shift={(0,0.2)}] at (s2){rocket={scalefac=1.1,picname=1, drawcolor=black,filllcolor=cyan!10!, Linewidth=1.0pt,filllcirclecolor=red}};
%center
\node[circle, draw=BrownLine, dashed,thick, fill=none,,minimum size=26mm](CE)at(0,0){};
\node[TxtC,below=0pt of CE]{Conservation\\ of Complexity};
\pic[shift={(0,0)}] at (0,0){vaga={scalefac=0.35,picname=1,filllcolor=BlueLine, Linewidth=1.0pt,filllcirclecolor=orange}};
\def\ra{26mm}
\foreach \i [count=\k from 0] in{360,320,140,135}{
\pgfmathtruncatemacro{\newX}{\i + 90} %
\draw[line width=2.6pt,violet]
(s\k)+(\i:0.5*\ra) arc[start angle=\i, end angle=\newX, radius=0.5*\ra];
}
\draw[LineA](s0.35)--++(0:1)coordinate(MA);
\node[Box,anchor=west](FO)at(MA){\textbf{Build}\\ (Model)};
\draw[LineA](s1.355)--++(315:1)coordinate(ST);
\node[Box,anchor=west](PR)at(ST){\textbf{Optimize}\\ (Hardware)};
\draw[LineA](s2.185)--++(200:3.25)coordinate(DE);
\node[Box,anchor=west](DEP)at(DE){\textbf{Deploy}\\(Operations)};
\draw[LineA](s3.180)--++(180:3.25)coordinate(FO);
\node[Box,anchor=west](DEP)at(FO){\textbf{Foundations}\\(Data)};
%
\draw[-{Triangle[width=18pt,length=8pt]}, line width=10pt,cyan!40] (60:\radius)
arc[radius=\radius, start angle=60, end angle= 16];
\coordinate (AR1) at (38:\radius);
\draw[-{Triangle[width=18pt,length=8pt]}, line width=10pt,cyan!40] (340:\radius)
arc[radius=\radius, start angle=340, end angle= 290];
\coordinate (AR2) at (315:\radius);
\draw[-{Triangle[width=18pt,length=8pt]}, line width=10pt,cyan!40] (240:\radius)
arc[radius=\radius, start angle=240, end angle= 200];
\coordinate (AR3) at (225:\radius);
\draw[-{Triangle[width=18pt,length=8pt]}, line width=10pt,cyan!40] (160:\radius)
arc[radius=\radius, start angle=160, end angle= 114];
\coordinate (AR4) at (137:\radius);
%
\draw[LineA](AR1)--++(0:1.3)coordinate(MA);
\node[Box2,anchor=west]at(MA){3. Iron Law\\
4. Silicon Contract};
\draw[LineA](AR2)--++(340:1.6)coordinate(MA1);
\node[Box2,anchor=west]at(MA1){5. Pareto Frontier\\
6. Arith. Intensity\\
7. Energy-Movement\\
8. Amdahls Law};
\draw[LineA](AR3)--++(180:6)coordinate(MA2);
\node[Box2,anchor=west]at(MA2){9. Verification Gap\\
10. Stat. Drift\\
11. Skew Law\\
12. Latency Budget};
\draw[LineA](AR4)--++(180:6)coordinate(MA3);
\node[Box2,anchor=west]at(MA3){1. Data as Code\\
2. Data Gravity};
\end{tikzpicture}
```
:::