🧱 Oakfield Architecture Overview

1. Introduction

The Oakfield runtime architecture implements the Oakfield Operator Calculus (OOC) in C++. It provides the computational substrate — the memory layout, scheduling, and numerical kernels — that bring the abstract operator algebra to life.

The runtime is modular and extensible. Every operator, field, and integrator is defined through a common interface, allowing them to be composed dynamically at runtime or patched interactively in the UI.

2. High-Level Structure

Field ↔ Operator ↔ Integrator ↔ Scheduler ↔ Profiler/Logger
↑ ↓
Registry Ensemble

At the highest level, Oakfield consists of five tightly integrated subsystems:

LayerResponsibility
Field LayerMemory and data layout for scalar/vector/tensor fields.
Operator LayerDefines analytic, stochastic, and differential transformations.
Integration LayerTime evolution and step control (RKF45, EM, etc.).
Scheduling LayerMulti-threaded task orchestration and execution graph.
Instrumentation LayerProfiling, logging, configuration, and runtime introspection.

3. Field Layer — The State Manifold

Role: Defines the field space , the domain on which all operators act.

Key Features

  • N-dimensional, strongly typed data containers (float, double, complex, etc.)
  • Contiguous or strided layouts suitable for CPU and GPU backends
  • Pluggable allocators for pinned or device-aware buffers
  • Explicit ownership semantics (create/destroy) rather than shared/RC handles
Analogy: In OOC terms, SimField is the object of the category — the carrier manifold for dynamics.

4. Operator Layer — The Algebra Engine

Purpose

Implements the operator algebra 𝒪: the set of morphisms acting on fields.

Operators are registered at runtime via descriptors that bind user state, field ports, and evaluation callbacks. The system builds a dependency graph from those descriptors and schedules evaluations on demand.

Relation to OOC

Operators here correspond to morphisms in the category 𝒪 : ℱ → ℱ. Composition and commutation are implemented as graph operations in the IR.

5. Integration Layer — Time Functors

Purpose

Provides functors that map static operators into time-evolving flows.

Core Integrators (Current runtime)

Name/IDMethodDescription
"rkf45"Runge–Kutta–FehlbergAdaptive-step deterministic solver.
"rk4"Runge–KuttaFixed-step fourth-order solver.
"heun"Heun / RK2Two-stage predictor–corrector with better stability than Euler.
"euler"Forward EulerSimple explicit, fixed-step integrator.
"backward_euler"Backward EulerImplicit first-order integrator for stiff drifts.
"crank_nicolson"Crank-NicolsonSemi-implicit second-order scheme.
"subordination"Convolution kernelImplements fractional-time subordination.

Integrators are registered dynamically and operate over the scheduled operator graph, evaluating sub-steps as needed. They are functors in the OOC sense: they act on morphisms to produce time-evolved flows.

6. Scheduler Layer — Runtime Orchestration

Purpose

The simulation scheduler manages the execution of all registered operators and integrators over time.

Responsibilities

  • Builds execution DAGs (directed acyclic graphs) from operator dependencies.
  • Dispatches computation across CPU cores or GPU streams.
  • Synchronizes I/O and logging.
  • Supports asynchronous, event-driven simulation (restarts, checkpoints, dynamic operator injection).
Analogy: The scheduler is the ensemble functor — it coordinates multiple operator evaluations into a consistent temporal evolution.

7. Instrumentation Layer — Observation and Feedback

ComponentRole
ProfilerRecords execution time, kernel latency, and memory bandwidth per operator.
LoggerAsynchronous, lock-free message system for diagnostics and analytics.
Config HooksIntegration points for embedding in UIs or scripting layers (Lua, etc.).

This layer provides the feedback that turns Oakfield from a black box into a playable instrument. Profiling and logging correspond to observation operators in the calculus — real-world sieves on performance and behavior.

8. Operator Families (Current Modules)

Operator FamilyDescription
StimulusBase waveform and field generators.
Phase FeatureExtracts phase or coordinate features.
Analytic WarpCore analytic transformations (digamma, Bessel, Gaussian).
MeasurementRemainder–sieve–mixer loop with symbolic descriptors.
Linear DissipativeImplements linear decay or damping operators.
Fractional MemoryFractional differential and hereditary kernels.
Stochastic NoiseWhite and colored noise injectors.
Coupling/MixerField combination, bias, and mixing operators.
Spatial DerivativeFinite-difference gradient/Laplacian families.
ThermostatEnergy-regulating feedback operators.
Remainder (Complex)Complex/polar residue measurement for analytic comparisons.

Upcoming:

  • Measurement metrics helpers (complexity summaries, curvature spectra)
  • Visualization bridge for live measurement inspection

9. Execution Flow

[ Field Initialization ]
[ Operator Graph Build ]
[ Integrator Selection ]
[ Scheduler Dispatch ]
[ Profiling / Logging / Visualization ]

Each step corresponds directly to one morphism in the operator calculus.

10. Future Architecture Expansions

ModuleGoalDescription
Measurement MetricsComplexity feedback loopHigher-order analytics built on remainder/sieve outputs
Neural Operator LayerLearning integrationRuntime-trainable analytic operators
Quantum Operator LayerOperator liftingMode-based Fock-space evolution
Visualization EngineReal-time "oscilloscope"GPU-based analytic waveform renderer
Patch InterfaceModular operator graph UIDrag-and-drop composition of operators

11. Summary

Oakfield's architecture is the embodied calculus. Where OOC provides the theoretical rules of composition, the architecture executes them — faithfully, efficiently, and interactively.

It's built to grow by composition, not replacement: every new operator or integrator extends the language of the system without breaking it.

In short: the architecture is to Oakfield what circuitry is to a modular synthesizer — it carries the current that makes the math audible.

Ready to explore the implementation?