Skip to content

rename _JensensMixin to reflect its generic pre-loop xhat candidate role #713

@DLWoodruff

Description

@DLWoodruff

mpisppy/cylinders/_jensens_mixin.py defines _JensensMixin, but only some of its methods are Jensen's-specific:

  • Jensen's-specific: _jensens_build_avg, _jensens_solve, _jensens_assert_safe_for_outer_bound, _try_average_scenario_xhat
  • Generic pre-loop xhat candidate machinery (not Jensen's-specific): _jensens_pack_nonant_cache, _jensens_evaluate_xhat, _try_feasible_xhat, _feasible_xhat_enabled

The generic helpers can be used by any candidate source, including the feasible_xhat_creator path added in #677. The Jensen's bound is the theoretical statement that, for convex problems, the expected objective is bounded by the average-scenario objective — feasible_xhat_creator has no claim on that theory; it just delivers a candidate by some unspecified means.

Suggested directions

  1. Rename + drop prefixes. Rename _JensensMixin_PreLoopXhatMixin; drop the _jensens_ prefix from the generic helpers; keep the Jensen-specific ones (_jensens_build_avg, _jensens_solve, _jensens_assert_safe_for_outer_bound, _try_average_scenario_xhat) with the prefix.
  2. Split into two mixins. _JensensMixin keeps the Jensen-specific methods; a new _XhatCandidateMixin carries pack_nonant_cache, evaluate_xhat, try_feasible_xhat, feasible_xhat_enabled. All four inner-bound xhat spokes (XhatXbarInnerBound, XhatShuffleInnerBound, XhatLooperInnerBound, XhatSpecificInnerBound) inherit from both.

Option 2 keeps the concept boundary cleaner but is more churn. Option 1 is the lighter-weight change.

Breadcrumb

A # NOTE: comment on _try_feasible_xhat in #677 marks this for follow-up so a contributor reading the file from cold notices the smell.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions