Core and the app · crate
kinogaki-cook
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
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
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-parallel | lib-parallel | normal | Scoped parallel work over disjoint output slices, sized by cost. |
kinogaki-studio-api | SDK | normal | Kinogaki Studio's headless plugin API. |
Third-party
None.
Used by
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-editor | Core and the app | normal | Kinogaki Studio's editor: the document and everything the window shows of it, as parts one frame borrows one by one. |
kinogaki-image-pipeline | Core and the app | normal | ImagePipeline: what renders become on screen and in files. |
kinogaki-network | Core and the app | normal | Studio's core networks (design: core-owned networks; "Cooking DAG for nodes is studio core"). |
kinogaki-project | Core and the app | normal | Studio's project files: a document as a Prism document. |
kinogaki-scene | Core and the app | normal | Studio's scene: the document cooked object by object. |
kinogaki-scripting | Core and the app | tests | Scripts over the standard values: lib-script's engine behind the SDK's ScriptEngine, and what a script sees of each value. |
kinogaki-studio | Core and the app | normal | Kinogaki Studio: the editor in a window, after the plugins load. |
kinogaki-testkit | Core and the app | normal | Kinogaki Studio's core testkit: toy packages written against the SDK alone, so core is tested with no real plugin. |
Modules
cacheThe per-node result cache: one entry a node, overwritten by its next cook (so drags never grow it), kept while the node exists and the memory budget keeps it (kinogaki_network::budget).335 linesdagEvaluation order: the nodes a cook visits, each after what it reads.85 linesheldHeld edits: a node holding authored edits over a captured input (an edit node of a polygon or B-rep context).127 lineslanesLanes: one latest-request worker per key (an object), so one object's slow cook never holds another's.251 lineslatestOne running task, one replaceable pending task, one result.755 linesnodesCooking a package's node types through the SDK contract (kinogaki_studio_api::NodeType): core lends the node its scratch slot and withholds what the node didn't declare it reads.504 linesobjectsCooking every object of a scene on one worker: latest-request scheduling, which objects are cooking, idle refinement of provisional results, and running objects' cooks (the open one first, the rest in parallel, duplicates once).376 linesqueueA queue: every request answered, one at a time, in the order asked, on oneLatestTaskService.190 lineswakeHow background work tells the UI it has something to show.72 linesworkersCore's workers as the SDK'sWorkers: every parallel step of the process (packages'geometry::parallelcalls and the standard values' own validation and indexing) runs on lib-parallel's shared helper budget, and each call site keeps its own measured cost.97 lines
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.
