Skip to content

fix(strategy): expose --spectral-alpha for the decaying-spectrum fill#232

Open
ultrahighsuper wants to merge 1 commit into
zeokin:mainfrom
ultrahighsuper:feat/strategy-cli-spectral-alpha
Open

fix(strategy): expose --spectral-alpha for the decaying-spectrum fill#232
ultrahighsuper wants to merge 1 commit into
zeokin:mainfrom
ultrahighsuper:feat/strategy-cli-spectral-alpha

Conversation

@ultrahighsuper

Copy link
Copy Markdown
Contributor

PR kind

  • fix
  • feat

Summary

storage.generate takes a spectral_alpha knob (the k^-alpha singular-value decay for --fill decaying-spectrum), but the strategy CLI had no flag for it and runner.run/runner.compare didn't thread it through — so every decaying-spectrum run was hardcoded to alpha=1.0. It was the only generate() parameter with no CLI path. Now that decaying-spectrum is a scored track (floor 0.90), contributors need to sweep the decay rate to see where a transform holds up vs. degrades.

This adds --spectral-alpha (float, default 1.0, >= 0; negatives grow the tail — not a decaying spectrum — and are rejected at the CLI boundary like --n/--data-rank) and threads it through runner.run/compare into storage.generate.

Fixes #231. Distinct from #229 (which only corrects the --data-rank help text).

Effect (GPU end-to-end, N=512, decaying-spectrum, M=48)

--spectral-alpha 0.5 -> rel_err 7.0e-01   (gentle decay: hard)
--spectral-alpha 3.0 -> rel_err 4.1e-03   (steep decay: compressible)

Steeper alpha packs more energy into the leading components, so the subspace method reconstructs it far better — exactly the axis this fill is meant to probe.

Validation (CPU-safe path)

$ python -m pytest tests/ strategy/tests/ eval/tests/ -q
314 passed, 2 failed

The 2 failures pre-exist on clean main and are environment-only (Windows path-separator assertion in eval/tests/test_gpu_batch.py; fp16 in-core/tiled parity on a GTX 1650). New tests: negative --spectral-alpha exits cleanly (rc 2), the flag is parsed with default 1.0, and a larger alpha provably steepens the singular-value decay (pure NumPy).

Scope

  • strategy/cli.py + strategy/runner.py + tests only; open (non-protected) zone. Pure plumbing of an existing-but-unreachable knob; no behavior change at the default alpha=1.0.

storage.generate takes a spectral_alpha knob (the k^-alpha singular-value decay
for --fill decaying-spectrum), but the strategy CLI had no flag for it and
runner.run/compare didn't thread it through, so every decaying-spectrum run was
hardcoded to alpha=1.0 -- the only generate() parameter with no CLI path. Now
that decaying-spectrum is a scored track (floor 0.90), contributors need to
sweep the decay rate to see where a transform holds vs. degrades.

Add --spectral-alpha (float, default 1.0, >= 0; negatives grow the tail and are
rejected at the CLI boundary like --n/--data-rank) and thread it through
runner.run/compare into storage.generate. End-to-end (N=512, M=48):
--spectral-alpha 0.5 -> rel_err 0.70; 3.0 -> rel_err 0.004.

Adds CLI-validation and pure-NumPy plumbing/effect tests.

Fixes zeokin#231
@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 type:bug Something is incorrect or broken status:ready-non-gpu Fix/docs PR cleared non-GPU triage; maintainer review only labels Jul 14, 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:ready-non-gpu Fix/docs PR cleared non-GPU triage; maintainer review only type:bug Something is incorrect or broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] strategy CLI offers --fill decaying-spectrum but no way to set its k^-alpha decay rate (stuck at alpha=1.0)

1 participant