Summary
reference.pdf cross-reference user lists can change depending on registration/traversal order, even when the documented model content is unchanged.
Root cause
The documentation cross-reference builder stores model users in std::set<XRef::ModelUser>, but XRef::ModelUser::operator< in src/object_model/xref.C compares only:
It does not compare the path field.
That means distinct uses of the same model from different parameter paths collapse into a single set entry, and whichever path is visited first wins. After the explicit-registration rewrite changed traversal/registration timing, the surviving entry changed in generated docs.
Example
For vegetation afforestation, both litter_am and root_am are AOM objects, but the generated reference can show either:
vegetation afforestation root am
vegetation afforestation litter am
depending on traversal order.
This was observed as a documentation diff while checking that generated PDFs remain stable across the explicit-registration refactor.
Why this matters
The documentation output should not depend on registration order when the underlying semantics are unchanged. Today it can, because xref deduplication is path-insensitive.
Proposed fix
Include path in XRef::ModelUser::operator< so the set ordering and uniqueness account for the full usage location, not just (component, model).
That should make the cross-reference data structurally correct and prevent registration-order-dependent user-list differences in the generated documentation.
Relevant code
src/object_model/xref.C
include/object_model/xref.h
src/programs/program_document.C
Summary
reference.pdfcross-reference user lists can change depending on registration/traversal order, even when the documented model content is unchanged.Root cause
The documentation cross-reference builder stores model users in
std::set<XRef::ModelUser>, butXRef::ModelUser::operator<insrc/object_model/xref.Ccompares only:componentmodelIt does not compare the
pathfield.That means distinct uses of the same model from different parameter paths collapse into a single set entry, and whichever path is visited first wins. After the explicit-registration rewrite changed traversal/registration timing, the surviving entry changed in generated docs.
Example
For
vegetation afforestation, bothlitter_amandroot_amareAOMobjects, but the generated reference can show either:vegetation afforestation root amvegetation afforestation litter amdepending on traversal order.
This was observed as a documentation diff while checking that generated PDFs remain stable across the explicit-registration refactor.
Why this matters
The documentation output should not depend on registration order when the underlying semantics are unchanged. Today it can, because xref deduplication is path-insensitive.
Proposed fix
Include
pathinXRef::ModelUser::operator<so the set ordering and uniqueness account for the full usage location, not just(component, model).That should make the cross-reference data structurally correct and prevent registration-order-dependent user-list differences in the generated documentation.
Relevant code
src/object_model/xref.Cinclude/object_model/xref.hsrc/programs/program_document.C