ovclash Architecture Overview#

This page of the Technical Guide explains how ovclash is layered. It covers the API surfaces, the flow of one query through them, the source tree, the Python packages and how to add a capability. The Glossary at the end defines the implementation terms; Concepts defines the consumer vocabulary.

What ovclash is#

ovclash is the standalone clash-detection product of this repository. It runs outside Kit, NVIDIA Omniverse’s application framework, and is a sibling of ovphysx, the repository’s library for USD physics simulation outside Kit. It loads USD stages, runs static and dynamic queries, returns the results, stores them and exports them.

ovclash is pre-release software. The ovstage backend, which reads USD through the ovstage runtime, is the product. The OpenUSD backend is an unpublished parity reference; Backends compares the two.

API surfaces#

ovclash has two C ABIs (application binary interfaces) and three Python packages. The Suite ABI is built on the canonical ABI. ovclash and ovclash_suite each wrap one C ABI. The compatibility package wraps ovclash_suite.

Surface

Layer

Use it for

<ovclash/ovclash.h>

Canonical C ABI

Contexts, settings, scopes, pipeline runs and raw results

<ovclash/ovclash_ovstage.h>

ovstage-only extension of the canonical ABI

The matrix-decomposition mode per context, attaching a Stage that the caller owns (an attached stage), and owner operations

<ovclash_suite/ovclash_suite.h> and the other headers in include/ovclash_suite/

Suite C ABI, built on the canonical ABI

Runtime, result conversion, models, SQLite and JSON directory stores, export and file utilities

<ovclash_suite/ovclash_suite_ovstage.h>

ovstage-only extension of the Suite ABI

Stage attachment and owner operations for Suite runtimes

ovclash (Python)

ctypes binding of the canonical ABI

ClashRuntime and its result types

ovclash_suite (Python)

ctypes object API over the Suite ABI

ClashDetection, ClashData, ClashQuery and the serializers

omni.physxclashdetectioncore (Python)

Compatibility imports for Kit code, backed by ovclash_suite

Existing Kit-era callers

The C API reference documents both C ABIs. ovstage integration explains Stage attachment and owner operations.

Two more headers complete the public include tree:

  • include/ovclash/ovclash_export.h defines OVCLASH_API. No other header defines it.

  • <ovclash/version.h> is generated from cmake/version.h.in and installed beside the other headers.

The string type is not an ovclash type. ovclash_string_t is a typedef of ovx_string_t, which <ovx/string_types.h> declares. ovclash never defines, copies or installs it. On an include tree of the ovx headers without that header, ovclash.h includes <ovx/types.h> instead. Linking in the C/C++ quickstart explains where consumers find these headers. The Suite headers use a local twin, ovclash_suite_string_t, with the same layout.

Features#

  • Scene input: a USD stage opened from a local file, or an ovstage Stage that the caller already owns and attaches.

  • Queries: full-scene or scoped mesh-vs-mesh, point-vs-mesh, duplicate-mesh search and dynamic mesh-vs-mesh.

  • Execution: one pipeline step at a time, or the whole pipeline asynchronously behind a handle that the caller polls, finishes or cancels (Async pipelines).

  • Results: overlap counts and records, duplicate records, query statistics, overlap reports with DLPack views, depth and depenetration helpers, and prim transforms.

  • Persistence: queries, clash records, frames and point-cloud settings in a SQLite .ovclashdb file or a JSON directory store, plus reading and migrating legacy .clashDetection containers.

  • Export: JSON and HTML, generated in native code.

  • Samples: C++ and Python processors over both C ABIs. Also the ovRTX clash sample app, a developer viewer that renders a stage with ovRTX, runs queries through the Suite and lists their results. It is not part of the product surface and ships in neither package (ovRTX clash sample app).

ovclash has no Kit timeline or Kit current-context behavior and no product UI. Limitations lists the consumer-visible limits.

Mental model#

One query follows the same steps on every layer:

Step

Canonical C

Suite C

Python ovclash_suite

1. Create a runtime

ovclash_create_context

ovclash_suite_create_runtime

ClashDetection()

2. Open a stage

ovclash_open_stage

ovclash_suite_open_stage

open_stage()

3. Apply settings

ovclash_set_settings

ovclash_suite_set_run_settings

set_settings()

4. Set the scope (optional)

ovclash_set_scope_paths

ovclash_suite_set_scope

set_scope_paths()

5. Build the pipeline

ovclash_create_pipeline

ovclash_suite_create_pipeline

create_pipeline()

6. Run it

ovclash_run_pipeline_step per step, or ovclash_run_pipeline_async

ovclash_suite_run_pipeline_step, or ovclash_suite_run_pipeline_async

run_pipeline_step(), run_pipeline() or run_async_pipeline()

7. Read results

ovclash_get_overlap_count, ovclash_get_overlap_data

ovclash_suite_get_nb_overlaps, ovclash_suite_get_overlap_data

get_nb_overlaps(), get_overlap_data()

8. Save results

none

ovclash_suite_runtime_fetch_and_save_begin into an ovclash_suite_data_t

