Skip to content

optimize: rename OptimizeOptions terminology (objective_function / volatile_weight / CSE)#556

Merged
evaleev merged 4 commits into
masterfrom
feature/optimize-options-terminology
Jun 17, 2026
Merged

optimize: rename OptimizeOptions terminology (objective_function / volatile_weight / CSE)#556
evaleev merged 4 commits into
masterfrom
feature/optimize-options-terminology

Conversation

@evaleev

@evaleev evaleev commented Jun 16, 2026

Copy link
Copy Markdown
Member

Renames OptimizeOptions terminology to match how the values are used (prerequisite for the MPQC SeQuantEngine keyword cleanup):

  • OptFor{Flops,Memsize}ObjectiveFunction{DenseFLOPs,DenseSize} (current cost models are dense; "Size" because operands need not live in memory — disk/distributed; room for Sparse* later)
  • opt_forobjective_function
  • n_replay (unsigned) → volatile_weight (double, beside footprint_weight)
  • subnet_cse/SubnetCSE{Enable,Disable}CSEOptions CSE (CSE.subnet; room to grow)

Hard rename, no aliases. Behavior unchanged — test_optimize passes (204 assertions / 3 cases). The free-function bool subnet_cse parameter is intentionally kept.

🤖 Generated with Claude Code

OptFor{Flops,Memsize} -> ObjectiveFunction{DenseFLOPs,DenseSize} (the current
cost models are dense; 'Size' since operands need not live in memory);
opt_for -> objective_function; n_replay (unsigned) -> volatile_weight (double,
beside footprint_weight); subnet_cse/SubnetCSE -> CSEOptions CSE (CSE.subnet).
Hard rename, no aliases. Behavior unchanged (test_optimize passes).
Comment thread SeQuant/core/optimize/options.hpp Outdated
Comment thread SeQuant/core/optimize/options.hpp
Comment thread SeQuant/core/optimize/options.hpp Outdated
Comment thread SeQuant/core/optimize/options.hpp

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR renames OptimizeOptions terminology to better match the actual cost models and behaviors, serving as a cleanup prerequisite for upcoming MPQC SeQuantEngine keyword changes.

Changes:

  • Renamed optimization objective terminology (OptFor / opt_for) to ObjectiveFunction / objective_function with Dense* variants.
  • Renamed volatility replay multiplier (n_replay) to a real-valued volatile_weight and threaded it through the single-term optimizer.
  • Replaced subnet_cse/SubnetCSE option with a CSEOptions struct exposed as OptimizeOptions::CSE (with .subnet).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
tests/unit/test_optimize.cpp Updates unit tests to use volatile_weight, objective_function, and CSE.subnet terminology.
SeQuant/core/optimize/single_term.hpp Renames template parameters and volatility weighting input, plus updates related documentation.
SeQuant/core/optimize/options.hpp Introduces ObjectiveFunction and CSEOptions, and updates OptimizeOptions fields accordingly.
SeQuant/core/optimize/optimize.cpp Wires new OptimizeOptions fields into the top-level optimization dispatch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread SeQuant/core/optimize/single_term.hpp Outdated
Comment thread SeQuant/core/optimize/options.hpp
Comment thread SeQuant/core/optimize/options.hpp
Comment thread SeQuant/core/optimize/options.hpp
Comment thread tests/unit/test_optimize.cpp Outdated
Comment thread SeQuant/core/optimize/single_term.hpp
- ObjectiveFunction comment no longer references the removed `Memsize` name;
  describe what DenseFLOPs/DenseSize each count instead.
- Drop the "`CSE` is an initialism" sentence (naming rationale belongs in the
  commit/PR, not the code comment).
evaleev added 2 commits June 16, 2026 22:39
- single_term.hpp: restore one Doxygen command per line in the
  detail::single_term_opt block (it had been reflowed into shared lines that
  Doxygen would not parse); add the missing IdxToSz/footprint_weight entries.
- Qualify enum values in docs as ObjectiveFunction::DenseFLOPs (options.hpp
  volatile_weight/footprint_weight) for unambiguous generated output.
- single_term.hpp: update a stale "Flops/Memsize" comment to DenseFLOPs/DenseSize.
- test_optimize.cpp: rename stale n_replay references in comments to
  volatile_weight.
CSE was the only OptimizeOptions member without an in-class initializer, so
designated-initializer sites that don't set it (e.g. the compatibility_opts
OptimizeOptions{.reorder=...} in optimize.cpp, and several in test_optimize.cpp)
tripped g++-14's -Werror=missing-field-initializers. clang does not warn here,
so it passed on macOS but failed the Linux/g++ CI. Add `= {}` to match the
other members.
@evaleev evaleev merged commit 5225136 into master Jun 17, 2026
16 checks passed
@evaleev evaleev deleted the feature/optimize-options-terminology branch June 17, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants