Skip to content

Add unit tests for src modules#3

Open
Jah-yee wants to merge 3 commits into
thinking-machines-lab:mainfrom
Jah-yee:main
Open

Add unit tests for src modules#3
Jah-yee wants to merge 3 commits into
thinking-machines-lab:mainfrom
Jah-yee:main

Conversation

@Jah-yee
Copy link
Copy Markdown

@Jah-yee Jah-yee commented Apr 15, 2026

Good day,

I have added comprehensive unit tests for the three modules in the src/ directory:

  • test_msign.py: Tests for matrix sign function (Polar Express algorithm)

    • Shape preservation tests
    • NaN/Inf checks
    • Determinism tests
    • Sign property verification for PD/ND matrices
    • Custom parameter tests
  • test_manifold_muon.py: Tests for manifold Muon optimizer

    • Shape preservation tests
    • Convergence tests
    • Orthogonality verification
    • Custom parameter tests (eta, alpha, steps)
  • test_hyperspherical_descent.py: Tests for hyperspherical descent

    • 1D/2D input tests
    • Unit sphere constraint tests
    • Gradient descent direction tests
    • Custom eta parameter tests

Note: The tests require and ============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-7.4.4, pluggy-1.4.0
rootdir: /home/ubuntu/.openclaw/workspace-taizi/manifolds
configfile: pytest.ini
testpaths: tests
plugins: anyio-4.13.0
collected 0 items / 3 errors

==================================== ERRORS ====================================
____________ ERROR collecting tests/test_hyperspherical_descent.py _____________
ImportError while importing test module '/home/ubuntu/.openclaw/workspace-taizi/manifolds/tests/test_hyperspherical_descent.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.12/importlib/init.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_hyperspherical_descent.py:2: in
import torch
E ModuleNotFoundError: No module named 'torch'
_________________ ERROR collecting tests/test_manifold_muon.py _________________
ImportError while importing test module '/home/ubuntu/.openclaw/workspace-taizi/manifolds/tests/test_manifold_muon.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.12/importlib/init.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_manifold_muon.py:2: in
import torch
E ModuleNotFoundError: No module named 'torch'
_____________________ ERROR collecting tests/test_msign.py _____________________
ImportError while importing test module '/home/ubuntu/.openclaw/workspace-taizi/manifolds/tests/test_msign.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.12/importlib/init.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_msign.py:2: in
import torch
E ModuleNotFoundError: No module named 'torch'
=========================== short test summary info ============================
ERROR tests/test_hyperspherical_descent.py
ERROR tests/test_manifold_muon.py
ERROR tests/test_msign.py
!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 3 errors in 0.05s =============================== to run. Due to environment constraints, I was unable to run the tests locally, but they follow standard pytest conventions and should work when executed in an environment with the required dependencies.

Thank you for your work on this project.

Warmly, RoomWithOutRoof

Good day!

Warmly, RoomWithoutRoof
RoomWithOutRoof and others added 2 commits April 16, 2026 01:31
Address issue #1: The code forgot the multiplication with eta when assembling H.
This ensures the tangent constraint metric H is properly scaled by the
learning rate eta, providing more accurate gradient descent on the manifold.

Good day,

Thank you for your work on this excellent library!

Warmly,
RoomWithOutRoof
Fix eta multiplication in H calculation
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