Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit192c685f66

README.md

procgen.validate

Checks a .procGraph graph and returns diagnostics — { level, code, node, input, expected, actual, message, suggestions } — with valid true when none is an error. Part of procgen.toolbox; surfaces as the global procgen.validate. Accepts a VFS path to a .procGraph folder, its name, or an in-memory graph object.

It checks, in order:

  • The build. A source that does not build (a compile error, an error raised while the graph is built, a comparison or logic over a socket the static check refuses) answers one BUILD_FAILS error carrying the build's own message, which names the file and the line. A reference that names no graph is an error of the call.
  • The connections, through the modules.proc validate(graph) model function: missing inputs, type mismatches, cycles, invalid composite bindings and unknown nodes.
  • A cook of its first frame, in a cache of its own, standing nothing in the scene: a refusal is a COOK_REFUSES error with the cook's message, and a node that runs on the CPU every frame a CPU_PER_FRAME warning. params checks the cook with other values for the graph's inputs.

The cook shares each frame's slice of cooking time with every cook running in the engine, so while Generators cook it runs across more frames. timeoutMs bounds it: past it the cook check stops at its next step and answers what it found, with a COOK_UNFINISHED warning saying how many of the plan's pulls it cooked, and finished = false. cook = false checks the build and the connections without a cook.

A COOK_REFUSES diagnostic's message leads with the line of the call that failed, the call and the reason:

/zero/source/city.procGraph/init.luau:12: g.geometry.merge failed: core.concat: the point column 'tag' is Float in part 1 and Vec3 in part 2; a column joins only at one width
  inside: geometry.merge > core.concat > cpu.call (merge_1/concat_2/luau_3/call_2)

The line is in the deepest source you can edit: the graph's own, or a node of your world the failure happened inside. node is the graph's call, at the line, call the call to open, and suggestions says where to open it.