Skip to content

wave2-polish: implement etk-geom + etk-config, add CI#1

Merged
Peterc3-dev merged 1 commit into
mainfrom
wave2-polish
May 30, 2026
Merged

wave2-polish: implement etk-geom + etk-config, add CI#1
Peterc3-dev merged 1 commit into
mainfrom
wave2-polish

Conversation

@Peterc3-dev

Copy link
Copy Markdown
Owner

Summary

Polish pass on the scaffold. Filled in the two crates whose intent is fully
specified by PLAN.md and that are pure CPU math (no camera/GPU/Wayland
hardware needed), added unit tests, and wired up CI.

What was finished

etk-geom (was a doc-comment-only scaffold → fully implemented):

  • Pointf64 2D point + Euclidean distance.
  • Ellipse — pupil ellipse parameterisation: area, eccentricity (axis-order independent), point_at boundary sampling.
  • OneEuro — One-Euro cursor-smoothing filter. Defaults match PLAN.md §6 Phase 7 (min_cutoff=1.0, beta=0.007). Handles first-sample passthrough, out-of-order timestamps, and reset.
  • Homography — 2D 9-point calibration map (gaze feature → screen px) via Direct Linear Transform solved through the normal equations, with a hand-rolled 8×8 Gaussian-elimination solver (partial pivoting). No external linear-algebra dependency. Rejects too-few / mismatched-length / singular inputs.
  • 17 unit tests (recovers a known projective map, detects collinear-singular, variance reduction, etc.).

etk-config (scaffold → fully implemented):

  • Typed Config tree: capture / smoothing / dwell / fusion, every field documented with a default drawn from PLAN.md.
  • TOML parse / serialise / round-trip; partial files merge with defaults; unknown fields rejected (deny_unknown_fields); missing file → Config::default().
  • config_path() resolves XDG_CONFIG_HOME then HOME/.config.
  • 6 unit tests.

CI.github/workflows/ci.yml: cargo fmt --check, cargo clippy --workspace --all-targets -D warnings, build, test on stable. Uses no untrusted input in run:/ref:.

Verified (built + tested on this machine)

Toolchain present: cargo/rustc 1.95.0, gcc.

  • cargo fmt --all --check — clean
  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo build --workspace --all-targets — success
  • cargo test --workspace — 23 tests pass (17 etk-geom + 6 etk-config), 0 failures. All previously-building crates still build.

NOT done / UNVERIFIED (left as documented scaffolds)

These crates/apps need hardware or large GPU/Wayland stacks that cannot be exercised in this environment, so finishing them would be guessing at integration details. Left as the existing doc-comment scaffolds:

  • etk-capture (tokio UDP/MJPEG receiver — needs ESP32-S3 modules)
  • etk-preproc (JPEG decode / GPU upload)
  • etk-infer (burn-wgpu / wonnx Vulkan inference — needs the burn/wgpu stack + ONNX weights)
  • etk-output (libei / uinput cursor injection — needs Wayland portal / /dev/uinput)
  • etk-gui (egui calibration UI)
  • apps bench-infer, capture-preview, track-preview, eye-tracker (print placeholders)

The heavy workspace dependencies (burn, wgpu, egui, reis, evdev, tokio) were not pulled into any crate, so the build stays light and these were not benchmarked. No invented benchmarks.

TODOs left in code

  • etk-config: notify live-reload watcher — belongs in the eye-tracker daemon event loop, marked TODO(Phase 7) on config_path().

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

🤖 Generated with Claude Code

Fill in the two pure-CPU, hardware-free crates from the scaffold and wire
up a GitHub Actions CI workflow.

etk-geom (fully implemented + tested):
- Point: f64 2D point with distance helper.
- Ellipse: pupil ellipse parameterisation (area, eccentricity, boundary
  sampling).
- OneEuro: One-Euro filter for cursor smoothing, plan defaults
  min_cutoff=1.0 / beta=0.007 (PLAN.md Phase 7).
- Homography: 2D 9-point calibration map via DLT + normal equations, with a
  hand-rolled 8x8 Gaussian-elimination solver (no extra deps). Validates
  point count / length / singularity.
- 17 unit tests.

etk-config (fully implemented + tested):
- Typed Config tree (capture / smoothing / dwell / fusion) with documented
  defaults drawn from PLAN.md.
- TOML load/parse/round-trip; partial files merge with defaults; unknown
  fields rejected; missing file -> default.
- config_path() resolves XDG_CONFIG_HOME / HOME.
- notify live-reload left as an explicit TODO (belongs in daemon event loop).
- 6 unit tests.

CI:
- .github/workflows/ci.yml: fmt --check, clippy -D warnings, build, test on
  stable.

The remaining crates (capture, preproc, infer, output, gui) and the four
app binaries are left as documented scaffolds: their intent requires
camera/GPU/Wayland hardware that cannot be verified in this environment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Peterc3-dev

Copy link
Copy Markdown
Owner Author

Independent verification — verdict: solid, ready to merge

Re-cloned wave2-polish and re-ran the full pipeline on a clean checkout (cargo 1.95.0). All implementer claims confirmed:

  • cargo build --workspace --all-targets — success
  • cargo fmt --all --check — clean
  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo test --workspace23 passed, 0 failed (17 etk-geom + 6 etk-config), matching the PR body exactly.

Code review:

  • OneEuro matches the canonical Casiez et al. (2012) formulation; first-sample passthrough, dt<=0 guard, and reset all correct. Defaults (min_cutoff=1.0, beta=0.007) match PLAN §6 Phase 7.
  • Homography is a correct DLT fit via normal equations (AᵀA h = Aᵀb) with an 8×8 Gaussian-elimination solver (partial pivoting). Singular/collinear and length/count validation all correct.
  • Ellipse area/eccentricity/point_at formulas correct; eccentricity is axis-order independent as claimed.
  • Config: deny_unknown_fields + nested default partial-merge behavior verified by passing tests.

Overclaims: none. The PR honestly downgraded the etk-geom module doc-comment (removed the old scaffold's unimplemented 'Levenberg-Marquardt refinement' and 'brightest-CC glint detection' claims) and was explicit that those live in etk-infer. The 'NOT done' section accurately lists the untouched hardware/GPU crates — confirmed: git diff shows zero changes to any other crate or app, so no regressions.

CI: .github/workflows/ci.yml is correct and safe — pinned action versions, no untrusted input in run/ref.

Minor, non-blocking nits (optional follow-up):

  • Homography uses raw normal equations without Hartley pre-normalization. Fine for the well-conditioned 9-point calibration grid, but SVD/normalized-DLT would be more robust if feature coordinates ever span a wide dynamic range. Not claimed otherwise.
  • Point.x/.y fields lack doc comments (missing_docs lint isn't enabled, so clippy is happy).

LGTM to merge.

@Peterc3-dev Peterc3-dev merged commit 2b5e634 into main May 30, 2026
1 check passed
@Peterc3-dev Peterc3-dev deleted the wave2-polish branch May 30, 2026 01:17
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