Breakwater

Backtest / #1258

perf: add __slots__ to token classes

pypa/packaging#1258 · merged 2026-06-13 · base e7f0351352 → head bce44a178e · ran on Docker

PASS

No behaviour divergence found by any probe.

† Merged after Nemotron 3 Ultra was released (2026-06-04): the model cannot have seen this PR or its fixes.

Performance · Requirement

No realistic input family measured slower.

Measured in backtest packaging-v2 (same commits, run bt-1258-a58f0c, image bw-pair:aa205a50cfdfbeb7). The semantic results above are from a later run; perf doesn't use the semantic planner, so it was not re-measured.

head slowerhead faster1×1001,00010,000input size (characters)F1F1: 0.99× at ~28 charsF1: 0.99× at ~42 charsF1: 0.98× at ~132 charsF1: 0.99× at ~516 charsF1: 0.97× at ~2,208 charsF1: 0.99× at ~9,144 charsF1: 0.98× at ~39,864 chars
  • F1
Head/base cachegrind instructions per call, by input size (log-log). Each line is one input family Nemotron proposed; points above 1× are where the "faster" code does more work.
FamilyInputsRatio range Slope base → headVerdict
F1requirement strings with a large number of extra markers (extras), which produce many Token objects during tokenization; the added __slots__ on Token reduces per‑token memory and attribute‑access cost, so this path should become faster.claimed speedup · plan0.97× – 0.99×0.87 → 0.87neutral

Receipt

TargetBackendImageRun AuditAdjudication
packaging.requirements:Requirementlocal Dockerbw-pair:bc22d3399fde3139bt-1258-40f7e2$0.010$0.000

Nemotron cost on Nebius Token Factory. Backend: where the untrusted code ran. local Docker (an image cited by its content-addressed tag). Every image is content-addressed (repo at each commit + harness), so every card re-runs from the image and seed 0. Raw data: audit.