Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Decisions

IDs O1 to O17. Each row states the recommendation, the alternative it was weighed against, and why the recommendation wins. Phases P1 to P5 have shipped (see Roadmap and testing gates), so every decision except O15 is built as recommended; O15 is built in part. The table keeps each decision as it was argued. Where the build departed from it, the section “As built” after the table says what was built and why, under the same ID.

IDTopicRecommendedAlternativeWhy
O1Scope of coreRecommended: pipekit-ops adds container plumbing, flow limits, execution, a store protocol and serialisable checks, and never inspects a carrier or adds a dependency.Alternative: a separate pipekit-flow package for the new operators.The operators are small, stdlib-only and used by every sister package; a new package adds an install and a version to pin for about 1,400 lines.
O2CallablesRecommended: new operators take predicates, keys and folds as Operator instances or plain keys; a bare callable raises TypeError pointing to Lambda.Alternative: accept callables, as toolz does, and set forbid_in_yaml on every new class.With operators, a pipeline built from new ops round-trips and hashes; with callables, half the new catalogue would be flagged and check_pickleable would grow noisier.
O3Output typeRecommended: iterable ops return lists (dicts for the group-by family); Map.iter and Prefetch are the only lazy outputs.Alternative: lazy iterators throughout, like toolz.A Graph node may feed several consumers, and a Cache must hash its input; both break on a one-shot iterator.
O4One engineRecommended: a single Map(op, executor=…) implements ordering, errors, backpressure, chunking and cancellation once.Alternative: keep four classes and add the missing features to each.Four copies of the same loop drift; today the classes already disagree on fail fast (0.20 s vs 1.01 s in the same test).
O5Where the executor livesRecommended: executor is a name in the config; a live executor is bound with executor_scope and is not hashed.Alternative: executor objects as config-carrying operators (ThreadExecutor(8), DaskExecutor(address)).The same pipeline must have the same pipeline_hash on a laptop and on a cluster; any concurrent.futures.Executor (dask, Ray, loky) then works with no code in pipekit.
O6The four presetsRecommended: keep ThreadMap, ProcessMap, AsyncMap, BatchedMap as subclasses of Map with unchanged constructors, configs and hashes; document them as presets.Alternative: deprecate them in favour of Map and remove them in 0.3.They appear in docs, tutorials and stored configs; their hashes are registry keys, and a deprecation would buy only a shorter list of names.
O7Default error policyRecommended: on_error="raise" fails fast and cancels pending work; "collect" raises a MapError (an ExceptionGroup) with partial results; "log_and_continue" keeps today’s None slots.Alternative: make "collect" the default, as batch tools such as Prefect do.Fail fast matches ThreadMap and AsyncMap today and Python’s own Executor.map; collect is one argument away.
O8BackpressureRecommended: Map pulls input lazily and holds at most max_in_flight items, default 2nw2 n_w for owned pools and 32 for borrowed ones; in Map.iter(ordered=True) and Prefetch, finished results not yet yielded count as held.Alternative: Executor.map(…, buffersize=…), added in Python 3.14.pipekit supports 3.12 and 3.13; and a hand-written loop over submit and wait is also what gives per-item error records and cancellation.
O9Process start methodRecommended: start_method="spawn" by default for owned process pools, with "fork" and "forkserver" as opt-outs.Alternative: the platform default (fork on Linux up to 3.13).fork deadlocks after JAX, BLAS or a thread pool has started threads, and makes pickling bugs platform-dependent.
O10Pickling checkRecommended: before the first remote submit, run check_pickleable(op) and then pickle.dumps(op) once; Cache and RateLimit define __getstate__.Alternative: trust the forbid_in_yaml flag, as today.The flag misses unflagged state: ProcessMap(Cache(op)) fails today with a lock pickling error that check_pickleable does not report.
O11ProgressRecommended: Map(…, progress=every) logs counts and throughput through logging; Log is the pass-through observer.Alternative: a Progress operator, or a tqdm extra.A pass-through step cannot know nn or what is in flight; Map can. Core takes no dependency, and a tqdm logging handler is a user choice.
O12Disk cacheRecommended: a three-method Store protocol, MemoryStore and DirectoryStore in core, Cache(inner, store=name, key=op), stores bound by store_scope; no Checkpoint class.Alternative: Cache(inner, path="/scratch") with the path in the config, plus a separate Checkpoint(store) operator.A path in the config makes the hash depend on the machine; Checkpoint would duplicate Cache with a store and clash with pipekit_train.Checkpoint.
O13Names from toolzRecommended: use toolz names where semantics match (PartitionAll, Concat, UpdateIn, Assoc, Dissoc, Get, GetIn, CountBy, Count).Alternative: the planned names (Chunk, Flatten, OnKey, GetItem).The background page calls pipekit “toolz with each function replaced by a typed class”; matching names make that literal and avoid reusing Count for two meanings.
O14Two BatchedMapsRecommended: the core class keeps BatchedMap; the planned pipekit-array class becomes BatchAlong(inner, batch_size, dim), as the sibling proposal says.Alternative: ADR A5 of pipekit-array: keep both names and let the import path disambiguate.Hydra YAML and from pipekit_ops import * next to pipekit-array imports both see the bare class name; the core name has shipped since v0.1, the array one has not.
O15Async compositionRecommended: sync wrappers (Retry, Try, Cache, Timeout, RateLimit, Until, the iterable ops) refuse a child with an async def _apply at construction; async-aware versions come later through an optional _apply_async.Alternative: make every wrapper detect and await coroutines.Today Retry(async_op) returns an un-awaited coroutine and retries nothing; an early TypeError fixes the silent bug now, and the full async path can be designed on its own.
O16JAX tracersRecommended: Map(executor="serial") accepts tracers; every pool, Cache, Timeout, RateLimit and Prefetch raise TypeError on a tracer via is_traced.Alternative: refuse tracers everywhere in the execution group.A serial loop under jit is just unrolled Python and is useful for small nn; sending a tracer to a thread or process is never correct.
O17Areas and the recorded module (#295)Recommended: seven areas, carriers, core, saving, operators, execution, observe and testing, where an area imports only from the ones before it and a name is imported from the package or its area. Each public class is recorded under pipekit_ops, and record_moves makes current_module read a state saved under a flat module (pipekit_ops.control, pipekit_ops._base.operator, …) as pipekit_ops.Alternative: keep each class recorded under its old file, so no pipeline_hash changes.The flat list of 27 files hid what goes together, execution and parallel imported each other, and pipekit-cycle, pipekit-jax, pipekit-array and pipekit-experiment imported private helpers from _base.operator. Recording under the files would name modules that no longer exist and change every hash again at the next move; recorded under the package, the hashes change once, here. Because current_module is the one place that plain loads, sandboxed loads and exception records read a module name, one table covers all three. The loggers are named after their areas: Map logs on pipekit_ops.execution (it was pipekit_ops.parallel) and Timeout on pipekit_ops.operators (it was pipekit_ops.flow).

As built

These notes come from the pull requests that implemented P1 to P5 (#209, #210, #211, #215, #216, #217). Decisions without a note were built as written.

Four departures from Operators fall under no decision:

Things this design does not decide