Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofmodule generator.module·originates fromworld 07158574-5…

cook

Cooking a Generator's graph: the outputs it resolves, the node and frame caches a cook reads and fills, the cook's own state and costs, the world values a graph follows, the pacing of a cook on a worker, the inputs a cook takes, the evaluation of one output, and the per-node plac…

by◐lumi·posted 1mo ago
What it does

generator.cook

Cooking a Generator's graph: the outputs it resolves, the node and frame caches a cook reads and fills, the cook's own state and costs, the world values a graph follows, the pacing of a cook on a worker, the inputs a cook takes, the evaluation of one output, and the per-node placement the playback report reads.

One part of the Generator component. ~.generator installs it on a Generator instance's context table, gen, which the component makes once per instance: the part keeps its shared state and the operations other parts call as fields of gen, and what only it reads as locals of its install function, so every instance holds its own.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

generator.cook Cooking a Generator's graph: the outputs it resolves, the node and frame caches a cook reads and fills, the cook's own state and costs, the world values a graph follows, the pacing of a cook on a worker, the inputs a cook takes, the evaluation of one output, and the per-node placement the `playback` report reads. Installed on one Generator instance's context, `gen`, by `~.generator`: its state and the operations other parts call are fields of `gen`, and what only this part reads stays local to it.

missingGraphMessage( ) → string

Why the bound graph does not play when it names an asset this world holds no .procGraph for, or nil when it names none or resolves to one. The component's lifecycle waits while the field names an asset not here yet, and `playback().error` says why from this.

resolveTargets( ) → void

Why the latest cook of the bound graph failed, while it does: the output standing is the last one that cooked.

pinStanding(frames: any, key: any) → void

argtypedescription
framesany
keyany

pinWorking(frames: any, key: any) → void

argtypedescription
framesany
keyany

unpinWorking( ) → void

unpinStanding( ) → void

keepShared(value: any) → void

Hand what this generator keeps in a cache it shares on to that cache's owner (`proc.adopt`), so it stands as long as the cache does rather than as long as this generator.

argtypedescription
valueany

holdPlayStore(key: any) → void

argtypedescription
keyany

cookInto(key: any) → void

argtypedescription
keyany

takeDrain( ) → number

The milliseconds the render side spent recording the device work the generator queued since this was last asked, added to its cost.

watchWorld(values: { any }, clock: any) → void

Find, in what a present stood, the runs that read the world.

argtypedescription
values{ any }
clockany

followWorld( ) → void

Run the live chain of what stands again when the scene one of its runs read has moved: an entity it fetched or the generator moved, or the ground was rebuilt.

workerCheckpoint( ) → void

Yield the frame when the worker has run its budget since it last did, counting the wait as waited rather than as the worker's CPU.

nodeWorkerCpuMs( ) → number

The CPU the node-form cook worker has run since it was last settled.

workerCpuMs( ) → number

The CPU the cook worker has run since it was last settled, with the CPU a present of a graph of the call form cooking now has run.

settleWorker(running: boolean) → void

Settle the worker's CPU so far into `cost`, and go on counting from now.

argtypedescription
runningboolean

realizeArrived( ) → void

Realize every read-back output whose runs have arrived. An output whose value a later cook replaced waits for nothing: the value it waited on is no longer the one standing, and what it read may already be let go of.

awaitsReadBack( ) → boolean

Realize a read-back output once what it reads has arrived. Whether an output stands as a value waiting for its read-back: a cook lets go of the values it supersedes, and with them the runs that realize reads.

realizeWhenArrived(value: any, name: string, output: string, domain: string) → void

argtypedescription
valueany
namestring
outputstring
domainstring

graphInputs(graph: any) → void

Evaluate a resolved (graph, outputName) with the graph's input defaults merged under the user's param overrides. `cancel` is the cook's cancellation token; the eval yields between node cooks when it outruns the frame budget (tunable via `cookBudgetMs`), so a heavy graph never freezes the engine. `cookRecord`, when given, is the owning cook record the eval reports progress into. `clock` is the graph time the cook runs at; a cook is a computation and states no origin for writes of its own.

argtypedescription
graphany

vectorOf(value: any) → vector

The vector a graph input's value is, when it is one: a vector a play is given, or a vector a graph declares as its default (`{ x, y, z }`), so a play given none and a play given one hand the clock the same kind of value.

argtypedescription
valueany

cookInputs(graph: any) → void

The inputs a cook of the bound graph is handed: while it moves on the device, each input the clock carries (a number, or a vector a play of the call form is given) as the curve that reads it from the clock.

argtypedescription
graphany

playInputs(graph: any, onClock: boolean) → void

The inputs a play of `graph` is handed, the clock carrying its number and vector inputs where `onClock` says so: on a timeline with no end each frame is simulated from the one before it, so those inputs are values the clock carries (`gen.clockInputs`, a new table each time one of them changes) and the play is handed the curve that reads each from the clock. Other values of them are then a present at a clock carrying them, and a simulation steps on from where it stands under them. A build-time input (one the graph declares `plain`) chooses the graph's structure, so the play is handed its value and builds the graph again for another one. Otherwise the play is handed every input's value.

argtypedescription
graphany
onClockboolean

splitInputs(graph: any) → void

The graph's number inputs by name, and the rest of its params.

argtypedescription
graphany

changedInputs(a: { [string]: number }, b: { [string]: number }) → void

The names of the number inputs whose values differ between two sets, or nil when none does.

argtypedescription
a{ [string]: number }
b{ [string]: number }

cacheReadsInputs(changed: { [string]: boolean }) → boolean

Whether a node the cache holds took one of `changed` as the value it holds, so other values of them are a cook of it rather than a present on the device alone. A node that reads an input live is keyed by it, and a present rewrites what it made.

argtypedescription
changed{ [string]: boolean }

evalTarget(graph: any, outputName: string, cancel: any?, cookRecord: any?, clock: any?) → any

argtypedescription
graphany
outputNamestring
cancelany?
cookRecordany?
clockany?

placementOf(raw: { [string]: any }) → void

Each cooked node's placement with what it adds up to, and the sums per graph used as a node — every prefix `a`, `a/b` of a written-out node id.

argtypedescription
raw{ [string]: any }

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.