Repository navigation
crust-core: the delegate asks its host only for .mtlx references (host-facts-mtlx-only) - #432
Conversation
…t-facts-mtlx-only) HostFacts keeps mtlx_reference alone (a test implements it with one method); StageHostFacts::new takes the stage only. Everything else the delegate reads, warns about or reports comes from the scene index: - time.outside_range reads sceneGlobals start/endTimeCode, 0..0 being no range; a pass that is not a RenderPass is explained from the index (no prim, or its type from __usdPrimInfo, else its Hydra type). - Removed: xform.unknown_op, xform.unknown_type, xform.uncomposable and instancing.instanceable_without_prototype (the index carries none of their causes), so crust check writes crust-check/3; Scene::layers (unused, with tests/usd_layers.rs); foreign spec paths in material provenance. - The EXR stamp's layer stack and invisible-override count are the batch host's: load_scene_with reads them off its stage before the commit and sets them after it. - crust-render/tests/host_facts.rs leaves cornellbox_guided out: path guiding is not bit-reproducible run to run (about 1 render in 5). Images: all 45 samples identical to the goldens recorded before hydra-only-renders (16 spp, --indirect-clamp 0). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR Summary by QodoLimit delegate host facts to MaterialX references
AI Description
Diagram
High-Level Assessment
Files changed (41)
|
Code Review by Qodo
1.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…odo on #432) - index_time_range: the index gives an unauthored end as USD's fallback 0 and does not say which ends are authored, so a start after its end (a start authored alone, e.g. 1001..0) reads as no range, as 0..0 does, instead of warning on every frame. An end authored alone reads as 0..end (recorded in the design and the render-delegate design record). tests/host_facts_mtlx_only.rs: a_start_authored_alone_raises_nothing. - check_time_range's doc comment sits above check_time_range again; it had merged into index_time_range's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Why
Since #431 (
hydra-only-renders), Crust's image depends on the scene index alone. The delegate still asked its host eight more questions about the stage throughHostFacts:invisibleoverrides;xform.*warnings;A Hydra 2.0 delegate is handed a terminal scene index and nothing else. The one fact Hydra cannot carry is the
.mtlxdocument a material references, which openusd does not compose untilmtlx-format-plugin.What
HostFactskeeps one method,mtlx_reference.crust-core/tests/host_facts_mtlx_only.rsimplements it with one method. BREAKING (API):StageHostFacts::newtakes the stage only.time.outside_rangetakessceneGlobals/startTimeCodeandendTimeCode.0..0, what the index gives a stage that authors none, means no range, so a stage authoring0..0itself gets no warning.RenderPassis explained by the index: no prim there, or the prim's type. That is its USD type name from__usdPrimInfo/typeName, else its Hydra type, so anXformis still namedXform.xform.unknown_op,xform.unknown_type,xform.uncomposableandinstancing.instanceable_without_prototypeare removed. The index carries none of their causes. Removing codes bumpscrust check --jsontocrust-check/3, under the scene-warnings versioning rule.crust:layerStackandcrust:invisibleOverridescome from the stagecrust renderopened.load_scene_withreads them before the commit releases the stage and sets them on the scene after it. The stamp's content is unchanged.Scene::layers, which nothing read, withtests/usd_layers.rs. Also the foreign spec paths in material provenance.crust-render/tests/host_facts.rsleaves outcornellbox_guided. Path guiding is not bit-reproducible run to run: on the same binary, about one 16 spp render in five differs. That race predates this change and makes the guard flaky. It is not fixed here.OpenSpec:
openspec/changes/host-facts-mtlx-only/.render-delegate: "The image depends on the scene index alone" is modified. Two requirements are added: "The delegate's warnings come from the index" and "The batch host stamps the stage's layers".scene-check:crust-check/3.Tests
host_facts_mtlx_only.rs, four tests covering the one question, an authored and an unauthored range, and a pass naming a mesh or nothing.xform_uncomposable.rs,warnings.rsand theOnce-policy unit test use anotherOncecode.Measurements
scripts/check_images.shagainst goldens recorded before crust-core: the image depends on the scene index alone (hydra-only-renders) #431 (16 spp,--indirect-clamp 0): all 45 samples identical. Kitchen_set is not on the machine I used.--features delegate.main, all Windows-specific:kept(touching a directory is denied),asset_anchoring(Linux path expectations) andstamp(8.3 path spelling).stampconfirms the layer stack is unchanged (task 3.2).Downstream
At its next crust-render bump, Mantle replaces
StageHostFacts::new(&stage, &path, Some(terminal))withStageHostFacts::new(&stage)(itsipr-index-only).🤖 Generated with Claude Code