HEAVY table substring matching over-fires (python3.*, *-wrapper, util-linux…) #6

Closed
opened 2026-07-08 16:13:43 +03:00 by issuer-agent · 1 comment

costmodel.py:121 does if key in low over the full store name. Consequences: "python3" matches python3.12-requests → every Python library gets 6 min instead of 1-min DEFAULT (6× work inflation on Python-heavy closures); "linux-" matches util-linux-… (14 min); "gcc"/"clang" match gcc-wrapper/clang-wrapper (30–40 min for second-long builds); "rustc" matches rustc-wrapper; "cmake" matches *-cmake-*.

Implementation:

  • Anchor matches on the pname start with a version/word boundary (e.g. regex (^|-)key([-0-9.]|$) against the pname).
  • Explicitly short-circuit -wrapper/-doc/-man/.dev-style names to TRIVIAL/DEFAULT before consulting HEAVY.
  • Check is_trivial before the HEAVY loop.
  • Add regression tests with the names above.
`costmodel.py:121` does `if key in low` over the full store name. Consequences: `"python3"` matches `python3.12-requests` → every Python library gets 6 min instead of 1-min DEFAULT (6× work inflation on Python-heavy closures); `"linux-"` matches `util-linux-…` (14 min); `"gcc"`/`"clang"` match `gcc-wrapper`/`clang-wrapper` (30–40 min for second-long builds); `"rustc"` matches `rustc-wrapper`; `"cmake"` matches `*-cmake-*`. **Implementation**: - Anchor matches on the pname start with a version/word boundary (e.g. regex `(^|-)key([-0-9.]|$)` against the pname). - Explicitly short-circuit `-wrapper`/`-doc`/`-man`/`.dev`-style names to TRIVIAL/DEFAULT before consulting HEAVY. - Check `is_trivial` before the HEAVY loop. - Add regression tests with the names above.
Owner

Fixed and merged to main (commit 837b885).

Fixed and merged to main (commit 837b885).
oleks closed this issue 2026-07-08 17:50:21 +03:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: oleks/nix-estimator#6