fetch_and_save_overlaps() into a ClashData

9. Export

none

ovclash_suite_export_rows_json, ovclash_suite_export_rows_html

export_to_json(), export_to_html()

10. Release

ovclash_release_context

ovclash_suite_destroy_runtime

destroy()

Release explicit handles in reverse order of creation.

The scope, the prim paths of search sets A and B, follows different rules in the two C ABIs:

  • Canonical C: opening a stage and applying settings both clear the scope. Set the scope last.

  • Suite C and Python: a scope survives a settings change, so the order of steps 3 and 4 does not matter. Opening a stage still clears it.

Suite runtime and fetch explains steps 8 and 9 inside the Suite. Persistence, export and legacy migration covers the stores.

One query in C#

This function runs one static query of /World/A against /World/B through the canonical ABI. It returns the overlap count, or -1 on failure. It is not a complete program: put it in a C source file of your own that links the ovclash CMake target, and call it from your main. <ovclash/ovclash.h> already includes <stdbool.h> and <stdint.h>. The C/C++ Quickstart shows a complete program and its build. Canonical C in the settings reference lists the fields of ovclash_settings_t, which <ovclash/ovclash.h> declares.

#include <ovclash/ovclash.h>
#include <stdio.h>

static int64_t count_overlaps(ovclash_string_t stage_path)
{
    ovclash_context_t* context = NULL;
    if (ovclash_create_context(&context).status != OVCLASH_STATUS_SUCCESS)
        return -1;

    const ovclash_string_t scope_a[] = { { "/World/A", 8 } };
    const ovclash_string_t scope_b[] = { { "/World/B", 8 } };
    ovclash_settings_t settings;
    uint32_t step_count = 0;
    uint32_t overlap_count = 0;

    /* Open the stage and apply the settings first: both clear the scope. */
    bool ok = ovclash_open_stage(context, stage_path).status == OVCLASH_STATUS_SUCCESS &&
              ovclash_reset_settings(&settings).status == OVCLASH_STATUS_SUCCESS &&
              ovclash_set_settings(context, &settings).status == OVCLASH_STATUS_SUCCESS &&
              ovclash_set_scope_paths(context, scope_a, 1, scope_b, 1).status == OVCLASH_STATUS_SUCCESS &&
              ovclash_create_pipeline(context, &step_count).status == OVCLASH_STATUS_SUCCESS;
    for (uint32_t step = 0; ok && step < step_count; ++step)
        ok = ovclash_run_pipeline_step(context, step).status == OVCLASH_STATUS_SUCCESS;
    ok = ok && ovclash_get_overlap_count(context, &overlap_count).status == OVCLASH_STATUS_SUCCESS;

    if (!ok)
    {
        ovclash_string_t error = ovclash_get_last_error(context); /* borrowed: use it before the next call */
        fprintf(stderr, "ovclash: %.*s\n", (int)error.length, error.ptr);
    }
    ovclash_release_context(context);
    return ok ? (int64_t)overlap_count : -1;
}

For a stage in which /World/A and /World/B intersect, the function returns 1. For a missing file it prints ovclash: Failed to open USD stage: missing.usda and returns -1.

The canonical ABI follows these rules:

  • Every entry point returns an ovclash_result_t. Compare result.status with OVCLASH_STATUS_SUCCESS, which is 0. The three string getters ovclash_get_result_string, ovclash_get_last_error and ovclash_get_version_string return their string directly.

  • Values come back through out-parameters.

  • Strings are ovclash_string_t spans: a pointer and a byte length.

  • Boolean run toggles are bits in ovclash_settings_t::flags, such as OVCLASH_SETTINGS_FLAG_FULL_SCENE.

  • Some state is process-global: the bootstrap, the stage and path registries, and the OpenUSD cancellation, out-of-memory and error state. Threading and Ownership gives the rules.

  • ovclash.h declares its standalone entry points only when OVCLASH_STANDALONE is defined. They are file-backed stage access, path encoding and scopes, the per-context last error, settings readback, the version queries and the DLPack report interop. The ovclash CMake target and ovclash.pc define the macro for consumers.

The C API conventions are the full contract.

One query in Python#

ovclash_suite.ClashDetection is the main Python runtime object. The same query in Python also changes one setting. ovclash_suite Python in the settings reference lists every SettingId key. Save the script and run it with an interpreter that has the ovclash wheel installed, from the directory that holds scene.usda:

from ovclash_suite import ClashDetection, SettingId

clash = ClashDetection()
try:
    clash.open_stage("scene.usda")
    clash.set_settings({SettingId.SETTING_TOLERANCE: 0.25})
    clash.set_scope_paths(["/World/A"], ["/World/B"])
    for step_index in range(clash.create_pipeline()):
        clash.run_pipeline_step(step_index)
    print("overlaps:", clash.get_nb_overlaps())
finally:
    clash.destroy()

For the same stage it prints:

overlaps: 1

The Suite C ABI#

