# autotuningPolicy

A autotuning policy record carrying schema, seed, budgetUs, requiredSamples, fallbackLocalSizeX, and related state.

Last updated: 2026-09-09

Package: compute.accelerator | Status: source-declared

Tags: accelerator, compute, compute.accelerator, cpu, method, source-example, thing, yeho

Describe accelerator capabilities and explicit placement boundaries.

```yh
external thing autotuningPolicy
```

- text schema: Stores schema as text.
- int seed: Stores seed as int.
- int budgetUs: Stores budget us as int.
- int requiredSamples: Stores required samples as int.
- int fallbackLocalSizeX: Stores fallback local size x as int.
- text cacheKeyFields: Stores cache key fields as text.
- text invalidation: Stores invalidation as text.
- autotuningPolicy(text schema, int seed, int budgetUs, int requiredSamples, int fallbackLocalSizeX, text cacheKeyFields, text invalidation): Autotuning policy.
- IsValid() returns bool: Is valid.

## Use autotuningPolicy

A complete small caller. Values are illustrative; check the returned result and package requirements before connecting live resources.

Verification: type checked

```yh
using compute.accelerator

// Describe accelerator capabilities and explicit placement boundaries.
autotuningPolicy sample = autotuningPolicy("schema", 1, 1, 1, 1, "cache Key Fields", "invalidation")
Console.Log(Text.From(sample.schema))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_accelerator__autotuningpolicy"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "compute.accelerator"
version = "0.1.0"
path = "../../../yeho/packages/compute/accelerator"

```

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/compute.accelerator--autotuningPolicy/usage --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## autotuningPolicy.IsValid

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.accelerator

// Is valid.
autotuningPolicy instance = autotuningPolicy("schema", 1, 1, 1, 1, "cache Key Fields", "invalidation")
bool result = instance.IsValid()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_accelerator__autotuningpolicy"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "compute.accelerator"
version = "0.1.0"
path = "../../../yeho/packages/compute/accelerator"

```

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/compute.accelerator--autotuningPolicy/method-IsValid-8 --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/compute/accelerator/accelerator.yh

AI training permission: https://demonhunterlabs.com/ai-use
