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:

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

shared-runner-recorded-contention-v2

Default CPU domain

four-physical-cores-retry-v2: four physical cores, one logical CPU on each

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 /proc/stat

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)

release profile: 10 per run. smoke profile: until the allowance or the deadline ends them; see Recovery

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

shared-runner-recorded-contention-v2

Recorded contention. A quiet 1-second window gates each attempt. Load during the operation is recorded, not judged

strict

A quiet 10-second window gates each attempt, and the operation must prove low external load. Diagnostic only; see Strict admission

CPU domain

Meaning

four-physical-cores-retry-v2

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

inherited

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

run_kpi.bat, run_kpi.sh and the driver scripts/kpi_ci.py

--admission-policy, then PARENT_OVCLASH_KPI_ADMISSION_POLICY, then shared-runner-recorded-contention-v2

four-physical-cores-retry-v2; inherited when the policy is strict

strict with the four-core domain: prints KPI input rejected; no workload executed. and exits 4 before preparation

--mode collect-baseline

Same as the launchers and the driver

four-physical-cores-retry-v2

Any policy other than recorded contention, or any domain other than the four-core domain: prints KPI collection input rejected; no workload executed. and exits 4

python -m benchmarks.kpi run

strict

inherited

strict with the four-core domain: exit 4

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:

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

Recorded contention on shared runners#

shared-runner-recorded-contention-v2 is the default admission policy of the launchers.

What the check requires#

Each 1-second window must meet all of these conditions:

  • The aggregate busy fraction of the four selected CPUs is at most 25%. With inherited placement, the aggregate covers all assigned CPUs.

  • Each selected CPU, and each online SMT sibling of a selected CPU, is at most 25% busy on its own. One overloaded CPU therefore cannot hide behind quieter ones.

  • On Linux, the steal counter is available and does not advance.

A busy core outside the selected cores and their siblings does not reject the attempt. The check uses total busy time. It subtracts nothing for the process’s own CPU use and assumes no CPU capacity. Busy time comes from /proc/stat on Linux and from Performance Data Helper (PDH) counters on Windows; see Windows saturation limitation.

Example. The selected CPUs are 2, 4, 6 and 8; their SMT siblings are 3, 5, 7 and 9. One 1-second window measures these busy fractions:

CPU

2

3

4

5

6

7

8

9

Quiet window

10%

0%

5%

20%

15%

0%

20%

5%

Busy window

10%

0%

5%

40%

15%

0%

20%

5%

The aggregate of CPUs 2, 4, 6 and 8 is 12.5% in both windows. The quiet window admits the attempt. In the busy window, sibling CPU 5 exceeds 25%, so the check reports per_cpu_external_load and rejects the attempt. The console CPU % column shows the aggregate and the busiest checked CPU: 12.5/20.0% and 12.5/40.0%.

The 25% threshold detects overload. It is not a precision promise and not a timing allowance. A measurement is valid only when its workload, counter, source, placement, memory and cleanup checks also pass. A failure found after the run is never replaced. The admission policy is part of the cohort: budgets collected under one policy never apply to observations of the other.

What is recorded#

Record

Where

Content

admission.json

Each attempt directory of the private execution tree

The full admission receipt: capabilities, every sample and window, reasons and the wait limit

contention

Each qualified attempt in public/measurements.json

The pre-run load of the selected CPUs and siblings, and one operation window

cpu_diagnostics

Attempts in public/measurements.json

ovclash-kpi-cpu-diagnostics-v2: the stage (placement, admission, operation, cohort, cleanup) and controller branch that actually ran, with registered reason codes

cpu_contention_wait

Top level of public/measurements.json

limit_seconds, extra_wait_seconds and remaining_seconds of the shared CPU-wait allowance

Public record describes the other fields of public/measurements.json. A contention record looks like this (synthetic values, validated with contention.validate()):