The Suite C ABI wraps the canonical ABI and adds the product behavior. Its rules:

  • Every function returns ovclash_suite_result_t, except the three last-error getters ovclash_suite_get_last_error, ovclash_suite_data_get_last_error and ovclash_suite_get_thread_last_error.

  • On failure, read the last error of the handle that failed. Handle-free functions record a thread-local last error instead.

  • String inputs are ovclash_suite_string_t spans. A null pointer is valid only with length 0.

  • Text outputs take a buffer and its byte size and report the required size. A null buffer with size 0 is the size query.

  • Returned views are borrowed. Their lifetime is stated on the function that returns them. A data getter reuses one scratch record per kind, so the next read of the same kind can invalidate an earlier view.

Source tree#

Generated, local-only outputs live under _build/. The Technical Guide’s Generated outputs section lists that layout.

Top-level files#

Path

Purpose

CMakeLists.txt

The CMake project: targets, backend selection, install and export, samples, tests, validation targets and Visual Studio debugger setup

VERSION, OVSTAGE_VERSION

The product version, read by CMake and Python, and the ovstage pin

config.toml.in

Template of the runtime metadata file config.toml, installed beside the native library

README.md, AGENTS.md, CLAUDE.md

The landing page, with the quick starts and the build and validation commands, and the engineering rules for contributors and agents. CLAUDE.md only includes AGENTS.md.

CHANGELOG.md

The release history

.clang-format, .isort.cfg

Formatter configuration. .clang-format turns layout changes off; it exists because repo format requires it. .isort.cfg sets the Python import order.

.gitattributes, .gitignore

Line endings, byte-exact golden files and Git LFS rules; ignored local trees

LICENSE.txt, THIRD-PARTY-NOTICES.txt

The Apache-2.0 source license; the source files under other licenses or with extra attribution

build_ovstage.*, build_openusd.*, build.bat, build_native.sh

Build wrappers. Wrapper flags lists the options.

test_all.*, test_sentinel.*, run_kpi.*

Full validation of both backends, Sentinel and KPI launchers

build_packages.*

Package an existing install tree into _build/dist/<backend>

repo.toml, repo.*, build_docs.*

The repo docs and repo format configuration and wrappers

SDK_README.md

The root README.md of the SDK archive

setup_ovrtx_viewer.*, launch_rtx_viewer_*, launch_ovrtx_viewer.py

Setup and launchers of the ovRTX clash sample app

Directories#

Path

Contents

include/ovclash/

The canonical C ABI ovclash.h, the ovstage extension ovclash_ovstage.h and the export macro ovclash_export.h

include/ovclash_suite/

The Suite C ABI ovclash_suite.h, the model ABI ovclash_suite_models.h, the fetch-serializer callback table ovclash_suite_serializer.h, the ovstage extension ovclash_suite_ovstage.h and the public data types ovclash_suite_types.h

source/

The canonical ABI implementation and both backends (Inside source/)

source/suite/

The Suite implementation (Inside source/suite/)

source/usdclash/

The shared clash-engine sources; scripts/usdclash_sources.cmake lists what compiles. ovclash never modifies them.

python/

The Python packages, pyproject.toml, setup.py and the wheel’s WHEEL_README.md

samples/

clash_api/ and clash_suite_api/ (C++ and Python processors over the canonical and Suite ABIs), legacy_clash_detection/ (the legacy .clashDetection container), and the shared launcher helpers build_samples.*, sdk_runtime.py and windows_argv.bat

tests/native/

The native C++ tests, such as ovclash.native.test

tests/c_compat/

The pure-C compatibility smoke test and the C quickstart snippet check

tests/python_tests/

The Python tests: runtime, Suite, bindings, packaging and documentation

tests/sentinel/

The Sentinel controller, checkers, native consumer and golden files

tests/kpi_tests/

Full KPI reference-fixture generation, run only by the explicit test_kpi_full_fixtures target. The other KPI tests are in tests/python_tests/.

tests/common/

ToolHelp.h, the --help and --version handling shared by the native and C test programs and the matrix-decomposition benchmark, and its check CheckToolHelp.cmake

tests/data/

USD stages and expected-export fixtures

scripts/

CMake and Python script entry points: dependency fetch, build, install, tests, wheel, SDK archive packaging, documentation and package-boundary scans

tooling/

Source-checkout infrastructure shared by KPI, Sentinel, CI and the CMake scripts; see Shared repository tooling

tools/

packman/ (the Packman bootstrap) and repoman/ (the bootstrap of the repo tool)

deps/

Packman dependency manifests

cmake/

CMake modules in cmake/modules/, the precompiled-header helper StandaloneEngineTestConfiguration.cmake, the Visual Studio helpers, the installed CMake and pkg-config templates, and the version.h and build-provenance templates

docs/

The Sphinx sources of this documentation. docs/README.md lists every page. Only docs/consumer/ ships as Markdown, in the SDK archive.

benchmarks/

