Memory-mapped file serialization and unfolding for RTHDDNetComposer. Provides binary topology serialization, buffer registry generation, and zero-copy memory layout for C++/C# interop.
$ dotnet add package NetComposer.MemoryMapA high-performance neural network compositor with dual-language architecture (C# for graph construction, C++ for runtime execution) using memory-mapped files for zero-copy communication.
Status: Phase 3 MVP + Phase 3D Partial + Phase 4A Complete ✅ (622 C# + 114 C++ unit + 17 C++ integration tests passing)
RTHDDNetComposer implements a unique dual-graph architecture where forward computation and gradient flow exist as separate, parallel computational graphs. This design enables:
Support for multiple numeric domains:
IntegratorNode - First temporal/stateful node in C++ runtime:
s(t+1) = (1-α)·s(t) + α·gain·inputDeferred to Future: LTCNode, conversion nodes (C++ execution), multi-threading, performance validation
Gradient Graph Construction API - Dual-graph architecture foundation:
Phase 4B (Gradient Memory Mapping): Extend .mmap format to serialize gradient graphs for C++ runtime
git clone https://github.com/rjogilvie/RTHDDNetComposer.git
cd RTHDDNetComposer
# Run environment setup script
./scripts/setup_env.sh
# Check for CUDA (optional)
./scripts/detect_cuda.sh
# Restore dependencies
dotnet restore RTHDDNetComposer.sln
# Build all C# projects
dotnet build RTHDDNetComposer.sln --configuration Release
# Run tests
dotnet test RTHDDNetComposer.sln
# Configure (without CUDA)
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_CUDA=OFF
# Build
cmake --build . -j$(nproc)
# Run tests
ctest --output-on-failure
cd ..
# Configure with CUDA
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_CUDA=ON
# Build
cmake --build . -j$(nproc)
cd ..
RTHDDNetComposer/
├── src/
│ ├── NetComposer.Core/ # C# core data structures
│ ├── NetComposer.Builder/ # C# graph building API
│ ├── NetComposer.MemoryMap/ # C# memory mapping
│ ├── NetComposer.Simulation/ # C# simulation interfaces
│ └── cpp/ # C++ runtime
│ ├── core/ # Memory-mapped graph, buffers
│ ├── execution/ # Execution engine, threading
│ ├── gradient/ # Gradient processing
│ ├── simulation/ # Simulation adapters
│ └── io/ # I/O controller
├── include/ # C++ public headers
├── tests/
│ ├── NetComposer.Tests/ # C# NUnit tests
│ └── cpp/ # C++ Google Test tests
├── docs/ # Architecture documentation
├── scripts/ # Build and setup scripts
├── .github/workflows/ # CI/CD pipelines
└── CLAUDE.md # AI assistant guidance
Ctrl+Shift+B / Cmd+Shift+B# C# development
dotnet build # Build
dotnet test # Run tests
dotnet run --project <project> # Run specific project
# C++ development
cmake -B build -S . # Configure
cmake --build build # Build
cd build && ctest # Test
# Clean builds
rm -rf build # Clean C++
dotnet clean # Clean C#
# Run all tests
dotnet test
# Run with detailed output
dotnet test --logger "console;verbosity=detailed"
# Run specific test
dotnet test --filter "TestName~<pattern>"
cd build
# Run all tests
ctest --output-on-failure
# Run specific test
./tests/cpp/netcomposer_tests --gtest_filter="CoreTests.*"
RTHDDNetComposer includes a comprehensive benchmark suite for performance validation and regression detection.
# Run complete benchmark suite (C++ + C#)
./scripts/run_benchmarks.sh
Results Location:
benchmarks/results/cpp_benchmarks.jsonbenchmarks/results/csharp/benchmarks/baseline_report.mdC++ Runtime (24 benchmarks):
Key Findings:
For detailed results, see benchmarks/baseline_report.md.
C++ Only:
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_BENCHMARKS=ON
cmake --build build --target netcomposer_benchmarks -j$(nproc)
cd build/benchmarks/cpp && ./netcomposer_benchmarks
C# Only:
cd benchmarks/NetComposer.Benchmarks
dotnet run -c Release
See benchmarks/README.md for complete benchmarking guide.
git checkout -b feature/amazing-feature)GitHub Actions workflows automatically:
See .github/workflows/ for CI configuration.
[Specify your license here]
See docs/ for detailed architecture documentation and design decisions.
Run the CUDA detection script:
./scripts/detect_cuda.sh
Follow the instructions to install CUDA or build without CUDA support using -DENABLE_CUDA=OFF.
# Clean CMake cache
rm -rf build
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
Check global.json for pinned SDK version:
cat global.json
dotnet --list-sdks
Install the matching SDK version or update global.json.