KPI CPU admission#
KPI runs on shared machines. Before an attempt measures anything, the controller places it on CPUs and checks that those CPUs are quiet. This page is the reference for that step: admission policies and CPU domains, four-core placement, the load checks, CPU recovery, the shared CPU-wait allowance, campaign deadlines, the cohort, the Windows CPU accounting model and the supervisor Job. A Job, or Job object, is the Windows kernel object that groups processes and applies limits, such as CPU affinity, to all of them.
Related pages:
KPI maintainer guide: the overall flow and the glossary.
KPI sampling: runs per workload, the Release stop lines and workload restarts.
KPI evidence, reports and verdicts: the console tables, exit codes and the CI CPU-contention warning.
Run KPI: the option and the variable that select the admission policy, in CI as locally.
benchmarks/kpi/environment.py defines the load policies, and benchmarks/kpi/admission_guard.py
owns a campaign’s placement, recovery and shared CPU-wait allowance. The
source map lists every admission module.
Rules at a glance#
Rule |
Value |
|---|---|
Default admission policy |
|
Default CPU domain |
|
Load window |
1 second, sampled once per second |
Busy limit |
25% for the aggregate of the four selected CPUs, and 25% for each selected CPU and each online SMT sibling: a logical CPU of the same physical core under simultaneous multithreading (SMT). It is not the 25% Load noise limit of the noise gate |
Linux steal |
Must be readable and zero. Steal time is time that a hypervisor gave to other virtual machines while this one’s CPU was ready to run; Linux counts it in |
Longest wait of one check |
120 seconds |
Shared CPU-wait allowance |
180 seconds of extra waiting per four-core campaign |
CPU retries (four-core domain) |
|
In-operation sampling |
Every 100 ms (memory, and CPU counters on Linux); Windows CPU frames at least 1 second apart |
Operation watchdog |
900 seconds per workload |
Cleanup reserve |
300 seconds before a campaign deadline |
Admission policy and CPU domain#
Two options control this step:
The admission policy (
--admission-policy) defines when CPUs count as quiet and what the evidence records.The CPU domain (
--cpu-domain) defines which CPUs an attempt runs on.
Admission policy |
Meaning |
|---|---|
|
Recorded contention. A quiet 1-second window gates each attempt. Load during the operation is recorded, not judged |
|
A quiet 10-second window gates each attempt, and the operation must prove low external load. Diagnostic only; see Strict admission |
CPU domain |
Meaning |
|---|---|
|
The controller selects four physical cores and pins the child to one logical CPU on each. A busy check is retried on a new selection |
|
The child keeps the placement it inherits. A busy pre-run check stops the campaign |
Each entry point resolves the defaults differently:
Entry point |
Default policy |
Default domain |
Rejected combinations |
|---|---|---|---|
|
|
|
|
|
Same as the launchers and the driver |
|
Any policy other than recorded contention, or any domain other than the four-core domain: prints |
|
|
|
|
Run the controller without the launchers lists the other defaults of the direct run.
Requirement. CPU-model budgets and calibration evidence need the four-core domain with
recorded-contention admission. A check run with inherited placement observes no CPU model. It
therefore has no budget coverage and stops with exit 3 before fixture generation. Use strict
and inherited for diagnostics only.
The startup settings block shows the resolved pair. Under
--admission-policy strict its rows read:
KPI settings by source:
Arguments:
...
Admission policy --admission-policy | strict
Defaults:
...
CPU domain | inherited
In the four-core domain the block shows CPU domain | four-physical-cores-retry-v2 and adds the
fixed row CPU wait allowance | 180 seconds per campaign.
A strict diagnostic run, from ovclash/; it stops with exit 3 because it has no budget
coverage.
Linux:
bash ./run_kpi.sh --admission-policy strict --output _build/kpi-strict-example
Windows:
run_kpi.bat --admission-policy strict --output _build\kpi-strict-example
With the default inputs, the launcher may first run its
automatic preparation. A failed preparation build prints
FAILED: KPI Release preparation (exit N); no workload executed., where N is the build’s exit
code; the launcher’s other startup failures are listed in
troubleshooting.
How an attempt is admitted#
In the four-core domain, each attempt goes through these steps:
Placement. The controller reads the CPU topology and samples every online CPU once per second. It selects four physical cores that are quiet in one complete 1-second window (see Placement). The wait is at most 120 seconds, and shorter when the shared CPU-wait allowance or the deadline leaves less. Each receipt goes to
cpu-selections/000.json,001.json, … in the private execution tree. Later attempts reuse a selected placement until an attempt is rejected for a CPU reason.Pinning. The child process pins itself to the four selected CPUs before it loads ovclash. It then checks that the live topology and affinity still match the selection.
Child admission. After runtime initialization, the child checks the four selected CPUs and their online SMT siblings in its own 1-second windows, under the same wait limit. A quiet window admits the attempt. The first complete busy window rejects it at once, normally just over one second after the check starts, so the controller can select again.
Operation. The workload runs. The child samples memory every 100 ms and records the actual cadence. On Linux the CPU counters share that stream; Windows reads CPU frames separately (see Windows saturation limitation). The CPU load during the operation is recorded. It never rejects or retries the attempt.
Verification. The controller replays the admission and operation evidence from the raw samples, checks the campaign cohort, and keeps a public load summary.
Unsupported or malformed admission evidence prevents execution. The admission status is then
unsupported, not busy.
With inherited placement there is no placement step. Under recorded contention, the child
checks all CPUs of its inherited affinity and keeps waiting, up to 120 seconds, until one window
is quiet. If the wait ends busy, the campaign stops. Strict admission
describes the strict flow.
CPU placement and recovery#
Placement#
Placement selects four CPUs for the four-core domain:
Pool. A pool is the set of allowed physical cores with the same CPU model, core class, package, NUMA node (non-uniform memory access node, a set of cores with its local memory) and SMT width. The core class is the core type that the operating system reports for each CPU, the Linux topology core type or the Windows efficiency class, which tells apart the core kinds of a hybrid CPU. Placement never mixes pools. A core class that the operating system does not expose stays unknown: identical model text does not prove one microarchitecture.
Candidates. In each 1-second window, a CPU is eligible when its busy fraction is at most 25%. A physical core is a candidate only when all its online SMT siblings are eligible.
Choice. In each pool with at least four candidates, placement takes the four least busy cores, one logical CPU on each. It keeps the pool whose four CPUs have the lowest total load, and accepts them when their aggregate busy fraction is at most 25%. Otherwise it samples the next window.
Capacity. The affinity must hold at least four physical cores, and a known CPU capacity or cgroup quota (the CPU limit of a Linux control group) must be at least 4. With fewer than four usable physical cores, check mode exits 76. A known capacity or quota below four gives exit 3 instead, because no CPU model is measurable; see exit 76.
Every attempt retains its exact CPU IDs, the physical-core topology and the sibling sets. The child must prove that its observed placement matches the request. Missing topology or unverifiable pinning never falls back to inherited placement, and inherited-placement evidence cannot be relabeled as four-core evidence.
Between attempts, recovery can select a different set of cores, but only within the same pool. It never moves a running attempt.
Hybrid CPUs. A CPU-model package binds no exact CPU set. A host can show several CPU
models, for example two core classes, of which only some have budgets. Check mode then binds the
campaign to a pool of a covered model. It writes that pool to prepared/required-cpu-pool.json
and passes --required-cpu-pool. A busy covered class then cannot fall back to an uncovered
one. When every observed CPU model is covered, check mode binds no pool. collect-baseline
binds campaigns to pending models the same way; see
when collection continues and stops. The
standalone python -m benchmarks.kpi run accepts the same --required-cpu-pool PATH option,
with the four-core domain only.
Recovery#
Only these pre-run rejections are retried, and only in the four-core domain:
a busy placement search;
a busy child admission whose reasons are all
aggregate_external_load,per_cpu_external_loadorcpu_steal_observed;in Release only, a pre-run Windows
invalid_pdh_counter_deltafrom placement or child admission (see Physical bounds at admission).
Before a retry, benchmarks/kpi/cpu_recovery.py replays the rejected evidence from its raw
samples. A saved status label is never trusted. Recovery then selects a placement again,
possibly another four-core set in the same pool, and admits with unchanged thresholds.
These outcomes are never retried: load during the operation, product failures, invalid work,
harness errors, regressions, watchdog expiry, cohort mismatches, a pre-run Windows
pdh_clock_alignment_unsupported and other unsupported counters. Every rejected attempt stays
in the evidence.
Profile |
Four-core domain |
|
|---|---|---|
Release |
10 retries per run (11 attempts); see run, retry and attempt limits. The allowance and the deadline can end them sooner |
No CPU-busy retry: a busy pre-run check stops the campaign. Under |
Smoke |
No count limit. Retries end at the allowance or the deadline |
No CPU-busy retry. Under |
Console progress shows each retry as a new Try of the same Run; see
workload tables.
When retries end:
Release stops the campaign. The remaining cells are unexecuted, and the console prints a
Campaign stopped: ...line; see when a Release campaign stops.Smoke gives the workload exit 3 and prints one recovery line. In the four-core domain the allowance or the deadline ended the retries, so the campaign stops too. Under
strict, later workloads still run after a sample uses its two replacements.collect-baselinerestarts the workload instead, after a verified CPU retry limit or a pre-run clock-alignment rejection; see workload restarts.
When a Release campaign stops gives the
Recovery: line that a smoke workload prints, with its allowance, cleanup-reserve (console:
job reserve reached) and remaining-time endings.
Deadlines#
Run |
Campaign deadline |
|---|---|
Check mode through |
None: the driver passes |
Each |
Derived from the collection time left; see Deadline |
Standalone |
|
Every operation has a watchdog: 900 seconds for each representative workload, set in the workload definition. Under recorded contention, the owned-process limit adds the child’s admission wait. That limit covers runtime initialization, child admission and the operation, but not placement. None of these waits is part of the measured operation; see timing boundaries. Admission waits and owned cleanup keep their own finite bounds in every case.
With a deadline, the controller keeps a 300-second cleanup reserve before it:
No attempt starts inside the reserve.
In the four-core domain, a placement starts only when the time before the reserve exceeds the placement wait limit plus one window. Otherwise the attempt ends with exit 3 and the reason
job reserve cannot cover CPU selection and complete child admission.The operation watchdog is clipped to the time left before the reserve, less the child’s admission wait under recorded contention.
A watchdog expiry is an unqualified, non-retryable exit 3 after the child process tree drains.
Affinity is not a reservation#
Affinity controls placement. It does not reserve CPUs, and other processes can still run on the selected cores. Unrelated cores can contend for shared cache, memory bandwidth, storage or a cgroup CPU quota. Sibling load, constraints, throttling and steal therefore stay in the evidence.
Cohort#
The cohort is everything that must match before observations can pool. The controller records it once per campaign, as an object with these fields:
Field |
Type |
Required |
Default or values |
Description |
|---|---|---|---|---|
|
string |
Always |
The lowercase OS name, such as |
Platform |
|
string |
Always |
The lowercase machine name, such as |
Architecture |
|
string |
Always |
The processor string of the operating system, or |
Processor string |
|
string |
Always |
Machine and disk labels |
|
|
string |
Always |
Lowercase SHA-256 hex |
Hash of the build’s interpreter |
|
object |
Always |
|
The load policy and its thresholds |
|
object or null |
Always |
|
The CPU identity and the CPU constraints: affinity, effective capacity, Linux cgroup quotas and memberships, and the Windows Job |
|
string |
Recorded contention |
|
Admission policy |
|
string |
Four-core domain |
|
CPU domain |
|
string |
Windows under recorded contention |
|
The Windows PDH counter and envelope contracts |
|
string |
OpenUSD only |
|
An ovstage cohort has no backend field, so an OpenUSD cohort never matches an ovstage one |
In the four-core domain the CPU scope is the pool: its CPU model, core class, package, NUMA node, SMT width and cores, with the CPU constraints projected onto it. The selected CPU IDs are not part of it, so attempts on different cores of one pool match.
The CPU model enters the cohort through the CPU scope, not through the processor string.
Exported calibration replaces the processor string with observed-hardware. A CPU-model
package matches a digest of the cohort without the processor string and the CPU scope, and a
digest of the pool’s CPU model; see
How check mode matches a package.
Under recorded contention, the first child admission binds the CPU scope. A later child whose
scope differs stays unqualified (observed child constraints differ from the campaign cohort);
in Release this stops the campaign. Under strict, the controller binds the scope before the
first attempt.
Unknown ancestor capacity stays null. Only the hidden Linux cgroup ancestry and the Windows Job
ancestry cases in Constraint evidence are accepted. Constraints are
observed at checkpoints, so changes between checkpoints cannot be excluded.
Strict admission#
strict is a diagnostic policy with stricter rules:
Rule |
Value |
|---|---|
Pre-run window |
10 seconds, sampled once per second, checked by the controller |
Pre-run limits |
Aggregate external load at most 10%; each CPU at most 20%; no Linux steal |
Longest pre-run wait |
120 seconds |
In-operation proof |
Rolling 10-second windows over the 100 ms stream; the process’s own CPU time is subtracted from the aggregate |
Windows counters |
|
Strict observations of the public API always stay unqualified. Neither the Linux nor the
Windows adapter attributes the process’s own CPU time per CPU, so every operation reports
per_cpu_attribution_unavailable. An operation shorter than 10 seconds also reports
no_complete_load_window. Short operations are never padded with idle time, and no policy
rescales elapsed time by utilization. Missing scope or counters, or a changed affinity, quota or
topology, also prevent qualification.
A busy pre-run check stops the campaign. External load during the operation makes the attempt replaceable; see the Recovery table.
Constraint evidence#
The adapters record why a CPU scope cannot be established. These cases matter most:
Evidence |
Recorded contention |
Strict |
|---|---|---|
Linux |
Accepted; capacity stays |
Not qualified ( |
Windows |
Accepted; capacity stays |
Not qualified |
Linux |
Unsupported |
Not qualified |
Linux |
Unsupported |
Not qualified |
Windows: more than one processor group, the process outside group 0, or a default CPU set |
Unsupported |
Not qualified |
Missing physical-core or sibling topology, or unverifiable pinning |
No four-core placement; inherited placement is not a substitute |
Not applicable |
|
Memory is unavailable, and later peaks cannot substitute. On Windows the operation is not qualified either |
Not qualified |
Supervisor Job#
On Windows, every child runs in the supervisor’s cleanup Job, which has only the kill-on-close limit. That Job may sit inside an observed parent Job that allows breakaway, so that a process can start outside it, and sets no other limit: its limit flags hold breakaway-OK (0x800) or silent breakaway-OK (0x1000), optionally with kill-on-close (0x2000), and it has no affinity or CPU rate limit. Ancestor capacity then stays unknown. Two such parent Jobs are common: the CI supervisor’s (0x2800), and a session Job that some Windows hosts keep for every desktop process (0x1800). A parent CPU limit, any other Job flag or field, or a change in what can be observed rejects the cohort.
A terminal started from an IDE or an agent shell can run inside a parent Job that forbids
breakaway, such as an agent shell’s (0x0). Every attempt in such a Job is rejected, and the
console shows CPU check: Rejected: parent Windows Job not admitted with the failure line
The KPI driver runs inside a parent Windows Job that CPU admission does not accept; start the terminal outside that Job.
Outside CI, the driver checks its own Job before any KPI work starts
(scripts/kpi_windows_job.py). It leaves a Job that allows breakaway when it can, because a run
outside any Job keeps a known CPU capacity. A terminal started from a file manager can sit in
such a Job; Altap Salamander’s, for example, sets only the breakaway-OK limit (0x800).
Parent Job |
Driver action |
|---|---|
None, or the CI supervisor’s kill-on-close and breakaway-OK Job (0x2800) without an affinity or CPU rate limit |
Runs as started |
Allows breakaway (0x800 or silent breakaway 0x1000) |
Prints |
Takes the relaunched driver back, as the session Job (0x1800) does |
The relaunched driver finds the driver that started it in its own Job, prints |
Does not allow breakaway, for example an agent shell’s Job (0x0) |
Prints |
Breakaway fails |
Prints |
A relaunched driver in a Job that does not hold the driver that started it checks that Job the
same way, at most four levels deep. --version, --help, -h and --after-script never
relaunch, and CI keeps its supervisor Job.
Windows saturation limitation#
Recorded-contention admission on Windows reads CPU time from PDH.
Counters and contracts#
It reads the local
Processor Informationcounters% User Timeand% Privileged Timeper CPU. It retains the integer 100 ns values, their statuses, the checked counter mapping and the acquisition timestamps. No formatted counter value is used.Counters are requested by English name. The returned object and counter names must verify as English; other translations are unsupported, not guessed.
Only a host with one processor group is supported, and the process must run in group 0.
CPU frames are collected at least 1 second apart, measured from the end of one collection to the start of the next.
Execution binds
windows-pdh-direct-accounting-v2andcollection-bracketed-cpu-accounting-envelope-v2separately from the admission policy. Task, admission, operation, calibration and budget identities must agree on both, even when the physical CPU IDs differ between attempts.
Accounting rates during execution#
Windows CPU accounting advances in coarse quanta, often 15.625 ms, while the provider’s elapsed time is finer. Over a short interval, User plus Privileged time can therefore exceed the provider’s elapsed time, even for one busy core. The documented timer formula divides raw deltas by elapsed time. The 100 ns unit is not 100 ns precision, and the provider’s update mechanism and error bound are unknown.
Operation evidence therefore keeps raw rates, including rates above 100%. Neither the code nor a reviewer caps them at 100%, adds a one-tick tolerance or treats them as exact utilization. Every status, counter type, mapping, delta, interval, cadence, scope and frame sequence is still validated, and a gap or malformed value makes the operation unqualified. A reviewer never drops bad intervals or combines favorable rows from incomplete campaigns.
Physical bounds at admission#
Admission keeps the physical bounds. It applies the 25% limits to two fractions: the provider-clock fraction and a conservative fraction over the shortest possible interval of QueryPerformanceCounter (QPC), the Windows high-resolution clock, between the two collections. It rejects:
Condition |
Reason code |
|---|---|
A negative User or Privileged delta, or a provider elapsed delta that is not positive |
|
User plus Privileged delta greater than the provider’s elapsed delta |
|
Busy time longer than the widest QPC bracket of the two collections |
|
Collections less than 1 second apart |
|
Example (synthetic frames, checked with windows_pdh.interval()). One CPU reports 1.015625
seconds of User plus Privileged time over a provider interval of exactly 1 second:
Use |
Result |
|---|---|
Admission (with the policy) |
Rejected: |
Operation evidence (no policy) |
Accepted: busy rate |
Recovery lists which of these rejections are retried. A pre-run
pdh_clock_alignment_unsupported is a non-retryable exit 3 in check mode, and a Release
campaign stops there; collect-baseline restarts the workload instead. A failure after the run
is never replaced.
CPU envelope and memory#
Operation memory is a separate 100 ms stream that stops at result-ready. CPU frames run from the
admitted frame through one final collection after result-ready. A short operation therefore gets
a CPU envelope with leading and trailing padding, recorded in the contention record. That final
wait adds attempt wall time, not workload time, and it does not extend the memory stream.
CPU utilization during the operation is diagnostic. The required memory metrics,
resident_high_water_bytes and private_high_water_bytes, come from native high-water counters
at result-ready. On Windows a missing counter makes the operation unqualified. On Linux it
leaves only resident_high_water_bytes without a value, so that metric stays insufficient even
when the latency metrics qualify.
Judging ranges with recorded contention#
This optional manual review of retained evidence changes no automatic verdict. The budget comparator keeps its median, warning and failure rules. Recorded load adds no correction, no load-conditioned budget and no CI verdict. CPU busy fractions describe observed activity; metric noise describes repeat variability.
Before you begin, you need the retained records of the reference campaigns and of one complete
Release candidate campaign, with at least three qualified measured observations: the
public records public/measurements.json, which hold each attempt’s status, metric values and
contention record, and the calibration evidence calibration/calibration.json; see
public record and
calibration evidence. The private execution tree is
deleted after a verified drain, so the review cannot rely on it. Without compatible references,
or with an incomplete candidate, the review gives no result. Incomplete and failed attempts
keep their status throughout: a plausible duration or a load record does not repair them.
Check that each measurement did its complete frozen work.
Check that each measurement names a matching validated producer.
Check that the counters of each measurement were replayed.
Check that the placement and memory checks of each measurement passed.
Check that the owned cleanup of each measurement was verified.
Select the compatible references: one frozen producer and source, CPU model, core class and SMT pool, backend, platform, workload, measurement, admission and observation policy, and runner and storage class.
Collect every eligible reference value
xof those references, without the candidate’s own values. As in the noise gate, no favorable subset is chosen, before or after seeing the candidate.For each lower-is-better metric, compute the reference median
B, its MAD and the noiseNexactly as a budget does; see budget limits. The envelope[max(0, B - N), B + N]describes the retained observations. It is not a confidence interval and not a prediction of future load.Classify the candidate median
Cas inside, below or above the envelope.Report every candidate value next to that class: a median inside the envelope does not hide an unstable tail.
Report the load coverage of each observation separately: the selected aggregate, the largest selected-CPU and sibling pre-run fractions, and the largest operation busy rate, with the CPU IDs, next to the reference minimum and maximum. A null rate means unknown coverage and is reported as null, not zero. Windows rates stay as recorded; see Accounting rates during execution. Matching descriptors do not prove equal interference.
The review is complete when every lower-is-better metric of the candidate has a class and the report lists its values and load coverage.
Example. Reference load_seconds values 10.0, 10.2, 10.1, 10.4 and 9.9 give B = 10.1 and
MAD = 0.1. Three times the MAD and the largest deviation are both 0.3, so N = 0.3 and the
envelope is [9.8, 10.4]. A candidate median of 10.3 is inside; a candidate median of 10.6 is
above.
A candidate above the envelope is a suspected regression, not a load-caused slowdown, even when its load is represented in the references. Resolve it with a predeclared, bounded series of compatible campaigns of the reference and candidate builds on the same machine and pool, and keep failed campaigns visible. If comparable valid evidence cannot be obtained, report the result as unresolved.