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
- 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.
- 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.
mpisppy/cylinders/_jensens_mixin.pydefines_JensensMixin, but only some of its methods are Jensen's-specific:_jensens_build_avg,_jensens_solve,_jensens_assert_safe_for_outer_bound,_try_average_scenario_xhat_jensens_pack_nonant_cache,_jensens_evaluate_xhat,_try_feasible_xhat,_feasible_xhat_enabledThe generic helpers can be used by any candidate source, including the
feasible_xhat_creatorpath 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_creatorhas no claim on that theory; it just delivers a candidate by some unspecified means.Suggested directions
_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._JensensMixinkeeps the Jensen-specific methods; a new_XhatCandidateMixincarriespack_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_xhatin #677 marks this for follow-up so a contributor reading the file from cold notices the smell.