{
  "contract": "ovclash-kpi-recorded-contention-v1",
  "admission_policy": "shared-runner-recorded-contention-v2",
  "isolation_proven": false,
  "performance_verdict_authority": false,
  "pre_run": {
    "selected_cpus": [
      {"cpu": 2, "busy_fraction": 0.1}, {"cpu": 4, "busy_fraction": 0.05},
      {"cpu": 6, "busy_fraction": 0.15}, {"cpu": 8, "busy_fraction": 0.2}
    ],
    "sibling_cpus": [
      {"cpu": 3, "busy_fraction": 0.0}, {"cpu": 5, "busy_fraction": 0.2},
      {"cpu": 7, "busy_fraction": 0.0}, {"cpu": 9, "busy_fraction": 0.05}
    ],
    "aggregate_selected_fraction": 0.125,
    "window_seconds": 1.0,
    "wait_threshold_fraction": 0.25
  },
  "operation_windows": [
    {
      "mode": "cold",
      "observation_scope": "operation-checkpoints",
      "cpu_busy_rates": [
        {"cpu": 2, "busy_rate": 0.98}, {"cpu": 3, "busy_rate": 0.02},
        {"cpu": 4, "busy_rate": 0.97}, {"cpu": 5, "busy_rate": 0.01},
        {"cpu": 6, "busy_rate": 0.99}, {"cpu": 7, "busy_rate": 0.0},
        {"cpu": 8, "busy_rate": 0.96}, {"cpu": 9, "busy_rate": 0.0}
      ],
      "process_cpu_seconds": 25.1,
      "elapsed_seconds": 6.49,
      "leading_padding_seconds": null,
      "trailing_padding_seconds": null,
      "sample_count": 66,
      "sample_interval_min_seconds": 0.1,
      "sample_interval_max_seconds": 0.104,
      "external_load_known": false
    }
  ]
}

Every field is required, and the validator refuses any other field. A cpu is an integer from 0 to 1,048,576, and each CPU list is sorted, without repeats, and at most 256 entries long:

Field

Type

Required

Default or values

Description

contract

string

Yes

ovclash-kpi-recorded-contention-v1

Record format

admission_policy

string

Yes

shared-runner-recorded-contention-v2

The policy that admitted the attempt

isolation_proven

boolean

Yes

Always false

The record never proves isolation

performance_verdict_authority

boolean

Yes

Always false

The record never decides a verdict

pre_run

object

Yes

The five pre_run.* fields

The last admission window

pre_run.selected_cpus

array of objects

Yes

At least one {cpu, busy_fraction}; each fraction 0 to 0.25

Load of each selected CPU

pre_run.sibling_cpus

array of objects

Yes

{cpu, busy_fraction}, possibly empty, no CPU of selected_cpus; each fraction 0 to 0.25

Load of each online SMT sibling

pre_run.aggregate_selected_fraction

number

Yes

0 to 0.25

Aggregate load of the selected CPUs

pre_run.window_seconds

number

Yes

1.0

The fixed admission window

pre_run.wait_threshold_fraction

number

Yes

0.25

The fixed busy limit

operation_windows

array of objects

Yes

Exactly one window

The operation window

mode

string

Yes

cold for a canonical cold operation, suite for a Suite operation

Operation kind

observation_scope

string

Yes

operation-checkpoints on Linux; padded-cpu-envelope on Windows

How the window was observed

cpu_busy_rates

array of objects

Yes

{cpu, busy_rate} for exactly the selected and sibling CPUs; busy_rate 0 or more, or null on Linux for a CPU without accounting ticks

Total busy rate of each CPU over the window. Windows rates can exceed 1.0; see Accounting rates during execution

process_cpu_seconds

number or null

Yes

0 or more

CPU time of the measured process over its sampled boundaries

elapsed_seconds

number

Yes

Greater than 0

Length of the window

leading_padding_seconds, trailing_padding_seconds

number or null

Yes

null with operation-checkpoints; 0 or more with padded-cpu-envelope

Observed time before the operation start and after result-ready, the boundary at which the results are usable

sample_count

integer

Yes

2 to 100,000

Samples in the window

sample_interval_min_seconds, sample_interval_max_seconds

number

Yes

Greater than 0; minimum at most maximum

The actual sampling cadence

external_load_known

boolean

Yes

Always false

External load is never attributed

cpu_diagnostics holds contract (string, ovclash-kpi-cpu-diagnostics-v2) and records, an array of one to five records, at most one per stage. Each record has these fields:

Field

Type

Required

Default or values

Description

stage

string

Yes

placement, admission, operation, cohort or cleanup

The controller stage

branch_code

string

Yes

A registered branch of that stage, such as placement_selected or admission_observed

The branch that ran

reason_codes

array of strings

Yes