Standalone performance probes for maintainers, one folder each (backend_timings/, fetch_batch/, directory_serializer/, the ovRTX clash sample app’s selection and drag benchmark ovrtx_validation_selection/ and the C++ matrix_decomposition/); launcher_help.py, the --help layout the Python benchmarks share; and the KPI controller in benchmarks/kpi/, which also holds the benchmark helpers it shares with backend_timings

skills/

The agent playbooks and their catalog skills/README.md, shipped in the wheel and the SDK archive

examples/

examples/README.md, the task-keyed index of the samples for readers of the source repository; it does not ship

licenses/

LICENSE-binary.txt (installed as the package LICENSE.txt), physx/LICENSE.md (added to ovclash-LICENSES.zip) and the license and notice of the adapted OpenUSD code in openusd-v25.11/

samples/ovrtx_clash_sample_app/

The ovRTX clash sample app

tests/sample_app_tests/

The ovRTX clash sample app tests, run by the test_python_sample_app target

tests/diagnostics/

An opt-in dependency check for the ovRTX clash sample app’s ovstage environment

The Python tests also cover the viewer scripts, and tooling/ also serves them.

Inside source/#

The canonical ABI has two layers:

  • ovclash_capi_api.cpp exports the ABI. Each exported function is a one-line call to a private operation in the omni::ovclash namespace.

  • ClashApiInternal.h declares those operations. ClashApiCommon.cpp defines the shared ones. The backend files define the rest and own the argument validation and the exception guards.

The ovstage backend is in OvstageClash*.cpp (entry points, pipeline, selection, transforms, geometry, broad phase and collision) and OvstageSceneReader*.cpp (reads from ovstage populations). The OpenUSD backend adapter is OpenUsdClashBackend.cpp. Backend build composition lists what each backend compiles. Runtime architecture explains how each backend runs a query.

The directory also holds:

  • the Carbonite bootstrap and tasking (CarboniteBootstrap.cpp, Tasking.cpp), used by both backends;

  • the OpenUSD stage registry (StandaloneStageRegistry.cpp) and the internal NativeClash wrapper, both OpenUSD-only;

  • RtxViewerDebugEntrypoint.cpp, the Windows rtx_viewer launcher that runs the ovRTX clash sample app in an embedded Python for F5 debugging;

  • rtx/geometryprocessing/simd.h, a scalar stand-in for an RTX header that the shared engine’s PointCloud.cpp includes. Only the OpenUSD backend compiles PointCloud.cpp.

Inside source/suite/#

ovclash_suite_api.cpp exports the Suite ABI with the same forwarding pattern. The private operations are declared in SuiteApiInternal.h and defined in the Suite*.cpp files: runtime, fetch, models, settings, export, formatting, files, system helpers, versioning and view conversion. The stores are in serializers/sqlite/ and serializers/directory/. The Suite consumes the canonical ABI through <ovclash/ovclash.h>.

Python package architecture#

Package

Source

Built on

Import

ovclash

python/ovclash/python/api/

Canonical C ABI

from ovclash import ClashRuntime

ovclash_suite

python/ovclash/python/suite/

Suite C ABI

from ovclash_suite import ClashDetection

omni.physxclashdetectioncore

python/omni/physxclashdetectioncore/

ovclash_suite

from omni.physxclashdetectioncore.clash_detect import ClashDetection

Both ctypes packages live under the ovclash package directory. In the wheel, that directory also holds the native library: bin/ on Windows, lib/ on Linux. The OpenUSD developer wheel adds its OpenUSD runtime in plugins/. The top-level module python/ovclash_suite.py aliases ovclash.python.suite, so import ovclash_suite and its submodule imports resolve to the same module objects.

Native library loading#

python/ovclash/python/suite/_bindings.py loads the native library for all three packages. The canonical binding ovclash.python.api._bindings imports the same lib handle, so the library loads once per process. On import, _bindings.py:

  1. Resolves the library: OVCLASH_SUITE_LIB, else OVCLASH_LIB (an absolute path), else the library bundled in the ovclash package directory. A bare-name lookup runs only with OVCLASH_ALLOW_BARE_LIBRARY_LOAD. Failure raises OSError.

  2. For an ovstage SDK archive, selects the pinned ovstage installation. _ovstage_runtime.py reads the pin from the archive’s ovclash-runtime-dependencies.json. It takes the package from OVCLASH_OVSTAGE_PACKAGE_DIR or from the running interpreter, and requires the exact version. A mismatch raises OSError with the remedy, such as python -m pip install -r <sdk>/requirements.txt, where <sdk> is the extracted SDK archive root.

  3. Prepares the process: the plugin path variables of OpenUSD and ovstage (PXR_PLUGINPATH_NAME, OV_PXR_PLUGINPATH_2511), the Windows PATH and DLL directories, OVSTAGE_LIBRARY_PATH_HINT, and on Linux a global preload of the ovstage libraries.

  4. Declares the Suite prototypes on lib and reads the Suite constants from the library.

  5. Compares the library version with the package version. A mismatch raises RuntimeError.

The loader reads these variables. A flag is enabled by any value other than empty, 0, false, off or no:

Variable

Values

Required

Default

Effect

OVCLASH_SUITE_LIB

