Skip to content

refactor(linalg): de-duplicate linalg module (#47)#66

Merged
kalwalt merged 1 commit into
feat/refactor-jsfeat-nextfrom
refactor/47-dedup-linalg
Jul 8, 2026
Merged

refactor(linalg): de-duplicate linalg module (#47)#66
kalwalt merged 1 commit into
feat/refactor-jsfeat-nextfrom
refactor/47-dedup-linalg

Conversation

@kalwalt

@kalwalt kalwalt commented Jul 8, 2026

Copy link
Copy Markdown
Member

Fifth slice of #47 — the largest single extraction (~740 lines). Fresh branch off the integration branch.

What changed

  • src/linalg/linalg.ts — type-only stub replaced by the real implementation, verbatim from the monolith: JacobiImpl, JacobiSVDImpl, lu_solve, cholesky_solve, svd_decompose, svd_solve, svd_invert, eigenVV. It imports swap/hypot from ./linalg_base and matmath — both already real modules, no aggregator references needed.
  • src/jsfeatNext.ts — down another ~740 lines (monolith now ~1,300 of the original ~3,900).

Verification

  • tsc --noEmit → clean
  • npm test57/57 — six parity tests pin this module directly (LU, Cholesky, SVD ×3, eigenVV vs original jsfeat, SVD/eigen matched to 4 decimals)
  • UMD bundle smoke-checked: instanceof chain, static inheritance, lu_solve on an SPD system
  • dist//types/ untouched (rebuilt when the integration branch merges to dev)

Advances #47. Remaining: orbyape06motion_estimator (+ inline kernels → tightens core.ts any slots) → optical_flow_lk.

🤖 Generated with Claude Code

Fifth de-duplication step of #47, following the established pattern.

- src/linalg/linalg.ts: replace the type-only stub with the REAL
  implementation moved verbatim from the monolith (JacobiImpl, JacobiSVDImpl,
  lu_solve, cholesky_solve, svd_decompose, svd_solve, svd_invert, eigenVV).
  Imports swap/hypot from ./linalg_base and matmath — both already real
  modules.
- src/jsfeatNext.ts: shrinks by ~740 lines (largest single extraction).

Verified behavior-preserving: tsc --noEmit clean; npm test 57/57 (6 parity
tests pin linalg: LU, Cholesky, SVD x3, eigenVV vs original jsfeat); UMD
bundle smoke-checked (instanceof, static inheritance, lu_solve on an SPD
system).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@kalwalt kalwalt added this to the Parity & Modernization milestone Jul 8, 2026
@kalwalt kalwalt self-assigned this Jul 8, 2026
@kalwalt kalwalt added enhancement New feature or request Typescript all about Typescript code design javascript tests labels Jul 8, 2026
@kalwalt kalwalt merged commit 916febf into feat/refactor-jsfeat-next Jul 8, 2026
4 checks passed
@kalwalt kalwalt deleted the refactor/47-dedup-linalg branch July 10, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code design enhancement New feature or request javascript tests Typescript all about Typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant