Skip to content

docs: document the R layer in ARCHITECTURE.md; correct the stale src … - #12

Merged
billdenney merged 1 commit into
mainfrom
docs/architecture-contents
Jul 29, 2026
Merged

docs: document the R layer in ARCHITECTURE.md; correct the stale src …#12
billdenney merged 1 commit into
mainfrom
docs/architecture-contents

Conversation

@billdenney

Copy link
Copy Markdown
Member

…table

ARCHITECTURE.md named NONE of the five files in R/ -- it documented only the C++ kernels, so a reader had no map of the layer they actually call. The meta-repo's held-back audit check 8 (MR !76) reports all five.

Adds an "R contents" table in the same shape as the existing kernel table, one row per file, covering what the R layer is for: the validate / coerce / pad / dispatch / un-coerce sandwich in thin.R (including why NA is rejected -- NA_integer_ is INT_MIN in the kernels, where it corrupts neighbour sums far from the NA cell -- and why the one-pixel pad exists), how medial_axis() differs from thin() (width information), and distance_transform()'s all-foreground Inf convention.

R/RcppExports.R is documented as GENERATED by Rcpp::compileAttributes(), matching how the existing table already documents src/RcppExports.cpp, and lists the nine internal .Call shims plus the regenerate step. No exemption for generated files is needed or proposed: the package's own document already documents its generated .cpp counterpart, and the entry carries information a reader needs.

Also corrects the adjacent kernel table, which was contradicted by the new R rows. It listed Lee and K3M as "Stub" and omitted five files. All seven methods are implemented and exercised by test-thin.R with exact expected outputs; hilditch / opta / holt / medial_axis / distance_transform / thinr_common.h were absent entirely. Design constraint 3 ("Lee and K3M throw") is rewritten to the rule it was really encoding -- unsupported input errors rather than silently falling back -- which still holds for NA and >2-D arrays.

Docs-only. Verified with the real check-8 code extracted from the figureextract meta-repo's origin/audit/architecture-contents-check: thinr goes from 5 violations to 0.

…table

ARCHITECTURE.md named NONE of the five files in R/ -- it documented only
the C++ kernels, so a reader had no map of the layer they actually call.
The meta-repo's held-back audit check 8 (MR !76) reports all five.

Adds an "R contents" table in the same shape as the existing kernel
table, one row per file, covering what the R layer is for: the
validate / coerce / pad / dispatch / un-coerce sandwich in thin.R
(including why NA is rejected -- NA_integer_ is INT_MIN in the kernels,
where it corrupts neighbour sums far from the NA cell -- and why the
one-pixel pad exists), how medial_axis() differs from thin() (width
information), and distance_transform()'s all-foreground Inf convention.

R/RcppExports.R is documented as GENERATED by Rcpp::compileAttributes(),
matching how the existing table already documents src/RcppExports.cpp,
and lists the nine internal .Call shims plus the regenerate step. No
exemption for generated files is needed or proposed: the package's own
document already documents its generated .cpp counterpart, and the entry
carries information a reader needs.

Also corrects the adjacent kernel table, which was contradicted by the
new R rows. It listed Lee and K3M as "Stub" and omitted five files. All
seven methods are implemented and exercised by test-thin.R with exact
expected outputs; hilditch / opta / holt / medial_axis /
distance_transform / thinr_common.h were absent entirely. Design
constraint 3 ("Lee and K3M throw") is rewritten to the rule it was
really encoding -- unsupported input errors rather than silently falling
back -- which still holds for NA and >2-D arrays.

Docs-only. Verified with the real check-8 code extracted from the
figureextract meta-repo's origin/audit/architecture-contents-check:
thinr goes from 5 violations to 0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@billdenney
billdenney merged commit 713ffaf into main Jul 29, 2026
8 checks passed
@billdenney
billdenney deleted the docs/architecture-contents branch July 29, 2026 12:40
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant