# yuiCompositionPlan

A yui composition plan record carrying schema, schemaVersion, surfaceId, targets, layers, and related state.

Last updated: 2026-09-09

Package: ui | Status: source-declared

Tags: cpu, method, source-example, thing, ui, yeho

Build YUI's reusable control, layout, interaction, text, accessibility, and retained-rendering models.

```yh
external thing yuiCompositionPlan
```

- text schema: Stores schema as text.
- int schemaVersion: Stores schema version as int.
- text surfaceId: Stores surface id as text.
- list of yuiRenderTarget targets: Stores targets as list of yuiRenderTarget.
- list of yuiRenderLayer layers: Stores layers as list of yuiRenderLayer.
- list of yuiRenderBatch batches: Stores batches as list of yuiRenderBatch.
- int commandCount: Stores command count as int.
- int offscreenTargetCount: Stores offscreen target count as int.
- text diagnostic: Stores diagnostic as text.
- yuiCompositionPlan(text surfaceId): Yui composition plan.
- Reset(text surfaceId) returns bool: Reset.
- TargetIndex(text id) returns int: Target index.
- LayerIndex(text id) returns int: Layer index.
- AddTarget(yuiRenderTarget target) returns bool: Add target.
- AddLayer(yuiRenderLayer layer) returns bool: Add layer.
- BuildBatches(yuiDisplayList original displayList) returns bool: Build batches.
- RenderReport() returns text: Render report.

## Use yuiCompositionPlan

A complete small caller. Values are illustrative; check the returned result and package requirements before connecting live resources.

Verification: type checked

```yh
using ui

// Build YUI's reusable control, layout, interaction, text, accessibility, and retained-rendering models.
yuiCompositionPlan sample = yuiCompositionPlan("surface Id")
Console.Log(Text.From(sample.schema))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuicompositionplan"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/ui--yuiCompositionPlan/usage --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiCompositionPlan.Reset

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Reset.
yuiCompositionPlan instance = yuiCompositionPlan("surface Id")
text argument_surfaceId = "argument surface Id"
bool result = instance.Reset(argument_surfaceId)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuicompositionplan"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/ui--yuiCompositionPlan/method-Reset-10 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiCompositionPlan.TargetIndex

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Target index.
yuiCompositionPlan instance = yuiCompositionPlan("surface Id")
text argument_id = "argument id"
int result = instance.TargetIndex(argument_id)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuicompositionplan"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/ui--yuiCompositionPlan/method-TargetIndex-11 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiCompositionPlan.LayerIndex

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Layer index.
yuiCompositionPlan instance = yuiCompositionPlan("surface Id")
text argument_id = "argument id"
int result = instance.LayerIndex(argument_id)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuicompositionplan"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/ui--yuiCompositionPlan/method-LayerIndex-12 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiCompositionPlan.AddTarget

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Add target.
yuiCompositionPlan instance = yuiCompositionPlan("surface Id")
yuiRenderTarget argument_target = yuiRenderTarget("id", "kind", 1, 1, "png", 1, "clear Role")
bool result = instance.AddTarget(argument_target)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuicompositionplan"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/ui--yuiCompositionPlan/method-AddTarget-13 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiCompositionPlan.AddLayer

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Add layer.
yuiCompositionPlan instance = yuiCompositionPlan("surface Id")
yuiRenderLayer argument_layer = yuiRenderLayer("id", "target Id", 1, 1, "blend", true)
bool result = instance.AddLayer(argument_layer)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuicompositionplan"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/ui--yuiCompositionPlan/method-AddLayer-14 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiCompositionPlan.BuildBatches

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Build batches.
yuiCompositionPlan instance = yuiCompositionPlan("surface Id")
yuiDisplayList argument_displayList = yuiDisplayList("surface Id")
bool result = instance.BuildBatches(argument_displayList)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuicompositionplan"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/ui--yuiCompositionPlan/method-BuildBatches-15 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiCompositionPlan.RenderReport

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Render report.
yuiCompositionPlan instance = yuiCompositionPlan("surface Id")
text result = instance.RenderReport()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuicompositionplan"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "graphics.image"
version = "0.1.0"
path = "../../../yeho/packages/graphics/image"

[[dependencies]]
package = "graphics.text"
version = "0.1.0"
path = "../../../yeho/packages/graphics/text"

[[dependencies]]
package = "host.ui_services"
version = "0.1.0"
path = "../../../yeho/packages/host/ui_services"

[[dependencies]]
package = "ui"
version = "0.2.0"
path = "../../../yeho/packages/ui"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/ui--yuiCompositionPlan/method-RenderReport-16 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Package presence and a declaration do not establish support on every host. Host services need their platform and lifecycle setup.

Source: yeho/packages/ui/render-20-composition.yh

AI training permission: https://demonhunterlabs.com/ai-use
