KPI baselines and budget packages#

This page uses the terms of the KPI glossary. A budget is the warning limit and the failure limit of one workload and required metric for one CPU model. A package is one sealed .kpi-budget.json file with the budgets of one backend, platform and CPU model. A baseline is the output of a complete collection: its generated series and packages. Check mode reads the packages of its backend and platform from a catalog folder and compares each measurement with their budgets.

There are two ways to create a package:

  • --mode collect-baseline is the normal way. It measures complete Release campaigns, selects the closest stable set and generates the packages. They carry an automated-generation attestation: a generation record that names the selected campaigns and their content hashes instead of a human approval.

  • budget create is the manual way. You collect calibration evidence yourself and approve the package locally. See offline budget recording.

The budget formulas and a worked example are in KPI sampling. Run every command from ovclash/. In the Python commands, $PY (%PY% in cmd.exe) is the KPI input Python defined in the quick start.

A baseline goes through five steps:

1. Collect   run_kpi --mode collect-baseline                writes <output>/public/baseline/
2. Review    $PY -m benchmarks.kpi baseline-series review     replays it and prints review.txt
3. Try       run_kpi --budgets <series>/baselines/{backend}/{platform}   (optional check run)
4. Install   copy baselines/<backend>/<platform>/*.kpi-budget.json into
             benchmarks/kpi/baselines/<backend>/<platform>/
5. Commit    check mode now finds coverage for that CPU model

Measurement and baseline rules#

A package enforces its budgets only when all of these hold:

Requirement

Rule

Complete Release campaigns

Every campaign measured all nine workloads with the release profile, and every workload ended stable: one warm-up, then at least three measured runs whose required metrics pass the noise gate. Calibration export already requires this. Adaptive Release sampling gives the run and retry limits

Clean producer

A validated clean Release build with a passing validation receipt of the same build; see calibration evidence

Independent campaigns

No two campaigns share a campaign ID, a child execution, a child token or a raw observation receipt

One identity per CPU model

All pooled campaigns share the build, runtime, source and measurement identity, the workload contracts, the required metrics, the acquisition policy, the CPU accounting counters and the CPU model. A generated package also requires the same cohort apart from the reported processor string and the CPU scope, so its campaigns may run on different pools of the model. The inputs of a budget create package share one identical cohort, CPU scope included; see evidence requirements

Pooled stability

For every workload and metric, all pooled values together pass the noise gate: 3 * MAD, three times the median absolute deviation, is within the noise limit of their median

Activation

A generated package carries a validated generation attestation. A budget create package carries a local approval. A package with neither is a proposal and enforces nothing

These never create or replace a package:

  • the public record measurements.json, which is a numeric diagnostic;

  • a smoke, incomplete, failed or interrupted campaign, which exports no calibration;

  • a green or nonblocking CI job, a successful work audit or one qualified row;

  • an ovstage measurement for the OpenUSD backend, or the reverse.

Runner and storage labels#

Every cohort records a runner class and a storage class. They describe the machine and its disk, and a package covers only runs with the same pair. Both come from closed lists, the calibration vocabulary in benchmarks/kpi/calibration.py (RUNNER_CLASSES and STORAGE_CLASSES):

Label

Values

Default without the option or variable

Runner class (--runner-class, OVCLASH_KPI_RUNNER_CLASS)

local-review, ci-linux-x86_64, ci-linux-aarch64, ci-windows-x86_64, and three classes of the project’s own CI machines that RUNNER_CLASSES lists

ci-<os>-<architecture> in a CI job, for example ci-linux-x86_64; local-review otherwise

Storage class (--storage-class, OVCLASH_KPI_STORAGE_CLASS)

local-ssd, ci-local-disk, unclassified-local-disk, disk

ci-local-disk in a CI job; unclassified-local-disk otherwise

"$PY" -I -B scripts/kpi_ci.py --help prints both lists. Run KPI in another CI system explains when a run counts as a CI job. The labels have these effects:

  • Matching. Budgets apply only to observations with the same runner class and storage class. A package collected locally (local-review, unclassified-local-disk) covers only local checks with those labels, never a CI job that records other labels. After a CI system changes the labels it sets, collect new baselines under the new labels.

  • Calibration export. Export accepts only the listed values. Packages are built from calibration evidence, so no package carries another label.

  • Check mode. A check accepts any label. Under a label outside the lists it finds no compatible budgets and ends with exit 3 before fixture generation.

  • Collection. A collection rejects a label outside the lists before preparation, with exit 4.

A package with local labels and a package with CI labels for the same CPU model cannot share a catalog folder; see install or replace CPU-model budgets.

Collect a baseline#

Before you begin:

  • Commit your changes. Release preparation rejects a build of uncommitted source.

  • Use a machine whose process affinity holds at least four usable physical cores of one CPU model. Otherwise the collection stops with exit 3; see collection status and exit codes.

  • Choose an --output that does not exist yet.

--mode collect-baseline ignores all existing budgets. It runs complete Release campaigns until it can select --baseline-campaigns N campaigns per CPU model whose pooled values pass the noise gate. Without --inputs or --dist, the launcher first prepares the default Release inputs when they are missing, invalid or not built from the checked-out source; see automatic preparation.

Windows:

run_kpi.bat --mode collect-baseline --baseline-campaigns 3 --backend ovstage --collection-seconds 13800 --output _build/kpi-baseline-01

Linux x86-64 and AArch64:

bash ./run_kpi.sh --mode collect-baseline --baseline-campaigns 3 --backend ovstage --collection-seconds 13800 --output _build/kpi-baseline-01

Use --backend openusd for the OpenUSD reference backend. Choose a new --output for every run: the public output must not exist, and outputs lists the staging and lock files that an abrupt exit can leave beside it.

The collection succeeded when it exits 0, the last line of public/progress.log starts with Exit 0 | collection_complete and public/baseline/ exists. Any other result names its cause in that line and in public/status.json; see collection status and exit codes and, for a failed preparation, Troubleshooting.

A collection treats these options differently from a check. Command-line options lists every option and its default.

Option

In a collection

--baseline-campaigns N

Campaigns selected and pooled per CPU model: an integer of at least 3. Any other value does not parse

--collection-seconds S

Wall-clock allowance for the whole collection, including preparation, cleanup and publication. It must exceed 330 seconds; see deadline

--required-models PATH

CPU models that the collection must cover; see required CPU models

--public-output PATH

Receives progress.log, status.json, campaigns/ and baseline/

--admission-policy POLICY

Only shared-runner-recorded-contention-v2 is accepted

--cpu-domain DOMAIN

Only four-physical-cores-retry-v2 is accepted

--runner-class, --storage-class

Must be in the calibration vocabulary; see runner and storage labels

--profile

Always release, whatever the option says

--budgets, --calibration-output, --summary-mode

Ignored

Each run measures only the CPU models of the machine it runs on; another CPU model needs another run on another machine.

How a collection runs#

The driver scripts/kpi_ci.py hands a collection to the collector scripts/kpi_collect.py, which runs these steps in order. A Failed phase: line names the step by the code name in parentheses.

  1. Configuration (configuration). It checks the campaign count, the allowance, the CI job deadline, the admission policy and the CPU domain, the labels and the required-model list. It rejects outputs inside --inputs or --dist, and it creates the public output, which must not exist. A failure here writes no file and exits 4; see rejected input.

  2. Release preparation (Release preparation). It binds the validated Release SDK archive, wheel, runtime and validation receipt once, and rejects a build of uncommitted source. It observes the CPU pools of this machine and logs every CPU model it can measure.

  3. Fixture generation (immutable fixture generation). It generates the three bundles once and checks their pins; see representative fixture stages.

  4. Campaign collection (campaign collection). It runs campaigns one after another. Each campaign calls the controller command run --mode collect-baseline --profile release in a fresh private execution tree, with a campaign deadline from the time left (see deadline). After a successful campaign it exports the campaign’s calibration.json, replays it independently and selects a qualifying set for every CPU model that has one. Failures inside a campaign name campaign execution, calibration export, independent calibration validation or private execution cleanup. A selection failure names campaign selection.

  5. Baseline generation and publication (baseline generation and publication). When every model qualifies, it replays every eligible campaign again, writes the series in a hidden staging directory and renames it to baseline/ in one step.

  6. Collection result. It writes the final status.json and the last progress.log line.

Inside a campaign, a workload whose series fails for a verified noise or CPU cause restarts alone, at most ten times. Check mode never restarts a workload. See workload restarts.

Campaign selection#

After each eligible campaign, the collector groups the eligible campaigns by CPU model. For every set of exactly N campaigns of one model, it computes a score per workload and metric:

score = (largest campaign median - smallest campaign median) / median of the N medians / noise limit

The noise limit is the metric’s limit in the noise gate: 0.25 for load_seconds and 0.15 for every other required metric. A score of 1.0 means that the spread of the campaign medians equals the noise limit.

  1. Sets rank by their largest score, then by the sum of their scores, then by their sorted campaign IDs.

  2. The collector takes the best-ranked set whose pooled values pass the noise gate. The gate pools every value of the N campaigns and requires 3 * MAD within the noise limit of the median.

  3. The score only ranks the sets. A set with a score above 1.0 can still pass the gate.

Every metric uses the same selected campaigns, and each campaign contributes all of its values. Metrics are never selected separately, and no favorable subset of values is chosen. The selection policy is closest-three-campaigns-v1 for N = 3 and closest-n-campaigns-v1 for a larger N.

Example. Three campaigns A, B and C have the medians 100, 101 and 102 seconds for every time metric, and three values per campaign:

load_seconds        (102 - 100) / 101 / 0.25 = 0.079
operation_seconds   (102 - 100) / 101 / 0.15 = 0.132
set score           largest 0.132; sum 4.277 over the 47 metrics (memory metrics do not vary here)
pooled gate         MAD 1.0, 3 * MAD = 3.0 <= 15% of 101: stable

The pooled values give the budget of the worked example: N = 3.0, a warning limit of 109.05 and a failure limit of 114.1.

Replace C with an outlier campaign O whose medians are 200 seconds. The set A, B, O scores 6.6, but its pooled MAD is still 1.0, so it passes the gate. Its largest deviation is 99, so N = 99, the warning limit is 205.05 and the failure limit is 210.1. When A, B, C and O are all candidates, the collector selects A, B and C, because that set ranks first. The collector stops as soon as one set qualifies, so a run whose first three eligible campaigns are A, O and B publishes the wide budgets. Check the scores in review and install a generated series before you install.

These numbers come from the synthetic test campaigns of tests/python_tests/kpi_baseline_fixture.py.

When collection continues and stops#

The collector checks every campaign result and then continues or stops:

Campaign result

Disposition

Collection

Exit 0 with replayed calibration

eligible

Runs the selection. Stops with 0 when every observed and required model has a set, or with 3 when only required models that this machine does not offer remain. Otherwise starts another campaign

Exit 3 from a verified cause that no workload restart could absorb: CPU contention (pre-run busy rejections or the spent shared CPU-wait allowance), a Windows counter or clock-alignment rejection, or noise exhaustion

retryable

Starts another campaign. Earlier eligible campaigns stay candidates

Exit 3 at the campaign deadline, with every other final-series attempt successful or a verified pre-run CPU rejection

deadline

Stops with 3 (collection_deadline)

Exit 3 from a verified shortage of physical cores (the controller’s exit 76)

fatal

Stops with 3 (collection_insufficient_physical_cores)

Exit 130

fatal

Stops with 130 (collection_canceled)

Any other result: a product failure (1), other insufficient evidence (3), or a harness, export or replay failure (4)

fatal

Stops with that exit (collection_fatal_campaign)

A campaign is retryable only when its workflow receipt passed, its inputs stayed unchanged and its source is verified and clean. Every other executed attempt of its final series must be a qualified success or a verified pre-run CPU rejection. A spent shared CPU-wait allowance, which the whole campaign shares, stops the campaign, and the collector retries it as cpu_contention. A workload that used all its restarts without a stable result also ends the campaign with a retryable cause.

The collector logs each retry in progress.log:

progress.log line

Cause

Retry: cpu contention.

Verified CPU-busy rejections, or the spent shared CPU-wait allowance

Retry: cpu counter rejection.

Verified Windows counter rejections

Retry: verified pre-run CPU clock alignment rejection; discard this incomplete campaign and retain earlier candidates.

A verified Windows clock-alignment rejection

Retry: noise exhaustion.

A workload used ten runs without a stable result

Restart limit: 1 workload used all 10 restarts without a stable result in this campaign.

Follows a retry line when a workload’s final series is its last allowed series and is not stable

Retry: every observed and required CPU model needs 3 full campaigns that pass the pooled noise gates together.

An eligible campaign left a model without a qualifying set

The Restart limit: line names no cause. The saved records do not show whether the last series ended at a refused verified cause or at a stop that is never restarted.

It logs a stop with one of these lines:

progress.log line

Stop

Collection stopped: campaign verdict <code> is not retryable.

collection_fatal_campaign, or collection_canceled for 130

Collection stopped: the assigned runner exposes fewer than four physical cores; campaign verdict 3 is not retryable.

A campaign found the core shortage

Collection stopped: the assigned runner exposes fewer than four physical cores; no campaign can qualify.

Release preparation found the core shortage

Collection stopped: no CPU model with four usable physical cores of one class is measurable; no campaign can qualify.

collection_cpu_model_unavailable

Required CPU model is unavailable on the assigned runner; this job cannot migrate to another machine.

collection_required_model_unavailable

Deadline lists the deadline lines.

CPU models. The CPU model of every campaign that continues the collection becomes required, even if a later campaign runs on another pool. Once one model has a qualifying set, the collector binds each later campaign to the pending model with the fewest candidates that this machine offers. The log then reads Campaign 5 | bound to pending CPU model 33405c7bf70e. When every remaining model is a required model that this machine does not offer, collection stops with 3 (collection_required_model_unavailable).

Deadline#

The deadline is --collection-seconds after the collector starts. When the CI context supplies the job timeout and start time, the deadline is also at least 300 seconds before the job deadline, the start time plus the timeout. Those 300 seconds are left for uploading the output. The context reads them from the CI provider, or from the provider-neutral OVCLASH_CI_JOB_TIMEOUT (seconds) and OVCLASH_CI_JOB_STARTED_AT (an ISO 8601 time with a time zone); see Run KPI in another CI system. When only one of the two values is set, or either cannot be parsed, the collection is rejected before preparation.

For a job with a four-hour timeout (14,400 seconds) that started at 08:00:00 UTC and a 13,800-second allowance:

Collection starts

Job-based stop

Allowance stop

Deadline

08:04:00 (240 s of setup)

11:55:00

11:54:00

11:54:00, the full 13,800 seconds

08:10:00 (600 s of setup)

11:55:00

12:00:00

11:55:00, only 13,500 seconds

So with these values, up to 300 seconds of job setup still leave the full allowance. Inside that window, the collector keeps these reserves:

Check

Rule

Before fixture generation

More than 330 seconds must remain: 300 for cleanup and 30 for publication

New campaign

Starts only while more than 330 seconds remain

Campaign deadline

--job-seconds is the time left minus the 30-second publication reserve. The controller keeps its own 300-second cleanup reserve inside it; see deadlines

Evaluation

An eligible campaign is evaluated only while more than 2 * (sum of measured replay times) + 30 seconds remain. Otherwise it is retained with the ledger reason selection_deadline, and collection stops with 3

Generation

Generation replays every eligible campaign again and must finish 30 seconds before the deadline. The final rename must happen before the deadline

The deadline lines:

progress.log line

When

Campaign <N> ended too late to replay every eligible campaign before publication; evidence retained, not evaluated.

An eligible campaign reached the evaluation reserve (selection_deadline)

Deadline reached before every requested campaign group qualified; partial evidence retained, no baseline generated.

Campaign collection ended at the deadline: no time for another campaign, a campaign deadline, or the evaluation reserve

Collection deadline reached; no baseline generated.

The deadline came before fixture generation, during generation or before the final rename

The completed campaigns, their records and their calibration exports stay in the public output. No baseline/ is written.

Required CPU models#

Pass --required-models PATH to require CPU models that the collection must cover. Without the option, the collector reads PARENT_OVCLASH_KPI_BASELINE_REQUIRED_MODELS, then OVCLASH_KPI_BASELINE_REQUIRED_MODELS; environment variables gives the precedence rules. An empty value requires only the observed models. A PARENT_ value of only spaces still takes precedence and requires no model.

The value is JSON in one of two forms. Both are optional: an absent or empty value requires only the observed models.

Form

Type

Required

Default or values

Description

Model list

array of model_key objects

No

At most 4,096 distinct keys; default: an empty list

The CPU-model keys to cover, for every lane

Lane map

object of model lists

No

Keys: the lanes linux-ovstage, aarch64-ovstage, windows-ovstage, linux-openusd, aarch64-openusd and windows-openusd; each value a model list

Only the entry of the collection’s own lane applies. A lane without an entry requires no model

{
  "linux-ovstage": [
    {
      "architecture": "x86_64",
      "core_class": {"source": "linux-topology-core-type", "value": 0},
      "domain": "four-physical-cores-retry-v2",
      "model": {"family": "6", "model": "42", "name": "Example Core 42", "stepping": "1", "vendor": "GenuineIntel"},
      "platform": "linux",
      "schema_version": 1,
      "smt_width": 2
    }
  ]
}

Every field of a model_key is required, and no other field is allowed:

Field

Type

Required

Default or values

Description

schema_version

integer

Yes

1

Key schema version

domain

string

Yes

four-physical-cores-retry-v2

The CPU domain

platform

string

Yes

linux or windows

The OS of the CPU identity. Linux AArch64 keys also use linux

architecture

string

Yes

x86_64 or aarch64

The processor architecture

model

object of strings

Yes

Linux x86-64: vendor, name, family, model, stepping. Linux AArch64: implementer, architecture, variant, part, revision. Windows: vendor, identifier, name

The processor identity. Every listed field is present; the Linux numeric fields are canonical decimal strings

core_class

object or null

Yes

{"source": "linux-topology-core-type", "value": N} on Linux, {"source": "windows-efficiency-class", "value": N} on Windows, with N from 0 to 255; null only on Linux without an observed core class

The core class of the four-core pool

smt_width

integer

Yes

1 to 4,096

The simultaneous multithreading (SMT) width: logical CPUs per physical core

Copy the keys from models[].model_key in an earlier baseline/series.json, or from required_models in an earlier status.json. The abbreviated CPU model lines of progress.log are not keys. An unknown lane, a malformed or duplicate key, or invalid JSON is rejected with exit 4. A required model that this machine does not offer is logged at the start as Required CPU model unavailable on assigned runner: <model ID>, where <model ID> is the SHA-256 of its key.

Collection progress log#

The collector writes progress.log in the public output and echoes it to the console. The first lines are the collection mode lines; mode and lookup lines explains them. This is the log of a complete Linux collection. IDs and the CPU model are illustrative, IDs are shortened, and <seconds> stands for each measured time:

KPI MODE: MEASUREMENT / baseline collection (--mode collect-baseline)
Platform: linux | Backend: ovstage | Profile: release
Release sampling; existing baseline limits are ignored.
Select 3 successful full campaigns per CPU model that pass the pooled noise gates together.
Retryable failures do not count; retain additional candidates until a qualifying group exists or the allowance ends.
Collection allowance: 13800 seconds including preparation, cleanup and publication.
=== Prepare Release build and immutable fixtures once ===
=== Observed hardware and cohort ===
Platform linux | Backend ovstage | Admission shared-runner-recorded-contention-v2
CPU model 33405c7bf70e | {"family": "6", "model": "42", "name": "Example Core 42", "stepping": "1", "vendor": "GenuineIntel"} | core class {"source": "linux-topology-core-type", "value": 0} | SMT width 2
=== Generate immutable fixtures ===
KPI generation: body-representative starting
KPI generation: body-representative ready (<seconds>s)
KPI generation: cockpit-representative starting
KPI generation: cockpit-representative ready (<seconds>s)
KPI generation: body-representative-depth starting
KPI generation: body-representative-depth ready (<seconds>s)
=== Campaign 1 | requested 3 per CPU model | eligible 0 | completed attempts 0 | elapsed 0.0s ===
...                                       (the campaign's workload tables)
=== Campaign 1 | export and replay complete evidence ===
Calibration export complete | elapsed <seconds>s
Independent evidence replay complete | elapsed <seconds>s
Campaign 1 | verify private execution cleanup
Qualification: eligible complete Release campaign 9f6caa19... | eligible 1 | attempts 1 | requested 3 per CPU model
CPU model 33405c7bf70e | requested 3 | eligible 1 | additional campaigns needed 2
Retry: every observed and required CPU model needs 3 full campaigns that pass the pooled noise gates together.
=== Campaign 2 | requested 3 per CPU model | eligible 1 | completed attempts 1 | elapsed <seconds>s ===
...
Campaign 2 | verify private execution cleanup
Retry: cpu contention.
=== Campaign 3 | requested 3 per CPU model | eligible 1 | completed attempts 2 | elapsed <seconds>s ===
...
=== Campaign 4 | requested 3 per CPU model | eligible 2 | completed attempts 3 | elapsed <seconds>s ===
...
Qualification: eligible complete Release campaign 23bc8f1a... | eligible 3 | attempts 4 | requested 3 per CPU model
Selected 3 full campaigns: 23bc8f1a..., 9f6caa19..., f0d73b76...
=== Generate replacement baseline from selected full campaigns ===
Baseline generation replayed 3 campaigns | elapsed <seconds>s
Generated repository-shaped baseline files: baseline/baselines/
=== Collection result ===
Exit 0 | collection_complete | requested 3 per CPU model | eligible 3 | attempts 4
  • elapsed in a campaign heading counts from the start of the first campaign, after preparation and fixture generation.

  • Workload tables describes the tables of each campaign.

  • A model with N candidates that fail the pooled gate adds one line per unstable metric, for example Limiting metric: benchmark-body-representative-dynamic / pipeline_step_seconds | noise <noise>% | limit 15.00%.

  • When collection continues and stops lists the retry and stop lines.

  • The console, not progress.log, also prints the absolute path of each generated package as Baseline written: <path>. After a complete collection it ends with the sentence KPI baseline collection is complete and every selected campaign passed its noise limits. Everything is awesome! and a green heart, or <3 on a console that cannot show the heart.

Collection status and exit codes#

The final progress.log line and status.json record the collector’s own result. Read them whenever the process exit code is not available as is, for example on a CI system that reports every nonzero Windows exit as 1. The final line has this form:

Exit <code> | <reason> | requested <N> per CPU model | eligible <E> | attempts <A>

Exit

reason

Meaning

0

collection_complete

Every observed and required CPU model has a qualifying set, and baseline/ was published

3

collection_deadline

The allowance or the CI job deadline ended collection before every model qualified

3

collection_required_model_unavailable

Every observed model qualified, but each remaining required model is absent on this machine. The collection cannot move to another machine

3

collection_insufficient_physical_cores

Fewer than four usable physical cores are in the process affinity, found before fixture generation or inside a campaign

3

collection_cpu_model_unavailable

No observed pool offers four usable physical cores of one CPU model, core class, package, non-uniform memory access (NUMA) node and SMT width, for example under a CPU quota below four

1, 3 or 4

collection_fatal_campaign

The last campaign verdict cannot be retried

4

collection_cleanup_unverified

A private execution tree or a staging directory was not verifiably removed. This reason replaces the one that stopped collection. When a private execution tree is kept, progress.log reads Private execution cleanup unverified; private trees retained.

4

collection_harness_failure

A preparation, generation or publication failure, or a failed final status write

4

collection_campaign_identity_changed

The retained campaigns cannot be selected together, for example two campaigns of one CPU model with different environments

4

collection_calibration_invalid

A successful campaign has no replayed calibration

130

collection_canceled

The collection was interrupted

The collector never returns 76; exit 76 describes the check-mode code. In CI, a collection also needs the actual job ID; without it, the collection stops after fixture generation with collection_harness_failure.

Failed phases. A failed phase logs Failed phase: <phase> | <kind> | <exception class>. The kind is one of cancellation, process cleanup unverified, required input missing, input or output access denied, input identity or evidence validation failed or unexpected harness exception. On Windows, a private path past MAX_PATH logs the kind Windows private KPI paths exceed MAX_PATH; set TMPDIR, TEMP and TMP to a shorter folder instead; see private execution tree. When the exception message is fixed text from the KPI or shared tooling sources, or from scripts/kpi_ci.py or scripts/kpi_collect.py, a second line names the check. A message that carries a path, a value or other runtime text is never logged. For example:

Failed phase: independent calibration validation | input identity or evidence validation failed | ValueError
Failure detail: calibration requires three observations of every frozen workload

status.json. The collector writes status.json when preparation starts, after each campaign that continues the collection, and at the end. The file is one line of compact JSON with sorted keys. Pretty-printed, with IDs shortened and <seconds> in place of each measured time, a complete collection reads:

{
  "attempt_count": 4,
  "backend": "ovstage",
  "baseline_campaigns": 3,
  "campaigns": [
    {"campaign_id": "9f6caa19...", "disposition": "eligible", "elapsed_seconds": <seconds>,
     "exit_code": 0, "ordinal": 1, "session_id": "9d0d2e33..."},
    {"disposition": "retryable", "elapsed_seconds": <seconds>, "exit_code": 3, "ordinal": 2,
     "reason": "cpu_contention", "session_id": "41199dcd..."},
    {"campaign_id": "f0d73b76...", "disposition": "eligible", "elapsed_seconds": <seconds>,
     "exit_code": 0, "ordinal": 3, "session_id": "7cf32b3d..."},
    {"campaign_id": "23bc8f1a...", "disposition": "eligible", "elapsed_seconds": <seconds>,
     "exit_code": 0, "ordinal": 4, "session_id": "0279a115..."}
  ],
  "eligible_campaign_count": 3,
  "exit_code": 0,
  "format": "ovclash-kpi-native-collection-status-v1",
  "mode": "collect-baseline",
  "pending": [],
  "platform": "linux",
  "reason": "collection_complete",
  "required_models": [{"architecture": "x86_64", "...": "..."}],
  "schema_version": 1,
  "selections": [
    {"campaign_ids": ["23bc8f1a...", "9f6caa19...", "f0d73b76..."], "candidate_count": 3,
     "model_id": "33405c7b...", "score": [0.132, 4.277]}
  ],
  "status": "complete"
}

Every write contains every top-level field:

Field

Type

Required

Default or values

Description

schema_version

integer

Yes

1

Schema version

format

string

Yes

ovclash-kpi-native-collection-status-v1

Format name

mode

string

Yes

collect-baseline

The KPI mode

platform

string

Yes

linux, aarch64 or windows

The platform of the lane

backend

string

Yes

ovstage or openusd

The measured backend

baseline_campaigns

integer

Yes

3 or more; default 3

The campaign count N of --baseline-campaigns

attempt_count

integer

Yes

0 or more

The number of campaigns rows

eligible_campaign_count

integer

Yes

0 or more

The number of eligible campaigns retained

status

string

Yes

running, complete, incomplete, canceled or failed

running while collection runs, then complete (exit 0), incomplete (3), canceled (130) or failed (any other exit)

exit_code

integer or null

Yes

null while running

The collection’s exit code; see the exit table

reason

string

Yes

collection_running while running

The collection’s reason; see the exit table

campaigns

array of objects

Yes

One row per campaign attempt

The campaign ledger; see ledger rows

selections

array of objects

Yes

One row per CPU model with a qualifying set

The selected sets

pending

array of objects

Yes

One row per CPU model without a set

The models that still need campaigns

required_models

array of objects

Yes

model_key objects

The required keys in the required CPU models format, including the model of every campaign that continued the collection

Ledger rows#

Each campaigns row, the ledger row:

Field

Type

Required

Default or values

Description

ordinal

integer

Yes

1, 2, …

The campaign’s position in the collection

session_id

string

Yes

32 lowercase hexadecimal digits

The campaign’s session ID

exit_code

integer

Yes

0, 1, 2, 3, 4 or 130

The campaign verdict. Any other code is recorded as 4

elapsed_seconds

number

Yes

0 or more

Seconds from the start of the first campaign to the end of this one

disposition

string

Yes

eligible, retryable, deadline or fatal

The disposition of when collection continues and stops

campaign_id

string

Eligible campaigns only

64 lowercase hexadecimal digits

The calibration campaign ID

reason

string

No

cpu_contention, cpu_counter_rejection, cpu_clock_alignment, noise_exhaustion, collection_deadline, selection_deadline or insufficient_physical_cores

The retry cause of a retryable campaign, or the cause of a stop

Selection and pending rows#

Each selections and pending row:

Field

Type

Required

Default or values

Description

model_id

string

Yes

64 lowercase hexadecimal digits

The model ID, the SHA-256 of the model_key

candidate_count

integer

Yes

0 or more

The eligible campaigns of this CPU model

campaign_ids

array of strings

selections only

N campaign IDs

The selected campaigns

score

array of two numbers

selections only

[largest, sum]

The set’s selection score

needed

integer

pending only

1 or more

Additional campaigns needed: N minus the candidates, at least 1

limiting

array of objects

pending only

Empty below N candidates

The unstable metrics of the closest set, each with workload_id and metric_id (strings), noise_fraction (number, stability noise divided by the median) and limit (number, the noise limit as a fraction)

A pending model with enough candidates names its limiting metrics:

{"candidate_count": 3, "limiting": [{"limit": 0.25, "metric_id": "load_seconds", "noise_fraction": 0.6923, "workload_id": "benchmark-body-representative-dynamic"}], "model_id": "33405c7b...", "needed": 1}

A status.json that still reads running was cut off before the final record. A failed final write lowers the result to 4 (collection_harness_failure), or to 130 when interrupted, but never replaces collection_cleanup_unverified. On Windows a reader that holds status.json open blocks its replacement, so each write retries for up to 0.75 seconds. A checkpoint that still fails logs Status checkpoint deferred | <error type>. Collection then continues, because the final record is authoritative.

Rejected input#

Input rejected before the public output exists writes neither status.json nor progress.log, runs no workload and exits 4. Troubleshooting lists the lines that check runs share.

Console line

Cause

KPI startup: invalid arguments; no preparation or workload executed.

An option did not parse, for example --baseline-campaigns 2, in a launcher run that names neither --inputs nor --dist. The launcher’s startup check parses the options first

KPI input rejected; no workload executed.

An option did not parse in a run that names --inputs or --dist, as in CI. The driver parses the options

KPI collection input rejected; no workload executed.

An allowance of 330 seconds or less, an invalid CI job deadline, an admission policy other than shared-runner-recorded-contention-v2, a CPU domain other than four-physical-cores-retry-v2, a runner or storage label outside the calibration vocabulary, an invalid required-model list, or an output inside --inputs or --dist

KPI collection input rejected: output destination already exists; choose a new --output directory. No workload executed.

The public output exists. The line names --public-output when that option selected it. Existing files are kept

Collection outputs#

The public output holds these entries. <NNNN> is the campaign’s four-digit ordinal, such as 0001:

Path

Format

Present

Content

progress.log

UTF-8 text

Once the configuration step passed

The progress log

status.json

One line of compact JSON with sorted keys

From the start of preparation

The collection result; see collection status and exit codes

campaigns/<NNNN>/public/measurements.json

JSON, the public record

Each campaign, unless writing it failed

The campaign’s public record

campaigns/<NNNN>/calibration/calibration.json

JSON, the calibration evidence format

A campaign with exit 0 and a verified drain

The campaign’s calibration. It stays even when the independent replay rejects it

baseline/

Directory

Only after collection_complete

The generated series

The public record of a campaign is diagnostic. A failure to write it leaves the campaign verdict unchanged and logs Campaign N | public diagnostic record unavailable; verdict unchanged.

The generated series contains exactly these files; review rejects any other file:

Path

Format

Content

baseline/series.json

Canonical JSON

The series record, format ovclash-kpi-baseline-series-v2

baseline/review.txt

UTF-8 text

The review text that baseline-series review must reproduce byte for byte

baseline/evidence/<campaign-id>/calibration.json

JSON, the calibration evidence format

The calibration of every eligible campaign, selected or not

baseline/baselines/<backend>/<platform>/<model-id>.kpi-budget.json

Sealed package JSON; see budget packages

One generated package per CPU model. <platform> is linux, aarch64 or windows, and <model-id> is the model ID

series.json holds these fields, all required:

Field

Type

Required

Default or values

Description

schema_version, format

integer, string

Yes

2, ovclash-kpi-baseline-series-v2

Format identity

source

object

Yes

label (string, Native Release baseline collection) and created_at_utc (string, UTC time); in a CI job also collection

The provenance. collection holds project_id, pipeline_id and job_id (positive integers), commit_sha (40 lowercase hexadecimal digits) and lane (one of the six lanes)

attempts

array of objects

Yes

Empty locally; one row in a CI job

The collecting job: job_id (positive integer), status (success) and disposition (eligible)

baseline_campaigns

integer

Yes

3 or more

The campaign count N

selection_policy

string

Yes

closest-three-campaigns-v1 for N = 3, closest-n-campaigns-v1 otherwise

The selection policy

aggregation_contract

string

Yes

cpu-model-campaigns-v1

The pooling contract

candidates

array of objects

Yes

One row per eligible campaign

campaign_id, content_sha256, model_id and aggregation_key (each 64 lowercase hexadecimal digits) and input, the file reference of its retained calibration.json

models

array of objects

Yes

One row per CPU model

model_id (string), model_key (object), aggregation_key (string), the selected campaign_ids (array of strings), score (array of two numbers), review (array of objects) and proposal, the file reference of its package

required_models

array of objects

Yes

model_key objects

The required keys

missing_models

array of objects

Yes

Always empty in a published series

The models without a qualifying set

complete

boolean

Yes

true

Whether every model has a set

generation

object

Yes

schema_version (1), kind (automated-campaign-selection) and created_at_utc

The automated-generation record

approval

null

Yes

null

No human approval is claimed

A file reference, the input of a candidate and the proposal of a model, holds these fields, all required:

Field

Type

Required

Default or values

Description

path

string

Yes

A relative POSIX path inside baseline/, without . or .. parts

The retained file

sha256

string

Yes

64 lowercase hexadecimal digits

SHA-256 of the file’s bytes

bytes

integer

Yes

1 to 134,217,728 (128 MiB)

The file’s length

A review row holds the pooled statistics of one workload and required metric, which review.txt prints. Every field is required:

Field

Type

Required

Default or values

Description

workload_id

string

Yes

A workload ID

The workload

metric_id

string

Yes

A required metric

The metric

unit

string

Yes

seconds, nanoseconds or bytes

The metric’s unit

count

integer

Yes

3 or more in a published series

The number of pooled values

median

number

Yes

Greater than 0

The median B of the pooled values

mad

number

Yes

0 or more

The median absolute deviation from B

max_deviation

number

Yes

At least mad

The largest deviation from B

noise

number

Yes

max(3 * mad, max_deviation, f * B)

The conservative noise of the package row; f is the noise floor

warning, failure

number

Yes

B + noise + 0.05 * B, B + noise + 0.10 * B

The limits of the package row

stability_noise

number

Yes

3 * mad

The noise that the pooled noise gate checks

permitted_noise_fraction

number

Yes

0.25 for load_seconds, 0.15 otherwise

The noise limit as a fraction of B

stable

boolean

Yes

true in a published series

At least three values and stability_noise within permitted_noise_fraction * B

Review and install a generated series#

Review replays every retained campaign and repeats the selection. It then checks that the packages and review.txt are exactly what that replay produces.

Before you begin: you need the baseline/ directory of a complete collection (exit 0, collection_complete) with series.json, review.txt, evidence/ and baselines/ together and unchanged, and $PY from the quick start. The commands use the --output of the collection example. To see the packages work before you install them, you can also run a check against them first; see try the packages before installing.

  1. Get the complete baseline/ directory: <output>/public/baseline of the collection, or the same directory from the CI job that ran it. A copy that misses a file, or holds a changed or extra one, fails the review with exit 4; review results lists the causes.

  2. Run the review.

    Linux:

    "$PY" -B -m benchmarks.kpi baseline-series review --input _build/kpi-baseline-01/public/baseline
    

    Windows (cmd.exe):

    "%PY%" -B -m benchmarks.kpi baseline-series review --input _build/kpi-baseline-01/public/baseline
    

    It prints the review text and exits 0. The text equals review.txt.

  3. Check the CPU models in the review: its CPU models: count and one CPU MODEL section per model that you expect. A model that is not there needs a collection on a machine with that CPU model.

  4. Read the campaign counts in the last line of progress.log, Exit 0 | collection_complete | requested <N> per CPU model | eligible <E> | attempts <A>. Each attempt beyond the eligible campaigns was a retryable campaign, and the Retry: line after it in progress.log names the cause, such as Retry: cpu contention.

  5. Read the Limiting metric: lines of progress.log, if any. Each names a metric that kept the candidates of one CPU model from passing the pooled noise gate together.

  6. Check the two scores of each model in the review. A largest score above 1.0 widens both limits of the budget by the distance to the farthest campaign; see the campaign selection example.

  7. Install the packages; see install or replace CPU-model budgets.

  8. Keep the downloaded artifact unchanged for later audits: its review records name the generated files.

Review results#

The review fails, prints kpi baseline-series: retained evidence validation failed on stderr and exits 4 when anything differs:

  • a package, review.txt or a calibration file was changed;

  • the directory holds a file that series.json does not declare, such as a copied status.json or progress.log;

  • series.json or a retained input changes while the replay runs;

  • the series is incomplete or does not record its campaign count.

A series that names a .kpi-budget.zip package, the removed package shape of budget packages, prints a second line with the removal message.

This excerpt of a review comes from a series generated from four synthetic campaigns: A, B, C and the outlier O of the selection example. IDs are shortened:

KPI BASELINE GENERATION
====================================================================================================

SERIES
----------------------------------------------------------------------------------------------------
Source: Native Release baseline collection
Created UTC: 2026-10-12T00:00:00Z
Selection policy: closest-three-campaigns-v1
Generated baselines complete: True
Eligible campaigns retained: 4
CPU models: 1
Missing models: 0
Requested full campaigns per CPU model: 3

CPU MODEL
----------------------------------------------------------------------------------------------------
Model ID: 33405c7bf70eb576432b1ed27db64309e5d6e1941762af7b65b0d1b6dac9330a
Observed model: family=6, model=42, name=Example Core 42, stepping=1, vendor=GenuineIntel
Eligible candidates: 4
Selected campaigns: 3
Unselected candidates retained: 1
Score (maximum normalized range): 0.13201320132013203
Score (sum of normalized ranges): 4.2772277227722775
Selection: closest eligible group of 3 full campaigns; every selected observation contributes.
  selected   23bc8f1a...
  selected   9f6caa19...
  selected   f0d73b76...
  retained   70a8ef2e...
Install destination: ovclash/benchmarks/kpi/baselines/ovstage/linux/33405c7bf70eb576432b1ed27db64309e5d6e1941762af7b65b0d1b6dac9330a.kpi-budget.json
Unselected evidence remains available for offline reselection; other groups ranked later or failed a pooled noise gate.

benchmark-body-representative-duplicates-only
Metric                             Unit     Count             Median                MAD      Max deviation              Noise            Warning            Failure   Gate  Stable
load_seconds                       seconds      9              101.0                1.0                1.0                3.0             109.05              114.1    25%    True
operation_seconds                  seconds      9              101.0                1.0                1.0                3.0             109.05              114.1    15%    True
...
AUTOMATED GENERATION
----------------------------------------------------------------------------------------------------
3 complete independent campaigns per CPU model selected and replayed; no human approval is asserted.
Review: python -m benchmarks.kpi baseline-series review --input DIR
Copy baselines/ into ovclash/benchmarks/kpi/, replacing existing limits for the same CPU model, and commit to adopt.

Gate is the noise limit of the metric. Count is the number of pooled values; here it is three measured runs from each of three campaigns.

Generated packages carry an automated-generation attestation, not a human approval. They are active as soon as they are committed; there is no separate approve command.

Try the packages before installing#

Before you begin: use the machine, and the runner and storage labels, that the baseline was collected with, and choose an --output that does not exist yet.

A check run can read the generated catalog directly. A relative --budgets path resolves from ovclash/, and {backend} and {platform} are replaced; see command-line options.

Linux:

bash ./run_kpi.sh --profile release --budgets "_build/kpi-baseline-01/public/baseline/baselines/{backend}/{platform}" --output _build/kpi-check-01

Windows:

run_kpi.bat --profile release --budgets "_build/kpi-baseline-01/public/baseline/baselines/{backend}/{platform}" --output _build/kpi-check-01

The baseline lookup then prints Baseline source: CLI --budgets and Baseline lookup: coverage found; performance comparison is pending, and the check measures. Any other lookup decision ends the run with exit 3 before fixture generation; mode and lookup lines gives the cause of each decision line.

Budget packages#

Catalogs and --budgets accept only the ovclash-kpi-compact-budget-package-v1 format, schema version 1. A package is one plain JSON file named <name>.kpi-budget.json. It holds the budgets, not the measurements.

The bytes are sealed. A package must be exactly what the writer produces:

  • sorted keys and one-space indentation;

  • UTF-8 without a byte-order mark;

  • LF line endings and one final newline;

  • no duplicate fields and no NaN or infinity;

  • at most 4 MiB.

A reformatted or CRLF copy is rejected with compact package is not in its sealed .kpi-budget.json form, even when it decodes to the same document.

A .kpi-budget.zip file is the removed package shape. It is rejected with the .kpi-budget.zip package shape was removed; KPI budget packages are plain .kpi-budget.json files. A --budgets path with that suffix, or a catalog folder that holds such a file, fails the check with exit 4.

Package fields#

Every field is required, and a package with an unknown field fails to load:

Field

Type

Required

Default or values

Description

schema_version

integer

Yes

1

Schema version

format

string

Yes

ovclash-kpi-compact-budget-package-v1

Package format

comparison_contract

string

Yes

approved-cpu-model-limits-v2 or approved-cpu-model-limits-v1

v2 for every new package. Packages of the earlier v1 contract stay valid and are checked against the v1 formulas, which have no noise floor

acquisition_policy

string

Yes

adaptive-release-warmup-robust-load25-noise15-retry10-runs10-restarts10-v10

The current acquisition policy. Any other policy fails to load

source

string

Yes

A printable label of at most 512 characters without / or \

Native Release baseline collection for a generated package, or ovclash <VERSION> @ <created_at_utc> from budget create

created_at_utc

string

Yes

An explicit UTC timestamp

The creation time. An approval records its own review time

compatibility

object

Yes

cpu_model_sha256, absolute_pre_scope_sha256, cohort_sha256 and pre_scope_sha256 (64 lowercase hexadecimal digits each) and cpu_pool (object)

The cohort binding; see how check mode matches a package. cpu_pool is the original four-core pool declaration

approval

object or null

Yes

null, or {"reviewed_at": <UTC time>, "reviewer": "identity-withheld"}

The local approval of a budget create package. A generated package has null

generation

object or null

Yes

null, or the attestation of a generated package

schema_version (1), kind (automated-campaign-selection), created_at_utc (equal to the package’s), selection_policy, aggregation_contract (cpu-model-campaigns-v1), aggregation_key (SHA-256), baseline_campaigns (integer, 3 or more), campaigns (exactly that many {"campaign_id", "content_sha256"} objects, sorted by ID) and policy_sha256

budgets

array of objects

Yes

1 to 4,096 rows; 47 on Linux and 56 on Windows

One row per workload and required metric

Each row holds these fields, all required:

Field

Type

Required

Default or values

Description

workload_id

string

Yes

A workload ID

The workload

workload_digest

string

Yes

64 lowercase hexadecimal digits

The digest of the workload’s frozen contract

metric_id

string

Yes

A required metric

The metric

unit

string

Yes

seconds, nanoseconds or bytes; load_seconds uses seconds

The metric’s unit

baseline

number

Yes

Greater than 0

The median B of all pooled values

count

integer

Yes

1 to 10,000,000

The number of pooled values. An active row needs at least 3, and a generated row at least 3 * baseline_campaigns

mad

number

Yes

0 or more

The median absolute deviation from B

max_deviation

number

Yes

At least mad

The largest deviation from B

noise

number

Yes

N = max(3 * mad, max_deviation, f * baseline)

f is the noise floor of the metric: 0.30 for extraction_serialization_seconds under v2, otherwise 0

warning

number

Yes

B + N + 0.05 * B

The warning limit; budget limits explains it

failure

number

Yes

B + N + 0.10 * B

The failure limit

Readers recompute noise, warning and failure from the other fields, with the formulas of the package’s comparison contract, and reject any difference. They also recompute policy_sha256 over the package without its generation field. A hand-edited limit therefore makes the package invalid. Never edit a package; create a new one.

This excerpt of a generated package comes from the synthetic test campaigns. The sealed file lists all 47 rows:

{
 "acquisition_policy": "adaptive-release-warmup-robust-load25-noise15-retry10-runs10-restarts10-v10",
 "approval": null,
 "budgets": [
  {
   "baseline": 101.0,
   "count": 9,
   "failure": 114.1,
   "mad": 1.0,
   "max_deviation": 1.0,
   "metric_id": "load_seconds",
   "noise": 3.0,
   "unit": "seconds",
   "warning": 109.05,
   "workload_digest": "7f7d14d6aa409856c84b8a5db9eb47e70b6fdbf2885e82b1084def81c84e950f",
   "workload_id": "benchmark-body-representative-duplicates-only"
  }
 ],
 "comparison_contract": "approved-cpu-model-limits-v2",
 "compatibility": {
  "cpu_model_sha256": "33405c7bf70eb576432b1ed27db64309e5d6e1941762af7b65b0d1b6dac9330a",
  "...": "..."
 },
 "created_at_utc": "2026-10-12T00:00:00Z",
 "format": "ovclash-kpi-compact-budget-package-v1",
 "generation": {
  "aggregation_contract": "cpu-model-campaigns-v1",
  "baseline_campaigns": 3,
  "campaigns": [{"campaign_id": "23bc8f1a...", "content_sha256": "45789dbc..."}],
  "kind": "automated-campaign-selection",
  "selection_policy": "closest-three-campaigns-v1",
  "...": "..."
 },
 "schema_version": 1,
 "source": "Native Release baseline collection"
}

A package holds no raw attempts, databases, stage layers, runtime binaries, build hashes or measurement-implementation hash. Loading validates the format, the attestation or approval and the compatibility, then trusts the budgets. It cannot rebuild the observations. Keep the calibration inputs (the series evidence/, or the budget create inputs) when you need an audit trail.

How check mode matches a package#

A package covers a CPU model only when both of its compatibility digests match the observed run:

  • cpu_model_sha256 is the SHA-256 of the CPU model key, model_key: its schema version, the CPU domain, platform, architecture, processor identity, core class and SMT width. This digest is the model ID, and a generated package uses it as its file name.

  • absolute_pre_scope_sha256 covers the rest of the cohort, without the reported processor string and the CPU scope: platform, architecture, backend, runner class, storage class, interpreter, load and admission policy and CPU domain. On Windows it also covers the windows-pdh-direct-accounting-v2 counter contract and the collection-bracketed-cpu-accounting-envelope-v2 envelope contract.

The CPU placement may differ: a run on any pool of the same CPU model matches. A CPU model without a matching package has no coverage and no fallback to another model.

A candidate is then compared with each row as described in budget limits. Without complete coverage, the launchers stop before fixture generation with exit 3; mode and lookup lines shows the lookup lines.

Offline budget recording#

collect-baseline is the normal way to create packages. Offline budget recording is the manual alternative: you collect calibration evidence yourself, review it with budget create and approve the package locally.

budget create reads calibration evidence in the ovclash-kpi-calibration-evidence-v11 contract, which carries privacy-safe calibration from complete Release campaigns of the shared launchers under the current acquisition policy. Readers reject any other calibration version or acquisition policy. Public numerical diagnostics alone cannot be passed to budget create --artifacts.

budget create accepts 1 to 100 intact calibration directories or local calibration ZIPs after one --artifacts option. Each input holds exactly one calibration.json. A directory or ZIP without one is rejected with baseline campaign requires portable calibration evidence. The command verifies every workload and metric observation offline, prints one review table and asks for local approval. It writes one sealed .kpi-budget.json package in the ovclash-kpi-compact-budget-package-v1 format with the approved-cpu-model-limits-v2 contract; see budget packages. The package holds the reviewed budgets, not the measurements or the runtime. The command needs no CI service and runs no native workload.

Evidence requirements#

Calibration evidence gives the conditions under which a run exports calibration, what the export holds and what readers check. Pass these extracted directories:

  • the calibration directory of a --profile release check run;

  • the public/campaigns/<NNNN>/calibration directory of each collection campaign that ended with exit 0 and a verified drain;

  • the same directories from a CI job artifact.

budget create runs those reader checks offline on every input. Readers do not trust a stored qualification flag or projected budget. Content hashes and sizes record what the producer validated, and readers cannot rehash binaries absent from the artifact.

All inputs of one package must share one producer (the build, runtime, source and measurement identity), one workload contract and sampling policy, and one identical cohort and compatibility binding, CPU scope included. Every input therefore ran in the same verified four-core pool: retry-v2 observations may use different CPU IDs only within that pool. A generated package is less strict; its campaigns may come from different pools of one CPU model (see measurement and baseline rules). Never pool backends, platforms, CPU models, admission policies, CPU-domain versions or runtimes: ovstage budgets cannot qualify OpenUSD measurements, even on the same CPU. Duplicate input files and repeated campaigns or child executions are rejected; they are not new observations.

Measurement identity hashes the measurement sources (see measurement identity). Pool only campaigns that ran from the same sources. The cohort also records the CPU quota hierarchy of the Linux control groups (cgroups, the kernel’s per-process-group resource limits), without paths. On one Linux host, a desktop terminal, a systemd-run --user --scope unit and an SSH session give different hierarchies, so start every pooled local campaign the same way. budget create names the first differing part and up to three field levels, without values, on stderr and exits 4, for example:

KPI harness-failure: budget-create: artifacts differ in cohort field cpu_scope.cpu_constraints.quota_hierarchy

Collection plan and stopping rules#

Decide the number of campaigns and a finite attempt limit before you collect. One complete eligible Release campaign is enough for a proposal. Three observations per workload and three independent campaigns are different counts. More campaigns describe variability, but they never waive the noise gate. Do not continue collecting until a favorable result appears.

A machine can expose different core classes and SMT widths under one CPU model name. Keep campaigns of different classes apart: their differences establish no regression, noise estimate or budget. Include every eligible value of each campaign you use. Never trim slow values, and never fill missing cells from incomplete or incompatible evidence. A changed counter model, measurement source or workload needs a fresh collection.

Create and approve a package#

Before you begin: extract the calibration directories that meet the evidence requirements, and set $PY as in the quick start. Pass every retained campaign of one CPU model, not a favorable subset, and a fresh output name that ends in .kpi-budget.json. The first command reads the calibration of one check run; the second reads two campaigns of a collection.

Linux:

"$PY" -B -m benchmarks.kpi budget create --artifacts _build/kpi-local-example/calibration --output _build/kpi/cpu-reviewed.kpi-budget.json
"$PY" -B -m benchmarks.kpi budget create --artifacts _build/kpi-baseline-01/public/campaigns/0001/calibration _build/kpi-baseline-01/public/campaigns/0002/calibration --output _build/kpi/linux-reviewed.kpi-budget.json

Windows (cmd.exe):

"%PY%" -B -m benchmarks.kpi budget create --artifacts _build/kpi-local-example/calibration --output _build/kpi/cpu-reviewed.kpi-budget.json
"%PY%" -B -m benchmarks.kpi budget create --artifacts _build/kpi-baseline-01/public/campaigns/0001/calibration _build/kpi-baseline-01/public/campaigns/0002/calibration --output _build/kpi/windows-reviewed.kpi-budget.json

The results directory of a direct run is not a calibration input. The command refuses URLs, a repeated --artifacts, an existing output and an output without the .kpi-budget.json suffix. It prints a review like this (values illustrative):

Inputs: 1; sessions: 1; workloads: 9; budgets: 47
Input bytes: 1,234,567; unique evidence bytes inspected: 1,234,567
| Workload | Metric | Unit | Accepted | Sessions | Baseline | Warning | Failure | Eligibility | Evidence strength |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
...
A single observation does not measure repeat dispersion.
Approval records an explicit local review, not a CI attestation.
Comparison contract: approved-cpu-model-limits-v2
Approve this budget package locally? [y/N]: y
Locally approved budget package: policy-package (47 budgets, 61,234 bytes)
SHA-256: <package SHA-256>
Budget package written: <absolute path of the package>

Answer

Result

y or yes

An approved package

empty, n or no

An unapproved proposal, which cannot enforce its budgets

End of input, an interrupt or any other answer

No package

For a noninteractive choice, add --approve or --no-approve. --approve still validates and prints the review, and it cannot approve an ineligible package. Approval is a local review assertion by the operator, not a CI signature. The package records reviewer: "identity-withheld" and the UTC review time, separate from created_at_utc. The command does not look up the local user. To approve a proposal later, run budget create again from the original inputs into a fresh output. Never edit budgets or approval JSON by hand.

The command succeeded when it exits 0 and prints Budget package written: with the path of the new package. On a failure it writes no package, prints one KPI <status>: budget-create: line with a fixed reason on stderr and exits nonzero, for example KPI harness-failure: budget-create: output already exists; choose a fresh .kpi-budget.json output (exit 4) or KPI insufficient-evidence: budget-create: required local evidence input is unavailable (exit 3).

Budgets follow the formulas in KPI sampling. Install the package as described in install or replace CPU-model budgets, or test it first as described in check against a local package.

Check against a local package#

Before you begin: the package must exist, and it must cover this machine’s CPU model with the same runner and storage labels and cohort that the check records; see how check mode matches a package.

The launchers and the controller accept --budgets with a catalog directory or one package file. A launcher with a single package, from ovclash/:

Linux:

bash ./run_kpi.sh --profile release --budgets _build/kpi/cpu-reviewed.kpi-budget.json --output _build/kpi-local-budget-check

Windows:

run_kpi.bat --profile release --budgets _build/kpi/cpu-reviewed.kpi-budget.json --output _build/kpi-local-budget-check

With a covering package, the launcher’s lookup prints Baseline lookup: coverage found; performance comparison is pending and the check measures. Without coverage it ends with exit 3 before fixture generation; mode and lookup lines gives the cause of each decision line.

A direct controller run passes the same --budgets value to python -m benchmarks.kpi run; run a campaign gives the command. Pass the admission policy, CPU domain, runner and storage labels and interpreter that the package was collected with: the controller’s defaults never match a package.

--budgets value

Launcher

Direct run

Catalog directory

Every package must load; see catalog rules

Same

Approved or generated package

Its budgets apply

Same; results/budget-package.json records the package hash and its attestation or approval

Unapproved proposal

Covers no cell: exit 3 before fixture generation

Measures and shows the numeric result, but every comparison stays insufficient evidence

Any other existing file, or a missing path

Measurement is skipped: exit 3

Measures; comparisons report Budget artifact is unavailable: approved limits come only from a CPU-model package directory or an existing compact .kpi-budget.json file.

A .kpi-budget.zip file

Exit 4

Exit 4

Loading makes no network request and restores no runtime.

Install or replace CPU-model budgets#

Check mode reads one catalog per backend and platform:

Platform

ovstage catalog

OpenUSD catalog

Linux x86-64

benchmarks/kpi/baselines/ovstage/linux/

benchmarks/kpi/baselines/openusd/linux/

Linux AArch64

benchmarks/kpi/baselines/ovstage/aarch64/

benchmarks/kpi/baselines/openusd/aarch64/

Windows x86-64

benchmarks/kpi/baselines/ovstage/windows/

benchmarks/kpi/baselines/openusd/windows/

Each folder is checked in with a .gitkeep and may be empty. No KPI command edits these folders.

Before you begin: review the series or create the package, and find any older package of the same CPU model in the target folder; the catalog rules reject two packages for one CPU model.

To install a reviewed series on Linux x86-64, from ovclash/:

cp _build/kpi-baseline-01/public/baseline/baselines/ovstage/linux/*.kpi-budget.json benchmarks/kpi/baselines/ovstage/linux/
git add benchmarks/kpi/baselines/ovstage/linux/

On Linux AArch64, from ovclash/:

cp _build/kpi-baseline-01/public/baseline/baselines/ovstage/aarch64/*.kpi-budget.json benchmarks/kpi/baselines/ovstage/aarch64/
git add benchmarks/kpi/baselines/ovstage/aarch64/

On Windows, from ovclash\:

copy _build\kpi-baseline-01\public\baseline\baselines\ovstage\windows\*.kpi-budget.json benchmarks\kpi\baselines\ovstage\windows\
git add benchmarks\kpi\baselines\ovstage\windows\

For the OpenUSD backend, replace ovstage with openusd in both paths of each command. Copy the files unchanged. ovclash/.gitattributes marks benchmarks/kpi/baselines/**/*.kpi-budget.json as text eol=lf, so every checkout keeps the sealed LF bytes. Check mode selects a package by the compatibility inside it, not by its file name, so an installed copy may be renamed if it keeps the .kpi-budget.json suffix. A package from budget create is installed the same way and may use any descriptive name that ends in .kpi-budget.json.