Absolute path of the native library

No

Unset

Loads that library. A relative path raises OSError. Checked before OVCLASH_LIB.

OVCLASH_LIB

Absolute path of the native library

For the Python packages of an SDK archive, unless OVCLASH_SUITE_LIB is set

Unset: the library that the wheel bundles

Loads that library. A relative path raises OSError.

OVCLASH_ALLOW_BARE_LIBRARY_LOAD

Flag

No

Off

Falls back to the bare library name on the platform search path when no override is set and the package bundles no library. For development only.

OVCLASH_OVSTAGE_PACKAGE_DIR

Absolute path of an installed ovstage package directory

No

Unset: the ovstage of the running interpreter

Selects the pinned ovstage for an ovstage SDK archive. A package that is not the pinned version raises OSError. The wheel ignores it.

OVCLASH_DISABLE_BUNDLED_PLUGIN_PATHS

Flag

No

Off

Skips the plugin path variables and the plugin DLL directories of the ovclash payload.

OVCLASH_DLL_DIRS

Directories separated by os.pathsep

No

Unset

Windows only: adds DLL search directories for an override or bundled library.

The module docstring of _bindings.py states every variable and the exact order. Native library lookup is the consumer contract, and the environment variable table lists the runtime variables. The packages do not read OVCLASH_TEST_DATA_DIR or OVCLASH_OVSTAGE_ONLY; only the test and sample tooling does. To import the packages from a source checkout, follow Running the module from a source checkout.

Python does not repeat the Suite enum values and schema versions as integer literals. _bindings.native_constant() reads each one from the library through ovclash_suite_get_named_constant, and enums such as SettingId use those values. The Python test test_public_python_constants_are_native_abi_derived checks that the Python and native values match.

The ovclash_suite package#

ovclash_suite is the object API over the Suite C ABI. It keeps the Kit object model: ClashDetection, ClashQuery, ClashData and the serializers. Its public surface is __all__ in python/ovclash/python/suite/__init__.py, which the Python API Reference renders.

The runtime and persistence classes live in these private modules:

Module

Holds

_runtime.py

ClashDetection, AsyncPipeline, AsyncFetchAndSave and the update_clash_states_after_detection flag

_runtime_stage.py, _runtime_settings.py, _runtime_queries.py

The private mixin bases of ClashDetection: stage access and time ranges; run settings and scope; result counts, overlap data, statistics and depth

_redetection.py

Snapshots of detected data and of user edits, which the clash-state policy in _runtime.py uses when overlaps are detected again

_data.py

ClashData, serializer_data_op and the built-in ClashDataSerializerSqlite and ClashDataSerializerDirectory

_data_contract.py

AbstractClashDataSerializer and _NativeFetchSerializerAdapter, which exposes the serializer of a custom store to the native fetch

_data_native.py

_NativeClashDataSerializer, the base of both built-in serializers

_models.py, types.py

ClashQuery, PointCloudSettings and ExportColumnDef; the enums, RunSettings, ClashInfo and ClashFrameInfo

_data.py also re-exports AbstractClashDataSerializer, _NativeFetchSerializerAdapter and _NativeClashDataSerializer.

backend_info() exists in both ovclash and ovclash_suite. Each returns its own BackendInfo dataclass, which names the active backend:

import ovclash_suite

print(ovclash_suite.backend_info().backend_name)  # "ovstage" in a product build

Suite workflows and Persistence show the processor flow. Sample internals covers the samples.

Compatibility package#

omni.physxclashdetectioncore keeps the Kit import names and forwards them to ovclash_suite. Kit compatibility lists what each module exports. It also documents the reduced usd_utils module: its matrix helpers work, and its helpers that need Python OpenUSD (pxr) raise NotImplementedError.

API references#

Native API reference#

Doxygen generates the C API reference from the headers in include/ovclash/ and include/ovclash_suite/. The C API conventions own the status, string and OVCLASH_STANDALONE rules, and Threading and Ownership owns the ownership and threading rules. This guide keeps no symbol inventory.

Internal OpenUSD C++ wrapper#

source/NativeClash.h declares omni::ovclash::NativeClash, a private C++ wrapper. It opens a stage, runs every pipeline step, and reports the overlap count, the last error and the stage ID. Only the OpenUSD library compiles it. It is not installed, not shipped in the wheel and not given to Doxygen. Only the OpenUSD native tests use it. New code uses the C ABIs or the Python Suite API.

Python API reference#

Autodoc generates the Python API Reference from the docstrings. These pages document the consumer-visible Python contracts:

attach_ovstage(), detach_ovstage() and run_ovstage_owner_operation() follow the C rules in ovstage integration.

Adding new functionality#

Follow the ownership rule:

  • C++ owns the implementation.

  • The public C ABI exposes every product capability.

  • Python wraps the C ABI with ctypes and adds convenience. It is never a second implementation.

Steps for a new Suite capability#

