Docs · Context Assimilation Engine

Inside the assimilation engine.

The CAE is a runtime module that copies, or lazily maps, outside data into CTE tags. Its work is done by assimilators, one class per kind of source, chosen by the source URL. This page names the pieces and follows a transfer through them.

Module
clio_cae_core (pool 400.0)
Methods
ParseOmni, ImportData (HDF5), ExportData, ProcessHdf5Dataset, plus CTE forwarding
Fault I/O threads
CLIO_CAE_REF_IO_THREADS (32)

The pieces

clio-cae + OMNI loaderYAML → AssimilationCtx list CEE / Python / C++context_bundle, CAE client CAE core moduleParseOmni: run transfers in order · fault handler registry Assimilator factoryfile · string · hdf5 · http(s) · s3 · gs · globus Reference I/O poolblocking source reads off workers Summarizer (optional)labels blobs via a model CTE chain (next_pool_id: the indexer, 564.0, in the shipped config)
Transfers arrive as one task. The core picks an assimilator per source and writes blobs through the chain, or registers the source so blobs are ingested when first read.

A transfer, step by step

  1. Load. The clio-cae tool's OMNI loader reads the YAML, expands each entry into an assimilation context (source, destination, format, range, dataset filters, credentials) and submits the list as one ParseOmni task. The CEE and the language clients build the same contexts directly.
  2. Choose. In the runtime, the core asks the assimilator factory for the class that handles each source's scheme.
  3. Assimilate. The assimilator's schedule coroutine reads the source and puts blobs into the destination tag through the CTE client: a description blob plus 1 MiB chunk_N blobs for files and objects, one tag per dataset for HDF5, one blob for a string. Puts go to the CAE's next_pool_id, so imports pass the cache, indexer and replication like any other write. The HTTP(S) and Globus assimilators are the exception: they download to a file:: path (or, for Globus, another endpoint), not into a tag.
  4. Finish. Transfers run in order, each completing before the next starts, and the task returns one status.

Assimilators

An assimilator is a C++ class implementing a small base interface. Besides scheduling a whole transfer, it can optionally produce the bytes of one destination blob on request (for ingest on fault) and describe the source's page layout (for pagify). The shipped ones cover local files, inline strings, HDF5, HTTP and HTTPS, S3 (with a pooled keep-alive connection set and forwarded credentials, since the daemon does not inherit the client's environment), Google Cloud Storage and Globus. Of these, only the local-file assimilator implements per-blob reads, so only file:: sources can be ingested on fault. Extending the CAE adds a new one.

Where each source lands

AssimilationCtx (one per transfer) src, dst, format, range_off, range_sizeon_fault, chunk_size, blob_prefix (default chunk_)dataset filters, tokens, S3 region and profile BaseAssimilator interface Schedule: the whole transfer (a coroutine)ReadBlob, BlobBytes: one blob, for on_faultBuildPageMap: the page layout, for pagify SCHEME OF srcCLASS (AssimilatorFactory::Get)WHAT IT WRITES file::file::/data/run.bin BinaryFileAssimilatorthe only one with ReadBlob dst iowarp::run → tag rundescription, chunk_0, chunk_1, … (1 MiB, or chunk_size) string::string::notes StringDataAssimilatorpayload rides in src_data the tag named by dstone blob, named notes, holding the bytes verbatim hdf5::hdf5::/d/sim.h5 Hdf5FileAssimilatordatasets round-robin over nodes a tag per dataset: sim/fields/tempdescription (tensor type, dims) + 1.5 MiB chunk_N s3://s3://bucket/key S3FileAssimilatorkeep-alive connection pool an iowarp:: tag, or a cfs:: filedescription + 1 MiB chunk_N; cfs: clio-fs pages 0, 1, … gs:// · gcs://gs://bucket/key GcsFileAssimilatorup to 32 puts in flight the tag named by dstdescription + 1 MiB chunk_N http:// · https://https://host/f.nc HttpFileAssimilatorparallel ranged GETs (curl) a local file, not a tagdst must be file::<path> globus://or app.globus.org URL GlobusFileAssimilatordownloads with curl a local file or another endpointdst file:: or globus://, not a tag
The factory picks the class by the scheme of the source URL; the format field only refines it (HDF5's hdf5_vol stages the file in the VOL connector's cache layout instead). Accented outputs are CTE tags, written through the CAE's next_pool_id; the last two rows write files outside the CTE. Only the file assimilator can serve a single blob, so only it supports on_fault.

