Representative fixture stages#
KPI measures three generated bundles: body-representative,
cockpit-representative and body-representative-depth, a full-motion Body bundle that only
the Dynamic depth workload uses. Each bundle is a directory that holds one USD stage, its
root.usda and layer files, and the bundle.json manifest. The KPI glossary
defines bundle, stage, workload and the other KPI terms used here. The source-only
benchmarks.kpi.reference_fixtures package generates the first two bundles from fixed recipes;
benchmarks/kpi/reference_fixtures/profiles.py defines their size tiers.
benchmarks/kpi/representative_depth.py generates the depth bundle from the
body-representative recipe.
Generation, inspection and the structural census use only the Python standard library. They
need no stage assets, OpenUSD Python bindings (pxr),
renderer, sample application or network access. measure is the exception: it needs a
configured ovstage runtime, the ovstage backend of the
ovclash Python package.
This page covers the bundles. KPI workloads and metrics lists the nine workloads, their settings, counts and saved sizes, and KPI frozen contracts and maintenance owns the pins. Sentinel owns product correctness.
Generate and retain stages#
KPI preparation generates all three bundles before measurement, stops when one differs from its pin, and reuses them for every workload. A check generates them once, after its budget coverage check passes; a check without compatible coverage stops before generation. A baseline collection generates them once per collection, before its first campaign, and reads no installed budgets. The launchers and CI run both through the KPI driver; see how a KPI run works.
Note Generate the bundles with the KPI input Python, the packaged CPython 3.12. The pins match only the bytes it writes: other interpreter versions can print different digits for a few floating-point values. Python 3.14, for example, writes 17 layers of
body-representativedifferently, and KPI preparation then stops withgenerated representative bundle differs from frozen bytes.
To generate the bundles yourself, run these commands from ovclash/ with $PY (%PY% in
cmd.exe), the KPI input Python of the quick start. Each output directory
must not exist yet. If generation fails, delete its output directory, if present, before you
retry.
Linux x86-64 and AArch64:
"$PY" -B -m benchmarks.kpi.reference_fixtures generate --profile body-representative --output _build/reference-fixtures/body-representative
"$PY" -B -m benchmarks.kpi.reference_fixtures generate --profile cockpit-representative --output _build/reference-fixtures/cockpit-representative
"$PY" -B -c "from pathlib import Path; from benchmarks.kpi import representative_depth; r = representative_depth.generate_bundle(Path('_build/reference-fixtures/body-representative-depth')); print(r['manifest_sha256'], r['closure_digest'])"
Windows (cmd.exe):
"%PY%" -B -m benchmarks.kpi.reference_fixtures generate --profile body-representative --output _build/reference-fixtures/body-representative
"%PY%" -B -m benchmarks.kpi.reference_fixtures generate --profile cockpit-representative --output _build/reference-fixtures/cockpit-representative
"%PY%" -B -c "from pathlib import Path; from benchmarks.kpi import representative_depth; r = representative_depth.generate_bundle(Path('_build/reference-fixtures/body-representative-depth')); print(r['manifest_sha256'], r['closure_digest'])"
Each command exits 0 when its bundle is sealed. generate prints a JSON summary with these
fields:
Field |
Type |
Required |
Default or values |
Description |
|---|---|---|---|---|
|
string |
Yes |
64 lowercase hexadecimal digits |
SHA-256 of the |
|
string |
Yes |
64 lowercase hexadecimal digits |
The |
|
integer |
Yes |
1 or more |
Number of member layers |
|
integer |
Yes |
1 or more |
Sum of the member layer sizes |
|
number |
Yes |
Seconds |
Wall time of the command |
|
object |
Yes |
The generation metadata stored in |
Generation metadata#
The metadata object holds these fields:
Field |
Type |
Required |
Default or values |
Description |
|---|---|---|---|---|
|
string |
Yes |
The |
The generated profile |
|
string |
Yes |
|
The assembly family |
|
number |
Yes |
|
The animation duration |
|
boolean |
Yes |
|
Whether the references are instanceable |
|
object |
Yes |
|
The recipe parameters: |
|
object |
Yes |
Authored and composed geometry counts, and path and hierarchy summaries |
|
|
object |
Yes |
The planned contacts: |
|
|
object |
Yes |
|
|
|
object |
Yes |
|
|
|
object |
Yes |
|
The recipe identity: |
Pinned bundles#
The depth command prints only its manifest_sha256 and closure_digest. With the pinned
interpreter, the three bundles reproduce their pins:
Bundle |
|
|
Files |
Bytes |
|---|---|---|---|---|
|
|
|
102 |
47,523,889 |
|
|
|
2,200 |
120,791,385 |
|
|
|
102 |
47,513,313 |
The authority for these values is bundle.sha256 and bundle.closure_digest of each profile in
benchmarks/kpi/representative_expectations.json, and fixture.bundle in
benchmarks/kpi/representative_depth.json. The table changes with them. Expected work comes
only from the reviewed contract files, never from a candidate build.
The depth bundle has no generate --profile entry; representative_depth.generate_bundle is
its only generator. Of its layers, only root.usda differs from the body-representative
bundle: it holds the Body motion compressed to 1.125 seconds and a probe schedule for
8 samples/s. Its bundle metadata records the recipe identifier representative-depth-v1.
An intentional recipe change requires a version bump in
benchmarks/kpi/reference_fixtures/recipe.json and refreshed pins; see
refresh pinned fixture identities.
Comment, docstring and formatting edits need no refresh.
Open root.usda and keep the whole bundle directory. root.usda references the other layers,
so it is not a portable stage on its own, and its size is not the input size.
Bundle manifest and seal#
generate seals each bundle by writing bundle.json exclusively; an existing bundle.json is
never replaced. It holds exactly these fields, all required; a reader rejects any other field:
Field |
Type |
Required |
Default or values |
Description |
|---|---|---|---|---|
|
integer |
Yes |
|
Manifest format version |
|
string |
Yes |
|
Layer encoding: USDA, the ASCII text format of USD layers |
|
string |
Yes |
|
The entry layer, relative to the bundle |
|
object |
Yes |
|
The composition policy |
|
object |
Yes |
At most 2 MiB of JSON |
Generation metadata (recipe, source identity, inventory, contact and motion summaries); see generation metadata |
|
string |
Yes |
64 lowercase hexadecimal digits |
SHA-256 of the canonical JSON of |
|
array of objects |
Yes |
One object per layer |
|
|
string |
Yes |
64 lowercase hexadecimal digits |
SHA-256 of the canonical JSON of every other field of the manifest |
The printed manifest_sha256 is the SHA-256 of the bundle.json bytes. The recipe identity in
the metadata is the identifier and version of recipe.json with their SHA-256, for example
{"policy": "recipe-version", "sha256": "...", "recipe": {"identifier": "reference-fixtures-v1", "version": 1}}.
Inspect a bundle#
Before you begin: generate the bundle as in
generate and retain stages, and set $PY (%PY%) as in the
quick start. From ovclash/, pass the bundle directory, here the Cockpit
bundle of that section.
Linux x86-64 and AArch64:
"$PY" -B -m benchmarks.kpi.reference_fixtures inspect _build/reference-fixtures/cockpit-representative
Windows (cmd.exe):
"%PY%" -B -m benchmarks.kpi.reference_fixtures inspect _build/reference-fixtures/cockpit-representative
inspect re-reads the whole bundle, prints the verified manifest as JSON and exits 0. It checks the member
inventory, every member’s size and SHA-256, the closure digest, and the USDA syntax and
composition of every layer. Every member must be an ordinary .usda file listed in
bundle.json and reachable from root.usda. Links, reparse points, hard-linked aliases,
undeclared files and asset paths that leave the bundle are rejected. The bundle directory and
every directory above it must also be real directories: generate, inspect and KPI
preparation reject a path that passes through a symlink, junction or other reparse point.
--sha256 DIGEST also requires the bundle.json bytes to have that SHA-256. It then hashes the
members without reparsing them. Pass only the digest of a fully validated manifest: the
manifest_sha256 that generate printed, or a pinned value from
pinned bundles.
When a command rejects an input or a file or native call fails (OSError, ValueError or
RuntimeError), generate, inspect and measure print reference fixtures: <reason> and
exit with code 4. An option that does not parse prints the usage message and exits with code
2.
Geometry and motion#
Body combines repeated carriers and roofs, nested instanced warehouse racks and departing assemblies. Cockpit combines deep paths, geometry payload layers, repeated tool prototypes, hidden branches and independent Module and Tool motion. Both recipes include diverse transforms, instancing and distinct mesh definitions. The bundle inventory reports authored geometry and composed placements separately; it makes no claim about contact correctness.
cockpit-representative is a single recipe with triangle-budget divisor 16. The KPI smoke and
release profiles measure the same bundle. It is not a large-scene
stress test. Its 63 instances of 21 tool prototypes and 6,400 hidden-branch meshes exercise deep
composition, prototype fan-out and file opening. Hidden branches exercise filtering of invisible
prims; their visibility is not animated. Contact construction covers:
spoke hubs and dense crossing-panel groups;
co-located duplicate pairs and a broad-phase decoy stack;
resting and crossing gates and motion probes;
one undivided high-triangle tail mesh per role (Structure, Module and Tool).
These are construction targets, not verified native results. Counts and saved stage sizes lists the bundle inventory.
cockpit-representative generation first runs a byte preflight
(benchmarks/kpi/reference_fixtures/preflight.py). It predicts the authored USDA size, adds an
8% margin and fails when the prediction exceeds 160,000,000 bytes. It never adjusts the recipe
to fit. The prediction is not a hard upper bound and covers authored USDA only. The bundle
metadata records the result as recipe.byte_preflight.
Mover keys come from fixed 120-second (Cockpit) and 100-second (Body) timelines. Generation scales the key times to the animation duration, two seconds by default, and keeps every pose. Cockpit has 7 Module keys and 14 Tool keys. Each of the 15 Body movers (3 carriers and 12 roofs) has 601 keys. Ordinary Dynamic and Suite-save workloads (fresh saves through the Suite API) sample 0–2 seconds at 32 samples/s. The 1/32-second step is exact in binary, so the grid has 65 poses, both ends included. The depth bundle compresses the same Body motion into 1.125 seconds, and Dynamic depth samples it at 8 samples/s (10 poses). Detection is sampled: a contact that occurs only between two poses is not guaranteed to be found.
Query scopes and settings are frozen in the work contract; see the nine workloads. A different interval, task manager, geometry scope or sample rate defines different work and cannot reuse the existing expectations.
Structural census#
Before you begin: generate or copy a sealed bundle, and set $PY (%PY%) as in the
quick start. From ovclash/, replace SAVED_BUNDLE with that bundle’s
directory, such as _build/reference-fixtures/cockpit-representative, and
NEW_REPORT_DIRECTORY with a directory outside the bundle, such as _build/census.
--bundle takes the path of bundle.json. --output must be a new file outside the bundle
directory; an output that already exists or lies inside the bundle stops the command with a
usage error and exit code 2.
Linux x86-64 and AArch64:
"$PY" -B -m benchmarks.kpi.reference_census --bundle SAVED_BUNDLE/bundle.json --output NEW_REPORT_DIRECTORY/census.json
Windows (cmd.exe):
"%PY%" -B -m benchmarks.kpi.reference_census --bundle SAVED_BUNDLE/bundle.json --output NEW_REPORT_DIRECTORY/census.json
On success the command writes census.json, prints a one-line JSON summary with sorted keys,
and exits 0. A changed or unsupported bundle, or an exceeded
diagnostic limit, raises a ValueError, exits nonzero and
writes no census.json. The summary copies these fields from census.json:
Field |
Type |
Required |
Default or values |
Description |
|---|---|---|---|---|
|
string |
Yes |
The |
The written census |
|
string |
Yes |
|
The bundle’s profile |
|
object |
Yes |
|
The bundle size |
|
object |
Yes |
|
The composed visible geometry counts |
|
object |
Yes |
|
The comparison with the bundle metadata; each count has |
|
number |
Yes |
|
Wall time of the census |
The census verifies every member, then reports at time code zero:
authored and composed geometry, visible and hidden;
prim types, face counts and triangle equivalents;
instance boundaries, path depth and transform classes.
It also compares its visible-mesh and expanded visible-triangle counts with the bundle metadata
(metadata_cross_checks). Rotation counts describe transform bases, not surface-normal
directions. Instance-boundary counts are not native prototype-cache entries. A census qualifies
neither collision results nor timing.
census.json holds these top-level fields, all required:
Field |
Type |
Required |
Default or values |
Description |
|---|---|---|---|---|
|
integer |
Yes |
|
Census format version |
|
object |
Yes |
|
|
|
object |
Yes |
|
|
|
object |
Yes |
Geometry counts over all prim specs in all layers, with a face-vertex-count histogram |
|
|
object |
Yes |
Composed geometry counts as |
|
|
object |
Yes |
Authored, composed and visible prim counts by type, with totals and mesh path depths |
|
|
object |
Yes |
|
Authored composition arcs, instance boundaries and instance nesting depth |
|
object |
Yes |
|
Transform classes of authored, composed and visible prims, the source |
|
object |
Yes |
For each compared inventory count, such as |
|
|
number |
Yes |
Seconds |
Wall time of the census |
|
object |
Yes |
The text definitions of authored, composed, visible, polygon and depth counts |
Diagnostic recipes and tools#
benchmarks/kpi/reference_fixtures/profiles.py also defines diagnostic recipes:
Profile |
Purpose |
|---|---|
|
Small recipes with every triangle budget clamped to 256 |
|
Intermediate recipes |
|
The |
generate --ordinary-references authors ordinary instead of instanceable references (USD
references marked instanceable, whose instances share one prototype), and
generate --duration SECONDS sets another animation duration (default 2.0). A representative
recipe generated with either option no longer matches its pins. KPI never generates or
measures these variants. The Python tests in tests/python_tests/test_reference_fixture_*.py
cover the generator. The opt-in test_kpi_full_fixtures target runs the slow full-profile
generation checks; see
ordinary tests and dedicated workloads.
measure runs a saved bundle through the ovstage runtime that import ovclash loads in the calling
environment. Before you begin, you need a Python interpreter in which import ovclash loads the
ovstage backend, for example a virtual environment with the ovstage ovclash
wheel installed. python in the command stands for that
interpreter. python -c "import ovclash; print(ovclash.backend_info().backend_name)" prints
ovstage when it is the right one. When it prints openusd or unknown, or import ovclash
fails, measure cannot run in that interpreter: install the ovstage ovclash wheel into it, or use
one that has it. Run the command from ovclash/, so that benchmarks is importable, and replace
SAVED_BUNDLE and NEW_REPORT_DIRECTORY as for the structural census. It
writes a JSON receipt to a new path outside the bundle:
python -m benchmarks.kpi.reference_fixtures measure --kind dynamic --report NEW_REPORT_DIRECTORY/receipt.json SAVED_BUNDLE
Option |
Default |
Meaning |
|---|---|---|
|
|
|
|
|
Dynamic samples per second |
|
|
Worker tasks, 1 to 256; 1 runs single-threaded |
|
off |
Also read every full native report, with report flags 30: the outline, the faces of both meshes and the points |
|
required |
New receipt path outside the bundle |
The command prints the receipt and writes it to --report. It exits 0 when the audit passes and
2 when the audit failed; a rejected input exits 4 with reference fixtures: <reason>. The
receipt holds these fields, all required:
Field |
Type |
Required |
Default or values |
Description |
|---|---|---|---|---|
|
integer |
Yes |
|
Receipt format version |
|
string |
Yes |
|
The bundle’s profile ID and assembly family |
|
string |
Yes |
|
The |
|
number |
Yes |
The bundle’s animation duration and the |
|
|
integer |
Yes |
The |
|
|
string |
Yes |
64 lowercase hexadecimal digits |
The measured bundle’s closure digest |
|
string |
Yes |
64 lowercase hexadecimal digits |
The KPI measurement identity; see measurement identity |
|
object |
Yes |
|
The fields of |
|
string |
Yes |
64 lowercase hexadecimal digits |
SHA-256 of the loaded native library |
|
object |
Yes |
The settings applied to the run |
|
|
object |
Yes |
The search sets |
|
|
object |
Yes |
The stage timeline data |
|
|
number |
Yes |
Seconds |
Stage opening, pipeline creation, the sum of the pipeline steps, result capture and audit |
|
array of objects |
Yes |
One per pipeline step |
|
|
object |
Yes |
The query statistics |
|
|
object |
Yes |
The result counts, the per-sample record histogram and the membership digests; with |
|
|
object |
Yes |
|
The audit against the contact plan, including |
|
object |
Yes |
|
Diagnostic host counters before the run and process memory at result-ready; no CPU admission |
|
string |
Yes |
States that the receipt is a diagnostic measurement only |
measure rejects a backend other than ovstage and a bundle whose recipe identity differs from
recipe.json. It cannot tell
whether the current generator modules generated the bundle, so regenerate a diagnostic bundle
after you edit them. measure is outside the KPI path: it approves neither expected work nor a
timing budget. Product correctness coverage belongs in Sentinel.
Saved-reference diagnostic limits#
The saved-bundle readers in benchmarks/kpi/reference_capture.py, reference_census.py and
reference_geometry.py validate the closed USDA grammar and the member hashes, and they bound
their work. By default they allow a 180-second construction deadline, 4,000,000 composition
operations, 250,000 composed nodes and 256 MiB of accounted composition storage (conservative
accounting, not the process’s resident set size, RSS). An exhausted bound prevents a complete diagnostic or qualification and
never authorizes a partial result.
reference_geometry is the independent geometry oracle of the reference-fixture tests; no KPI
check, budget or baseline flow imports it. Its native fixture tests run only with
OVCLASH_KPI_REFERENCE_GEOMETRY_NATIVE=1 and a configured runtime.
Package layout#
The benchmarks/kpi/reference_fixtures/ package holds these modules:
Module |
Role |
|---|---|
|
The |
|
The size tiers by profile ID, and the recipe identifier and version |
|
|
|
The |
|
The contact-group pool layout |
|
The contact-boundary cuts that the planner applies to a built plan |
|
The streaming USDA writer of the bundle layers ( |
|
Hierarchy recipes, cluster dimensions, special contact shapes and part frames |
|
Streamed mesh surfaces and exact angle values |
|
Mover keys, sample grids and analytical contact plans |
|
|
|
The Cockpit byte preflight |
|
|
generator.py looks up the contact cuts and _Writer in its own globals, so tests patch those
names on generator. preflight.estimate_plan subclasses _Writer to count bytes, so the
method names and signatures of _Writer are an extension API.