diff --git a/.gitignore b/.gitignore index c1919f775..71396f911 100644 --- a/.gitignore +++ b/.gitignore @@ -1,220 +1,4 @@ -# ── Git worktrees ────────────────────────────────────────────────────── -.worktrees/ - -# ── Zig build artifacts ─────────────────────────────────────────────── -zig-cache/ -.zig-cache/ -.zig/ -zig-out/ -exe/ -docs_html/ -# build/ contains source .zig files — only ignore non-Zig artifacts -build/* -!build/*.zig - -# ── Documentation build artifacts ───────────────────────────────────── -docs-src/build/ -docs/api-app/data/docs_engine.component.wasm -docs/api-app/data/features.json - -# ── Editor and IDE ──────────────────────────────────────────────────── -.vscode/ -.cursor/ -.idea/ -*.swp -*.swo -*~ -.DS_Store - -# ── Dependencies and package management ─────────────────────────────── -node_modules/ -.bun/ - -# ── Python artifacts ────────────────────────────────────────────────── -__pycache__/ -*.py[cod] -*.pyo -*.pyd -*.egg-info/ -.pytest_cache/ -.mypy_cache/ -.ruff_cache/ -.pytype/ -.venv/ -venv/ - -# ── Test and benchmark results ──────────────────────────────────────── -*.test -*.bench -coverage/ -# Benchmark output JSON files (root-level only) -/ai.json -/all.json -/conc.json -/crypto.json -/db.json -/mem.json -/net.json -/quick.json -/simd.json - -# ── Logs ────────────────────────────────────────────────────────────── -*.log -logs/ - -# ── Environment files ───────────────────────────────────────────────── -.env -.env.local -.env.*.local - -# ── Database files ──────────────────────────────────────────────────── -*.wdbx -*.wdbx.wal -*.wal -*.db -*.sqlite - -# ── Temporary and generated files ───────────────────────────────────── -tmp/ -temp/ -*.tmp -abi.json -probe_error.txt -probe_*.txt -probe_*.zig -test_build.zig -build_options.zig -src/build_options.zig -/abi_*_tmp*.zig -/tmp_*.zig -fix_*.py -migrate*.sh - -# ── Debug/test output files ─────────────────────────────────────────── -test_log.txt -test_output.txt -test_full.txt -web_error.txt -network_error.txt -build_errors.txt -build_full*.txt -wasm_build_log.txt -wasm_install_log.txt -training_data.txt - -# ── AI model files and training artifacts ───────────────────────────── -*.onnx -*.pt -*.pth -*.h5 -*.pb -*.ckpt -*.gguf -models/ -test-models/ -train.bin -testingllm.ckpt/ - -# ── GPU shader artifacts ───────────────────────────────────────────── -*.spv - -# ── Root-level build artifacts (one-off test binaries) ──────────────── -/test_page_size -/cast_test -/runner -/unused_test -/synthetic.bin - -# ── Binary executables and object files ─────────────────────────────── -*.a -*.o -*.exe -*.dll -*.so -*.dylib -*.pdb -*.pdb.* -*.core - -# ── Profiling data ──────────────────────────────────────────────────── -*.prof -*.profraw -*.tracy -perf.data* - -# ── Claude Code (track rules, skills, README, hooks — ignore the rest) -.claude/ -!.claude/ -!.claude/README.md -!.claude/rules/ -!.claude/rules/** -!.claude/skills/ -!.claude/skills/** -!.claude/agents/ -!.claude/agents/** -!.claude/settings.json -.claude-plugin/ - -# ── Local task tracking (agent notes) ──────────────────────────────── -tasks/ -!/tasks/ - -# ── ABI runtime state ──────────────────────────────────────────────── -.abi/ - -# ── Ralph runtime output and lock ───────────────────────────────────── -.ralph/ - -# ── Development checkpoints ─────────────────────────────────────────── -checkpoints/ - -# ── Generated reports (Ralph gate, skill memory) ───────────────────── -reports/ - -# ── Backup files ────────────────────────────────────────────────────── -backups/ -*.bak -*.backup - -# ── Distribution ────────────────────────────────────────────────────── -dist/ -release/ -*.tar.gz -*.zip - -# ── Rust build artifacts in bindings ────────────────────────────────── -bindings/**/target/ -bindings/c/.zig-cache/ - -# ── OS specific ─────────────────────────────────────────────────────── -Thumbs.db -desktop.ini -nul - -# ── Misc generated / workspace ──────────────────────────────────────── -.nx/installation -.nx/cache -.nx/workspace-data -tmpclaude-*-cwd -tmpclaude-* -/abi/ -/hello -examples/c_test -.discord -*.cell.out - -# ── Trash (cleanup staging) ───────────────────────────────────────── -TRASH/ -TRASH-FILES.md - -# ── Cleanup policy: markdown allowlist only ───────────────────────── -*.md -!/AGENTS.md -!/README.md -!/tasks/todo.md -!/tasks/lessons.md - -# ── Local one-off artifacts ────────────────────────────────────────── -.zig-global-cache/ -/hashmap_check -/hashmap_check2 +**/*.DS_Store +**/*.zig-cache +# Ignore build directories +*/build/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..14458c274 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# Contributing + +Please write clear commit messages that briefly describe the changes. +For example: + +``` +Add Cell framework example using C++23 modules +``` + +Commit messages like "Applying previous commit" should be avoided. diff --git a/README.md b/README.md index c29d5911c..fbf5b071b 100644 --- a/README.md +++ b/README.md @@ -484,62 +484,6 @@ zig build benchmarks zig build lint ``` ---- - -## Environment Variables - -| Variable | Description | -|:---------|:------------| -| `ABI_OPENAI_API_KEY` | OpenAI API key | -| `ABI_ANTHROPIC_API_KEY` | Anthropic/Claude API key | -| `ABI_OLLAMA_HOST` | Ollama host (default: `http://127.0.0.1:11434`) | -| `ABI_OLLAMA_MODEL` | Default Ollama model | -| `ABI_HF_API_TOKEN` | HuggingFace API token | -| `DISCORD_BOT_TOKEN` | Discord bot token | - ---- - -## Project Status - -| Milestone | Status | -|:----------|:------:| -| Zig 0.16 Migration | ![Complete](https://img.shields.io/badge/-Complete-success) | -| Llama-CPP Parity | ![Complete](https://img.shields.io/badge/-Complete-success) | -| C Library Bindings | ![Complete](https://img.shields.io/badge/-Complete-success) | -| Plugin Registry | ![Complete](https://img.shields.io/badge/-Complete-success) | -| Runtime Consolidation | ![Complete](https://img.shields.io/badge/-Complete-success) | -| Feature Stubs | ![Complete](https://img.shields.io/badge/-Complete-success) | -| Multi-GPU Orchestration | ![Complete](https://img.shields.io/badge/-Complete-success) | -See [PLAN.md](PLAN.md) for current sprint status and [ROADMAP.md](ROADMAP.md) for version history. - ---- - -## Contributing - -We welcome contributions! Please see: - -- [CONTRIBUTING.md](CONTRIBUTING.md) - Development workflow -- [CLAUDE.md](CLAUDE.md) - Coding guidelines and patterns - -
- -[![Issues](https://img.shields.io/badge/Issues-Report_Bug-red?logo=github)](https://github.com/donaldfilimon/abi/issues) -[![Discussions](https://img.shields.io/badge/Discussions-Ask_Questions-blue?logo=github)](https://github.com/donaldfilimon/abi/discussions) -[![Contributing](https://img.shields.io/badge/PRs-Welcome-brightgreen?logo=git)](CONTRIBUTING.md) - -
- ---- - -
- -[![License](https://img.shields.io/github/license/donaldfilimon/abi?style=for-the-badge)](LICENSE) - -MIT License - See [LICENSE](LICENSE) for details. - -
- -**Built with Zig** - -
+### Cell Framework Example +This repository now includes a demonstration of the Cell framework using modern C++23 modules. See `cell_framework/README.md` for build instructions. diff --git a/cell_framework/CMakeLists.txt b/cell_framework/CMakeLists.txt new file mode 100644 index 000000000..7253c3852 --- /dev/null +++ b/cell_framework/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 3.26) +project(CellFramework LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 23) +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API 1) + +# Directory for generated headers +set(GENERATED_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include) +file(MAKE_DIRECTORY ${GENERATED_INCLUDE_DIR}) + +add_custom_target(generate_headers + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_headers.cmake + BYPRODUCTS ${GENERATED_INCLUDE_DIR}/Cell/Core.hpp + VERBATIM +) + +add_library(CellCore) + +target_sources(CellCore + PUBLIC + FILE_SET cxx_modules TYPE CXX_MODULES FILES + ${CMAKE_CURRENT_SOURCE_DIR}/Cell/Core.ixx + FILE_SET cxx_modules TYPE CXX_MODULES FILES + ${CMAKE_CURRENT_SOURCE_DIR}/Cell/Core.cpp +) + +target_include_directories(CellCore PUBLIC ${GENERATED_INCLUDE_DIR}) + +add_dependencies(CellCore generate_headers) + +add_executable(cell_app main.cpp) + +target_link_libraries(cell_app PRIVATE CellCore) + +add_dependencies(cell_app generate_headers) diff --git a/cell_framework/Cell/Core.cpp b/cell_framework/Cell/Core.cpp new file mode 100644 index 000000000..a0ed2f418 --- /dev/null +++ b/cell_framework/Cell/Core.cpp @@ -0,0 +1,11 @@ +module; +#include + +module Cell.Core; + +namespace Cell { + void Engine::run() { + std::cout << "Cell Engine running!" << std::endl; + std::cout << "2 + 2 = " << add(2, 2) << std::endl; + } +} diff --git a/cell_framework/Cell/Core.ixx b/cell_framework/Cell/Core.ixx new file mode 100644 index 000000000..609ae65a7 --- /dev/null +++ b/cell_framework/Cell/Core.ixx @@ -0,0 +1,14 @@ +export module Cell.Core; + +export import ; + +export namespace Cell { + inline int add(int a, int b) { + return a + b; + } + + class Engine { + public: + void run(); + }; +} diff --git a/cell_framework/README.md b/cell_framework/README.md new file mode 100644 index 000000000..f4518f423 --- /dev/null +++ b/cell_framework/README.md @@ -0,0 +1,27 @@ +# Cell Framework Example with C++23 Modules + +This example demonstrates the Cell framework using a modules-first design. +The build system uses CMake 3.26+ with the experimental C++ module API and +automatically generates traditional headers from module interface files. + +## Prerequisites + +- CMake 3.26 or newer +- A C++23 compiler with module support (Clang 18+ or equivalent) + +## Building + +```bash +mkdir build && cd build +cmake .. +cmake --build . +./cell_app +``` + +CMake should be invoked from a separate `build` directory to keep +generated files isolated from the source tree. + +During configuration, module interfaces located in the `Cell/` directory are +converted into headers under `build/include/Cell`. These generated headers +allow interoperability with code that still relies on the traditional `#include` +mechanism. diff --git a/cell_framework/main.cpp b/cell_framework/main.cpp new file mode 100644 index 000000000..239dbf731 --- /dev/null +++ b/cell_framework/main.cpp @@ -0,0 +1,7 @@ +import Cell.Core; + +int main() { + Cell::Engine engine; + engine.run(); + return 0; +} diff --git a/scripts/generate_headers.cmake b/scripts/generate_headers.cmake new file mode 100644 index 000000000..5c8ae44a2 --- /dev/null +++ b/scripts/generate_headers.cmake @@ -0,0 +1,10 @@ +# Simple header generation from module interface files +file(GLOB MODULE_FILES "${CMAKE_CURRENT_LIST_DIR}/../cell_framework/Cell/*.ixx") +foreach(MFILE ${MODULE_FILES}) + get_filename_component(MNAME ${MFILE} NAME_WE) + set(HEADER "${GENERATED_INCLUDE_DIR}/Cell/${MNAME}.hpp") + file(MAKE_DIRECTORY "${GENERATED_INCLUDE_DIR}/Cell") + file(READ ${MFILE} CONTENTS) + string(REGEX REPLACE "export module ([A-Za-z0-9_.]+);" "#pragma once\n// Generated from module \1" CONTENTS "${CONTENTS}") + file(WRITE ${HEADER} "${CONTENTS}") +endforeach()