Skip to content

Documentation xref user lists depend on registration order #91

Description

@orting

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:

  • component
  • model

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions