Skip to main content

PROJECT LOOMY

PyPI version CI Status LSO-Eval v1.1.0 Documentation Portal Python Versions License

Loomy (luminamoon) is the reference implementation and central repository of PROJECT LOOMY, providing low-precision numerical optimization, dataset text preprocessing and data processing utilities, and an evaluation suite developed by Silver Moon (@cloverxion) and Lumina Moon (@cloverx-id) contributors.

Built with a modular Rust and Python architecture under PROJECT LOOMY, luminamoon provides components for CPU/GPU parameter updates, text dataset preprocessing, and numerical verification:

LSO-Eval v1.1.0 Evaluation & Verification Notebook: Open in Google Colab — Empirical Stage II–IV benchmarks executed on LuminaV v1.5.3 under native torch.bfloat16 (centered_defect=False).

Projects & Components

Project / Component Path Status Description Documentation
LuminaV Optimizer optimizer/ Active (Spec v1.6.0) LuminaV v1.6.0 optimizer implementation with CPU SIMD (AVX-512/AVX2), Vulkan UMA, Triton AOT/JIT kernels, Triangle Family (buffer="T1", "T2"), optional contiguous bucket fusion, and Triton JIT pre-warmup. Optimizer Guide
LuminaMoon Data Engine data/ Active (v1.0.9) Modular text preprocessing library: AVX-512/AVX2/NEON SIMD text normalization, dual-layout StringTensor (CPU StringView & GPU contiguous buffers), Shannon entropy filtering, MinHash/XXH3-64 deduplication, PII masking, and 128B Ping-Pong checkpoint recovery. Data Engine Guide
LSO-Eval Suite eval/ Active (v1.1.0) Algorithm-agnostic optimizer evaluation & verification suite (LSO-Eval v1.1.0): Z3 SMT solver checks, 2D trajectory benchmarks, numerical parity tests, and Two-Class 4B LLM & Vision evaluation. LSO-Eval Guide
Changelogs changelogs/ Active Version histories separating Software Package releases (v1.0.0–v1.0.9) and LuminaV Algorithm Specifications (v1.0.0–v1.6.0). Changelogs
Documentation docs/ Active Documentation portal, developer guides (docs/optimize/, docs/dataloader/), and dependency version audits. Docs Portal
Python Package python/luminamoon/ Active (v1.0.9) Unified free-threaded (abi3t) Python namespace exposing LuminaV Optimizer, DataStreamLoader, and PyTorch/NumPy/HuggingFace integration. API Reference

Quickstart

Installation

Install the compiled package wheel from PyPI:

pip install luminamoon

Or build from source using Maturin and the Rust 2024 toolchain:

git clone https://github.com/cloverx-id/luminamoon.git
cd luminamoon
pip install maturin
maturin develop --release

Basic Usage (LuminaV Optimizer)

import numpy as np
from luminamoon import LuminaV

# Initialize parameters
weights = np.random.randn(64, 10).astype(np.float32)
biases = np.zeros(10, dtype=np.float32)

# Instantiate LuminaV optimizer (uses default hyperparameters)
optimizer = LuminaV([weights, biases], lr=8e-4, weight_decay=0.08, buffer=2)

# Execute optimization step with explicit gradients
grad_w = np.random.randn(64, 10).astype(np.float32)
grad_b = np.random.randn(10, dtype=np.float32)
optimizer.step(grads=[grad_w, grad_b])

For PyTorch deep learning workflows, see the PyTorch Integration Guide.

LuminaV Hyperparameter Quick Reference

All default values below are exposed in IDE autocompletion and LuminaV.__init__ docstrings:

