Upgrading from ovstage 0.3#
This page lists what a 0.3 application must change to run on 0.4, what behaves differently without a source change, and what is new. The complete record is the [0.4.0] section of CHANGELOG.md for this documentation version. There are no deprecation aliases: a removed or renamed name fails immediately.
Use headers, native libraries and Python bindings from one 0.4 package, and rebuild every native consumer. Several public types keep their size but change meaning, so a 0.3 binary is not compatible with 0.4 even where structure sizes match.
An agent can apply the mechanical changes with the update-0-3-to-0-4 skill (skills/update-0-3-to-0-4/SKILL.md).
Breaking changes#
The breaking changes fall into four groups, from changes the compiler reports to changes that only alter populated data.
C/C++ names and layouts#
Most of these fail to compile or link against the 0.4 headers or fail at symbol lookup. The new selector fields compile without a change, so search for selectors explicitly. Python is unaffected unless it uses the ctypes structures directly.
Change |
Who is affected |
What to do |
Before / after |
|---|---|---|---|
Renamed C types |
Code that names |
Rename to |
/* 0.3 */ ovx_string_or_token_t name;
/* 0.4 */ ovx_token_or_string_t name;
|
|
Code that reads |
Use |
/* 0.3 */
instance->vtable->read_attributes(instance->context, ...);
/* 0.4 */
instance->data_plane.vtable->read_attributes(
instance->data_plane.context, ...);
|
Population selectors and prim predicates grow |
C/C++ code that builds |
|
/* 0.3 */
ovstage_population_selector_t sel;
sel.prim_predicate = ...; /* every 0.3 member */
/* 0.4, C */
ovstage_population_selector_t sel = {0};
/* 0.4, C++ ({0} does not convert to the
predicate's enum) */
ovstage_population_selector_t sel{};
|
Implementations and wrappers of the vtable |
Code that defines, forwards or interposes |
Rename the |
/* 0.3 */
ovstage_instance_t inst = { &vtable, ctx };
/* 0.4 */
ovstage_instance_t inst = {
{ &data_plane_vtable, ctx },
ext_instances };
|
Typed identities#
Ids, handles, tokens and paths are distinct types. Passing a plain integer or a handle of the wrong kind fails to compile in C and C++ and raises TypeError in Python. Comparing does not raise in Python: a handle compared with an integer is never equal, so op_id == 0 or token == 0 silently becomes False. Compare with the ovstage.INVALID_* constants (INVALID_OP_ID, INVALID_QUERY_HANDLE, …) or with typed values, or test bool(handle), which is true when the handle is not its kind’s invalid value.
Change |
Who is affected |
What to do |
Before / after |
|---|---|---|---|
Typed operation ids and handles |
C, C++ and Python code that stores, compares or passes op ids, query, read, map, hierarchy, population or result handles as integers. |
Keep the typed values ( |
/* 0.3 */
uint64_t op = result.op_index;
/* 0.4 */
ovstage_op_id_t op = result.op_index;
|
Typed tokens and paths |
Code that treats |
Keep the typed values. In C compare |
# 0.3
tensor[i] = pd.intern_path("/World")
# 0.4
tensor[i] = pd.intern_path("/World").raw_id
path = ovstage.PrimPath(int(tensor[i]))
|
|
Code that uses token |
Test against |
/* 0.3 */
if (token == 0) { /* no token */ }
/* 0.4 */
if (token.raw_id == OVX_INVALID_TOKEN.raw_id) { /* no token */ }
|
Ordinals and reads#
The ordinal domain and the shape of read results change. Some of these still compile and fail or return different results at run time.
Change |
Who is affected |
What to do |
Before / after |
|---|---|---|---|
|
Code that reads current values with |
Use |
/* 0.3 */
range.end_ordinal = UINT64_MAX;
/* 0.4 */
range.end_ordinal = OVSTAGE_ORDINAL_MAX;
|
Array fetch and |
C code that calls |
Pass an output array, a positive capacity and a count to the fetch, and release with |
/* 0.3 */
while (ovstage_fetch_read_next(inst, read, t, &group)
== OVSTAGE_OK) {
/* use group */
ovstage_release_group(inst, &group);
}
/* 0.4 */
while (ovstage_fetch_read_next(inst, read, t,
groups, cap, &n)
== OVSTAGE_OK) {
/* use groups[0..n) */
ovstage_release_groups(inst, groups, n);
}
/* then check the status is
OVSTAGE_ERROR_END_OF_ITERATION */
|
Read groups hold columns |
C and Python code that reads |
Read them from |
# 0.3 (one attribute per group)
values = group.array(0)
# 0.4, read of one attribute
values = group.columns[0].array(0)
# 0.4, read of several attributes
points = pd.intern_token("points")
for column in group.columns:
if column.attribute == points:
values = column.array(0)
|
Migrating read consumers from 0.3#
The read changes in the table above apply even to single-attribute reads.
Rebuild C/C++ consumers against the new headers and use matching Python
bindings and native libraries: ovstage_read_group_t now contains
prims, columns, column_count, and the release identity. Its former
attribute, ordinal, is_delete, is_array, semantic, data,
and meta members belong to each ovstage_read_column_t.
In Python, move payload accessors to ReadColumn as shown in the table.
Prim accessors (prim_list, prim_count, and prim_index()) remain on
ReadGroup. MapGroup keeps its writable single-attribute interface.
Then check each read loop against Read Groups and Columns, especially
the independent prim/value mappings, omitted columns, masks, and borrowed-view
lifetimes. The reading guide includes tested
multi-column examples and the C batching contract.
Populated data#
These compile and run unchanged but populate different data. Search for them explicitly. Refer to Population (USD → ovstage) and Instancing Queries.
Change |
Who is affected |
What to do |
Before / after |
|---|---|---|---|
|
Code that populates with |
Pass the physics population description your physics library provides through a |
# 0.3: domains = PHYSICS | RENDERING
# 0.4: descs = [physics_desc,
# desc with domains = RENDERING]
|
Instance roots carry their authored type |
Code that finds instance roots by |
Find instance roots with the instancing queries. Read their type from |
# 0.3: usd-prim-type = XformInstance
# 0.4: usd-prim-type = <authored type>
|
|
Code that reads |
Read |
# 0.3: prototypes:usd-targets = authored targets
# 0.4: prototypes = authored targets
|
Render camera targets |
Code that reads |
The targets are kept in authored order whatever their type, including targets that do not resolve; property paths stay excluded. Check each target’s type and skip the ones you do not support. |
— |
|
Code that reads |
|
# 0.3: float3[] as authored
# 0.4: {kDLFloat, 64, 6}
|
Behavior changes#
These need no source change but can alter results.
Attribute names containing an asterisk. Writes, maps, deletes, query filter predicates and attribute lists,
advance_write_floorwithSCOPE_INCLUDEorSCOPE_EXCLUDE, andget_attribute_write_floorreject a name that contains*withOVSTAGE_ERROR_INVALID_ARGUMENT. In reads, a single trailing*(*orprefix*) is a selector pattern; any other*fails withOVSTAGE_ERROR_INVALID_ARGUMENT.Range reads of usd-path. A range read of
usd-pathreturns one tombstone group for the query prims deleted whole in the range, and fails withOVSTAGE_ERROR_WRITE_FLOOR_VIOLATIONunless theusd-pathwrite floor is at or above the range end. Advance it withSCOPE_ALL, orSCOPE_INCLUDElistingusd-path, before the read.Retention frontier. Prim creations and whole-prim deletes keep history for
usd-pathrange reads, which can raiseovstage_get_oldest_preserved_ordinalfor every caller. Query the frontier instead of caching it.Changed-property export.
since_ordinalaccepts zero and negative values; it must still precede the export ordinal.Live USD edits. Adding, removing or changing a property republishes that property and the values population computes from its prim (derived properties,
RENDERINGschema tags and, after a transform op edit, the transform), rewriting them on every property edit even when they do not change, so they appear in change ranges. The whole prim is republished only when a description’s prim predicate reads the property, the property is a relationship and a description brings relationship targets into scope, or it is a new collection property. The prims below it are republished only when a predicate reads the property on an ancestor (HAS_ANCESTOR,HAS_PARENT,HAS_PURPOSE) or a derived property resolves a material binding from it. In 0.3, adding or removing a property republished the prim and every prim below it. Instances, prototype content and prims below aPointInstancerstill republish with their subtree.Scene hierarchy. Clones, populated prims and deletes now reconnect prims in the scene hierarchy, which can change transforms and hierarchy answers and can make structural operations fail under a retained read. See Scene hierarchy below.
Maps of the type, schema and ancestor-type tags.
ovstage_map_attribute(PythonStage.map_attribute) on these names now takes effect: the committed token ids become the prim’s type, applied-schema and ancestor-type tags, as after a copy-in write, and a map that creates a prim gives it that type. In 0.3 such a map could land in a value column no reader consulted, so it did not change the tags; this is a correction, not the removal of a working GPU path. The map must be host-resident and canonical:dtypeomitted or{kDLUInt, 64, 1}, semanticNONE,element_sizesgiven forusd-schemasandusd-ancestor-typesand omitted forusd-prim-type, and a query that names each prim once. A CUDA placement returnsOVSTAGE_ERROR_NOT_SUPPORTED, even for an empty query that 0.3 completed as a no-op. Like a copy-in write of these names, a commit is refused while any attribute of a mapped prim has an outstanding read, so release those read groups before committing; a failed accepted commit ends the map session (see the map-commit recovery item under Scene hierarchy). A staged row whose ids name nothing fails the commit before any tag changes.Process environment. ovstage sets
HD_ENABLE_SCENE_INDEX_EMULATION=0before loading OpenUSD, and release loaders setTF_ENV_SETTING_ALERTS_ENABLED=0. Both override inherited values and are inherited by child processes.Resolver context.
ovstage_create_instancecaptures theArResolverContextbound on the calling thread and uses it for every population layer open. Bind or configure a context-dependent resolver before creating the instance. Instance creation can be the process’s firstArGetResolver()call, which fixes OpenUSD’s primary resolver, so select one withArSetPreferredResolverbefore creating the first instance. Destroy the instance before releasing the resolver runtime its captured context refers to.Bundled Omniverse Client Library 2.76.0.
omniverse_connectionis no longer shipped inbin/plugins/omni.client.lib.
Scene hierarchy#
Writes, maps, clones, deletes and USD population now keep one scene hierarchy. Prims are reconnected under their real parent when it appears, which changes derived transforms and hierarchy answers that 0.3 left stale. Refer to Cloning Subtrees and Transforms.
Late parents adopt their children. A clone whose destination parent does not exist attaches to the nearest existing ancestor, as before. When a later write, map, clone or population creates the parent, the clone root moves under it, and its derived transforms are recomputed on the next computation trigger. Populated prims whose parent is not a prim, such as a
RENDERINGinstance proxy under a prototype intermediate, are reconnected the same way. Create destination parents before cloning where you can: the copies then land in their final place at once and nothing is reconnected later.Deletes reattach surviving children. Deleting a prim that has connected children moves them under the nearest remaining ancestor; creating the prim again adopts them. A clone whose target root still has such children reattaches them and counts them in
prims_cloned.Parents gain the world matrix attribute. A written or mapped parent of prims that carry
omni:fabric:worldMatrixreceives the attribute once it has both those children and a local transform, and so do its written ancestors up to the first that already has it. The ancestor a clone root attaches to while its destination parent is absent receives it the same way when the clone is published. Its value is the identity until the next computation.Retained reads can block structural operations. Receiving that attribute relocates the prim’s storage. A write, map or clone that would give it to a prim that a fetched, unreleased read group covers fails with
OVSTAGE_ERROR_OP_FAILEDand the rejected operation creates nothing. A delete that would give it to the remaining ancestor fails the same way and deletes nothing. The prim need not be a target: it can be the destination parent or one of its ancestors, a prim with a transform input between a target and a descendant that carries the attribute, or an existing descendant a clone merges into.Recovering from that failure.
OVSTAGE_ERROR_OP_FAILEDalso has other causes, so read the diagnostic first (see Error Handling and Diagnostics). If a held read group is the cause, release it before trying again; releasing it does not undo or complete the failed operation.Writes. Entries that completed before the failure stay applied, and the API does not report which ones did. Treat a failed batch as possibly partial and do not infer completion from query visibility. Prefer repairing it with a newer ordinal. A corrected retry at the same ordinal is safe when no entry completed; under
STRICTLY_INCREASING, replaying completed cells at their recorded ordinal is rejected, while the other admission policies may admit it. Finish the repair before advancing the watermark, as Recovering from a Failed Write describes.Map commits. A map commit is not transactional: a failed commit is not undone, so some of its changes can remain. After an accepted group commit fails, the map session is terminal and its groups cannot be committed again, even once the read group is released. Call
unmap_attributeto end the session, then repair with a new map session or a write.
Population defers instead of failing. A population step in the same situation succeeds: the affected prims keep the parent population gave them, a warning is logged once, and they are connected at the next population step or
ovstage_compute_hierarchy()call after the groups are released, or at the next write, map or clone that targets that parent and adds attributes or maps its transform input. Releasing the groups alone connects nothing.Hierarchy answers. Cloned prims now appear under their parents in
ovstage_get_hierarchy()PARENT,CHILDRENandSIBLINGSanswers; in 0.3 they reported no parent and no children. A prim written, mapped or cloned under a parent that exists only through USD population reports that parent fromovstage_get_hierarchy()PARENT. A populated prim whose parent is not a prim reports noPARENTuntil the parent exists, where 0.3 reported the ancestor it hung under; that ancestor’sCHILDRENand its other children’sSIBLINGSlist it meanwhile.usd-parentandusd-childrenare unchanged.
New in 0.4#
OVSTAGE_ORDINAL_MINandOVSTAGE_ORDINAL_MAX(PythonORDINAL_MINandORDINAL_MAX).OVSTAGE_FILTER_OP_NOT_HAS(PythonFilterOp.NOT_HAS): leave out prims that have an attribute. Refer to Queries.Attribute selector patterns
*andprefix*inread_attributes. Refer to Reading Attributes.CUDA placed reads of numeric array-valued attributes, including ragged and empty arrays.
Population predicates
TARGETS,HAS_DESCENDANT,IS_TARGETED_BYandIS_INSTANCE, and derived properties with expressions, including resolved material bindings and collection members. Refer to Population (USD → ovstage).ovstage_instancing_resolve_paths(Pythonovstage.instancing.resolve_paths) andovstage_instancing_get_instance_roots_batch(Pythonovstage.instancing.get_instance_roots_batch). Refer to Instancing Queries.OVSTAGE_CONFIG_POPULATION_THREAD_LIMIT(PythonStageConfig.population_thread_limit) andOVSTAGE_CONFIG_POPULATION_STRICT_RESOLUTION(PythonStageConfig.population_strict_resolution), withOVSTAGE_POPULATION_THREAD_LIMIT_AUTO(Pythonovstage.POPULATION_THREAD_LIMIT_AUTO).
Checklist#
Search the application for these patterns before building against 0.4. The rows follow the groups above.
Pattern |
Action |
|---|---|
|
Rename. |
|
Use |
definitions or wrappers of |
Rename |
|
Zero-initialize it ( |
op ids, handles, tokens or paths held as integers, compared with integers ( |
Keep typed values; compare with |
|
Test |
|
Use |
|
Fetch into an array while the status is |
|
Pass the physics description; use |
|
Find instance roots with the instancing queries. |
|
Read |
|
Filter camera targets by type; read |
attribute names containing |
Rename; use |
|
Advance the |
read groups held across writes, maps, clones or deletes; assertions on |
Release groups first; create destination parents before cloning; on |
|
Use a canonical host-resident map without CUDA placement; release read groups on the mapped prims before committing. |