This directory is the main implementation surface for the repository.
It currently contains:
- the reusable
gfe_coreC++ library - the
abersoesingle-level runtime layer - the
hierarchical_minhierarchy, diagnostics, and renormalization layer - the C ABI in
include/gfe/gfe_c_api.h - CLI tools and local test targets
- SOE fitting
- spectral units and kernel utilities
- augmented stepping primitives
- backend selection
- assumption and energy bookkeeping foundations
- single-level model assembly
- scenario execution
- runtime diagnostics
- optional Hebbian memory-weight adaptation
- multi-level composition
- bottom-up and top-down coupling
- cross-level diagnostics
- renormalization analysis
- constrained custom chain construction
This C++ layer is no longer just a fitter plus a few demos.
The current codebase already includes:
- installable
gfe_corelibrary packaging - shared-library builds for wrapper use
- canonical
abersoeand hierarchy scenarios - typed C ABI access to runtime and report surfaces
- renormalization consistency reporting
- passing local tests for core, ABI, runtime, hierarchy, and renorm paths
What is still intentionally incomplete relative to the broader D2C reference:
- predictive-coding learning heads
- per-channel value learning runtime
- Python-side Director/TraceStore orchestration
- language/token bridge modules
So this directory should be treated as the stable numerical and runtime substrate, not yet the full end-to-end D2C training stack.
cmake -S "code/c++ core" -B "code/c++ core/build" -DCMAKE_BUILD_TYPE=Release
cmake --build "code/c++ core/build" -jcmake -S "code/c++ core" -B "code/c++ core/build-shared" -DBUILD_SHARED_LIBS=ON
cmake --build "code/c++ core/build-shared" -jcmake --install "code/c++ core/build" --prefix "$HOME/.local"Installed CMake package files land under:
$prefix/lib/cmake/gfe_core
Consumer pattern:
find_package(gfe_core REQUIRED)
target_link_libraries(my_target PRIVATE gfe::gfe_core)- backend-driven SOE fitting
- spectral metrics with policy control
- CPU reference path with scaffolded backend selection
Key families:
fit_soe_kernel(...)fit_soe_on_basis(...)logspace_gamma_basis(...)
- formulations A, B, and C
- deterministic and seeded-stochastic execution
- scenario registry
- diagnostics/config snapshots
- optional Hebbian updates
CLI target:
abersoe_cli
- canonical hierarchy scenarios
- constrained custom chain specs
- typed level summaries
- cross-level contract/warning reporting
- renormalization analyses and CSV export
CLI target:
hierarchical_min_cli
- header:
include/gfe/gfe_c_api.h - implementation:
src/gfe_c_api.cpp
The ABI already covers more than fitting:
- SOE fit calls
abersoescenario runsabersoescenario runs with explicit state/kernel overrides and trajectory export- hierarchy scenario runs
- cross-level report retrieval
- renorm report retrieval
- constrained custom chain validation and execution
Design rule:
- plain C structs/enums only
- explicit output capacities and required-size reporting
- typed reports for wrappers instead of CLI parsing
Worth noting for current experiment work:
- the richer single-level ABERSOE ABI entrypoint is
gfe_c_abersoe_run_scenario_with_overrides(...) - it is the intended surface when a caller needs:
- custom Lorenz63 initial conditions
- custom single-level memory kernels (
gamma/w) - the active runtime kernel returned directly
- sampled
u/chitrajectories for memory-side analysis
- trajectory output follows the normal runtime
sample_stride; usesample_stride = 1for dense analysis
ctest --test-dir "code/c++ core/build" --output-on-failure"code/c++ core/build"/gfe_cliList operations:
"code/c++ core/build"/gfe_cli --listcmake --build "code/c++ core/build" --target gfe_ou_experiment
"code/c++ core/build"/gfe_ou_experimentOptional CSV export:
"code/c++ core/build"/gfe_ou_experiment --csv /tmp/ou_metrics.csvcmake --build "code/c++ core/build" --target abersoe_cli
"code/c++ core/build"/abersoe_cli --list-scenariosLinear run:
"code/c++ core/build"/abersoe_cli --scenario linear --steps 500 --dt 0.01 --form BLorenz63 run:
"code/c++ core/build"/abersoe_cli --scenario lorenz63 --steps 3000 --dt 0.005 --form BResonant Formulation C run:
"code/c++ core/build"/abersoe_cli --scenario resonant1d --steps 2000 --dt 0.01 --form CDiagnostics / reproducibility example:
"code/c++ core/build"/abersoe_cli \
--scenario linear \
--steps 1000 \
--dt 0.01 \
--stochastic-noise-std 0.05 \
--seed 42 \
--diagnostics-csv /tmp/abersoe_diag.csv \
--config-csv /tmp/abersoe_cfg.csv \
--fit-report-csv /tmp/abersoe_fit.csv \
--fit-backend nnlsHebbian update example:
"code/c++ core/build"/abersoe_cli \
--scenario linear \
--hebbian oja \
--hebbian-lr 0.05 \
--hebbian-decay 0.001cmake --build "code/c++ core/build" --target hierarchical_min_cli
"code/c++ core/build"/hierarchical_min_cliThis is the right entrypoint when you want to inspect:
- canonical hierarchy scenarios
- per-level summaries
- cross-level report output
- renormalization report output
Notable local targets include:
gfe_smoke_testgst_smoke_testgfe_foundation_smoke_testgfe_backend_smoke_testgfe_c_api_smoke_testabersoe_smoke_testhierarchical_min_smoke_testhierarchical_min_integration_testhierarchical_min_unit_testhierarchical_min_renorm_testhierarchical_min_renorm_integration_testhierarchical_min_consistency_testhierarchical_min_benchmark_test
These are wired in the local CMake build and can be run together through ctest.
- Root overview:
/README.md - Python wrapper guide:
/code/python/README.md - Julia guide:
/code/julia/README.md - Technical reference extract:
/D2C.md - Project notebook:
/Context.md
Clean compiled targets:
cmake --build "code/c++ core/build" --target cleanPurge CMake cache and temp artifacts:
cmake --build "code/c++ core/build" --target space_clean