Parameter Type Default Description
lr float 8e-4 (0.0008) Learning rate (η).
betas Tuple[float, float] (0.9, 0.999) Exponential moving average factors (β₁, β₂) for first moment and second moment / Triangle Defect.
eps float 1e-8 Numerical stability constant (ε) in the adaptive denominator.
weight_decay float 0.08 (8e-2) Decoupled weight decay coefficient.
tau float 0.8 Soft-projection temperature threshold (τ) for denominator damping.
lam float 0.3 Defect weight (λ) for the Triangle Defect in 1-Buffer TD-CLM (buffer=1) and Triangle Family (buffer="T1", "T2").
cautious bool True Enables sign-aligned cautious update masking and lagged EMA scaling.
cautious_clamp_min float 0.5 Lower bound in (0.0, 1.0] for cautious alignment scaling.
buffer int | str 2 State mode: 2 ("dual", "clm") for 2-Buffer CLM, 1 ("single", "td-clm") for 1-Buffer TD-CLM, "T2" for 2-Buffer Triangle Family (tanh-free), or "T1" for 1-Buffer Triangle Family (tanh-free).
stochastic_rounding bool True Applies stateless 32-bit MurmurHash3 stochastic rounding when writing to bfloat16 / float16 weights.
bound bool True Enables adaptive update bounding.
bound_type str | int "coordinate" Clipping mode: "coordinate" (element-wise clip) or "radial" (global norm ratio).
bound_ratio float 0.05 Maximum update magnitude relative to parameter scale.
master_weights str | bool "none" Mixed-precision master weight mode for bfloat16/float16: "none" (False), "semi", or "full" (True).
execution str | int "auto" Hardware backend: "auto", "triton", "vulkan", "simd", or "scalar".
fused_single_pass bool True Fuses parameter update and scalar reduction statistics into a single kernel pass.
fuse_tensors bool False Coalesces parameters into contiguous 1D memory buffers to reduce kernel launch latency on fragmented architectures (e.g. Vision models / ViT). Not recommended for large LLMs or distributed FSDP training.
bucket_cap_mb float 500.0 Maximum memory capacity per contiguous bucket chunk in megabytes when fuse_tensors=True. Partitions large models into bounded chunks. Emits a UserWarning if explicitly specified when fuse_tensors=False.
prewarm_jit bool True Pre-compiles Triton GPU kernels on 64-element dummy buffers (lr=0.0) during initialization to avoid first-step JIT compilation delay.
ema_decay str | float "auto" EMA decay for lagged cautious/radial scalars ("auto" resolves to 0.80 for buffer=2/"T2" and 0.95 for buffer=1/"T1").
fsdp_sync bool False Synchronizes global reduction scratch buffers across torch.distributed FSDP shards.
seed int 1337 Deterministic PRNG seed for stateless stochastic rounding.
version Optional[str] "1.6.0" Selects the active LuminaV mathematical specification version.

Software vs. Algorithm Versioning (v1.0.9 / Spec v1.6.0)

luminamoon maintains two separate version tracks (documented in changelogs/):

All version resolution operates offline using local compatibility profiles:

import luminamoon
from luminamoon import LuminaV
import luminamoon.data as lmd

# 1. Inspect Software Package Version vs. Algorithm Specification Version
print(luminamoon.__version__)    # "1.0.9" (Software distribution)
print(lmd.get_version())         # "1.0.9" (Data Engine module)
print(LuminaV.ALGORITHM_SPEC)    # "1.6.0" (Mathematical specification)
print(LuminaV.getVersion())      # "1.6.0"

# 2. Select a specific algorithm version per-instance or globally
opt = LuminaV([weights, biases], lr=8e-4, version="1.5.5")
opt.setVersion("1.5.5")          # Instance-level version selection
LuminaV.setVersion("1.5.5")      # Class-level default

# 3. Default specification (Note: Specifications prior to v1.5.0 are deprecated)
opt_default = LuminaV([weights, biases], version="1.6.0")

Basic Usage (LuminaMoon Data Engine: Fused Text Preprocessing Pipeline)

from luminamoon.data import FusedPipeline, StringTensor, create_resumable_collate, ResumablePipeline

# 1. Fused single-pass text preprocessing in Rust
pipeline = FusedPipeline(
    trim_whitespace=True,
    normalize_newlines=True,  # AVX-512 / AVX2 / NEON SIMD
    min_chars=10,
    min_entropy=2.0,
)
string_tensor = pipeline(["  sample 1\r\n", "sample 2 with proper prose text"])

# 2. Export to Apache Arrow, Polars, and PyTorch buffers
polars_series = string_tensor.to_polars()
arrow_array = string_tensor.to_arrow()
offsets_tensor, payload_tensor = string_tensor.to_torch_gpu(device="cuda")

# 3. Stream dataset with background prefetching & 128B Ping-Pong checkpointing
pipe = ResumablePipeline(
    source=raw_data,
    fused_pipeline=pipeline,
    batch_size=64,
    prefetch_batches=4,
    checkpoint_path="./cache/checkpoint.meta",
)
for batch in pipe:
    # Training step...
    pipe.commit()  # Saves Dual-Slot A/B checkpoint and deduplication WAL

For detailed architecture, Shannon entropy filtering, MinHash deduplication, and PyTorch collate_fn adapters, see the Data Engine Guide.

Verification & CI/CD

All pull requests and releases are tested across Linux, Windows, and macOS:

# Run static analysis across the Rust workspace
cargo clippy --workspace --all-targets -- -D warnings

# Run Rust workspace unit and parity tests (Optimizer + Data Engine)
cargo test --workspace

# Run Python static type check
npx pyright python/luminamoon

# Run standalone NumPy, PyTorch, and Data Engine test suites
python optimizer/tests/test_standalone_numpy.py
python optimizer/tests/test_end_to_end_training.py
python -B tests/test_data_modular.py
python -B tests/test_gpu_vs_cpu_strings.py

# Run LSO-Eval verification suite
python -m eval

Developer Resources

For contributors working on PROJECT LOOMY (luminamoon):

Authors & Maintenance

PROJECT LOOMY (luminamoon) is developed and maintained by:

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

Metadata

