Skip to content

refactor(#50): remove dead stub + commented-out scaffolding#57

Merged
kalwalt merged 3 commits into
devfrom
cleanup/dead-code-50
Jun 20, 2026
Merged

refactor(#50): remove dead stub + commented-out scaffolding#57
kalwalt merged 3 commits into
devfrom
cleanup/dead-code-50

Conversation

@kalwalt

@kalwalt kalwalt commented Jun 20, 2026

Copy link
Copy Markdown
Member

First (and minimal) cleanup from the #50 audit. Behavior-neutral — only a dead declaration and commented-out text are removed, so the compiled WASM is byte-identical (no rebuild needed). Three commits:

  1. WebARKitManager::update() — declared in the header but never defined or called (the live per-frame path is processFrameData()). It only linked because nothing referenced it. Removed.
  2. im_gray() — a fully commented-out grayscale routine in WebARKitUtils.h, superseded by convert2Grayscale(). Removed.
  3. Commented _trackables[…] / getPoseMatrix3 lines — the old multi-marker forms left beside their live single-marker replacements, plus the commented getPoseMatrix3 decls. Removed; live code and explanatory comments untouched (brace balance verified 135/135).

Scope note (per audit discussion)

After cross-checking ArtoolkitX OCVT, we deliberately kept everything with plausible future value rather than chasing maximal deletion:

  • OCVT-derived symbols (CleanUp — used by ArtoolkitX RemoveAllMarkers; GetAllFeatures, IsSelected, markerRoi, inlier_matches) — kept for parity / possible future use.
  • _trackVizActive / TrackerVisualization — kept as scaffolding for a future debug overlay.
  • WebARKit accessors / alt-API / version / config constants (getWebARKitVersion, getTracker, getDistortionCoefficients, the cv::Mat overloads, the BCD version API, N, featureDetectPyramidLevel) — kept as plausible API surface.

So this PR removes only un-restorable-value noise. The KEEP decisions are being recorded in the companion webarkit-testing audit doc.

Refs #50.

🤖 Generated with Claude Code

kalwalt and others added 3 commits June 20, 2026 13:34
update() was declared in the header but never defined or called (the live
per-frame path is processFrameData()). It only linked because nothing
referenced it; calling it would have been a link error. Not scaffolding --
a future update() would be declared with its implementation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
im_gray() was a fully commented-out grayscale routine in WebARKitUtils.h,
superseded by convert2Grayscale(). Pure dead text (git history retains it).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Remove the commented-out multi-marker _trackables[...] lines (the old
artoolkitX-style forms left beside their live single-marker replacements)
and the commented getPoseMatrix3 declarations. Comment-only; the live code
and explanatory comments are untouched, so the compiled output is identical.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@kalwalt kalwalt self-assigned this Jun 20, 2026
@kalwalt kalwalt added enhancement New feature or request C/C++ code concerning the C/C++ code design and improvements Emscripten labels Jun 20, 2026
@kalwalt kalwalt moved this from To do to Review in progress in New markerless image tracking Jun 20, 2026
@kalwalt kalwalt added this to the Markerless tracking milestone Jun 20, 2026
@kalwalt kalwalt moved this from Review in progress to Reviewer approved in New markerless image tracking Jun 20, 2026
@kalwalt kalwalt merged commit f6bca84 into dev Jun 20, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in New markerless image tracking Jun 20, 2026
kalwalt added a commit to webarkit/webarkit-testing that referenced this pull request Jun 20, 2026
…isions

Companion to webarkit/WebARKitLib#57. Bump the submodule to the cleanup
commits (remove update() stub, im_gray(), commented _trackables/getPoseMatrix3)
and rebuild build/ + dist/ (emscripten output is not byte-reproducible, so the
artifacts change even for a behavior-neutral source edit).

docs/audit-dead-code-issue50.md: add a "Decisions & status" section recording
what was removed in #57 and what was deliberately KEPT (OCVT-derived symbols for
ArtoolkitX parity, _trackVizActive scaffolding, and plausible WebARKit API /
accessors / config constants), plus the one pending item (computePose cluster).

Verified: static (pyrLevel 1) and webcam (pyrLevel 0) examples both track, 1000 matches.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
kalwalt added a commit to webarkit/webarkit-testing that referenced this pull request Jun 21, 2026
…isions

Companion to webarkit/WebARKitLib#57. Bump the submodule to the cleanup
commits (remove update() stub, im_gray(), commented _trackables/getPoseMatrix3)
and rebuild build/ + dist/ (emscripten output is not byte-reproducible, so the
artifacts change even for a behavior-neutral source edit).

docs/audit-dead-code-issue50.md: add a "Decisions & status" section recording
what was removed in #57 and what was deliberately KEPT (OCVT-derived symbols for
ArtoolkitX parity, _trackVizActive scaffolding, and plausible WebARKit API /
accessors / config constants), plus the one pending item (computePose cluster).

Verified: static (pyrLevel 1) and webcam (pyrLevel 0) examples both track, 1000 matches.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C/C++ code concerning the C/C++ code design and improvements Emscripten enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant