From 8ad5f8acaac74759d1bd654ad0c67e0681e10d27 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Mon, 27 Jul 2026 07:19:53 -0500 Subject: [PATCH 1/2] fix: scale divides by first value without zero guard --- bobber/lib/analysis/table.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bobber/lib/analysis/table.py b/bobber/lib/analysis/table.py index ab379d1..6579ce6 100644 --- a/bobber/lib/analysis/table.py +++ b/bobber/lib/analysis/table.py @@ -85,6 +85,8 @@ def scale(values: list) -> float: x = np.array(range(1, len(values) + 1)) y = np.array(values) slope, _ = np.polyfit(x, y, 1) + if values[0] == 0: + return 0.0 return slope / values[0] + 1.0 From 4baf2130f11bb6176183bd5a5e3866bca822f1a0 Mon Sep 17 00:00:00 2001 From: nvidia-sweep repair bot Date: Fri, 31 Jul 2026 20:19:48 -0500 Subject: [PATCH 2/2] fixup: address auditor feedback Auditor: The guard returns 0.0 for a zero baseline, but this function computes a relative scale ratio (slope/first value + 1), so the undefined zero-baseline case should be NaN/raise, not a misleading finite scale. This silently changes semantics and lacks a regression test. --- bobber/lib/analysis/table.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bobber/lib/analysis/table.py b/bobber/lib/analysis/table.py index 6579ce6..8d17b7d 100644 --- a/bobber/lib/analysis/table.py +++ b/bobber/lib/analysis/table.py @@ -86,7 +86,7 @@ def scale(values: list) -> float: y = np.array(values) slope, _ = np.polyfit(x, y, 1) if values[0] == 0: - return 0.0 + return float('nan') return slope / values[0] + 1.0