Run KPI#
This page explains how to start KPI and what it prints when it starts: the launchers, input preparation, every option and environment variable, the settings block, the CI contract, the controller commands and the observer study. For a first run, follow the quick start. Pages in this guide lists the other KPI pages.
Run every command from the ovclash/ directory of a source checkout or
source export. In the Python commands, $PY (%PY% in cmd.exe) is the KPI
input Python that the quick start defines: the packaged CPython 3.12 of
the staged inputs. The KPI glossary defines the KPI terms used here, such as
portable input bundle, validation receipt, driver, controller, campaign, catalog, cohort,
budget, package and verified drain. The
consumer glossary defines backend, ovstage, OpenUSD and SDK
archive.
Launchers#
Host |
Launcher |
|---|---|
Linux x86-64 and Linux AArch64 |
|
Windows x86-64 |
|
Both launchers run the driver scripts/kpi_ci.py with the portable input bundle’s own Python,
<inputs>/python-runtime/bin/python3 or <inputs>\python-runtime\python.exe, as
python -I -B. They never fall back to another interpreter. They pass these defaults before your
arguments, and a later option of yours wins:
Option |
Launcher default |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
The launchers set OVCLASH_KPI_LAUNCHER_DEFAULTS to the number of default arguments, for the
startup check and the driver only. The settings block uses it to tell
launcher defaults from your arguments. Do not set it yourself.
The launchers answer two requests themselves. These work without an SDK archive or a Python runtime:
--helpor-h, anywhere on the command line, prints the launcher help.--versionas the only argument printsovclash <version>.
Automatic preparation#
Without an explicit --inputs or --dist, the launcher makes sure that the default inputs
belong to the checked-out source:
It runs the startup check
scripts/kpi_startup.pywith the bundle’s Python. When that Python is missing, it goes straight to step 2.When preparation is required, it runs
build_<backend> --release --validate --stage-inputsonce. It addspackage_sdktoOVCLASH_VALIDATE_EXTRA_TARGETSfor this build.It runs the startup check again. Any result other than 0 now stops the launcher with exit 4.
It starts the driver.
Startup check result |
Launcher action |
|---|---|
0: the SDK archive, wheel, portable inputs and producer receipt (the validation receipt of the build that produced the inputs) match each other and the checkout |
Reuses the inputs and starts the driver |
10: inputs are missing, invalid or built from other source |
Builds once, as in step 2 |
11: as 10, for a local ovstage check of uncommitted source |
Builds once with the diagnostic validation plan |
4: invalid arguments, a source identity it cannot verify, or uncommitted changes in a baseline collection or CI run |
Stops with exit 4. A build cannot fix this; see source identity |
More rules:
The extra
package_sdktarget keeps the SDK archive when an inheritedOVCLASH_VALIDATE_EXCLUDE_TARGETSdropstest_c_compat_sdk_archive.The Windows launcher sets
OVCLASH_CI_REF_PROTECTED=falsefor the build when none ofCI_JOB_ID,CI_COMMIT_REF_PROTECTED,OVCLASH_CI_PROVIDER,OVCLASH_CI_JOB_IDandOVCLASH_CI_REF_PROTECTEDis set. The receipt then records an unprotected development ref, which KPI requires before it accepts an ovstage signing skip. An OpenUSD skip does not depend on the ref. See supported workflows.The Windows launcher clears
OVCLASH_KPI_LAUNCHER_DEFAULTSfor the build.A failed build stops the launcher with the build’s exit code.
Preparation runs at most once, before any KPI timer starts.
A run after a new commit prints lines like these (Linux; ... marks omitted lines):
KPI startup: checking ovstage Release inputs and checkout identity.
KPI startup: the checkout changed since the validated Release build. Release preparation is required.
ovclash <version> - KPI startup preparation (ovstage)
KPI settings by source:
...
START: build_ovstage.sh --release --validate --stage-inputs (including package_sdk)
...
PASS: KPI Release preparation; checking staged inputs.
KPI startup: checking ovstage Release inputs and checkout identity.
KPI startup: matching validated Release inputs are ready; reusing them.
KPI settings by source:
...
The settings block appears twice: the startup check prints it before the build, and the
driver prints it again when the run starts. The Release preparation is required. line names
the reason:
After a commit or an edit, it reads
KPI startup: the checkout changed since the validated Release build. Release preparation is required.When an SDK archive, wheel or receipt is missing or invalid, it reads
KPI startup: the SDK, wheel, portable inputs or producer receipt is missing or invalid. Release preparation is required.Without a staged Python, the startup check cannot run. The launcher then prints only the
ovclash <version> - KPI startup preparation (<backend>)banner beforeSTART:.
With uncommitted source, the startup check adds the notice described in
source identity, and for a diagnostic build the line described in
diagnostic validation plan. On Windows, the START: line names
build_<backend>.bat.
Diagnostic validation plan#
A local ovstage check of uncommitted source only needs its build to be measurable. The startup check then returns 11 and prints:
KPI startup: uncommitted local check; preparing with the diagnostic validation plan (build, wheel and SDK packaging, staged inputs).
The launcher then validates less. It appends these targets to OVCLASH_VALIDATE_EXCLUDE_TARGETS:
test_c_compat, test_cpp, test_python_runtime, the
ovRTX viewer smoke test_ovrtx_sample, test_samples,
test_no_clash_dependency, test_ovx_package_coherence and test_c_compat_sdk_archive. Build,
install, the wheel (test_python_wheel), SDK packaging and staging still run, and so does signing
when OVCLASH_CODESIGN is on. The receipt lists only the steps that ran. The START: line ends
with (including package_sdk; diagnostic validation plan).
The startup check asks for the full plan instead when:
the source is committed;
the backend is OpenUSD;
the checkout has no Python test venv (
_build/deps/venv/python_tests). Staging runs with that venv, and onlytest_python_runtimecreates it;the bundle’s Python is missing, so the startup check cannot run (the first run after a clean).
A baseline collection or a CI run never gets this plan: with local changes it stops before preparation. A diagnostic-plan build is always dirty, so it serves only a local check; see source identity. Committing changes the source identity, and the next run prepares with the full plan.
Source identity#
The startup check computes the same source identity that the build records in its provenance.
Ignored files, such as everything under _build/, never count.
In a Git checkout, it uses the Git executable that the build tree recorded, or
gitonPATHwhen the tree is not configured. The build tree is the Ninja tree; on Windows it is the Visual Studio tree unlessGENERATORselects Ninja.A source export without Git uses the content snapshot of
scripts/source_snapshot.cmake. The startup check also uses the snapshot when the build tree recorded an empty or NOTFOUND Git, when an unconfigured tree finds nogitonPATH, when Git finds no repository, or when the repository root is not the parent ofovclash/. The snapshot runs the CMake thatCMAKEnames, else the bundled CMake, elsecmakeonPATH.
Source state |
Startup check |
Measurement |
|---|---|---|
Committed, no local changes |
Reuses inputs built from this commit; otherwise builds |
Runs |
Source export without Git |
Reuses inputs built from the same content; otherwise builds |
Runs |
Staged, unstaged or untracked changes |
Reuses inputs built from the same working tree; otherwise builds |
Only a local check, as a diagnostic check. A staged change that the working tree reverted counts as committed source, because the working tree then equals HEAD |
With local changes, the identity is HEAD and the tree of the whole working tree: every staged, unstaged and untracked file that is not ignored. Git hashes unstaged and untracked changes into a scratch copy of the index, so your own index never changes. Staging a change keeps the identity; any edit changes it and makes the next run build again.
Baseline collection and CI measure only committed source. With local changes they stop at
startup, before any preparation, with
KPI startup: baseline collection measures only committed source; ... or
KPI startup: CI measures only committed source; ... (exit 4). Commit or stash the changes
first. With caller-managed inputs, the driver applies the same rule after preparation and stops
with exit 4. Budget creation and calibration export also require committed source.
A local check of uncommitted changes measures and compares with the budgets as usual. Its verdict is for development only: a release-profile run exports no calibration evidence, and no budget package can be created from it. The run prints this notice:
KPI diagnostic run: the checkout has uncommitted changes. Limits are checked as usual, but the result is not release evidence; commit the changes for a recorded verdict or a baseline.
The notice appears each time the startup check runs (before an automatic build and again after it), after the driver’s Release preparation, and again after the verdict.
Caller-managed inputs#
An explicit --inputs or --dist turns automatic preparation off, even when it names the
default directory. --inputs=PATH and --dist=PATH count too. The launcher then never builds,
and the driver never builds either. Use this to measure inputs that were staged elsewhere.
Before you begin, make sure that the inputs meet these requirements. Troubleshooting gives the line that each failure prints.
<inputs>/python-runtime/bin/python3(python-runtime\python.exeon Windows) must exist. Otherwise the launcher stops with exit 4 before the driver starts.--distmust hold exactly one SDK archive (*.zip,*.tar.gz,*.tar.xzor*.tgz) and exactly one wheel. A--distwithout an SDK archive, for example after a validation that excludedtest_c_compat_sdk_archive, stops preparation with exit 4.This checkout must hold exactly one passing validation receipt of that build; see prepare inputs explicitly.
In CI and in a baseline collection, the inputs must be built from committed source; see source identity.
Replace <bundle-directory> with the staged portable input bundle and <dist-directory> with
the directory that holds its SDK archive and wheel.
Linux:
bash ./run_kpi.sh --inputs <bundle-directory> --dist <dist-directory> --output _build/kpi-staged-01
Windows:
run_kpi.bat --inputs <bundle-directory> --dist <dist-directory> --output _build/kpi-staged-01
The run then continues as with the default inputs: a passing check ends with
All KPI workloads passed and stay within their approved limits. Everything is awesome! and
exit 0; reports and verdicts lists the other exit
codes.
Prepare inputs explicitly#
You can prepare the inputs yourself before you run KPI. The commands, including the Windows signing setting, are in the quick start. Preparation works like this:
Release validation packages the SDK archive and the wheel into
_build/dist/<backend>.Validation writes
validation_receipt.jsoninto the tree it validated,_build/compile/<backend>/<generator>/, where<generator>isvsorninja. The local validation workflow describes it.--stage-inputscopies the validated installed SDK (the install tree), its Python runtime and the Sentinel helpers into_build/portable-inputs/<backend>/Release. It compiles nothing. Portable input bundles describes the bundle and how restaging replaces it.
When configurations share an install, run the matching Release build and validation last.
Staging refuses an install that holds another backend or configuration, and keeps the earlier
bundle. For OpenUSD, use build_openusd and --backend openusd; OpenUSD has its own budgets.
KPI selects the receipt by the artifacts it describes, not by the tree it sits in. The driver
and the startup check read validation_receipt.json from every
_build/compile/<backend>/<generator>/ tree. Visual Studio and Ninja validations of one backend
share _build/dist/<backend>, but each keeps its own receipt. KPI uses the one passing receipt
that matches the packaged artifacts and ignores receipts of other artifacts.
With caller-managed inputs, preparation stops with exit 4 when no receipt matches, when the
matching receipt did not pass, or when two passing receipts match. With the default inputs, the
startup check treats the same cases as inputs that need preparation. A direct
run --validation-receipt instead turns a receipt that did not pass into a campaign result;
supported workflows states what a receipt must contain
and how its state maps to a result.
Command-line options#
run_kpi.bat, run_kpi.sh and scripts/kpi_ci.py accept the same options. The driver
requires --inputs, --dist, --output, --platform and --profile, and the launchers fill
them. The Mode column shows which mode reads an option. Both modes parse every option, so a
malformed value fails either mode: --baseline-campaigns 2 fails a check run too.
Option |
Default |
Mode |
Meaning |
|---|---|---|---|
|
Launcher default |
Both |
Portable Release input bundle with its Python runtime |
|
Launcher default |
Both |
Directory with the validated SDK archive and wheel |
|
|
Both |
Backend of the inputs |
|
Launcher default |
Both |
Platform of the inputs; must match the wheel |
|
|
Check |
Sampling profile; a collection always uses |
|
|
Both |
Compare with the budgets, or collect a new baseline |
|
Launcher default |
Both |
Output container; see outputs |
|
|
Both |
Fresh directory for the public record, or for the collection output |
|
|
Check |
Fresh directory for calibration evidence |
|
|
Check |
|
|
|
Check |
A catalog directory or one |
|
|
Collection |
Campaigns per CPU model; an integer of at least 3 |
|
|
Collection |
Allowance for the whole collection, in seconds; must exceed 330; see deadline |
|
|
Collection |
JSON file of CPU models the collection must cover; see required CPU models |
|
|
Both |
|
|
|
Both |
|
|
|
Both |
Runner label of the cohort |
|
|
Both |
Storage label of the cohort |
|
Print the version or the help, then exit 0 |
Rules for the values:
Relative paths resolve against the current directory.
--budgetsis the exception: it resolves againstovclash/. In--budgetsandPARENT_OVCLASH_KPI_BUDGETS, the literal texts{backend}and{platform}are replaced by the selected backend and platform.A
--budgetspath that names a removed.kpi-budget.zippackage is an input failure (exit 4). A missing path, or a file that is not a.kpi-budget.jsonpackage, supplies no budgets: such a file is never read, and the check stops with exit 3 before fixture generation. Check against a local package gives the outcome of each--budgetsvalue.The driver accepts abbreviated option names, for example
--collection-sec 3600. The launchers recognize--inputs,--dist,--outputand--backendonly when spelled in full, so abbreviate none of these four.strictadmission with the four-core domain is rejected with exit 4. A collection also rejectsstrictadmission and theinheriteddomain. Admission policy and CPU domain gives the defaults of each entry point.A collection accepts only labels of the closed calibration vocabulary. Check mode accepts any label, but calibration export then fails. See runner and storage labels.
The public and calibration directories must not exist yet. Choose a new
--outputfor every run; see outputs.
Options that the launcher does not interpret go to the driver unchanged. The launcher never chooses or approves budgets.
Environment variables#
No variable is required. An unset or empty variable leaves the default in place, except for the
OVCLASH_CI_* variables described after the table.
Variable |
Values |
Required |
Default |
Read by |
Effect |
|---|---|---|---|---|---|
|
|
No |
|
Launchers |
Default backend |
|
A catalog directory or one |
No |
|
Driver, check mode |
Default |
|
|
No |
|
Driver |
Default admission policy. An invalid value is rejected with exit 4. The driver reads no other name |
|
Inline JSON text in the required CPU models format, not a path |
No |
Observed CPU models only |
Driver, collection |
Required CPU models |
|
A runner class; a collection accepts only the calibration vocabulary |
No |
|
Driver |
Default runner label |
|
A storage class; a collection accepts only the calibration vocabulary |
No |
|
Driver |
Default storage label |
|
See declare the job |
No |
Unset: no declared job; a provider adapter may detect one |
Startup check, driver, collector, producer build |
Declare a CI job and set its fields |
|
|
No |
Unset; the Windows launcher sets |
Windows launcher, producer build |
The build records the ref protection in the validation receipt; see automatic preparation |
|
|
No |
Unset |
Automatic preparation build |
Extra and excluded validation steps. The launcher appends |
|
|
No |
|
Startup check, automatic preparation build |
On Windows, |
|
Path of a CMake executable |
No |
The bundled CMake, then |
Startup check |
The CMake that computes the content snapshot when the source identity cannot use Git |
|
|
No |
Unset: color on an interactive terminal |
Console |
Turn color off; see console colors |
OVCLASH_KPI_LAUNCHER_DEFAULTS is set by the launchers; do not set it yourself. An explicit
option always wins over a variable, and an empty variable means “use the default”. The
OVCLASH_CI_* variables are the exception: each takes effect once it is set, even to an empty
value. A set OVCLASH_CI_JOB_ID or OVCLASH_CI_PROVIDER declares a CI job, an empty
OVCLASH_CI_PROVIDER is rejected, and an empty field variable replaces that field. Unset them,
rather than clearing them, when you want local defaults or provider detection. The driver
reads the budgets and the admission policy only under their PARENT_ names, so a CI job sets
those names like any other variable.
Examples#
Use the same arguments with run_kpi.bat on Windows.
Goal |
Command |
|---|---|
Smoke check with the defaults |
|
Release check into a new output |
|
Release check of OpenUSD |
|
Check against one package |
|
Check against a catalog per lane |
|
Collection |
|
Collection that must cover listed CPU models |
|
Strict admission, a diagnostic that stops with exit 3 because the |
|
Check against a local package explains what a package check proves. Collect a baseline explains the collection.
Startup console output#
Settings block#
Before it validates, prepares or measures anything, the driver prints a
KPI settings by source: block. Rows are grouped by source in this order. Empty groups are
left out.
Group |
Rows |
|---|---|
|
Values you passed. The detail column names the full option, even when you abbreviated it |
|
Launcher defaults that you did not override |
|
Values read from a variable, which the detail column names. A launcher backend taken from |
|
Values the driver chose itself |
|
Values that no option selects. In a collection, |
Columns align across the whole block. The label column fits the longest label, and the detail column fits the longest detail up to 40 characters; a longer detail overflows its column. Excerpts on other pages therefore align differently.
This is the block of a Windows collection started with
run_kpi.bat --mode collect-baseline --baseline-campaigns 3 --backend ovstage --collection-seconds 13800 --output _build/kpi-baseline-01:
KPI settings by source:
Arguments:
Mode --mode | collect-baseline
Backend --backend | ovstage
Output --output | ovclash/_build/kpi-baseline-01
Baseline campaigns --baseline-campaigns | 3
Collection allowance --collection-seconds | 13800 seconds for the whole collection
Launcher defaults:
Platform | windows
Inputs | ovclash/_build/portable-inputs/ovstage/Release
Distribution | ovclash/_build/dist/ovstage
Defaults:
Public output | ovclash/_build/kpi-baseline-01/public
Required CPU models | observed CPU models only
Admission policy | shared-runner-recorded-contention-v2
CPU domain | four-physical-cores-retry-v2
Runner class | local-review
Storage class | unclassified-local-disk
Fixed:
Profile by collect-baseline | release
Configuration | Release
Workloads | all 9 representative workloads
Runs per workload | 1 warm-up + 3 to 9 measured, until stable
CPU retries | 10 per run
Workload restarts | 10 per workload and campaign
Noise limits | Load 25%; all other metrics 15%
CPU wait allowance | 180 seconds per campaign
This is the block of a smoke check on Linux, started with
OVCLASH_KPI_BACKEND=openusd bash ./run_kpi.sh --budgets '_build/catalogs/{backend}/{platform}':
KPI settings by source:
Arguments:
Baselines --budgets | ovclash/_build/catalogs/openusd/linux
Launcher defaults:
Profile | smoke
Platform | linux
Inputs | ovclash/_build/portable-inputs/openusd/Release
Distribution | ovclash/_build/dist/openusd
Output | ovclash/_build/kpi-openusd
Environment:
Backend OVCLASH_KPI_BACKEND | openusd
Defaults:
Mode | check
Public output | ovclash/_build/kpi-openusd/public
Calibration output | ovclash/_build/kpi-openusd/calibration
Admission policy | shared-runner-recorded-contention-v2
CPU domain | four-physical-cores-retry-v2
Runner class | local-review
Storage class | unclassified-local-disk
Fixed:
Configuration | Release
Workloads | all 9 representative workloads
Runs per workload | 1; may expand to 3 when approved limits apply
Noise limits | not applied to the smoke profile
CPU wait allowance | 180 seconds per campaign
Campaign deadline | none; each operation keeps its own deadline
The quick start shows the block of a Release check. The rows depend on the mode and the profile:
Rows |
When shown |
|---|---|
|
Always. |
|
Always |
|
Check mode |
|
Collection |
|
Always. The values differ for |
|
The |
|
Always |
|
The |
KPI sampling explains the run, retry, restart and noise values.
python -m benchmarks.kpi run prints a block of its own; see run a campaign.
Paths are shown without host details:
A path inside the checkout is shown relative to the repository root, for example
ovclash/_build/kpi.A path outside the checkout reads
outside checkout.Any printable path inside the checkout is shown as it is, including
!,%and non-ASCII letters. A path with a control character such as a tab, newline or escape readslocation omitted: unprintable characters, and one longer than 512 characters readslocation omitted: longer than 512 characters.
Required CPU models shows <N> CPU models, or observed CPU models only when no model is
required. It reads given; only the collection reads it when --required-models is not a
regular file, such as a pipe; the block never reads such a file. It reads
invalid; collection rejects it when the list cannot be read or is invalid.
The block is display only:
An invalid option combination, such as
strictadmission with the four-core domain, still prints the block before its rejection line. An invalidPARENT_OVCLASH_KPI_ADMISSION_POLICYshows its value and, unless--cpu-domainnames one,CPU domain | unresolved.Arguments that do not parse print no block, only the rejection line; see troubleshooting.
The block never enters
progress.log, public records, reports or JSON. A failure to print it never changes the run.
Mode and lookup lines#
Mode lines follow the block. Check mode prints:
KPI MODE: VALIDATION (--mode check)
Platform: linux | Backend: ovstage | Profile: release
Require compatible baseline coverage before fixture generation; then measure and compare.
ovclash <version> - KPI Release consumer measurements:
KPI measures validated Release consumer performance for nine frozen Body/Cockpit workloads. Sentinel remains the correctness gate.
A collection prints these lines, and they also start its progress.log:
KPI MODE: MEASUREMENT / baseline collection (--mode collect-baseline)
Platform: windows | 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.
After Release preparation, check mode prints the baseline lookup: its source, the catalog, the
observed CPU models and the coverage decision. The source is CLI --budgets,
environment PARENT_OVCLASH_KPI_BUDGETS or default. The catalog follows the path rules of
the settings block. With a package that covers the observed CPU model, the lines read (CPU
values are illustrative):
Baseline lookup | Backend: ovstage | Platform: linux
Baseline source: CLI --budgets | Catalog: ovclash/_build/kpi-baseline-01/public/baseline/baselines/ovstage/linux
CPU model: name=Example Core 42, vendor=GenuineIntel, family=6, model=42, stepping=1 | id 33405c7bf70eb576432b1ed27db64309e5d6e1941762af7b65b0d1b6dac9330a | architecture x86_64 | core class linux-topology-core-type 0 | SMT width 2
Selected CPU model: 33405c7bf70eb576432b1ed27db64309e5d6e1941762af7b65b0d1b6dac9330a
Baseline entries read: 1 packages / 47 metric limits | Required cells per CPU model: 47
Baseline lookup: coverage found; performance comparison is pending
The quick start shows the lines for a CPU model that no package
covers, with one Missing: line per uncovered cell. Every outcome other than coverage found
ends with
KPI WARNING: exit 3 (insufficient evidence); no fixture generation and no measurements executed.
Decision line |
Cause |
|---|---|
|
Every required cell of one observed CPU model is covered. The run continues |
|
The default catalog directory is missing, or the selected path supplies no budgets |
|
Follows |
|
Follows |
|
The catalog or package holds no budgets. For a catalog with no packages, the |
|
Budgets exist but do not cover this CPU model, cohort or workload digest |
|
No pool of four usable physical cores of one class, or the |
|
The run can end with process exit 76; see exit 76 |
Console progress describes the lines that follow, from the
Campaign context block to the per-attempt tables.
Console colors#
An interactive terminal shows the build’s palette: violet headings, bright green passes and
bright red failures. The Linux launcher colors its own help headings, banner and PASS and
failure lines too; the Windows launcher’s own lines stay plain. Redirected output, CI logs,
progress.log, reports and JSON stay plain. A nonempty NO_COLOR, TERM=dumb, or a Windows
console without escape-sequence support turns color off.
A passing check and a complete collection end with a fixed success sentence. The final summary and the collection progress log give the sentences and when they print.
Run KPI in another CI system#
A CI job runs KPI with the same launchers, options and driver as a local run. Only the CI
context changes what the driver does. KPI reads that context only through
tooling/ci_context.py, and no KPI module holds a server, project, job or revision constant.
The producer build reads its part of the same context, the source revision, the ref name and
the ref protection, through tooling/ci_context.cmake. The context itself is never written to a file; only
validated IDs reach exported evidence. CI context describes
how both sides build it.
Declare the job#
tooling/ci_providers/ holds one built-in provider adapter, which reads GitLab’s predefined
CI_* variables. Any other CI system declares its job with provider-neutral variables. A
declared job never reads provider variables, so set every field that you need.
Before you begin, the job must have staged its own portable input bundle and its dist
directory, as in prepare inputs explicitly, from committed source.
Replace <bundle-directory> and <dist-directory> as for
caller-managed inputs. Run from ovclash/.
Linux:
export OVCLASH_CI_PROVIDER=example-ci
export OVCLASH_CI_JOB_ID=1234
bash ./run_kpi.sh --inputs <bundle-directory> --dist <dist-directory> --profile release \
--summary-mode deferred --output _build/kpi-ci-1234
<bundle-directory>/python-runtime/bin/python3 -I -B scripts/kpi_ci.py --after-script \
--public-output "$PWD/_build/kpi-ci-1234/public"
Windows (cmd.exe):
set "OVCLASH_CI_PROVIDER=example-ci"
set "OVCLASH_CI_JOB_ID=1234"
run_kpi.bat --inputs <bundle-directory> --dist <dist-directory> --profile release ^
--summary-mode deferred --output _build/kpi-ci-1234
<bundle-directory>\python-runtime\python.exe -I -B scripts/kpi_ci.py --after-script ^
--public-output "%CD%\_build\kpi-ci-1234\public"
The explicit --inputs and --dist keep the inputs
caller-managed, so the job measures the inputs that its build staged.
The first command exits with the run’s verdict: 0 for a pass,
exit 75 or 0 for the CI CPU-contention
warning, and the codes of reports and verdicts
otherwise. The second command prints the final summary and always exits 0; for a passing run it
ends with the check success sentence; see
print the summary in a later step.
Variable |
Context field |
Effect |
|---|---|---|
|
None |
Declares a CI job. The value is 1 to 63 lowercase letters, digits and hyphens that start with a letter. Without it, |
|
|
Declares a CI job, even when empty. Binds the public record as |
|
|
A collection records them with the job ID and the lane under |
|
|
The job timeout in seconds and the job start, an ISO 8601 time with a UTC offset. They clamp a collection’s deadline; see deadline. Check mode ignores them |
|
None; the producer build reads it |
|
|
None; the producer build reads it |
The branch of the PEP 440 local version of the wheel and the SDK archive. In a declared job without it, the build reads the branch from Git |
A CI job, declared with these variables or detected by a provider adapter, changes these settings:
Setting |
In a CI job |
|---|---|
Runner class |
|
Storage class |
|
Publication context |
|
CPU-contention warning |
Check mode exits 75 on Linux and AArch64 and 0 on Windows; see the CI CPU-contention warning |
Source |
Committed source only; see source identity |
Windows parent Job |
The driver stays in it; see supervisor Job |
A package covers only checks that record its labels. Collect the baselines of a CI machine under the labels that its checks record; see runner and storage labels.
Keep these rules:
OVCLASH_CI_JOB_IDmust be a positive integer. In a CI job without a valid job ID, check mode stops with exit 4 andKPI harness failure; private exception text withheld., and a collection stops with exit 4 before its first campaign.For a collection, set both
OVCLASH_CI_JOB_TIMEOUTandOVCLASH_CI_JOB_STARTED_AT, or neither. One without the other, or a value that does not parse, is rejected with exit 4 before preparation.Set
OVCLASH_CI_PROJECT_ID,OVCLASH_CI_PIPELINE_IDandOVCLASH_CI_SOURCE_REVISIONto record the collection’s provenance inseries.json.
Print the summary in a later step#
With --summary-mode deferred, the driver finalizes the public record measurements.json and
verifies cleanup, but prints no final summary. Print it from a later step of the job, one that
also runs after a failure, a timeout or a cancellation of the measuring step. Run
scripts/kpi_ci.py --after-script --public-output <public-output> with the input bundle’s
Python (python-runtime\python.exe on Windows) and -I -B, as the second command in
declare the job does.
The after-script follows these rules:
It reads only the public record. The public directory must hold exactly
measurements.json.It prints the final summary only for a record of the current context: the current job ID in a CI job,
{"kind": "local"}otherwise. A verified pass ends with the check success sentence.When the record is missing, invalid or from another job, or the CI job ID is invalid, it prints only
KPI public snapshot unavailable; original verdict unchanged.It always exits 0 and never changes the job result.
A collection ignores
--summary-mode. Itsprogress.logandstatus.jsonare the record, so it needs no after-script.
Deadlines and frozen inputs#
Check mode has no campaign deadline, so only the job timeout of the CI system bounds a check run; see deadlines. A timeout fails the run like any other failure; only the supported CPU-contention case becomes the CI warning.
CI never writes the frozen contract files
benchmarks/kpi/representative_*.jsonor the budget catalog. A job reads them from its checkout, and they grant it no calibration or approval authority. See frozen workloads and profiles and catalog rules.Ref protection reaches KPI only through the producer’s validation receipt, never through the Python context. Set
OVCLASH_CI_REF_PROTECTEDfor the producer build; see supported workflows.
Run the controller without the launchers#
The launchers wrap the controller python -m benchmarks.kpi. Run its steps yourself to keep
the complete private execution tree, to measure selected workloads or to see a failure’s
message. Use the matching validated Release SDK archive, wheel, installed SDK, interpreter and
validation receipt of one backend.
Subcommand |
Purpose |
|---|---|
|
Record an SDK archive, wheel, installed SDK and interpreter in a build manifest |
|
Run one campaign against a build manifest and a representative run manifest |
|
Render an existing |
|
Create a package from calibration evidence; see offline budget recording |
|
Replay and review a generated series; see review and install |
The commands in this section use the staged ovstage inputs. Each has a Linux form and a
Windows (cmd.exe) form.
Prepare a build manifest#
Before you begin: stage the Release inputs as in
prepare inputs explicitly, and set $PY as in the
quick start.
Linux:
IN=_build/portable-inputs/ovstage/Release
"$PY" -B -m benchmarks.kpi prepare \
--sdk _build/dist/ovstage/<sdk-archive> \
--wheel _build/dist/ovstage/<wheel-file> \
--install-root "$IN/install" \
--python "$IN/python-runtime/bin/python3" \
--helper-bundle "$IN/manifest.json" \
--binding-root _build/kpi-local/bindings \
--output _build/kpi-local/build.json
Windows (cmd.exe):
set "IN=_build\portable-inputs\ovstage\Release"
"%PY%" -B -m benchmarks.kpi prepare ^
--sdk _build\dist\ovstage\<sdk-archive> ^
--wheel _build\dist\ovstage\<wheel-file> ^
--install-root "%IN%\install" ^
--python "%IN%\python-runtime\python.exe" ^
--helper-bundle "%IN%\manifest.json" ^
--binding-root _build\kpi-local\bindings ^
--output _build\kpi-local\build.json
Replace <sdk-archive> and <wheel-file> with the file names of the SDK archive and the wheel
in _build/dist/ovstage. On success, prepare prints the manifest path as you gave it:
Build manifest: _build/kpi-local/build.json
Option |
Type |
Required |
Default |
Meaning |
|---|---|---|---|---|
|
Path |
Yes |
None |
The SDK archive and wheel from |
|
Path |
Yes |
None |
The installed Release SDK. Its provenance must name the selected backend and a Release build |
|
Path |
Yes |
None |
The interpreter of every measured child process. A child refuses to run under any other |
|
Path |
Yes |
None |
Directory of the extracted wheel. |
|
Path |
No |
None |
A staged bundle’s |
|
|
No |
|
The backend of the installed SDK |
|
Path |
Yes |
None |
The new build manifest. An existing file stops |
prepare records every file by SHA-256. It does not check the validation receipt; run does.
Generate the bundles#
representative_workloads.prepare_manifest generates the three pinned fixture bundles and
writes the representative run manifest. Run it with $PY: the pins hold only for the packaged
CPython 3.12; see generate and retain stages.
Before you begin, prepare a build manifest. On Linux, run the
heredoc as shown. On Windows, cmd.exe has no heredoc: save the Python lines between <<'EOF'
and EOF as a file in ovclash/, such as kpi_prepare_manifest.py, and run
"%PY%" -B kpi_prepare_manifest.py.
"$PY" -B - <<'EOF'
from pathlib import Path
from benchmarks.kpi.representative_workloads import prepare_manifest
manifest = prepare_manifest(
Path("_build/kpi-local/representative"),
build_path=Path("_build/kpi-local/build.json"),
)
print(manifest)
EOF
The destination must not exist, but its parent must. The snippet prints the absolute path of
representative-workloads.json in the destination. It requires a build of verified Release
source, and every generated bundle must match its pin. Preparation
lists the errors that it raises otherwise.
Run a campaign#
Before you begin, you need the build manifest of
prepare a build manifest, the representative run manifest of
generate the bundles, and the passing validation_receipt.json of the
same build in its compile tree; see supported workflows.
Linux:
"$PY" -B -m benchmarks.kpi run \
--build _build/kpi-local/build.json \
--workloads _build/kpi-local/representative/representative-workloads.json \
--validation-receipt _build/compile/ovstage/ninja/validation_receipt.json \
--profile release \
--output _build/kpi-local/results \
--cpu-domain four-physical-cores-retry-v2 \
--admission-policy shared-runner-recorded-contention-v2 \
--runner-class local-review \
--storage-class local-ssd
Windows (cmd.exe), where the compile tree is vs:
"%PY%" -B -m benchmarks.kpi run ^
--build _build\kpi-local\build.json ^
--workloads _build\kpi-local\representative\representative-workloads.json ^
--validation-receipt _build\compile\ovstage\vs\validation_receipt.json ^
--profile release ^
--output _build\kpi-local\results ^
--cpu-domain four-physical-cores-retry-v2 ^
--admission-policy shared-runner-recorded-contention-v2 ^
--runner-class local-review ^
--storage-class local-ssd
Option |
Default |
Meaning |
|---|---|---|
|
Required |
Build manifest from |
|
Required |
The representative run manifest from |
|
Required |
New results directory; an existing path is refused |
|
All nine |
Measure only this workload; repeat the option for more. Each ID must be unique and in the profile |
|
|
Sampling profile; |
|
|
Compare with the budgets, or qualify a fresh Release campaign without reading budgets |
|
|
|
|
|
|
|
None |
Restrict the campaign to one observed CPU pool; needs the four-core domain |
|
None |
A catalog directory or one |
|
None |
The validation receipt of the same build. Without it, the campaign reports insufficient evidence |
|
|
Runner label of the cohort |
|
|
Storage label of the cohort |
|
A new random ID |
Campaign session ID |
|
|
Campaign deadline in seconds; must exceed the 300-second cleanup reserve |
|
No campaign deadline; each operation keeps its own bound |
The defaults of run differ from the launchers:
rundefaults tostrictadmission on theinheriteddomain. Pass the four-core domain and the recorded-contention policy, as the run a campaign command does, to collect evidence that is comparable with launcher runs; see admission policy and CPU domain.Calibration export accepts only the closed runner and storage vocabulary. The default runner label
unclassified-localtherefore never produces exportable evidence.runhas a campaign deadline by default; the launchers’ check runs have none.runhas no coverage check. Without budgets, it still measures and reports each uncovered workload and metric as insufficient evidence.
run prints only its own settings block and one result line. It shows paths as you gave them:
KPI settings by source:
Arguments:
Profile --profile | release
Build manifest --build | _build/kpi-local/build.json
Workload manifest --workloads | _build/kpi-local/representative/representative-workloads.json
Output --output | _build/kpi-local/results
Validation receipt --validation-receipt | _build/compile/ovstage/ninja/validation_receipt.json
Admission policy --admission-policy | shared-runner-recorded-contention-v2
CPU domain --cpu-domain | four-physical-cores-retry-v2
Runner class --runner-class | local-review
Storage class --storage-class | local-ssd
Defaults:
Mode | check
Workloads | all in the workload manifest
Baselines | none
Required CPU pool | none
Campaign deadline | 3300 seconds (300-second cleanup reserve)
Fixed:
Runs per workload | 1 warm-up + 3 to 9 measured, until stable
CPU retries | 10 per run
Noise limits | Load 25%; all other metrics 15%
CPU wait allowance | 180 seconds per campaign
KPI insufficient-evidence (exit 3): <absolute output>/report.md
The result line has the form KPI <status> (exit <code>): <output>/report.md, where
<output> is the absolute --output path. <status> and <code> take these values:
|
|
Meaning |
|---|---|---|
|
0 |
Every required condition qualified and passed |
|
1 |
A product or work-contract failure |
|
2 |
A confirmed regression |
|
3 |
The evidence cannot decide |
|
4 |
A harness or input failure |
|
130 |
Cancellation |
Reports and verdicts defines each verdict. A topology
with fewer than four usable physical cores prints
KPI insufficient physical cores (process exit 76; benchmark exit 3): <output>/report.md
instead. A failure prints KPI <status>: <reason> on standard error. run keeps the whole
private execution tree in --output; see
reading the evidence directory.
run --mode collect-baseline --profile release with a campaign deadline grants
workload restarts, like the
campaigns of a collection. Its settings block then adds the Workload restarts row.
--no-campaign-deadline turns restarts off.
Render a report again#
Before you begin, you need the summary.json of a direct run, such as the
_build/kpi-local/results directory of run a campaign, and an --output
directory that does not exist yet.
Linux:
"$PY" -B -m benchmarks.kpi report \
--input _build/kpi-local/results/summary.json \
--output _build/kpi-local/report-02
Windows (cmd.exe):
"%PY%" -B -m benchmarks.kpi report ^
--input _build\kpi-local\results\summary.json ^
--output _build\kpi-local\report-02
Report: _build/kpi-local/report-02/report.md
report writes summary.json, metrics.csv and report.md into a new directory without
measuring. Use it on the results of a direct run. The launchers delete their private
results/ directory after a verified drain, so a launcher run leaves no summary.json to
render.
Observer overhead diagnostics#
python -m benchmarks.kpi.observer_study measures what the in-process operation
observer costs. It runs local pairs of the same workload with the observer on
and off. It is a local diagnostic and never a budget source.
Before you begin, create _build/kpi-local/build.json with
prepare a build manifest and the representative run manifest with
generate the bundles.
Linux:
"$PY" -B -m benchmarks.kpi.observer_study \
--build _build/kpi-local/build.json \
--workloads _build/kpi-local/representative/representative-workloads.json \
--profile body-representative \
--output _build/kpi-local/observer-body \
--pairs 4 \
--runner-class local-review \
--storage-class local-ssd
Windows (cmd.exe):
"%PY%" -B -m benchmarks.kpi.observer_study ^
--build _build\kpi-local\build.json ^
--workloads _build\kpi-local\representative\representative-workloads.json ^
--profile body-representative ^
--output _build\kpi-local\observer-body ^
--pairs 4 ^
--runner-class local-review ^
--storage-class local-ssd
Observer study: completed; diagnostic only; _build/kpi-local/observer-body/summary.json
Option |
Default |
Meaning |
|---|---|---|
|
Required |
Build manifest and representative run manifest, as for |
|
Required |
New output directory |
|
One is required |
Every workload of one benchmark profile (five for |
|
|
Observer-on and observer-off pairs per workload, 1 to 32 |
|
|
Watchdog per arm, at most 3,600 seconds. The workload’s own 900-second deadline also caps it |
|
|
Study deadline; above the 300-second cleanup reserve and at most 39,600 seconds |
|
|
|
|
|
Cohort labels |
|
The study ID |
Session label of the cohort |
How the study runs:
It uses
shared-runner-recorded-contention-v2admission for every arm.Each pair runs both arms in fresh supervised processes. The order alternates between the pairs of a workload: the first pair runs on then off, the next off then on.
The off arm leaves out only the operation monitor. Admission, input identity and result replay stay.
An arm starts only while the study time left covers its watchdog, the 120-second admission wait and the 300-second cleanup reserve. Otherwise the study stops. Four pairs of five workloads are 40 arms, so select fewer workloads for a shorter study.
The first failed, busy or incomplete arm stops the study.
The output directory holds summary.json, clock-steps.json, prepared-workloads.json,
fixtures/ and one attempt-NNNN/ directory per arm. The summary records
diagnostic_only=true, qualified=false and calibration_ready=false. It supplies no
observation for a package, and KPI applies no overhead correction.
Exit |
Meaning |
|---|---|
0 |
Every pair was collected and replayed |
4 |
Invalid input or a harness failure |
130 |
Interrupted |
Any other |
The code of the arm that stopped the study |
Troubleshooting#
The launchers forward the driver’s standard error. Interpreter startup, import and loader failures can therefore appear before the driver establishes its filtered console. Those messages can include paths and are not sanitized by the campaign’s output filter.
During a campaign, the driver still suppresses raw Python and native console output and prints fixed progress, failure categories and verdicts. Use the exit code, the final summary and the public files. To retain the full execution record when investigating a failed step, run it directly with the controller, which prints the reason on standard error.
Launcher and startup check lines#
Console line |
Exit |
Cause and remedy |
|---|---|---|
|
1 |
The launcher cannot read |
|
4 |
|
|
4 |
Fix |
|
4 |
|
|
4 |
With the default inputs, the startup check parses the options first and they do not parse; check them with |
|
4 |
A Git command failed in the checkout, for example on unmerged paths; the index file that Git names is missing; or the build tree’s |
|
4 |
Commit or stash local changes before a collection; see source identity |
|
4 |
A CI job saw uncommitted changes, such as generated files that are not ignored; see source identity |
|
N |
The automatic build failed; read the build output that precedes this line |
|
4 |
Linux: the build passed but staged no input Python |
|
4 |
The rebuilt inputs still do not match the source |
|
4 |
The selected |
Driver lines#
Console line |
Exit |
Cause and remedy |
|---|---|---|
|
4 |
An option did not parse (with the default inputs, the startup check reports this first), |
|
4 |
The collection settings were rejected; see collect a baseline |
|
4 |
Choose a new |
|
4 |
A check run found the public or calibration output of an earlier run. The line names |
|
4 |
An unexpected driver failure, or a CI job without a valid job ID |
|
4 |
Windows only, without long path support: the system temporary directory is too long even for the private execution tree, so no phase started. Python takes that directory from |
|
4 |
The driver failed outside its campaign handling, for example while it set up its console |
|
Run continues; every attempt is rejected (exit 3) |
Start the terminal outside that Job, for example from the Start menu; see supervisor Job |
|
Run continues; every attempt is rejected (exit 3) |
An enclosing Job forbids breakaway; start the terminal outside that Job; see supervisor Job |
|
Run continues in that Job |
Windows put the relaunched driver back into the same Job, such as a session Job that holds every desktop process (0x1800). Nothing to do; see supervisor Job |
|
Run continues; every attempt is rejected (exit 3) |
That Job also sets a limit that admission does not accept; start the terminal outside that Job; see supervisor Job |
|
3 |
The driver ran inside a parent Windows Job that CPU admission does not accept; see supervisor Job |
|
N |
A phase failed; failed phase reasons lists the reasons |
|
3 |
No compatible package covers this CPU model; see mode and lookup lines. Collect a baseline and install its packages |
|
76 |
Fewer than four usable physical cores; see exit 76 |
|
4 |
A child process could not be confirmed gone; the private execution tree is kept |
|
Unchanged; 76 becomes 4 |
The private execution tree could not be removed; no success sentence follows |
|
Unchanged |
The |
|
Unchanged; 76 becomes 4 |
The public record could not be written |
|
Unchanged; the after-script exits 0 |
The summary reader found no valid record of this job; see print the summary in a later step |
|
130 |
Cancellation |
Failed phase reasons#
A failed phase prints one line in the format that console progress shows. Its fixed reasons:
Reason |
Exit |
Cause and remedy |
|---|---|---|
|
4 |
Preparation found no SDK archive in |
|
4 |
A required input is missing, such as the wheel in |
|
4 |
Windows only: the private execution tree is in the system temporary directory, and a path there exceeds the native |
|
4 |
Preparation: an artifact, receipt, platform or source does not match. Examples are two SDK archives or wheels, no matching receipt, a matching receipt that did not pass, two passing receipts, the wrong |
|
4 |
An input or output cannot be read or written |
|
4 |
A file that the phase creates already exists |
|
130 |
Cancellation during the phase |
|
4 |
Any other harness failure |
For CPU admission problems, see KPI CPU admission. For a collection,
read status.json and the Failed phase: lines described in
collection status and exit codes.