This document summarizes the structural improvements made to the aika-cpp project.
- Added comprehensive coverage for build artifacts
- Added
activation_tests,debug_test,simple_activation_testsexecutables - Added
node_modules/directory - Added
install_manifest.txt - Added Python packaging artifacts (
.egg-info/,dist/,*.egg) - Consolidated duplicate entries and improved organization
- Added warning for in-source builds (recommends out-of-source builds)
- Made Python site-packages path dynamic and configurable:
- Checks
PYTHON_SITE_PACKAGESenvironment variable first - Falls back to detected Python installation path
- Uses
.venvas final fallback
- Checks
- Updated test paths to reflect new directory structure
- Improved comments and documentation
- Added comprehensive build instructions for both out-of-source and in-source builds
- Documented recommended workflow:
mkdir -p build && cd build cmake .. cmake --build . --target install
- Updated all test commands to reflect new directory structure
- Added notes about build configuration options
The python/ directory now has a proper package structure:
python/
├── __init__.py (enhanced with proper package documentation)
├── networks/
│ ├── __init__.py
│ ├── standard_network.py
│ └── transformer.py
├── types/
│ ├── __init__.py
│ ├── softmax_types.py
│ └── dot_product_types.py
├── utils/
│ ├── __init__.py
│ └── aika_debug_utils.py
└── examples/
├── __init__.py
├── activation_function_examples.py
└── debug_example.py
- Clear separation of concerns
- Easier imports:
from python.networks import transformer - Better discoverability of functionality
- Follows Python packaging best practices
- Ready for future
setup.pyif needed
tests/ # Mixed C++ tests
├── haslink_test.cpp
└── network/
python-tests/ # All Python tests
├── (test files)
└── fields/
tests/
├── cpp/
│ ├── haslink_test.cpp
│ └── network/
│ ├── test_runner.cpp
│ ├── activation_test.cpp
│ ├── abstract_activation_test.cpp
│ └── link_latent_test.cpp
└── python/
├── (all python test files)
└── fields/
└── (field-specific tests)
- Consistent naming convention (no hyphens vs underscores)
- Clear separation between C++ and Python tests
- Single
tests/directory as the entry point - Easier to navigate and understand
- Aligns with common project conventions
- Found orphaned
node_modules/directory (140+ packages, ~67KB package-lock) - No
package.jsonin project root - Contains packages including
claude,async,broadway, etc. - Last modified: May 5, 2025
- Appears to be leftover from a previous tool or experiment
- Already covered by updated
.gitignore - Safe to remove if not needed:
rm -rf node_modules/ - No impact on C++/Python build or functionality
# Recommended: Out-of-source build
mkdir -p build && cd build
cmake ..
cmake --build . --target install
# Alternative: In-source build (legacy)
cmake . && make clean && cmake --build . --target install# Python tests
python -m unittest discover tests/python
# C++ tests
cd build && ctest
# or
./build/activation_tests# Old way (still works but less organized)
import standard_network
# New way (recommended)
from python.networks import standard_network
from python.types import softmax_types
from python.utils import aika_debug_utils-
Test Scripts: Update any scripts that reference
python-tests/to usetests/python/# Old python python-tests/addition-test.py # New python tests/python/addition-test.py
-
Python Imports: Update imports to use new package structure (optional but recommended)
-
Build Process: Consider switching to out-of-source builds for cleaner project root
- Test file paths have changed (from
python-tests/totests/python/) - Python module organization changed (files moved to subdirectories)
- CMakeLists.txt test paths updated
.gitignoreimprovements (only adds new patterns)- CMakeLists.txt build improvements (backward compatible)
- Documentation updates
- Clean up
node_modules/if not needed:rm -rf node_modules/ - Test the new structure with a clean build
- Run test suite to ensure everything still works
- Consider adding
setup.pyfor Python package installation - Split large C++ implementation files (neuron.cpp ~17K lines, activation.cpp ~10K lines)
- Complete Sphinx documentation in
/docs - Clean up or populate
/ai_docsdirectory
- Add API documentation generation (Doxygen)
- Set up CI/CD to use new test structure
- Consider containerization (Docker) for consistent build environments
.gitignore- Enhanced build artifact coverageCMakeLists.txt- Out-of-source build support, dynamic pathsCLAUDE.md- Updated build and test commandspython/__init__.py- Enhanced package documentationpython/networks/__init__.py- New filepython/types/__init__.py- New filepython/utils/__init__.py- New filepython/examples/__init__.py- New file
python/*.py→python/*/(organized into subdirectories)tests/haslink_test.cpp→tests/cpp/haslink_test.cpptests/network/→tests/cpp/network/python-tests/→tests/python/(entire directory)
After these changes, verify:
-
Clean build works:
rm -rf build .venv python3 -m venv .venv source .venv/bin/activate mkdir build && cd build cmake .. cmake --build . --target install
-
Python tests pass:
python -m unittest discover tests/python
-
C++ tests pass:
cd build && ctest
-
Git status is clean (no untracked build artifacts):
git status
Removed obsolete conda packaging and CI workflows:
Removed /conda.recipe directory:
- Leftover from pybind11 example template
- Wrong package name: "cmake_example" instead of "aika"
- Wrong module import: "cmake_example" (doesn't exist)
- Generic template description not updated for project
- Last modified April 2025, never customized
Removed .github/workflows/conda.yml:
- Conda-based CI workflow
- Referenced removed pybind11 submodule (would fail)
- Tried to install non-existent "cmake_example" package
- Not needed - project uses pip-based distribution
Removed .appveyor.yml:
- AppVeyor CI configuration (obsolete)
- Referenced removed pybind11 submodule (line 16:
git submodule update) - Wrong package name: "cmake_example" instead of "aika"
- Redundant - GitHub Actions workflows already cover Windows builds
- AppVeyor no longer needed since GitHub Actions provides all CI
Removed .venv/ from git tracking:
- Virtual environment was incorrectly committed to repository
- Removed from git with
git rm -r --cached .venv - Directory still exists locally for development use
- Already covered by .gitignore (line 60)
- Virtual environments should never be version controlled
Fixed remaining CI workflows:
pip.yml: Removedsubmodules: true(line 23)wheels.yml: Removedsubmodules: true(lines 20, 45)format.yml: No changes needed
Current CI Strategy:
- pip-based installation via
setup.py - Works with removed pybind11 submodule (uses system pybind11)
- PyPI wheels generation via cibuildwheel
- Pre-commit formatting checks
Removed pybind11 git submodule and properly declared it as an external dependency:
Removed pybind11 git submodule:
- Was vendored as git submodule (outdated v2.9.2)
- Removed from repository (14MB including all history)
- Removed
.gitmodulesfile (no longer needed) - Build already used system pybind11 v2.13.6 via
find_package()
Updated dependency management:
- Added pybind11>=2.10.0 to
setup.pydependencies - Will be installed automatically via
pip install -e . - Can also be installed via system package managers (brew, apt, etc.)
- CMake uses
find_package(pybind11 REQUIRED)- standard approach
Benefits:
- Smaller repository size
- No git submodule maintenance
- Users get latest pybind11 version
- Standard dependency management
- Easier to update pybind11 version
Updated documentation:
- README.md now lists pybind11 in Prerequisites section
- CLAUDE.md updated with prerequisite information
- Build process unchanged (CMake already used find_package)
Removed incomplete and unused documentation directories:
Removed /docs directory:
- Contained skeleton Sphinx setup from 2016
- Only had a cmake_example.rst stub
- Not being used for actual project documentation
- Project already has comprehensive docs in README.md and specs/
Removed /ai_docs directory:
- Completely empty directory
- No content or purpose
Removed /node_modules directory:
- Orphaned Node.js packages (14MB, 140+ subdirectories)
- Leftover from previous tool experiment (May 2025)
- No package.json in project root
- Not needed for C++/Python build
Documentation Strategy:
- Primary:
README.md(user guide, installation, examples) - Developer:
CLAUDE.md(build commands, code style) - Specifications:
specs/directory (formal architecture docs) - All maintained in markdown format
To eliminate the need for sys.path.append() in test files and Python modules, we made the Python helpers an installable package:
Created setup.py:
- Makes the
python/directory an installable package - Allows using
pip install -e .for development mode - Automatically installs dependencies (parameterized, etc.)
Benefits:
- No more
sys.path.append()boilerplate in every file - Clean imports:
from python.networks.standard_network import ... - Standard Python development workflow
- Dependencies managed via pip
Updated workflow:
pip install -e . # Install once
# Now all imports work without sys.path manipulationFiles cleaned up:
- Removed
sys.path.append()from all 28 test files - Removed
sys.path.append()from all 7 Python module files - Updated all imports to use new package structure
These improvements modernize the project structure while maintaining backward compatibility where possible. The changes make the codebase more maintainable, easier to navigate, and aligned with industry best practices for C++/Python hybrid projects.
Key benefits:
- Cleaner git status (better .gitignore)
- Flexible build system (out-of-source builds)
- Organized Python code (proper package structure)
- Consistent test organization (unified tests/ directory)
- Better documentation (updated CLAUDE.md)
- Clean imports (no sys.path manipulation needed)