Up to 8 registered codes, sorted and unique; an unregistered code becomes unclassified_failure

Why the branch ran

category

string

Yes

counter, load or constraint when the reason codes name one category, mixed for several, otherwise the branch’s own category such as none, reserve or capability

The kind of cause

status

string

No

Placement: selected, busy, unsupported; admission: admitted, busy, unsupported

The stage status

qualified

boolean

No

Always false in the placement stage

Whether the stage qualified the attempt

counter_interval

object

No

Only for an unsupported placement_adjacent_counter_validation_failed with invalid_pdh_counter_delta

The integer operands of the rejected Windows counter comparison

cpu_contention_wait is present only for a campaign in the four-core domain. The controller writes all three fields; the public schema reader accepts each as optional:

Field

Type

Required

Default or values

Description

limit_seconds

number

No

180

The allowance

extra_wait_seconds

number

No

0 or more

Charged extra waiting

remaining_seconds

number

No

0 or more

Allowance left

The final summary shows the allowance in its Extra contention wait row as <extra>s of <limit>s; <remaining>s remaining. After the synthetic worked example of shared CPU-wait allowance it would read 32.1s of 180s; 147.9s remaining; see the final summary.

What the records do not prove#

  • They never prove isolation (isolation_proven: false) and have no verdict or calibration authority.

  • CPU utilization is not a timing correction. 20% busy does not permit a 20% slower result. Recorded load alone neither explains nor confirms a timing change.

  • Process CPU and the total busy rates cover different boundaries. Never subtract one from the other to estimate external interference.

  • cpu_diagnostics name only the branch that ran. They do not establish a hardware or provider cause. Unknown failures stay unknown, and unexecuted cells never inherit an earlier cause.

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.

Shared CPU-wait allowance#

In the four-core domain, placement and child admission share one allowance of 180 seconds of extra CPU waiting per campaign. Native operation time does not use it.

  • A clean first check is free.

  • Outside a recovery, a contended or counter-rejected placement or child admission is charged its time beyond the first 1-second window. A placement is contended when it was busy or needed more than one window, and a child admission when it observed load. A counter rejection is charged when Recovery retries it: a Release invalid_pdh_counter_delta.

  • A retryable CPU rejection starts a recovery. During a recovery, every placement and child check is charged in full, even when it is quiet. The recovery ends with the first attempt that is not a retryable CPU rejection.

  • The wait limit of a check is min(120, 1 + remaining) seconds outside a recovery and min(120, remaining) seconds during a recovery.

Example. One campaign spends its allowance like this:

Step

Wait limit

Charged

Remaining

Placement finds a quiet pool after 30.5 s

120 s

29.5 s

150.5 s

Child admission is busy at its first window, 1.2 s

120 s

0.2 s

150.3 s

Recovery placement succeeds after 1.3 s

120 s

1.3 s

149.0 s

Recovery child admission is quiet after 1.1 s

120 s

1.1 s

147.9 s

The next attempt reuses the placement and is quiet after 1.05 s

120 s

0 s

147.9 s

The wait limit falls below 120 seconds only when less than 119 seconds of allowance remain (120 seconds during a recovery). With 40.5 seconds left, the limit is 41.5 seconds outside a recovery and 40.5 seconds during one.

The controller stops and launches nothing further in these cases:

  • During a recovery, at most one second of allowance remains.

  • The allowance is spent.

  • Placement discovery used so much of an allowance-bounded wait that less than one complete window remains.

The remaining required cells are then unexecuted, and the campaign is insufficient evidence (exit 3) unless an earlier hard failure takes precedence. In collect-baseline, this stop ends the campaign and the collector starts another; see when collection continues and stops.

A placement wait that ends without one complete window for another reason is a non-retryable placement failure. This covers a wait that the 120-second maximum or the campaign deadline ended, and a busy placement whose counters recorded no complete window.

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_load or cpu_steal_observed;

  • in Release only, a pre-run Windows invalid_pdh_counter_delta from 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

inherited 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 strict, external load during the operation is replaced up to 10 times per run

Smoke

No count limit. Retries end at the allowance or the deadline

No CPU-busy retry. Under strict, external load during the operation is replaced at most twice per sample

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-baseline restarts 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 scripts/kpi_ci.py (launchers and CI)

