Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Nomenclature

Quick reference for symbols, notation, and abbreviations the book uses. Concept definitions live in the glossary; this page covers the shorthand only.

Symbols

SymbolMeaning
§NSection number — e.g., §5 refers to section 5.
Leads to / becomes / transitions to. Appears in section titles (e.g., §29 “10K → 1M”) and prose.
[!NOTE] / [!TIP] / [!WARNING]Callout box — content the reader should pay particular attention to.

Text formatting

FormMeaning
monospaceCode: types, variable names, function names, file paths.
italicFirst definition of a term, or emphasis.
boldA term being highlighted as load-bearing in the current paragraph.
# anti-pattern: bad!A code comment that flags the snippet as something the chapter is arguing against. The label travels with the code if a reader copy-pastes.

Variables you will see across chapters

VariableMeaning
i, jIndex into a column. i is the index of the row currently under discussion.
t or tickTick number — the simulator’s step counter.
idStable entity identifier (a small unsigned integer; usually np.uint32).
genGeneration counter, paired with a slot index to detect stale references (§10).
pos_x, pos_yPosition columns of a creature (np.float32).
vel_x, vel_yVelocity columns of a creature (np.float32).
to_remove, to_insertBuffers of pending mutations applied at end-of-tick (§22).
n_activeLength of the live prefix of a fixed-capacity column (§21, §24).

Python types and their numpy counterparts

This book uses numpy’s typed dtypes for hot data. The mapping the reader will see most often:

Pythonnumpysizerange
int (CPython, ≤ 2³⁰)28 bytesunbounded
np.int81 byte-128 to 127
np.uint81 byte0 to 255
np.int324 bytes±2¹
np.uint324 bytes0 to 2³²
np.int648 bytes±2⁶³
float (CPython)np.float648 bytes (CPython has 24-byte object overhead)~15 decimal digits
np.float324 bytes~7 decimal digits
np.bool_1 byte (in arrays)True / False

Conventions for code blocks

FormConvention
Plain triple-backtick pythonA snippet to read; not necessarily complete.
Snippet with # anti-pattern: bad! first lineA snippet shown as the wrong way; the chapter is about the right way.
uv run code/measurement/<file>.pyA measurement exhibit the reader can run on their machine. The numbers in the chapter were measured the same way.