Skip to content

python-math #39: feat(math): mode collapse C3 — powerit warm-start PCA + legacy kmeans as the only solvers (item 8 parked) - #2668

Draft
jucor wants to merge 1 commit into
spr/edge/ac5c5903from
spr/edge/30038853
Draft

python-math #39: feat(math): mode collapse C3 — powerit warm-start PCA + legacy kmeans as the only solvers (item 8 parked)#2668
jucor wants to merge 1 commit into
spr/edge/ac5c5903from
spr/edge/30038853

Conversation

@jucor

@jucor jucor commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

What

GOAL_CUTOVER_READY.md Phase 2, chunk C3 of the mode collapse (removing the engine's improved-mode branches so the Clojure-faithful behavior is the only code path). The engine's solver paths are now unconditionally the Clojure-faithful ones:

  • _compute_pca: always warm-starts power iteration from the previous tick's components (Clojure's :start-vectors, conversation.clj:385), with require_powerit=True.
  • _compute_clusters: the base level always runs legacy_kmeans with lineage warm start (PR-C of this stack); the group level always runs the per-k legacy loop with the group-K smoother (PR-D). The sklearn cold-recompute arms (kmeans_sklearn at the base level + best_k group selection) are deleted; dead GROUP_ITERS/base_weights/legacy_mode cleaned up.
  • POLISMATH_PCA_IMPL (the env var selecting the PCA implementation) is left in pca.py but is now ENGINE-INERT: with require_powerit always True, a sklearn selection is always overridden back to powerit (the existing warn+fallback). Full removal ships with queue item 8 post-cutover — deleting it now would cascade through 9 test files for zero behavior change (scope ruling, journal session 7).

Tests

Improved-mode pins deleted with their branches: improved-tick2-cold, cross-mode cold-tick equality (PCA warm start), improved-never-calls-legacy-kmeans + cross-mode vw invariance (lineage; replaced by a legacy determinism pin), and 3 smoother-inert tests. 51 tests green across the affected files. The deleted sklearn arms are queue item 8 in POST_CUTOVER_IMPROVEMENTS.md (park commit at the end of the collapse).

commit-id:30038853


Stack:


⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.

This was referenced Jul 27, 2026
This was referenced Jul 27, 2026
@jucor
jucor force-pushed the spr/edge/30038853 branch from be468f9 to 8bf1e87 Compare July 28, 2026 00:11
@jucor jucor changed the title feat(math): mode collapse C3 — powerit warm-start PCA + legacy kmeans as the only solvers (item 8 parked) python-math #39: feat(math): mode collapse C3 — powerit warm-start PCA + legacy kmeans as the only solvers (item 8 parked) Jul 28, 2026
…A + legacy kmeans as the only solvers (item 8 parked)

## What

`GOAL_CUTOVER_READY.md` Phase 2, chunk C3 of the mode collapse (removing the engine's improved-mode branches so the Clojure-faithful behavior is the only code path). The engine's solver paths are now unconditionally the Clojure-faithful ones:

- `_compute_pca`: always warm-starts power iteration from the previous tick's components (Clojure's `:start-vectors`, `conversation.clj:385`), with `require_powerit=True`.
- `_compute_clusters`: the base level always runs `legacy_kmeans` with lineage warm start (PR-C of this stack); the group level always runs the per-k legacy loop with the group-K smoother (PR-D). The sklearn cold-recompute arms (`kmeans_sklearn` at the base level + `best_k` group selection) are deleted; dead `GROUP_ITERS`/`base_weights`/`legacy_mode` cleaned up.
- `POLISMATH_PCA_IMPL` (the env var selecting the PCA implementation) is left in `pca.py` but is now ENGINE-INERT: with `require_powerit` always True, a sklearn selection is always overridden back to powerit (the existing warn+fallback). Full removal ships with queue item 8 post-cutover — deleting it now would cascade through 9 test files for zero behavior change (scope ruling, journal session 7).

## Tests

Improved-mode pins deleted with their branches: improved-tick2-cold, cross-mode cold-tick equality (PCA warm start), improved-never-calls-legacy-kmeans + cross-mode vw invariance (lineage; replaced by a legacy determinism pin), and 3 smoother-inert tests. 51 tests green across the affected files. The deleted sklearn arms are queue item 8 in `POST_CUTOVER_IMPROVEMENTS.md` (park commit at the end of the collapse).

commit-id:30038853
@jucor
jucor force-pushed the spr/edge/ac5c5903 branch from 09fe503 to 4fc18f2 Compare July 28, 2026 01:10
@jucor
jucor force-pushed the spr/edge/30038853 branch from 8bf1e87 to 25dcc93 Compare July 28, 2026 01:10
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