Skip to content

Commit cdb2156

Browse files
committed
fix: emit up to 3 dd_line + 3 cancellation annotations per case
Previously only dd_line locations were annotated (minimal delta-debug set, often just 1 line). Now also emit the top 3 cancellation sites per case as ::notice:: so the PR diff shows a richer set of FP hotspots.
1 parent b3656c8 commit cdb2156

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

toolchain/mfc/fp_stability.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -745,22 +745,33 @@ def _run_case(
745745

746746

747747
def _emit_github_annotations(results: list):
748-
"""Emit GitHub ::warning:: annotations for dd_line source locations.
748+
"""Emit GitHub annotations for FP hotspots.
749749
750750
Only runs inside GitHub Actions (GITHUB_ACTIONS env var set). Annotations
751751
appear inline on the responsible source lines in the PR diff view.
752+
753+
Up to 3 dd_line locations are emitted as ::warning:: per case (minimal
754+
responsible lines from delta-debug). Up to 3 cancellation sites per case
755+
are emitted as ::notice:: so the diff also highlights subtraction-
756+
cancellation hotspots identified by --check-cancellation.
752757
"""
753758
if not os.environ.get("GITHUB_ACTIONS"):
754759
return
755760
for r in results:
756761
status = "FAIL" if not r["passed"] else "hotspot"
757-
for rel_path, start, end in r.get("dd_line_locs", [])[:10]:
762+
dev_str = f"max_dev={r['max_dev']:.2e} (threshold {r['threshold']:.0e})"
763+
764+
for rel_path, start, end in r.get("dd_line_locs", [])[:3]:
758765
loc = f"file={rel_path},line={start}"
759766
if end != start:
760767
loc += f",endLine={end}"
761768
title = f"FP {status} [{r['name']}]"
762-
msg = f"max_dev={r['max_dev']:.2e} (threshold {r['threshold']:.0e})"
763-
print(f"::warning {loc},title={title}::{msg}", flush=True)
769+
print(f"::warning {loc},title={title}::{dev_str}", flush=True)
770+
771+
for fname, lineno in r.get("cancellation_locs", [])[:3]:
772+
loc = f"file={fname},line={lineno}"
773+
title = f"FP cancellation [{r['name']}]"
774+
print(f"::notice {loc},title={title}::catastrophic cancellation site", flush=True)
764775

765776

766777
def _emit_github_summary(results: list, n_samples: int):

0 commit comments

Comments
 (0)