mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-07-18 09:38:08 +00:00
Replaced UNDECIDED with AMBG, use Gray color/shrug emoji
This commit is contained in:
@@ -428,7 +428,7 @@ class TimingInterval:
|
||||
|
||||
class ComparisonStatus(str, Enum):
|
||||
UNKNOWN = "????"
|
||||
UNDECIDED = "UNDECIDED"
|
||||
UNDECIDED = "AMBG"
|
||||
SAME = "SAME"
|
||||
FAST = "FAST"
|
||||
SLOW = "SLOW"
|
||||
@@ -702,6 +702,7 @@ class Emoji(str, Enum):
|
||||
BLUE = "\U0001f535"
|
||||
GREEN = "\U0001f7e2"
|
||||
RED = "\U0001f534"
|
||||
SHRUG = "\U0001f937"
|
||||
NONE = ""
|
||||
|
||||
|
||||
@@ -1026,7 +1027,7 @@ def format_bulk_debug_python(bulk_rows: list[dict[str, Any]]) -> str:
|
||||
"# Examples:\n"
|
||||
"# row = bulk_rows[0]\n"
|
||||
"# arrays = load_bulk_data(row)\n"
|
||||
"# undecided = [row for row in bulk_rows if row['status'] == 'UNDECIDED']\n"
|
||||
"# ambiguous = [row for row in bulk_rows if row['status'] == 'AMBG']\n"
|
||||
)
|
||||
|
||||
|
||||
@@ -2288,7 +2289,7 @@ def colorize_comparison_status(status, no_color):
|
||||
if status == ComparisonStatus.UNKNOWN:
|
||||
return colorize(status.value, Fore.YELLOW, Emoji.YELLOW, no_color)
|
||||
if status == ComparisonStatus.UNDECIDED:
|
||||
return colorize(status.value, Fore.YELLOW, Emoji.YELLOW, no_color)
|
||||
return colorize(status.value, Fore.LIGHTBLACK_EX, Emoji.SHRUG, no_color)
|
||||
if status == ComparisonStatus.SAME:
|
||||
return colorize(status.value, Fore.BLUE, Emoji.BLUE, no_color)
|
||||
if status == ComparisonStatus.FAST:
|
||||
@@ -2954,9 +2955,7 @@ def main() -> int:
|
||||
print(f" - Pass (centers close and intervals overlap): {stats.pass_count}")
|
||||
print(f" - Improvement (clear timing gap, %Diff < 0): {stats.improvement_count}")
|
||||
print(f" - Regression (clear timing gap, %Diff > 0): {stats.regression_count}")
|
||||
print(
|
||||
f" - Undecided (comparison requires more evidence): {stats.undecided_count}"
|
||||
)
|
||||
print(f" - Ambiguous (comparison requires more evidence): {stats.undecided_count}")
|
||||
if stats.undecided_reasons:
|
||||
print(" - Reasons:")
|
||||
for code, reason_summary in sorted(
|
||||
|
||||
@@ -55,6 +55,7 @@ def nvbench_compare(monkeypatch):
|
||||
Fore=types.SimpleNamespace(
|
||||
BLUE="",
|
||||
GREEN="",
|
||||
LIGHTBLACK_EX="",
|
||||
RED="",
|
||||
RESET="",
|
||||
YELLOW="",
|
||||
@@ -900,6 +901,15 @@ def test_format_change_only_reports_fast_and_slow_rows(nvbench_compare):
|
||||
assert nvbench_compare.format_change(undecided) == ""
|
||||
|
||||
|
||||
def test_ambiguous_status_uses_shrug_marker(nvbench_compare):
|
||||
assert (
|
||||
nvbench_compare.colorize_comparison_status(
|
||||
nvbench_compare.ComparisonStatus.UNDECIDED, no_color=True
|
||||
)
|
||||
== "\U0001f937 AMBG"
|
||||
)
|
||||
|
||||
|
||||
def test_format_timing_with_interval(nvbench_compare):
|
||||
interval = nvbench_compare.TimingInterval(
|
||||
lower=0.002237, upper=0.002389, center=0.0023
|
||||
@@ -1601,7 +1611,7 @@ def test_main_prints_undecided_reason_summary(monkeypatch, capsys, nvbench_compa
|
||||
|
||||
assert nvbench_compare.main() == 0
|
||||
output = capsys.readouterr().out
|
||||
assert "Undecided (comparison requires more evidence): 1" in output
|
||||
assert "Ambiguous (comparison requires more evidence): 1" in output
|
||||
assert "noise_too_high: 1" in output
|
||||
assert "Reason legend: noise-high = noise_too_high" in output
|
||||
|
||||
@@ -1810,7 +1820,7 @@ def test_main_prints_bulk_debug_python_to_stdout(monkeypatch, capsys, nvbench_co
|
||||
kwargs["bulk_debug_rows"].append(
|
||||
{
|
||||
"row_index": 0,
|
||||
"status": "UNDECIDED",
|
||||
"status": "AMBG",
|
||||
"reference_sample_filename": None,
|
||||
"reference_sample_count": None,
|
||||
"reference_frequency_filename": None,
|
||||
@@ -1838,7 +1848,7 @@ def test_main_prints_bulk_debug_python_to_stdout(monkeypatch, capsys, nvbench_co
|
||||
assert nvbench_compare.main() == 0
|
||||
output = capsys.readouterr().out
|
||||
assert "bulk_rows = [" in output
|
||||
assert "'status': 'UNDECIDED'" in output
|
||||
assert "'status': 'AMBG'" in output
|
||||
assert "def load_bulk_data(row):" in output
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user