None: the driver passes --no-campaign-deadline. In CI only the job timeout bounds the campaign

Each collect-baseline campaign

Derived from the collection time left; see Deadline

Standalone python -m benchmarks.kpi run

--job-seconds 3300 by default, which must exceed the 300-second cleanup reserve; --no-campaign-deadline removes it

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

platform

string

Always

The lowercase OS name, such as linux or windows

Platform

architecture

string

Always

The lowercase machine name, such as x86_64, amd64 or aarch64

Architecture

cpu

string

Always

The processor string of the operating system, or unreported

Processor string

runner_class, storage_class

string

Always

The runner and storage labels

Machine and disk labels

python_sha256

string

Always

Lowercase SHA-256 hex

Hash of the build’s interpreter

load_policy

object

Always

admission_interval_seconds, window_seconds, max_wait_seconds, sample_interval_seconds, aggregate_external_limit and per_cpu_external_limit (numbers), plus admission_policy under recorded contention

The load policy and its thresholds

cpu_scope

object or null

Always

null under recorded contention until the first child admission binds it; under strict, bound before the first attempt. In the four-core domain it is projected onto the pool

The CPU identity and the CPU constraints: affinity, effective capacity, Linux cgroup quotas and memberships, and the Windows Job

admission_policy

string

Recorded contention

shared-runner-recorded-contention-v2

Admission policy

cpu_domain

string

Four-core domain

four-physical-cores-retry-v2

CPU domain

cpu_counter_contract, cpu_envelope_contract

string

Windows under recorded contention

windows-pdh-direct-accounting-v2, collection-bracketed-cpu-accounting-envelope-v2

The Windows PDH counter and envelope contracts

backend

string

OpenUSD only

openusd

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

NtQuerySystemInformation, not PDH

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 ancestor_cpu_constraints_unobservable: the cgroup namespace is not the initial one, or a cgroup mount root is not /

Accepted; capacity stays null

Not qualified (assigned_cpu_scope_unavailable)

Windows ancestor_job_constraints_unobservable: the process is in a Job whose ancestor limits cannot be enumerated

Accepted; capacity stays null

Not qualified

Linux hybrid_cpu_controller_layout_unsupported: CPU controllers split between cgroup v1 and v2

Unsupported

Not qualified

Linux thread_cpu_cgroup_mismatch, thread_affinity_outside_cpuset, or another adapter scope code

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_boundary_unobserved, or a missing high-water counter

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 KPI tries to leave its parent Windows Job (limit flags 0x... allow breakaway) and starts again. and runs again with CREATE_BREAKAWAY_FROM_JOB, with the same interpreter options, arguments, environment and console. Its exit code is the run’s

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 KPI is back in its parent Windows Job (limit flags 0x1800): ... with whether CPU admission accepts that Job, and runs there

Does not allow breakaway, for example an agent shell’s Job (0x0)

Prints KPI runs inside a parent Windows Job (limit flags 0x0) that does not allow breakaway; ... and runs as started; CPU admission then rejects every measurement

Breakaway fails

Prints KPI could not leave its parent Windows Job ... and runs as started

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 Information counters % User Time and % Privileged Time per 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-v2 and collection-bracketed-cpu-accounting-envelope-v2 separately 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

invalid_pdh_counter_delta

User plus Privileged delta greater than the provider’s elapsed delta

invalid_pdh_counter_delta

Busy time longer than the widest QPC bracket of the two collections

pdh_clock_alignment_unsupported

Collections less than 1 second apart

pdh_collection_cadence_unsupported

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: invalid_pdh_counter_delta

Operation evidence (no policy)

Accepted: busy rate 1.015625

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.

  1. Check that each measurement did its complete frozen work.

  2. Check that each measurement names a matching validated producer.

  3. Check that the counters of each measurement were replayed.

  4. Check that the placement and memory checks of each measurement passed.

  5. Check that the owned cleanup of each measurement was verified.

  6. 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.

  7. Collect every eligible reference value x of those references, without the candidate’s own values. As in the noise gate, no favorable subset is chosen, before or after seeing the candidate.

  8. For each lower-is-better metric, compute the reference median B, its MAD and the noise N exactly 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.

  9. Classify the candidate median C as inside, below or above the envelope.

  10. Report every candidate value next to that class: a median inside the envelope does not hide an unstable tail.

  11. 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.