Before you begin, build both backends from a source checkout, as Local Development describes. A public declaration change needs both backend implementations.

  1. Declare the public C types and function in include/ovclash_suite/, with its Doxygen contract.

  2. Implement the native behavior in source/suite/.

  3. Validate the C arguments: invalid handles, invalid string spans, invalid UTF-8, null pointers with non-zero counts, and buffer sizes.

  4. Declare the ctypes prototype in python/ovclash/python/suite/_bindings.py.

  5. Wrap the function in the Python API under python/ovclash/python/suite/.

  6. Add C and Python parity tests.

  7. Update the documentation and samples that describe the changed behavior.

  8. Run the focused tests of the change, as Run focused tests describes.

  9. Run build_ovstage.* --release --validate.

  10. Run build_openusd.* --release --validate.

Each validation run ends with All validation checks passed! No bugs, only features.... A failed run marks the failing step FAILED in its summary table and prints the failed command; Validation output explains how to read it.

A public declaration change also needs a deliberate version and compatibility decision, and the API checks that Example: one Suite function through every layer names. AGENTS.md (“Public surfaces, state, and lifetime”) lists the full rule set.

Example: one Suite function through every layer#

ovclash_suite_get_named_constant is a small function that shows each layer.

The public declaration, in include/ovclash_suite/ovclash_suite.h:

OVCLASH_API ovclash_suite_result_t ovclash_suite_get_named_constant(ovclash_suite_string_t name, int64_t* out_value);

The export forwarder, in source/suite/ovclash_suite_api.cpp. The marker comments name the file that implements it; the native tests build their wrapper subsets from these markers:

// API implementation: SuiteConstants.cpp
ovclash_suite_result_t ovclash_suite_get_named_constant(ovclash_suite_string_t name, int64_t* out_value)
{
    return omni::ovclash::suiteGetNamedConstant(name, out_value);
}
// End API implementation

The private operation, declared in source/suite/SuiteApiInternal.h and defined in source/suite/SuiteConstants.cpp. suiteGuard clears the thread-local error and turns C++ exceptions into an error result. In an ovstage build it also rejects a call from inside an ovstage owner operation:

ovclash_suite_result_t omni::ovclash::suiteGetNamedConstant(ovclash_suite_string_t name, int64_t* out_value)
{
    return suiteGuard("ovclash_suite_get_named_constant", [&]() -> ovclash_suite_result_t {
        if (!out_value)
        {
            return suiteError();
        }
        if (!validateSuiteString(name, "name"))
        {
            return suiteError();
        }
        const std::string key = suiteStringToStd(name);
        for (const NamedConstant& constant : kNamedConstants)
        {
            if (key == constant.name)
            {
                *out_value = constant.value;
                return suiteSuccess();
            }
        }
        suiteSetLastError("Unknown ovclash suite constant: " + key);
        return suiteError();
    });
}

The ctypes prototype and the Python wrapper, in python/ovclash/python/suite/_bindings.py, which defines lib, ovclash_suite_string_t and ovclash_suite_result_t. The wrapper is shortened: the module compares the status with the native success constant once it has read it.

import ctypes
from ctypes import POINTER, c_int64, c_void_p

lib.ovclash_suite_get_named_constant.argtypes = [ovclash_suite_string_t, POINTER(c_int64)]
lib.ovclash_suite_get_named_constant.restype = ovclash_suite_result_t


def native_constant(name: str) -> int:
    encoded = name.encode("utf-8")
    value = c_int64()
    c_name = ovclash_suite_string_t(ctypes.cast(ctypes.c_char_p(encoded), c_void_p), len(encoded))
    result = lib.ovclash_suite_get_named_constant(c_name, ctypes.byref(value))
    if int(result.status) != 0:
        raise RuntimeError(f"Loaded ovclash suite library does not expose constant {name}")
    return int(value.value)

Two tests check the C boundary:

  • test_native_api_forwarding.py: each export forwards to its own private operation, with the same arguments in the same order and no added work.

  • test_binding_abi.py: every ctypes structure and prototype matches its header declaration.

Backend rules#

  • The OpenUSD backend stays as the permanent, unpublished parity reference. Keep its code behind the backend boundary. Never add OpenUSD-only product behavior, and never change what the OpenUSD backend computes to fix or speed up ovstage.

  • Keep ovstage code under source/ and behind the ovstage adapter boundary.

  • Do not add public source or backend callback APIs. No public callback supplies geometry or acts as a scene source.

  • When a backend does not support a setting, reject it explicitly with a useful last-error text.

Persistence rules#

  • A schema change needs migration tests from older versions (Schema versions).

  • A migration must keep rows, timestamps, identifiers and the legacy dictionary shapes.

  • Legacy .clashDetection migration must not modify its input.

  • Use the native bulk paths for large frame and report buffers.

Packaging rules#

  • Keep the install tree and the wheel layout aligned (Packaging policy).

  • Do not add Kit or rendering dependencies to the runtime package.

  • scripts/test_no_clash_dependency.cmake fails on any reference to the Kit clash tree. Add an ovclash-no-clash-allow marker only with a stated reason.

  • Verify a change from the packaged install tree, not only from the raw build output.

