Skip to content

docs(#50): dead / duplicated / orphan code inventory - #44

Merged
kalwalt merged 1 commit into
devfrom
audit/dead-code-issue50
Jun 19, 2026
Merged

docs(#50): dead / duplicated / orphan code inventory#44
kalwalt merged 1 commit into
devfrom
audit/dead-code-issue50

Conversation

@kalwalt

@kalwalt kalwalt commented Jun 19, 2026

Copy link
Copy Markdown
Member

Inventory deliverable for WebARKitLib#50. Doc only — no code removed. Removals happen in later PRs, each verified (recompile + examples track).

What

docs/audit-dead-code-issue50.md — a manual, cross-repo (C++ + JS/bindings) dead/duplicated/orphan-code inventory, audited at submodule 28ff065. Per-file findings + a master cleanup decision table (KEEP-API / KEEP-live / REMOVE-redundant / REMOVE-internal / FIX / DECIDE).

Highlights

  • All seven named suspects resolved. process_raw/processFrame are not a duplicate (public entry vs internal helper).
  • Matrix getters are intentional public API (per maintainer policy) → kept even though examples render only matrixGL_RH.
  • Found a real bug: getPoseMatrix() returns a zero matrix (pose3d never populated in the live path) — filed as getPoseMatrix() returns a zero matrix — pose3d is never populated in the live path WebARKitLib#55, with the agreed getPoseMatrix/getPoseMatrix2getPoseMatrixCV/getPoseMatrixGL rename riding along the fix.
  • _trackVizActive/TrackerVisualization is unreachable (no setter) → flagged DECIDE (wire a toggle or remove).
  • Confirmed-dead internal/redundant items enumerated: computePose/invertPose/pose3d cluster + its orphaned points2d/points3d inputs, getWebARKitVersion, getTracker, update() (declared, never defined), the cv::Mat initTracker/arglCameraViewRHf overloads, getDistortionCoefficients, GetAllFeatures/CleanUp, inlier_matches, TrackedPoint::IsSelected/markerRoi, grayscale()/im_gray()/webarkitGetVersion(char**), and dead constants N / featureDetectPyramidLevel / the VERSION_MAJOR/MINOR/TINY/DEV quartet.
  • Examples + makem.js + webpack.config.js are clean — no orphans.

Coverage

Full xref on Manager, Pattern, GL, Camera, Config, TrackingPointSelector, HomographyInfo, TrackedPoint, Utils, Enums, the whole JS/glue/examples chain, and the active paths of WebARKitTracker.cpp. Low-risk spot-check remaining: WebARKitLog and individual package.json scripts.

🤖 Generated with Claude Code

Manual cross-repo (C++ + JS/bindings) dead-code inventory for WebARKitLib#50,
audited at submodule 28ff065. Inventory only -- no code removed.

Key outcomes:
- All seven named suspects resolved; matrix getters classified as intentional
  public API (keep), with getPoseMatrix/getPoseMatrix2 -> getPoseMatrixCV/
  getPoseMatrixGL rename + the getPoseMatrix zero-matrix fix tracked in #55.
- Confirmed-dead internal/redundant code enumerated per file with a master
  cleanup decision table (KEEP-API / KEEP-live / REMOVE-redundant /
  REMOVE-internal / FIX / DECIDE).
- _trackVizActive / TrackerVisualization flagged DECIDE (unreachable, no setter).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@kalwalt kalwalt self-assigned this Jun 19, 2026
@kalwalt kalwalt added documentation Improvements or additions to documentation enhancement New feature or request Emscripten / C / C++ all about Emscripten labels Jun 19, 2026
@kalwalt kalwalt moved this from To do to In progress in New markerless image tracking Jun 19, 2026
@kalwalt kalwalt added this to the Markerless tracking milestone Jun 19, 2026
@kalwalt kalwalt moved this from In progress to Review in progress in New markerless image tracking Jun 19, 2026
@kalwalt kalwalt moved this from Review in progress to Reviewer approved in New markerless image tracking Jun 19, 2026
@kalwalt
kalwalt merged commit ab81eca into dev Jun 19, 2026
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in New markerless image tracking Jun 19, 2026
kalwalt added a commit that referenced this pull request Jun 21, 2026
…xample

Bump WebARKitLib to the part-A downsampling change (webarkit/WebARKitLib#52)
and rebuild build/ + dist/. Feature detection now runs on a pyrDown'd copy
of the live frame; matched keypoints are rescaled to full-frame coords.

- examples: point the Teblid static-image example at a marker-fills-frame
  1920x1440 demo image (pinball-demo-big.jpg) so HD downsampling is
  exercised (pyrLevel 1, scale 2.0) and the marker still acquires. The old
  pinball-demo.jpg (small marker in a large frame) falls below the detector
  threshold once downsampled.
- docs: add docs/design-detection-downsampling.md (understanding, ArtoolkitX
  reference, decision log, the four edits, testing, risks, non-goals).

Verified: Marker tracked, 1000 matches, content centered (#38) and
right-handed (#42/#46), no #43-style doubling.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
kalwalt added a commit that referenced this pull request Jun 21, 2026
Bump WebARKitLib to the part-B detection guard (webarkit/WebARKitLib#54)
and rebuild build/ + dist/. Feature detection is now skipped while optical
flow holds a lock, so the steady tracking state is much cheaper.

Measured on the Teblid webcam example (640x480): ~10-15 fps when detecting
every frame -> ~45 fps while tracking. Static example (1920x1440, pyrLevel 1)
still acquires and holds (no freeze).

- docs: add docs/design-detection-guard.md (understanding, ArtoolkitX
  reference, why the guard is on _isTracking rather than the marker counter,
  state walk-through, testing, risks, non-goals).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@kalwalt
kalwalt deleted the audit/dead-code-issue50 branch July 5, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation Emscripten / C / C++ all about Emscripten enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant