Core and the app · crate

kinogaki-cook

Core

Studio's core cooking engine, the same for every network kind (the owner's rule: the cooking DAG for nodes is core's).

Repository
Core and the app (kinogaki/studio-core)
Folder
studio/core/cook
Source
11 files, 2,831 lines
Tests
1 file, 190 lines
depends onused by tests alonedependencies for tests alone are listed below, not drawn

What it is

Studio's core cooking engine, the same for every network kind (the owner's rule: the cooking DAG for nodes is core's).

Core owns how cooking is scheduled and kept; a network kind brings what its nodes compute and what makes a node's last cook reusable:

  • dag: evaluation order, each node after what it reads.
  • cache: the per-node result cache (one entry a node, recency on one clock for a memory budget to evict by) and each node's scratch slot.
  • latest: one worker answering the latest request, cancellation, continuing gestures, idle refinement and stuck work left behind.
  • lanes: one such worker per object, asked only when what the object reads changed.
  • queue: requests none of which supersedes another (files written), every one answered in the order asked, on one such worker.
  • objects: every object of a scene on one worker: request numbers, which objects are cooking, refinement rounds, the open object first and duplicates cooked once.
  • held: held edits (a package's edit node): a base captured by the first cook and a result filled by the first to finish, shared by every copy of the held state.
  • nodes: a package's node type cooked through the SDK contract (NodeType): reuse by what it declared it reads, its scratch slot.
  • workers: the process's parallel steps (packages' and the standard values') on lib-parallel's shared helpers, installed as Studio starts.
  • wake: how a worker tells the UI it has something to show (one wake per result; the UI never polls).

Cancellation is lib-parallel's CancelToken, the one kernels poll.

Depends on

CrateRepositoryAsWhat it is
kinogaki-parallellib-parallelnormalScoped parallel work over disjoint output slices, sized by cost.
kinogaki-studio-apiSDKnormalKinogaki Studio's headless plugin API.

Third-party

None.

Used by

CrateRepositoryAsWhat it is
kinogaki-editorCore and the appnormalKinogaki Studio's editor: the document and everything the window shows of it, as parts one frame borrows one by one.
kinogaki-image-pipelineCore and the appnormalImagePipeline: what renders become on screen and in files.
kinogaki-networkCore and the appnormalStudio's core networks (design: core-owned networks; "Cooking DAG for nodes is studio core").
kinogaki-projectCore and the appnormalStudio's project files: a document as a Prism document.
kinogaki-sceneCore and the appnormalStudio's scene: the document cooked object by object.
kinogaki-scriptingCore and the apptestsScripts over the standard values: lib-script's engine behind the SDK's ScriptEngine, and what a script sees of each value.
kinogaki-studioCore and the appnormalKinogaki Studio: the editor in a window, after the plugins load.
kinogaki-testkitCore and the appnormalKinogaki Studio's core testkit: toy packages written against the SDK alone, so core is tested with no real plugin.

Modules

Public types and traits

At the crate root

Traits ObjectsCook

Structs AbandonedAnswerHeldLanesLatestTaskServiceNodeCacheQueueSceneServiceTaskResultTicketWake

Enums Task

Type aliases Scratch

Re-exported from other crates

From kinogaki_parallel CancelTokenCancelled

By module: 26 public types and traits in 9 modules

cache FrameKeptNodeCacheScratch

dag OrderError

held Held

lanes JobLanesWork

latest AbandonedLatestTaskServiceTaskTaskResult

nodes AppliedCapturedHeldCookNodeCookNodeEntry

objects AnswerAnswerOfJobObjectsCookSceneService

queue QueueTicket

wake Wake

Besides these, 6 public functions at module level.