Ingest on fault

With on_fault set, a transfer copies nothing. The core records the context in a registry under a hashed id, and the destination carries that id as its fault parameters. When a read misses a blob, the CTE sends a get for that blob to the tag's fault pool, the CAE, carrying the id; the core looks up the context and asks the source's assimilator for exactly that blob, stores it, and lets the read continue. Source reads can take seconds on a parallel filesystem, so they run on a separate pool of threads (32 by default, CLIO_CAE_REF_IO_THREADS) while the fault task yields, keeping runtime workers free. Because the source is readable from every node, a fault tag's blobs are served and kept on whichever node reads them, rather than on a hashed owner. CLIO_CAE_FAULT_STATS=1 logs per-stage counters every five seconds.

Ingested blobs can always be fetched again, so they never take the last of a tier: a fault is served from the source without being stored when the node's free space would drop below a reserve (512 MiB, CLIO_CAE_FAULT_RESERVE_MB), and for the next 256 faults after a store fails. CLIO_CAE_FAULT_STORE=0 turns storing off entirely, making the tag a pure read-through.

The fault path

Registration: ParseOmni with on_fault: true (nothing is copied) id = "fault:" + a 64-bit FNV-1a hash of the context · the context is saved as blob <id> in tag __cae_on_fault tag run gets fault pool = the CAE and fault params = <id> on every CTE container · the CAE maps id → assimilator ANY NODE THAT READS THE TAG ReaderGetBlob(tag run, chunk_7, 64 KiB at offset 0) CTE core container on this node a fault tag's blobs are served where they are readchunk_7 is missing and the get lacks kNoFault, so:GetBlob → fault pool, fault_params = fault:<16 hex> CAE core: GetBlob with a fault: id 1. find the id in the map, else load it from the registry 2. stage a buffer of BlobBytes (1 MiB here) 3. ReadBlob on the I/O pool; the task yields meanwhile 4. zero-fill past the end of the source 5. PutBlob chunk_7 into tag run, with kNoFault 6. copy the asked range into the reader's buffer Tag runchunk_7 is now held: the next read is a plain hit Tag __cae_on_fault (registry) one 16 KiB blob per id: the encoded contextread on nodes that did not register the source Reference I/O pool 32 threads (CLIO_CAE_REF_IO_THREADS)task re-polls at 20 µs, 200 µs after 64 polls Source /data/run.binbytes [7 MiB, 8 MiB): one open stream per thread Store guard (step 5) skip if node free space < 512 MiB reserveskip for 256 faults after a failed putCLIO_CAE_FAULT_STORE=0: never store
A transfer from file::/data/run.bin to iowarp::run, registered with on_fault. The first read of chunk_7 misses in the CTE, which hands the whole get to the CAE; the CAE reads just that megabyte from the source off the runtime workers, stores it as an eager import would have, and answers the read. Its own registry read and put carry kNoFault so they cannot fault back into it.

Pagify and page maps

Paged consumers such as memory expansion and clio-ml address data only as page 0, 1, 2 and so on. A page map is an ordered list of extents saying which bytes of which blob occupy which range of page space. It travels with the data, as a blob named pagemap in the tag; the assimilator interface has a hook for producing one, though no shipped assimilator overrides it yet. Pagify uses it to build a page: a get through the CAE for a blob named page:<N> loads the tag's map once, fetches the slices straight into the caller's buffer, composes pages made of several blobs, and zero-fills uncovered ranges. The split keeps the arithmetic pure and testable and the I/O injectable.

The summarizer

The optional summarizer module is a CTE interposer: it forwards every operation, and after a matching put sends the content to the configured language model endpoint (it speaks the Ollama protocol by default) and stores the label as a sibling blob. The model call runs inline on the put's task, so every matching put waits for the model. Enable it only for data you want described.

Costs of this design

DecisionBuysCosts
One task per transfer listOne round trip; ordered, simple statusTransfers in a list do not run in parallel
Writes through the chainImported data is indexed, cached and made durableImports pay every composed module's cost
Ingest on faultInstant registration of huge sourcesFirst reads pay source latency
Separate reference I/O poolSlow sources never stall workersExtra threads per runtime