From e0645f86447a5aa5eea55f4d4cdcbcd757a15937 Mon Sep 17 00:00:00 2001 From: Bill Denney Date: Tue, 28 Jul 2026 22:19:56 +0000 Subject: [PATCH] Record is_border_4() as deliberately retained, not orphaned The 2026-07-28 no-consumer audit re-confirmed that src/thinr_common.h's is_border_4() has no caller: no .cpp references it, and the only other mention was the CLAUDE.md line listing it as a shared helper. Its last callers were the stentiford and pavlidis kernels, dropped 2026-05-20. thinr's own REVIEW-2026-07-28.md left the choice open -- "delete the is_border_4 definition and the CLAUDE.md mention, or add a comment stating it is retained deliberately" -- and deliberately did not decide. This commit takes the second option and closes the ambiguity, which is the point of the audit: the helper is part of the shared 8-neighbour vocabulary a new thinning kernel is written against, an uncalled inline emits no code, and the standing instruction is not to remove code that is likely to be useful merely because it has no consumer yet. No behaviour change: comments only. Co-Authored-By: Claude Opus 5 --- CLAUDE.md | 4 ++++ src/thinr_common.h | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 8d561f4..60d281e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -44,6 +44,10 @@ C++ sources in `src/`: - `thinr_common.h` — shared inline helpers (`crossing_number`, `neighbour_count`, `is_border_4`). + `is_border_4` has **no caller today** and is retained deliberately as part of + the shared 8-neighbour vocabulary a new kernel would be written against (its + last callers, `stentiford` / `pavlidis`, were dropped 2026-05-20). See the + comment on its definition; do not "clean it up" without reading that first. - `zhang_suen.cpp` — Zhang & Suen (1984). - `guo_hall.cpp` — Guo & Hall (1989). - `lee.cpp` — Lee, Kashyap & Chu (1994), 2-D adaptation. diff --git a/src/thinr_common.h b/src/thinr_common.h index ed529b1..31b49bf 100644 --- a/src/thinr_common.h +++ b/src/thinr_common.h @@ -30,7 +30,21 @@ inline int neighbour_count(int p2, int p3, int p4, int p5, } // 4-connected background test: TRUE iff at least one 4-connected -// neighbour is background. Used to identify border pixels. +// neighbour is background. Identifies border pixels. +// +// NO CALLER TODAY -- retained deliberately, not orphaned. Every kernel +// currently in src/ tests deletability through crossing_number() / +// neighbour_count() instead; this predicate was last used by the +// `stentiford` and `pavlidis` kernels, dropped 2026-05-20. It is kept +// because it is part of this header's reason to exist -- the shared +// 8-neighbour vocabulary a NEW thinning kernel is written against -- +// and an uncalled `inline` emits no code, so it costs nothing at +// runtime or in binary size. +// +// The 2026-07-28 review left "delete it or state that it is deliberate" +// open as a judgement call; this comment is that decision. If a future +// reader finds this helper still callerless and the header's shared- +// vocabulary role no longer holds, deleting it is safe and expected. inline bool is_border_4(int p2, int p4, int p6, int p8) { return (p2 == 0) || (p4 == 0) || (p6 == 0) || (p8 == 0); }