Skip to content

feat(strategy): nystrom captures 3 subspaces, not 4 (drop redundant col(B) landmark block)#226

Draft
RenzoMXD wants to merge 1 commit into
zeokin:mainfrom
RenzoMXD:feat/nystrom-three-way
Draft

feat(strategy): nystrom captures 3 subspaces, not 4 (drop redundant col(B) landmark block)#226
RenzoMXD wants to merge 1 commit into
zeokin:mainfrom
RenzoMXD:feat/nystrom-three-way

Conversation

@RenzoMXD

Copy link
Copy Markdown
Contributor

PR kind

  • fix
  • feat

DRAFT -- GPU scorecard pending. No GPU available right now; opening as a draft to avoid the missing-scorecard auto-close (close_missing_scorecard fires immediately for a non-draft feat PR with no scorecard). CPU-safe validation is green. Will mark this ready for review once I attach a real python -m eval scorecard.

Summary

Mirrors #156's rsvd fix, applied to nystrom (#194).

The reconstruction Ĉ = P A P B P (P = QQᵀ) needs only col(A), row(A), row(B) in range(Q) -- col(B) is provably redundant. #156 proved this for rsvd's random-projection sketches. That proof is about the projector algebra, not about how each space gets sketched, so it applies identically to nystrom's landmark-column sketches. NystromTransform still split its landmark budget 4 ways (col(A), row(A), col(B), row(B)) -- the same pre-#156 waste rsvd had. This splits 3 ways instead, over {col(A), row(A), row(B)}.

basis_flops is unchanged (2 n m²) -- same total sketch width, just reallocated.

What's new here versus just copying #156's reasoning

Added a numeric proof specific to landmark sampling (not just assumed by analogy to rsvd's random projections): construct Q from each pair of the three spaces and confirm reconstruction breaks when col(A) or row(B) is dropped, but not when col(B) is dropped -- see test_nystrom_col_b_is_redundant_but_col_a_and_row_b_are_not.

CPU-safe validation

$ uv run python -m strategy.smoke        # 2/2 transforms pass
$ uv run --extra test python -m pytest tests/ strategy/tests/ eval/tests/ -q
270 passed, 24 skipped

GPU Result (required for feat PRs only)

Pending -- will attach before marking ready for review. Plan: same regime #156 used (--n 8192 --pairs 3 --fill lowrank --data-rank 16 --rank-m 48 --transforms nystrom,rsvd --seed 0), before/after comparison against main.

Scope

strategy/transforms.py only (Open -- "the main event" zone per CONTRIBUTING.md); no API change, basis_flops unchanged, no protected-path edits.

Checklist

  • CPU-safe validation passed
  • My commits do not include Co-authored-by footers for coding agents
  • GPU scorecard attached (pending -- draft)

…ol(B) landmark block)

Mirrors zeokin#156's rsvd fix: the reconstruction C-hat = P A P B P needs only
col(A), row(A), row(B) in range(Q); col(B) is provably redundant, and
that's a property of the projector P = QQ^T, not of how each space gets
sketched. NystromTransform still split its landmark budget 4 ways
(col(A), row(A), col(B), row(B)) -- the same pre-zeokin#156 waste rsvd had.
Splits 3 ways now. basis_flops is unchanged (same total sketch width).

Adds a numeric proof that the redundancy holds for landmark sampling
specifically (not just assumed by analogy to rsvd's random projections):
dropping col(A) or row(B) breaks exact reconstruction, dropping col(B)
does not.

DRAFT: GPU scorecard pending -- no GPU available yet. CPU-safe validation
(270 passed, 24 skipped) is green; will mark ready for review once the
eval scorecard is attached.
@github-actions github-actions Bot added area:strategy Smart strategies / transforms (strategy/) area:tests Correctness gates and test suites (tests/) status:needs-review Awaiting maintainer review status:needs-scorecard Feature / strategy PR is missing the reproducible eval scorecard type:feature Feature / improvement PR that must carry a GPU scorecard type:strategy New smart strategy / transform proposal labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:strategy Smart strategies / transforms (strategy/) area:tests Correctness gates and test suites (tests/) status:needs-review Awaiting maintainer review status:needs-scorecard Feature / strategy PR is missing the reproducible eval scorecard type:feature Feature / improvement PR that must carry a GPU scorecard type:strategy New smart strategy / transform proposal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant