# yuiRetainedFragmentCache

A yui retained fragment cache record carrying surfaceId, width, height, fragments, semanticFragments, 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 yuiRetainedFragmentCache
```

- text surfaceId: Stores surface id as text.
- int width: Stores width as int.
- int height: Stores height as int.
- list of yuiRetainedOwnerFragment fragments: Stores fragments as list of yuiRetainedOwnerFragment.
- list of yuiRetainedSemanticFragment semanticFragments: Stores semantic fragments as list of yuiRetainedSemanticFragment.
- yuiRetainedKeyIndex ownerIndex: Stores owner index as yuiRetainedKeyIndex.
- yuiRetainedKeyIndex semanticOwnerIndex: Stores semantic owner index as yuiRetainedKeyIndex.
- yuiRetainedDependencyIndex dependencyIndex: Stores dependency index as yuiRetainedDependencyIndex.
- int spatialColumns: Stores spatial columns as int.
- int spatialRows: Stores spatial rows as int.
- int spatialCellWidth: Stores spatial cell width as int.
- int spatialCellHeight: Stores spatial cell height as int.
- list of yuiRetainedSpatialBucket spatialBuckets: Stores spatial buckets as list of yuiRetainedSpatialBucket.
- list of int spatialCellBuckets: Stores spatial cell buckets as list of int.
- list of int spatialBucketEpochs: Stores spatial bucket epochs as list of int.
- list of int spatialOwnerEpochs: Stores spatial owner epochs as list of int.
- int spatialReplayEpoch: Stores spatial replay epoch as int.
- int spatialMemberships: Stores spatial memberships as int.
- int spatialMembershipWrites: Stores spatial membership writes as int.
- list of yuiRetainedDamageRegion pendingDamage: Stores pending damage as list of yuiRetainedDamageRegion.
- int touchedOwners: Stores touched owners as int.
- int rebuiltOwners: Stores rebuilt owners as int.
- int compositedOwners: Stores composited owners as int.
- int touchedSemanticOwners: Stores touched semantic owners as int.
- int frameOwnerIndexProbes: Stores frame owner index probes as int.
- int frameSpatialCellProbes: Stores frame spatial cell probes as int.
- int frameSpatialBucketsExamined: Stores frame spatial buckets examined as int.
- int frameSpatialOwnersExamined: Stores frame spatial owners examined as int.
- int frameReplayOwners: Stores frame replay owners as int.
- list of yuiRetainedSemanticFragment pendingSemanticUpdates: Stores pending semantic updates as list of yuiRetainedSemanticFragment.
- text reason: Stores reason as text.
- text structuralDiagnostic: Stores structural diagnostic as text.
- text diagnostic: Stores diagnostic as text.
- yuiRetainedFragmentCache(text surfaceId, int width, int height): Yui retained fragment cache.
- IndexOf(text ownerId) returns int: Index of.
- SemanticIndexOf(text ownerId) returns int: Semantic index of.
- SpatialBucketForCell(int cellX, int cellY, bool create) returns int: Spatial bucket for cell.
- IndexFragmentSpatially(yuiRetainedOwnerFragment original fragment, int ownerIndex): Index fragment spatially.
- RemoveFragmentSpatially(yuiRetainedOwnerFragment original fragment, int ownerIndex): Remove fragment spatially.
- SpatialCoverageEqual(yuiRenderBounds leftBounds, yuiRenderBounds rightBounds) returns bool: Spatial coverage equal.
- RegisterInitial(yuiRetainedOwnerFragment fragment) returns bool: Register initial.
- RegisterInitialSemantic(yuiRetainedSemanticFragment fragment) returns bool: Register initial semantic.
- BeginFrame(text reason) returns bool: Begin frame.
- AddDamage(yuiRenderBounds requested): Add damage.
- ApplyCandidate(yuiRetainedOwnerFragment candidate) returns bool: Apply candidate.
- ApplySemanticCandidate(yuiRetainedSemanticFragment candidate) returns bool: Apply semantic candidate.
- ReplaySpatially(yuiRetainedFramePlan original plan): Replay spatially.
- IntersectsDamage(yuiRenderBounds bounds) returns bool: Intersects damage.
- Plan() returns yuiRetainedFramePlan: Plan.

## Use yuiRetainedFragmentCache

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.
yuiRetainedFragmentCache sample = yuiRetainedFragmentCache("surface Id", 1, 1)
Console.Log(Text.From(sample.surfaceId))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiretainedfragmentcache"
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--yuiRetainedFragmentCache/usage --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiRetainedFragmentCache.IndexOf

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Index of.
yuiRetainedFragmentCache instance = yuiRetainedFragmentCache("surface Id", 1, 1)
text argument_ownerId = "argument owner Id"
int result = instance.IndexOf(argument_ownerId)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiretainedfragmentcache"
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--yuiRetainedFragmentCache/method-IndexOf-34 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiRetainedFragmentCache.SemanticIndexOf

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Semantic index of.
yuiRetainedFragmentCache instance = yuiRetainedFragmentCache("surface Id", 1, 1)
text argument_ownerId = "argument owner Id"
int result = instance.SemanticIndexOf(argument_ownerId)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiretainedfragmentcache"
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--yuiRetainedFragmentCache/method-SemanticIndexOf-35 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiRetainedFragmentCache.SpatialBucketForCell

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Spatial bucket for cell.
yuiRetainedFragmentCache instance = yuiRetainedFragmentCache("surface Id", 1, 1)
int argument_cellX = 1
int argument_cellY = 1
bool argument_create = true
int result = instance.SpatialBucketForCell(argument_cellX, argument_cellY, argument_create)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiretainedfragmentcache"
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--yuiRetainedFragmentCache/method-SpatialBucketForCell-36 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiRetainedFragmentCache.IndexFragmentSpatially

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Index fragment spatially.
yuiRetainedFragmentCache instance = yuiRetainedFragmentCache("surface Id", 1, 1)
yuiRetainedOwnerFragment argument_fragment = yuiRetainedOwnerFragment("owner Id", 1, 1, yuiRenderBounds(1, 1, 1, 1), yuiRenderBounds(1, 1, 1, 1), yuiFragmentDependencySignature("layout Key", "paint Key", "resource Key", "motion Key", "composite Key", "example"), "example")
int argument_ownerIndex = 1
instance.IndexFragmentSpatially(argument_fragment, argument_ownerIndex)
Console.Log("IndexFragmentSpatially completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiretainedfragmentcache"
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--yuiRetainedFragmentCache/method-IndexFragmentSpatially-37 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiRetainedFragmentCache.RemoveFragmentSpatially

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Remove fragment spatially.
yuiRetainedFragmentCache instance = yuiRetainedFragmentCache("surface Id", 1, 1)
yuiRetainedOwnerFragment argument_fragment = yuiRetainedOwnerFragment("owner Id", 1, 1, yuiRenderBounds(1, 1, 1, 1), yuiRenderBounds(1, 1, 1, 1), yuiFragmentDependencySignature("layout Key", "paint Key", "resource Key", "motion Key", "composite Key", "example"), "example")
int argument_ownerIndex = 1
instance.RemoveFragmentSpatially(argument_fragment, argument_ownerIndex)
Console.Log("RemoveFragmentSpatially completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiretainedfragmentcache"
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--yuiRetainedFragmentCache/method-RemoveFragmentSpatially-38 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiRetainedFragmentCache.SpatialCoverageEqual

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Spatial coverage equal.
yuiRetainedFragmentCache instance = yuiRetainedFragmentCache("surface Id", 1, 1)
yuiRenderBounds argument_leftBounds = yuiRenderBounds(1, 1, 1, 1)
yuiRenderBounds argument_rightBounds = yuiRenderBounds(1, 1, 1, 1)
bool result = instance.SpatialCoverageEqual(argument_leftBounds, argument_rightBounds)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiretainedfragmentcache"
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--yuiRetainedFragmentCache/method-SpatialCoverageEqual-39 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiRetainedFragmentCache.RegisterInitial

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Register initial.
yuiRetainedFragmentCache instance = yuiRetainedFragmentCache("surface Id", 1, 1)
yuiRetainedOwnerFragment argument_fragment = yuiRetainedOwnerFragment("owner Id", 1, 1, yuiRenderBounds(1, 1, 1, 1), yuiRenderBounds(1, 1, 1, 1), yuiFragmentDependencySignature("layout Key", "paint Key", "resource Key", "motion Key", "composite Key", "example"), "example")
bool result = instance.RegisterInitial(argument_fragment)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiretainedfragmentcache"
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--yuiRetainedFragmentCache/method-RegisterInitial-40 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiRetainedFragmentCache.RegisterInitialSemantic

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Register initial semantic.
yuiRetainedFragmentCache instance = yuiRetainedFragmentCache("surface Id", 1, 1)
yuiRetainedSemanticFragment argument_fragment = yuiRetainedSemanticFragment("owner Id", 1, "semantic Identity", "example")
bool result = instance.RegisterInitialSemantic(argument_fragment)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiretainedfragmentcache"
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--yuiRetainedFragmentCache/method-RegisterInitialSemantic-41 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiRetainedFragmentCache.BeginFrame

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Begin frame.
yuiRetainedFragmentCache instance = yuiRetainedFragmentCache("surface Id", 1, 1)
text argument_reason = "argument reason"
bool result = instance.BeginFrame(argument_reason)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiretainedfragmentcache"
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--yuiRetainedFragmentCache/method-BeginFrame-42 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiRetainedFragmentCache.AddDamage

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Add damage.
yuiRetainedFragmentCache instance = yuiRetainedFragmentCache("surface Id", 1, 1)
yuiRenderBounds argument_requested = yuiRenderBounds(1, 1, 1, 1)
instance.AddDamage(argument_requested)
Console.Log("AddDamage completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiretainedfragmentcache"
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--yuiRetainedFragmentCache/method-AddDamage-43 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiRetainedFragmentCache.ApplyCandidate

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Apply candidate.
yuiRetainedFragmentCache instance = yuiRetainedFragmentCache("surface Id", 1, 1)
yuiRetainedOwnerFragment argument_candidate = yuiRetainedOwnerFragment("owner Id", 1, 1, yuiRenderBounds(1, 1, 1, 1), yuiRenderBounds(1, 1, 1, 1), yuiFragmentDependencySignature("layout Key", "paint Key", "resource Key", "motion Key", "composite Key", "example"), "example")
bool result = instance.ApplyCandidate(argument_candidate)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiretainedfragmentcache"
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--yuiRetainedFragmentCache/method-ApplyCandidate-44 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiRetainedFragmentCache.ApplySemanticCandidate

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Apply semantic candidate.
yuiRetainedFragmentCache instance = yuiRetainedFragmentCache("surface Id", 1, 1)
yuiRetainedSemanticFragment argument_candidate = yuiRetainedSemanticFragment("owner Id", 1, "semantic Identity", "example")
bool result = instance.ApplySemanticCandidate(argument_candidate)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiretainedfragmentcache"
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--yuiRetainedFragmentCache/method-ApplySemanticCandidate-45 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiRetainedFragmentCache.ReplaySpatially

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Replay spatially.
yuiRetainedFragmentCache instance = yuiRetainedFragmentCache("surface Id", 1, 1)
yuiRetainedFramePlan argument_plan = yuiRetainedFramePlan("surface Id", "reason")
instance.ReplaySpatially(argument_plan)
Console.Log("ReplaySpatially completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiretainedfragmentcache"
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--yuiRetainedFragmentCache/method-ReplaySpatially-46 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiRetainedFragmentCache.IntersectsDamage

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Intersects damage.
yuiRetainedFragmentCache instance = yuiRetainedFragmentCache("surface Id", 1, 1)
yuiRenderBounds argument_bounds = yuiRenderBounds(1, 1, 1, 1)
bool result = instance.IntersectsDamage(argument_bounds)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiretainedfragmentcache"
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--yuiRetainedFragmentCache/method-IntersectsDamage-47 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## yuiRetainedFragmentCache.Plan

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using ui

// Plan.
yuiRetainedFragmentCache instance = yuiRetainedFragmentCache("surface Id", 1, 1)
yuiRetainedFramePlan result = instance.Plan()
Console.Log("Inspect result in your debugger")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.ui__yuiretainedfragmentcache"
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--yuiRetainedFragmentCache/method-Plan-48 --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-50-retained-fragments.yh

AI training permission: https://demonhunterlabs.com/ai-use
