fix(pcp): compose nested instance proxies - #135
Merged
mxpv merged 2 commits intoAug 14, 2026
Conversation
A nested instance can itself be an instance proxy when it is authored inside a payload-backed outer prototype. register_prototype previously seeded the nested prototype from the sparse instance namespace instead of the prim that composes inside the enclosing prototype, so the prototype root advertised child names while its descendants had no specs. Resolve the instance through effective_path before deriving its key and materializing its prototype. Keep the original instance path for registry membership and load-rule scoping. Add a three-layer regression fixture with sub-root payload and reference targets. The test proves that a value beneath the nested proxy resolves and maps into the nested prototype.
yohawing
marked this pull request as ready for review
August 14, 2026 11:05
Owner
|
Good catch, thanks for opening this! I think the payload isn't the trigger. I've spent some tokens - minimal repro is a single
I'll fold in a few cleanups before merging: single-file fixture to match the |
The payload and the extra layers were incidental: the trigger is a nested instance whose reference targets a sub-root prim, which reproduces in a single layer. Swap the fixture for one matching the other instancing_* fixtures, and assert what the fix guarantees — the proxy path is never composed in place, and both routes to the nested instance resolve to one prototype. materialize_prototype is handed the path whose index composes the instance, so name and document it as such rather than as the canonical instance. Note why the key takes its arcs from that path but its load rules from the instance's own path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Compose nested instance prototypes from the prim that actually composes inside
their enclosing prototype.
Add a three-layer regression fixture containing:
Root cause
register_prototypeaccepted an instance path that could itself be an instanceproxy. It built the nested prototype key and materialized root from the sparse
authored namespace at that path. Child-name composition could still discover
the nested reference, but the materialized prototype descendants had no
contributing specs.
Resolve the instance through
effective_pathfirst, then use that composedindex for the instance key and prototype materialization. The original path is
still retained for prototype registry membership and load-rule scoping.
Regression fixture
Before this change,
nested_payload_proxyfails because/Placed/Nested/Leaf.valueresolves toNone. After the change it resolves to7.0, and/Placed/Nested/Leafmaps to/__Prototype_1/Leaf.The fixture is intentionally small and contains only three USDA files. Pixar
OpenUSD
usdcheckervalidates its root layer successfully.Validation
cargo fmt --all -- --checkcargo test --all-targets --all-features(2315 passed,1 ignored)cargo clippy --all-targets --all-features -- -D warningsusdcheckeron the regression fixtureMesh prims, matching Pixar OpenUSD; generated GLB includes the formerly
missing nested-payload geometry