Glossary#

These are the implementation terms of this guide. Concepts explains the consumer vocabulary.

Term

Meaning

Clash

Any result of a query: a mesh intersection or contact, a duplicate mesh pair, or a point-vs-mesh hit. OverlapType classifies it.

Overlap

One result group that a run of the engine returns

Clash record

The persisted Suite form of one overlap (ClashInfo), with workflow fields such as state, priority and comment

Frame

One time sample of a clash record (ClashFrameInfo). ClashInfo.num_records holds the number of frames that the engine reported.

Query

A persisted clash search definition (ClashQuery): a name, two scope paths and settings

Search set

One of the two prim-path lists of a query’s scope, set A or set B: paths1 and paths2 in C, object_a_path and object_b_path on a Suite query. Each path also covers its descendants. Set A alone is tested against itself; with both sets, A is tested against B

Suite

The product layer: runtime, models, stores, export and the Python compatibility package

Canonical ABI

The canonical clash C ABI, include/ovclash/ovclash.h, installed as <ovclash/ovclash.h>; also called the Clash Detection Engine API. The Suite is built on it.

ovstage

The runtime through which ovclash reads USD: a separate Python package with its native libraries, pinned to one exact version per ovclash release. It supplies the USD runtime and the ovx/ headers; its “ovstage SDK” is its own headers and link library, not the ovclash SDK archive. See the ovstage runtime

ovstage backend

The product backend. It reads the scene through ovstage populations and runs clash detection natively.

Local ovstage mode

The opt-in build mode that builds the ovstage backend against a local ovstage source checkout instead of the pinned wheel (build_ovstage.bat --build-local-ovstage, or OVCLASH_BUILD_LOCAL_OVSTAGE=ON). Packaging and publishing refuse its builds. See Local ovstage source builds

OpenUSD backend

The permanent, unpublished parity reference. It uses namespaced OpenUSD and the shared clash engine. Its unchanged results are the reference when you investigate ovstage parity.

Parity reference

The role of the OpenUSD backend: its unchanged results are the expected answer when ovstage results are compared with it. Never change what it computes to fix or speed up ovstage. See Backends

Shared clash engine

The clash-detection engine sources shared with the Kit extension, under source/usdclash/. The OpenUSD backend compiles the engine list of scripts/usdclash_sources.cmake; ovstage compiles only its Intersection.cpp.

Sidecar

A plain SQLite .ovclashdb file whose path the caller chooses

Legacy container

A Kit-era .clashDetection file: a 16-byte header followed by a SQLite payload

BVH

Bounding volume hierarchy: the tree of mesh world bounds that the broad phase queries for candidate pairs

Broad phase

The run step that pairs meshes whose world bounds overlap. Only these candidate pairs reach the narrow phase

Narrow phase

The run step that tests each candidate pair with PhysX mesh-vs-mesh queries and decides whether it clashes

Cooking

Building the PhysX collision data of a mesh, a midphase tree, from its triangles before the narrow phase. A mesh that cannot be cooked is skipped

PhysX

NVIDIA’s physics SDK. The engine uses its mesh cooking and geometry queries, not its simulation

Carbonite

NVIDIA’s plugin and runtime framework. ovclash uses its bootstrap, globals and carb.tasking workers; ovclash_create_context bootstraps it once per process

Scheduler

The worker source of the parallel phases, which the threading settings select. single_threaded runs every phase serially. Otherwise new_task_manager on, the default, selects the new scheduler, and off selects the legacy scheduler; the settings call them the new and the legacy task manager. On ovstage the new scheduler runs Carbonite’s carb.tasking workers and the legacy one bounded std::thread workers. On OpenUSD they select the engine’s two Carbonite implementations, runTasks and MultiThreader. See Scheduler and worker budget

Packman

NVIDIA’s package fetcher. It downloads the pinned binary dependencies that the manifests under deps/ name, such as CMake, Python, OpenUSD, PhysX and Carbonite, into _build/deps/

ovx headers

The <ovx/...> headers that ovstage ships (ovx/string_types.h, or the older ovx/types.h, and ovx/dlpack/dlpack.h). The public C headers include them for shared types

ovRTX

NVIDIA’s RTX rendering runtime. Only the source-only ovRTX clash sample app uses it; neither package ships it

SDK archive

The C/C++ and Python release package: public headers, native library, Python packages, CMake and pkg-config files, samples and the consumer pages as Markdown. It does not contain ovstage

KPI

The performance benchmark suite under benchmarks/kpi/: nine frozen workloads measured against budgets per CPU model. See the KPI maintainer guide

Sentinel

The correctness campaign under tests/sentinel/. It checks a built SDK archive against independent oracles and reviewed goldens. See Sentinel

Golden

A reviewed, byte-exact expected-result file under tests/sentinel/goldens/ that Sentinel compares output against. See Sentinel goldens

Population

One load of a USD source into an ovstage instance. A description (domains and selectors) chooses the prims and properties, and the rows are written at an ordinal. A file-backed context keeps several, each with one role; Stage populations lists them

