optimize: rename OptimizeOptions terminology (objective_function / volatile_weight / CSE)#556
Merged
Merged
Conversation
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).
Krzmbrzl
reviewed
Jun 16, 2026
Contributor
There was a problem hiding this comment.
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) toObjectiveFunction/objective_functionwithDense*variants. - Renamed volatility replay multiplier (
n_replay) to a real-valuedvolatile_weightand threaded it through the single-term optimizer. - Replaced
subnet_cse/SubnetCSEoption with aCSEOptionsstruct exposed asOptimizeOptions::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.
- 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).
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Renames
OptimizeOptionsterminology to match how the values are used (prerequisite for the MPQCSeQuantEnginekeyword cleanup):OptFor{Flops,Memsize}→ObjectiveFunction{DenseFLOPs,DenseSize}(current cost models are dense; "Size" because operands need not live in memory — disk/distributed; room forSparse*later)opt_for→objective_functionn_replay(unsigned) →volatile_weight(double, besidefootprint_weight)subnet_cse/SubnetCSE{Enable,Disable}→CSEOptions CSE(CSE.subnet; room to grow)Hard rename, no aliases. Behavior unchanged —
test_optimizepasses (204 assertions / 3 cases). The free-functionbool subnet_cseparameter is intentionally kept.🤖 Generated with Claude Code