diff --git a/audit/internal/platform/benchmark.go b/audit/internal/platform/benchmark.go index 1b4e4d2..6984726 100644 --- a/audit/internal/platform/benchmark.go +++ b/audit/internal/platform/benchmark.go @@ -220,8 +220,6 @@ func benchmarkCalibrationThrottleReason(before, after BenchmarkThrottleCounters) return "hw_thermal" case diff.SWThermalSlowdownUS > 0: return "sw_thermal" - case diff.HWPowerBrakeSlowdownUS > 0: - return "hw_power_brake" default: return "" } diff --git a/audit/internal/platform/benchmark_test.go b/audit/internal/platform/benchmark_test.go index 92b26a4..9b2c5da 100644 --- a/audit/internal/platform/benchmark_test.go +++ b/audit/internal/platform/benchmark_test.go @@ -164,6 +164,24 @@ func TestBenchmarkPlannedPhaseStatus(t *testing.T) { } } +func TestBenchmarkCalibrationThrottleReasonIgnoresPowerReasons(t *testing.T) { + t.Parallel() + + before := BenchmarkThrottleCounters{} + if got := benchmarkCalibrationThrottleReason(before, BenchmarkThrottleCounters{SWPowerCapUS: 1_000_000}); got != "" { + t.Fatalf("sw_power_cap should be ignored, got %q", got) + } + if got := benchmarkCalibrationThrottleReason(before, BenchmarkThrottleCounters{HWPowerBrakeSlowdownUS: 1_000_000}); got != "" { + t.Fatalf("hw_power_brake should be ignored, got %q", got) + } + if got := benchmarkCalibrationThrottleReason(before, BenchmarkThrottleCounters{HWThermalSlowdownUS: 1_000_000}); got != "hw_thermal" { + t.Fatalf("hw_thermal mismatch: got %q", got) + } + if got := benchmarkCalibrationThrottleReason(before, BenchmarkThrottleCounters{SWThermalSlowdownUS: 1_000_000}); got != "sw_thermal" { + t.Fatalf("sw_thermal mismatch: got %q", got) + } +} + func TestNormalizeNvidiaBenchmarkOptionsPreservesRunNCCLChoice(t *testing.T) { t.Parallel()