Selection population

The Default-time RENDERING population that ovclash_open_stage keeps. It fixes mesh identity, geometry and visibility, and never advances in time

Numeric population

The population that serves every finite-time transform read. It advances forward in time and reopens on a rewind (Numeric population state)

Ordinal

ovstage’s 64-bit ordering key for writes and reads. A population writes its rows at an ordinal and then seals it; a read names the ordinal whose values it wants

Write floor

The ordinal at or below which ovstage accepts no more writes. Advancing it seals the ordinals below it

Tombstone

ovstage’s deletion marker: a read group with is_delete set, reported where an attribute or prim was deleted, or its schema replaced, at an ordinal. It carries no values, so readers treat it as absence

RENDERING domain

The ovstage population domain for meshes, lights, materials and cameras, with their published world matrices and visibility. The selection population uses it, and a population description that requests it is a RENDERING-domain description

Default time

USD’s default time code: the attribute values authored without time samples. ovstage names it with a time of NaN

Earliest

USD’s earliest time (UsdTimeCode::EarliestTime()): each attribute’s first authored time sample. ovclash reads a mesh at Earliest when it authors its points only as samples

Composition

The optional description of how the owner built an attached Stage: its root (a file or USDA text) and the USDA layers it merged, in order. With one, the engine replays the Stage into private engine populations for finite times

Owner

The application that owns an attached Stage and lends it to a runtime. See Attached stage and Owner operation

Prototype

The shared copy of an instanceable asset. ovstage reports it under a synthesized root such as /__Prototype_1, with its meshes in prototype space

Instance root

A scene prim that places a prototype through an instanceable reference, such as /World/RackA

Instance proxy

A path below an instance root that stands for a prim inside the prototype, such as /World/RackA/Box

Placement

One instance of a prototype mesh at one instance root, with its own pose. Extraction replaces each prototype mesh with one placement per instance root

Static purge

The dynamic-query run option OVCLASH_SETTINGS_FLAG_PURGE_PERMANENT_STATIC_OVERLAPS, on in the canonical defaults. The run classifies every mesh once and drops the pairs whose two meshes are both static

Dynamic matrix cache

The ovstage backend’s per-context cache of the sampled world matrices of a dynamic query. Playback keeps them in bounded windows, at most 32 frames within a fixed 1 GiB budget. It is on by default. ClashRuntime.set_ovstage_dynamic_matrix_cache(False) turns it off, and playback then reads one frame at a time without prefetch. See Matrix windows during playback

Validation observer

The engine event recorder that OVCLASH_ENGINE_VALIDATION_OBSERVER compiles in. Only private test programs define it, such as Sentinel’s ovclash.sentinel_engine.test; the product library never does

Gf

OpenUSD’s math library (GfMatrix4d, GfTransform). The ovstage backend reproduces its matrix decomposition without linking it

Fabric

NVIDIA Omniverse’s runtime scene-data store, which ovstage uses internally. Its registries are process-global, and some populated attribute names carry its prefix, such as omni:fabric:worldMatrix

Omni client

The Omniverse client library that the ovstage runtime loads to resolve omniverse:// URLs. OVCLASH_OMNI_CLIENT_RETRY_MAX_MS sets its reconnect window

Nucleus

NVIDIA Omniverse’s asset server, reached through omniverse:// URLs

ovui

The Python UI toolkit that provides omni.ui outside Kit. The ovRTX clash sample app builds its interface with it

Session layer

In USD, the strongest layer of a stage, for edits that are not saved to the source. The ovRTX clash sample app exports viewer_session.usda, which composes the source stage with the current edits and the camera and light state

Query lease

The ovRTX clash sample app’s exclusive hold on its scene while a query runs (acquire_query_scene()). Edits, inspection and rendering wait until detection and persistence finish

PVD

PhysX Visual Debugger. PhysX checked builds keep its hooks; release builds strip them

TBB

Threading Building Blocks (oneTBB), the C++ task-parallelism library that OpenUSD uses. The Packman OpenUSD package carries it, and only the OpenUSD backend links it

CRT

The Microsoft C and C++ runtime that MSVC-built binaries import: the Visual C++ runtime DLLs and the Universal CRT. /MD selects its Release DLLs and /MDd its Debug DLLs. No ovclash package bundles it

PDB

Program database: the Windows debug-symbol file that the MSVC linker writes beside a DLL or executable (/Zi, /DEBUG). Release SDK archives and every wheel ship none

PEP 440

The Python packaging standard for version identifiers. Its local segment, the part after +, marks a build that is not a public release, such as <VERSION>+openusd, where <VERSION> is the content of the VERSION file

Omni PhysX

The PhysX integration of Kit. Its runtime lives in this repository’s ovphysx/ovruntime/

OV Libraries V2

The API guidelines for NVIDIA Omniverse libraries. ovclash follows its shared ovx_ types and its package-root pkgconfig/ location

Repo tool

NVIDIA’s repository tool (repo.bat, repo.sh), configured by repo.toml. ovclash uses it for repo docs and repo format