PyTruth

Lab notebook · Python

Note PT-118 · 04 Dec 2026

A benchmark without an environment is a story

PyTruth keeps lab notes for claims about Python code. Each note records the interpreter version, the pinned dependencies, the smallest script that shows the behaviour and the raw output. Then it names the breakpoint: the data size, the concurrency level or the library release where the result stops holding. Notes that cannot name a breakpoint are marked incomplete rather than published as advice.

The notebook is small on purpose. A handful of reproduced findings is more useful than a feed of tips that nobody can rerun.

Laboratory bench with glassware and notes
Bench. The same machine is used for every note so timings stay comparable.

Open notes

Reproduced or marked open

PT-118

A dataframe merge silently changes row order

The merged frame follows the right key order, not the left. Notes include a fix and a test that fails on older releases.

Reproduced on three versions

PT-113

Type hints slow down import time more than expected

The cost comes from evaluating annotations at import. Deferring them recovers most of the time on the sample tested.

Measured, narrow

PT-109

A retry decorator double-counts transient failures

Two libraries disagree on what counts as a retry. The note stays open until the third case is measured.

Open

Protocol

Four fields, always filled

A note missing any of the four is returned to draft. That rule is what keeps the notebook worth reading a year later.

  1. 01EnvironmentPython version, package pins and hardware are recorded before the first run. A result without them is an anecdote.
  2. 02ScriptThe smallest script that demonstrates the claim is kept with the note. Notebooks are exported so the order of execution survives.
  3. 03OutputRaw output and timings are attached unchanged. Anything averaged or smoothed is shown both ways.
  4. 04BreakpointsEvery note names the condition where the behaviour changes: data size, concurrency, library version or memory ceiling.

Breakpoints

Every result has an edge

A merge that behaves one way at ten thousand rows and another at ten million is not a bug report, it is a boundary. The notebook treats boundaries as the most valuable part of a finding, because that is where a reader decides whether the advice applies to their data.

Where a boundary is unknown, the note says so in the first line and stays open. An open note is more honest than a closed one with a guess inside.

Handwritten data notes in a notebook
Notebook. Raw timings are written by hand before being typed up.

Notebook plates

Protocol lanes
Protocol lanesEach run records environment, script, output and breakpoint.
Timing trace
Timing traceSpikes are kept in the chart rather than smoothed away.
Calibration grid
Calibration gridHardware is calibrated before timing runs begin.
Note pages
Note pagesDrafts are handwritten, then exported with the script.

Reproduce a note

Send the environment where it breaks

The most useful message is a failure that contradicts a published note: your versions, your data shape and the traceback. Contradictions are logged as new notes rather than edited into the old one, so both results stay visible.