Commonplace kernel API
    Preparing search index...

    Dry runs

    Every public verb takes a third argument, { dryRun: true }, that runs the verb and keeps nothing. The answer is the commit's, because it is the commit: the same checks, the same solve and the same imprint, run on a copy of the edited mesh with a history of its own. Afterwards the model, its undo history and the entity ids are as they were.

    const preview = await offset(ctx, { mode: 'push', faceIds: [faceId], distance }, { dryRun: true });
    if (!preview.ok) showRefusal(preview.error?.message); // the commit's refusal, code and sentence
    else draw(preview.value?.frame); // the model the commit would leave
    // …on release, the same operands without the option commit it:
    await offset(ctx, { mode: 'push', faceIds: [faceId], distance });

    A tool that previews a drag or a typed value calls the verb with the option on each move, and without it on release. A kernel change to what a verb makes changes its preview the same way, since there is one path.

    A DryRunResult<T, C>: the commit's ok, error, notices, created and removed, with value holding

    Field Meaning
    value The verb's own value, as the commit returns it.
    frame A TessellationFrame of the model the commit would leave: every face and edge, as kernelTessellation(mesh).frame(…) draws them. Tessellated when first read.

    The options' tessellation field is how the frame is drawn (curvature samples, face debug colors, linear, visibility); the default carries neither curvature samples nor debug colors.

    The ids in created, value and frame are the ids the same commit draws next, provided no other edit draws an id between the dry run and the commit. A host can key its preview on them, and they still name the same things after the commit.

    A refusal is the commit's, in error, and there is no frame. Operands that do not parse are invalid-operands, as for the commit.

    A dry run costs what the commit costs, plus a copy of the mesh, plus the frame when it is read. Measured 2026-11-30 under Vitest in Node on a cloud container, ten runs averaged (kernelApi.dryRun.test.ts logs the box case):

    Model Offset push, commit Dry run, no frame read Dry run with its frame
    1 box (6 faces) 4 ms 7 ms 7 ms
    25 boxes (150 faces) 16 ms 28 ms 35 ms
    100 boxes (600 faces) 41 ms 51 ms 61 ms

    (Commit: the push and its undo, on the model itself.) The copy itself is about 0.01 ms a face; the rest of the overhead over the commit is not yet broken down. The frame is a whole frame, about 0.02 ms a face. On a large model, read frame only when drawing and throttle to the display rate; a preview that needs only the new faces can read created and skip it. The verb's own solve is the rest: a verb whose commit is slow (an exact Boolean, Offset through a curved solid, a Fold that searches for a lock) is as slow to dry-run. A host should throttle those to its idle time.

    • Another mesh. The copy is the edited mesh alone. A Boolean's other solid (other) is read as given, as the commit reads it, and neither changes it.
    • Ids drawn before the runner starts. A verb that plans before its runner (Transform solves its matrix first) may draw an id there; it is spent, never reused, and the commit draws the next one.
    • A host's read-only mesh. The copy has its own history, so a dry run on a read-only mesh answers what the commit would make, not read-only-context.

    canRun (Refusals and canRun) answers whether the operands are acceptable without the amount and without building anything; a dry run needs the amount and builds the result.