Release files for luminamoon 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for luminamoon 1.0.9
File Size Uploaded Provenance Actions
luminamoon-1.0.9.tar.gz 271.5 kB Without provenance Details for luminamoon-1.0.9.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for luminamoon 1.0.9
File Actions
luminamoon-1.0.9-py3-none-any.whl Python 3 none any Details for luminamoon-1.0.9-py3-none-any.whl
luminamoon-1.0.9-cp315-abi3.abi3t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.15 abi3t, abi3 Linux glibc 2.17+ x86-64 Details for luminamoon-1.0.9-cp315-abi3.abi3t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
luminamoon-1.0.9-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ x86-64 Details for luminamoon-1.0.9-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
luminamoon-1.0.9-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details for luminamoon-1.0.9-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
luminamoon-1.0.9-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for luminamoon-1.0.9-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
luminamoon-1.0.9-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details for luminamoon-1.0.9-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
luminamoon-1.0.9-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for luminamoon-1.0.9-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
luminamoon-1.0.9-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for luminamoon-1.0.9-cp310-abi3-win_amd64.whl
luminamoon-1.0.9-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for luminamoon-1.0.9-cp310-abi3-macosx_11_0_arm64.whl

Total release size: 21.7 MB

Release files / luminamoon-1.0.9.tar.gz

Download URL luminamoon-1.0.9.tar.gz
Size 271.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a06c7af6443f233c99099e4be4c53c44e55513418ff79cf17d5d9217eea244fc
BLAKE2b-256 checksum
How to use checksums
faf7cf6417963c0ab05faa05f734ae50564a596122e1fbdeff9efeb92d942842
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / luminamoon-1.0.9-py3-none-any.whl

Download URL luminamoon-1.0.9-py3-none-any.whl
Size 87.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1acfb30ef72bfcfc09eaf10fc4228a2fcc199edf853a6acfcc9ec0ee811fb6c
BLAKE2b-256 checksum
How to use checksums
eb9cb25fa4de64d0d947661a55667c4373a316d839943e18a11a01271d1c2ddf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / luminamoon-1.0.9-cp315-abi3.abi3t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL luminamoon-1.0.9-cp315-abi3.abi3t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.8 MB
Tags CPython 3.15 Linux glibc 2.17+ x86-64 abi3 abi3t
SHA-256 checksum
How to use checksums
da9db9d482df1154c7ffc8c5313088dd81fc13dfb974da96164f11a5f1aa684e
BLAKE2b-256 checksum
How to use checksums
e023908e55dfd2e724541a5668284820faa0942c28b3878bd875c4e39b4f3d13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / luminamoon-1.0.9-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL luminamoon-1.0.9-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.8 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
2ac6d8a2634d3e6c2d8c04f515371aa178191149ea1cbac0be99cdd993f28e91
BLAKE2b-256 checksum
How to use checksums
5eeb44ef480983ce37734e2a7f8e106158c1cbd3a7f9624575d274222b73e0a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / luminamoon-1.0.9-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL luminamoon-1.0.9-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.8 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
54832cc2efb053c113952c6e7151237abcfa3cfe7ed437209d3ab50c78fd242f
BLAKE2b-256 checksum
How to use checksums
e978d86606ff59c6d405f0f9b029eff2941c7e7caab9383ae5ec2389e9af657b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / luminamoon-1.0.9-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL luminamoon-1.0.9-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.8 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
664947b56bc77f24bb3f22722e3c8d10566f685d566196b972df58b641dae456
BLAKE2b-256 checksum
How to use checksums
ed8256d292aa1fbd3ccaff008be87bb6d9cc17bca2e04abf291683956dc5c739
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / luminamoon-1.0.9-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL luminamoon-1.0.9-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.8 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b8ec154831caba8ec15575691bb862b4bd64278cca674ba5d667b3f112d1502d
BLAKE2b-256 checksum
How to use checksums
d061e7dc04536706c196debd5771c3163c4642b3db7c056c48e2f857be632150
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / luminamoon-1.0.9-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL luminamoon-1.0.9-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.8 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
086be3b7355e8f089947402368873d2a5506e838bc9d953e607131719f2aa704
BLAKE2b-256 checksum
How to use checksums
9c83cdcaae3c2063e35563f1d65f67ec0d6607cb9e3c7e9318cc5a152ee50d8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / luminamoon-1.0.9-cp310-abi3-win_amd64.whl

Download URL luminamoon-1.0.9-cp310-abi3-win_amd64.whl
Size 2.4 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
0c0db9c7d2f1e777a660adaea0dfbf7d338e777813e116ffe739593edef6ccdf
BLAKE2b-256 checksum
How to use checksums
8f26d33d24513a4edb99d519ae7a019d000c87044b67e5b7a0c78001a1e02e16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / luminamoon-1.0.9-cp310-abi3-macosx_11_0_arm64.whl

Download URL luminamoon-1.0.9-cp310-abi3-macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0df44b8d0c85d7322d84b19570a85f1849e2fc307915a26f426d8e86b58c4a6e
BLAKE2b-256 checksum
How to use checksums
f6eb5086b6108a561536e48dfd4ae7d6e882c3fdda7875e28c891ee576a49199
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for luminamoon 1.0.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page