Developer Guide
The Developer Guide explains FHElium's implementation mechanisms: public value semantics, graph-free Eager dispatch, Program transformations, callable specialization, Backend preparation, numerical algorithms, native execution, and storage lifetimes. Eager and Compile share operation implementations; manual Program/Compilation/Pipeline execution and callable Compile are equally supported ways to compose the Compile machinery.
Architecture overview
Values, Programs, and execution preparation
| Implementation question | Article |
|---|---|
| How does an immediate operation update CKKS state and dispatch Tensor payloads? | Values, operation semantics, and Eager dispatch |
| How are computation, partial state, effects, and captured Python represented? | IR, capture, effects, and open state |
| What does each pass receive, and how is the common pipeline composed? | Compilation state and pass composition |
| How are keys, tables, and execution handles prepared and bound? | Tensor materials and operation preparation |
| How do operation declarations, lowerings, and implementation choices connect? | Operation registration and implementation selection |
| How does linking generate host calls, and how do callable specializations reuse them? | Linking and prepared host execution |
| How are SSA regions transformed into pointwise and NTT kernels? | Generated kernels, fusion, and NTT execution |
| Where is an operation family's numerical implementation? | IR operations and implementations |
For executable tasks, use evaluate CKKS data, build a Program pipeline, or compile a callable. These routes share the mechanisms documented here.
Security
Security describes cryptographic parameter assessment, randomness, key custody, stored data, executable Programs, and distributed execution.
Numerical algorithms and representations
| Implementation question | Article |
|---|---|
| How are slots encoded, random streams advanced, and key relations constructed? | Encoding, randomness, and key construction |
| How do prime rows, Montgomery residues, and transform schedules map to Tensor storage? | RNS and NTT architecture |
| How do component products, hybrid digits, rotations, and quotient rounding compose? | Multiplication, key switching, and rescale |
| How is compact encoded plaintext storage consumed without dense expansion? | CompressedPlaintext internals |
| How are modulus raising, linear transforms, and periodic reduction composed? | CKKS bootstrap internals |
Persistence, runtime, and distribution
| Implementation question | Article |
|---|---|
| What Program and Tensor state survives serialization, and what must be rebound? | Compilation persistence and rebinding |
| How are persistent values cataloged, published, recovered, and retired? | ArtifactStore internals |
| How are stable buffers, asynchronous copies, and CUDA Graph output lifetimes managed? | Execution buffers and CUDA Graphs |
| How are live values, replicas, reconstruction sources, and ownership represented? | Residency state and ownership |
| How do leases, reservations, plans, and admission decisions become transitions? | Residency plans and execution |
| How do rank-local IR, descriptors, payload transport, and reductions execute? | Distributed internals |
Contributor workflows
- Contributing to FHElium: environments, source checks, and mathematical validation.
- Native operator workflow: schemas, CPU/CUDA implementations, wrappers, and ABI checks.
- Binary packaging and release: wheel identities, installed-artifact checks, and package repositories.
- Contributing to documentation: page roles, static API generation, diagrams, and site builds.
Concept definitions belong in Concepts, runnable workflows in Tutorials, and individual tasks in How-to. Use the generated API reference for signatures and operation equations alongside these implementation traces.