<!-- SPDX-License-Identifier: CC-BY-SA-4.0 -->
<!-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk> -->
# TOPOLOGY.md — chapeliser

## Purpose

chapeliser is a general-purpose Chapel acceleration framework that distributes any workload across Chapel clusters without the user writing Chapel code. It reads a `chapeliser.toml` manifest describing entry points, data partition strategies, and gather strategies, then generates Chapel wrapper code, a Zig FFI bridge, and C headers. chapeliser is priority #2 in the -iser family, targeting any compute workload that benefits from data-parallel or distributed execution.

## Module Map

```
chapeliser/
├── src/
│   ├── main.rs                    # CLI entry point (clap): init, validate, generate, build, run, info
│   ├── lib.rs                     # Library API
│   ├── manifest/mod.rs            # chapeliser.toml parser
│   ├── codegen/mod.rs             # Chapel wrapper, Zig FFI bridge, C header generation
│   └── ...                        # [WIP] partition/gather strategy modules
├── examples/                      # Worked examples
├── verification/                  # Proof harnesses
├── container/                     # Stapeln container ecosystem
└── .machine_readable/             # A2ML metadata
```

## Data Flow

```
chapeliser.toml manifest
        │
   ┌────▼────┐
   │ Manifest │  parse + validate entry points, partition + gather strategies
   │  Parser  │
   └────┬────┘
        │  validated acceleration config
   ┌────▼────┐
   │ Analyser │  inspect source entry points, resolve types
   └────┬────┘
        │  intermediate representation
   ┌────▼────┐
   │ Codegen  │  emit generated/chapeliser/ (Chapel wrappers, Zig FFI, C headers)
   └────┬────┘
        │  Chapel + FFI artifacts
   ┌────▼────┐
   │  Chapel  │  compile + distribute across Chapel cluster
   └─────────┘
```
