Skip to content

calls

calls #

Memoized calls and keyed state — the surface a recipe author touches.

A call is keyed, asked of the scratch (the memo), and either served or run and sealed:

  • [.identity][] — function_identity: an explicit version ("name/1") or a digest of the compiled body.
  • [.returns][] — return_spec: the return annotation is the schema a result is stored and loaded with.
  • .parametersparameter_specs: a parameter annotation is the schema its argument hashes as, which is what types a broadcast value.
  • [.run][] — run_call: serve the key's results, else run the body in a workspace and seal them.
  • [.pure][] — pure_function / PureFunction, the decorator over run_call; its key is where arguments become a call key.
  • [.impure][] — ImpureState: a Struct whose values persist per key and whose methods evolve them under a lock.
  • .resourcelock: exclusive use of a machine-wide resource such as the GPU for a block, its wait and its hold reported as a step.

This __init__ is documentation-only; internal modules import from the leaf modules directly; the root imports the public leaves (cg.pure_function, cg.ImpureState, cg.lock).