To confirm the installation, run a check without --budgets on a machine of that CPU model and with the package’s labels. Its lookup prints Baseline source: default and Baseline lookup: coverage found; performance comparison is pending. A folder that breaks a catalog rule fails the check with exit 4 instead.

Keep one package per CPU model in a folder, whatever its labels. Remove the older package of the same CPU model in the same change. Two packages with budgets for the same CPU model, workload and metric are rejected as ambiguous duplicate CPU-model workload/metric limits, even when their runner or storage labels differ. A package with local labels therefore cannot sit beside the CI package of the same model. Never let a package with local labels replace one with CI labels: CI checks of that model would lose their coverage. Packages of different CPU models coexist.

Catalog rules#

Check mode loads the whole folder before it measures:

  • It reads only files that end in .kpi-budget.json and ignores other files, except that a file of the removed .kpi-budget.zip shape fails the folder; see budget packages.

  • A folder holds at most 256 entries of any kind, at most 64 packages and at most 32 MiB in total. Each package is at most 4 MiB.

  • Neither the folder nor a package may be a link. Package names must differ by more than letter case.

  • Every package must be approved or generated, use the approved-cpu-model-limits-v2 or approved-cpu-model-limits-v1 contract and the current acquisition policy, and keep its sealed bytes.

  • No two packages may define budgets for the same CPU model, workload and metric.

  • The folder and every package are checked again after loading; a change during loading fails.

A folder that breaks one of these rules fails every check on that backend and platform with exit 4, whatever the observed CPU model, until it is fixed. A valid package that does not match the observed cohort only leaves its CPU model without coverage.

Stale packages#

Committed packages become stale when the measured work or the package rules change:

Change

Effect

A frozen workload, a bundle recipe or a new required metric

The workload digests no longer match: check mode finds no coverage and exits 3

The acquisition policy or the package format

The packages fail to load: every check on that backend and platform exits 4

CommittedCatalogTests in tests/python_tests/test_kpi_preflight.py then fails. Regenerate the affected packages from fresh campaigns, or remove them, in the same change. See refresh pinned fixture identities.