SDDPOptions struct
#include <gtopt/sddp_types.hpp>
Configuration options for the SDDP iterative solver.
Public functions
- auto apertures_requested() const -> bool noexcept
- auto stationarity_enabled() const -> bool noexcept
Public variables
- std::optional<ApertureChunkMode> aperture_chunk_mode
- int aperture_chunk_size
- bool aperture_cut_resolve
- int aperture_screen_count
- bool aperture_seed_basis
- ApertureSelectionMode aperture_selection_mode
- ApertureSolveMode aperture_solve_mode
- double aperture_timeout
- bool aperture_use_manual_clone
- std::optional<std::vector<Uid>> apertures
- std::string api_status_file
- std::string api_stop_request_file
- std::chrono::milliseconds api_update_interval
- bool backward_resolve_target
- std::optional<SolverOptions> backward_solver_options
- BasisCrossMode basis_cross_mode
- BoundaryCutSharingMode boundary_cut_sharing
- std::string boundary_cuts_file
- bool boundary_cuts_mean_shift
- BoundaryCutsMode boundary_cuts_mode
- BoundaryCutsValuation boundary_cuts_valuation
- int boundary_max_iterations
- double convergence_confidence
- ConvergenceMode convergence_mode
- double convergence_tol
- double cut_coeff_eps
- CutDrainMode cut_drain_mode
- int cut_prune_interval
- HotStartMode cut_recovery_mode
- CutSharingMode cut_sharing
- std::string cuts_input_file
- File path for loading initial cuts (empty = no load / cold start).
- std::string cuts_output_file
- File path for saving cuts (empty = no save).
- ElasticFilterMode elastic_filter_mode
- double elastic_penalty
- bool enable_api
- double fact_eps
- int fact_max_cycles
- bool fcut_log
- bool forward_fail_stop
- bool forward_infeas_rollback
- int forward_max_attempts
- ForwardSamplingMode forward_sampling
- std::optional<SolverOptions> forward_solver_options
- bool free_solver_scratch
- IntegerCutsMode integer_cuts
- std::optional<IterationIndex> iteration_offset_hint
- std::string log_directory
- LowMemoryMode low_memory_mode
- bool lp_debug
- std::string lp_debug_compression
- std::string lp_debug_passes
- OptInt lp_debug_phase_max
- OptInt lp_debug_phase_min
- OptInt lp_debug_scene_max
- OptInt lp_debug_scene_min
- bool lp_debug_simulation_only
- bool lp_error
- MarkovChainConfig markov
- int max_async_spread
- int max_cuts_per_phase
- int max_iterations
- Maximum forward/backward iterations.
- int max_stored_cuts
- CompressionCodec memory_codec
- int min_iterations
- MissingCutVarMode missing_cut_var_mode
- How to handle cut rows referencing state variables not in the model.
- int multi_cut_threshold
- std::optional<int> num_apertures
- double pool_cpu_factor
- bool pool_cpu_factor_user_set
- double pool_memory_limit_mb
- double prune_dual_threshold
- RecoveryMode recovery_mode
- bool release_after_alpha
- bool release_backends
- bool save_aperture_lp
- bool save_per_iteration
- bool save_simulation_cuts
- double scale_alpha
- std::string sentinel_file
- bool single_cut_storage
- bool skip_simulation_pass
- double solve_timeout
- double stationary_gap_ceiling
- double stationary_tol
- int stationary_window
- int terminal_failure_threshold
- bool warm_start
Function documentation
bool gtopt:: SDDPOptions:: apertures_requested() const noexcept
True unless the backward apertures are switched off explicitly: apertures = [] or num_apertures = 0 (documented as "no
apertures", i.e. the deterministic Benders backward pass). Whether an aperture pool exists at all is decided later by resolve_effective_apertures.
bool gtopt:: SDDPOptions:: stationarity_enabled() const noexcept
True when ΔUB stationarity is the active convergence signal. When false the primary gap test (convergence_tol) is used instead.
Variable documentation
std::optional<ApertureChunkMode> gtopt:: SDDPOptions:: aperture_chunk_mode
How backward-pass apertures are grouped into work-pool tasks (per_scene / per_aperture / chunked). nullopt = not set → per_scene unless the legacy integer aperture_chunk_size selects another mode. Resolved once at SDDPMethod setup by resolve_aperture_chunk() (sddp_aperture.hpp); the resolved grouping is exposed via SDDPMethod::aperture_chunk_mode() / aperture_chunk_size() and these input fields are left untouched. See sddp_options.hpp::aperture_chunk_mode for the JSON-facing documentation.
int gtopt:: SDDPOptions:: aperture_chunk_size
Apertures per task for aperture_chunk_mode = chunked (0 = unset). With the mode unset, the legacy integer encoding still selects it (deprecated): 0 → per_scene (default), -1 → per_scene, 1 → per_aperture, K > 1 → chunked K.
bool gtopt:: SDDPOptions:: aperture_cut_resolve
Re-solve the source LP after installing an aperture backward cut (optimality check only; default false). See SddpOptions::aperture_cut_resolve.
int gtopt:: SDDPOptions:: aperture_screen_count
Number of dual-shared aperture cuts re-solved exactly under aperture_solve_mode = screened (picked by largest |intercept correction|). Ignored by every other mode. Default: the shared default_sddp_aperture_screen_count constant (sddp_enums.hpp). See sddp_options.hpp::aperture_screen_count.
bool gtopt:: SDDPOptions:: aperture_seed_basis
Seed each iteration's first backward aperture from the previous iteration's first-aperture basis (dual warm start). Orthogonal to aperture_solve_mode; acts for every basis-capable (vertex) mode — i.e. all modes except reduced_cost, which has no basis to capture. Default false. See sddp_options.hpp::aperture_seed_basis.
ApertureSelectionMode gtopt:: SDDPOptions:: aperture_selection_mode
Selection rule used by num_apertures to pick a subset from each phase's Phase::apertures list.
head(default): first N entries = N wettest per phase.stride: N entries evenly spaced across the full list.
See ApertureSelectionMode for details. Ignored when num_apertures is nullopt or ≥ the per-phase list length.
ApertureSolveMode gtopt:: SDDPOptions:: aperture_solve_mode
Aperture solve / cut-recovery mode: cold (barrier + crossover, vertex reduced-cost cuts), warm (warm simplex off the resident chunk basis; default), reduced_cost (barrier without crossover, interior-point reduced-cost cuts), dual_shared (representative solve + Infanger–Morton dual-shared synthesis), or screened (dual_shared + exact re-solve of the top aperture_screen_count cuts by |correction|). See sddp_options.hpp::aperture_solve_mode for the full rationale.
double gtopt:: SDDPOptions:: aperture_timeout
Timeout in seconds for individual aperture LP solves in the backward pass. When an aperture LP exceeds this time, it is treated as infeasible (skipped), a WARNING is logged, and the solver continues with the remaining apertures. 0 = no timeout (default).
bool gtopt:: SDDPOptions:: aperture_use_manual_clone
Use the manual clone_from_flat route for aperture clones instead of the backend's native clone() (CPXcloneprob). Manual route uses only env-local solver calls and does NOT acquire s_global_clone_mutex, so 80 aperture clones can be built in parallel rather than one-at-a-time under the lock. Pre-condition: the source phase LP must hold a decompressed FlatLinearProblem snapshot (typical for low_memory_mode = compress SDDP runs). When the pre-condition is not met, the call site falls back to the native route. This member defaults to false; the JSON-resolved default the planning path copies in (PlanningOptionsLP::sddp_aperture_use_manual_clone) is true.
std::optional<std::vector<Uid>> gtopt:: SDDPOptions:: apertures
Number of apertures (hydrological realisations) to solve in each backward-pass phase. Each aperture clones the phase LP and updates the flow column bounds to the corresponding scenario's discharge values, then solves the clone to obtain an independent Benders cut. The final cut added to the previous phase is the probability-weighted average of all aperture cuts (expected cut). Aperture UIDs for the backward pass.
nullopt – use per-phase Phase::apertures or simulation-level aperture_array (default behaviour). empty – no apertures; use pure Benders backward pass. [1,2,3] – use exactly these aperture UIDs, overriding per-phase sets.
When a non-empty list is given but no matching Aperture definitions exist in simulation.aperture_array, synthetic apertures are built from scenarios whose UIDs match.
Note: apertures only update flow column bounds (affluent values). Other stochastic parameters (demand, generator profiles) are not updated. State variable bounds remain fixed at the forward-pass trial values.
std::string gtopt:: SDDPOptions:: api_status_file
Path for the JSON status file. If empty, the solver writes to "<output_directory>/solver_status.json" (derived at solve time from the PlanningLP options).
std::string gtopt:: SDDPOptions:: api_stop_request_file
Path for the monitoring API stop-request file. When this file exists the solver stops gracefully after the current iteration and saves cuts, exactly like the sentinel_file mechanism. The file is written by the webservice soft-stop endpoint as part of the bidirectional monitoring API. Use sddp_file::stop_request ("sddp_stop_request.json") as the filename in the output directory. Empty = feature disabled.
std::chrono::milliseconds gtopt:: SDDPOptions:: api_update_interval
Interval at which the background monitoring thread refreshes real-time workpool statistics (CPU load, active workers) in the status file.
bool gtopt:: SDDPOptions:: backward_resolve_target
Re-solve target phase t LP at v̂_{t-1} before extracting cut data (default: true). When true, cuts on α_t added earlier in this backward pass (when the loop processed phase t+1) are reflected in z_t and reduced costs, producing a one-iter-tight Benders cut on α_{t-1}. See SDDPOptions::backward_resolve_target for the full rationale and cost analysis.
std::optional<SolverOptions> gtopt:: SDDPOptions:: backward_solver_options
Optional LP solver options for the backward pass. When set, these override the global solver options for backward-pass solves. The options are pre-merged with the global solver options at construction time (backward takes precedence).
BasisCrossMode gtopt:: SDDPOptions:: basis_cross_mode
Cross-pass simplex-basis warm-start reuse between the forward and backward passes. Default off. See sddp_options.hpp::basis_cross_mode and BasisCrossMode for the full rationale.
BoundaryCutSharingMode gtopt:: SDDPOptions:: boundary_cut_sharing
How terminal/boundary cuts are shared across scenes on the terminal α — the terminal-phase analogue of cut_sharing (resolved from SddpOptions::boundary_cut_sharing_mode, with the legacy boundary_cuts_mode scope as the fallback: separated→per_scene, combined→shared). per_scene (default) and multicut are valid; shared is valid only when the post-horizon value is scenario-identical.
std::string gtopt:: SDDPOptions:: boundary_cuts_file
CSV file with boundary (future-cost) cuts for the last phase.
These cuts approximate the expected future cost beyond the planning horizon, analogous to PLP's "planos de embalse" (reservoir future-cost function). Each cut has the form: a >= rhs + S_i coeff_i . state_var_i
The CSV header row names the state variables (reservoirs / batteries). The solver maps these names to LP columns in the last phase and adds each cut as a lower-bound constraint on the future cost variable a. Empty = no boundary cuts.
bool gtopt:: SDDPOptions:: boundary_cuts_mean_shift
Apply an α-rebase (mean-shift) to boundary cuts on load.
When true, per scene: subtract the per-scene mean from every boundary cut's lowb, and carry the offset via LinearInterface::add_obj_constant so get_obj_value() stays algebraically equivalent to the unshifted formulation. Mathematically exact (α' = α − c̄); LP-side α is centred near zero so equilibration sees comparable RHS magnitudes for boundary vs. runtime cuts. See FutureCost::mean_shift (input-side option, default true) and source/sddp_boundary_cuts.cpp for the implementation. Plain-bool storage default is true so callers that construct an SddpOptions directly (test fixtures, etc.) inherit the same default as the input-option path.
BoundaryCutsMode gtopt:: SDDPOptions:: boundary_cuts_mode
How boundary cuts are loaded:
- "noload" – skip loading even if a file is specified
- "separated" – assign each cut to the scene matching its
scenecolumn (scene UID); unmatched UIDs are skipped - "combined" – broadcast all cuts to all scenes
- "phi_expectation" – PLP-literal: the CSV
scenecolumn is a plane-hydrology index (PLPISimul); every scene's terminal LP carries NVarPhi φ_j columns pricedp_s/NVarPhi, each bounded by hydrology-j's cuts at FULL magnitude (RAW CSV, no pre-division). The forward UB carries the terminalE_j[FCF_j]at realized volumes (PLPZSPFAdd). Requiresboundary_cut_sharing != multicut; forcesboundary_cuts_mean_shiftoff at load. SeeBoundaryCutsMode::phi_expectation. Default: "separated".
BoundaryCutsValuation gtopt:: SDDPOptions:: boundary_cuts_valuation
Valuation basis of the boundary cuts (FutureCost::valuation): present_value applies the last stage's effective discount factor to the cut RHS and coefficients on load.
int gtopt:: SDDPOptions:: boundary_max_iterations
FutureCost::iteration_limit: keep only the cuts of the last N distinct iterations of the source run (by the iteration column / PLP IPDNumIte). 0 = load all.
double gtopt:: SDDPOptions:: convergence_confidence
Confidence level for statistical convergence criterion (0-1). When > 0 and multiple scenes exist, convergence is also checked via confidence interval: UB - LB <= z_{α/2} · σ (PLP-style). Combined with stationary_tol, declares convergence when the gap stabilises above the CI threshold (non-zero-gap case).
Default: 0.0 (DISABLED) — the CI test is opt-in because under heterogeneous-scene scatter (σ ≈ 50 % of mean on the large case) z·σ trivially exceeds the absolute gap at 25 % relative, declaring premature convergence. Set to 0.95 to enable the standard 95 % CI test, or 0.50 for a much tighter narrow-CI variant.
ConvergenceMode gtopt:: SDDPOptions:: convergence_mode
Convergence rule (see docs/methods/sddp.md §4.5):
- ΔUB stationarity ENABLED (
stationarity_enabled(): mode is notgap_only,stationary_tol > 0andstationary_window > 0) — stationarity is the stop signal (plus the opt-in statistical CI test); the gap test itself never stops the run, because under multi-cut / aperture overshoot the signed gap zero-crosses before the policy has stabilised: gap_change = |UB[i] - UB[i - window]| / max(1e-10, |UB[i - window]|) converged <- gap_change < stationary_tol AND >= window own iterations with cuts AND signed gap < stationary_gap_ceiling - stationarity DISABLED — the primary gap test
sddp_gap_converged(gap, convergence_tol)(band(-kSddpGapFpEpsilon, convergence_tol)) is the stop signal.
Default: gap_stationary. The statistical CI test (ConvergenceMode::statistical) is opt-in because heterogeneous-scene σ scatter (large hydrothermal cases) can trivially fire it at large gap.
double gtopt:: SDDPOptions:: convergence_tol
Relative gap tolerance; the stop criterion only when ΔUB stationarity is disabled (see stationarity_enabled()).
double gtopt:: SDDPOptions:: cut_coeff_eps
Absolute tolerance for filtering tiny Benders cut coefficients. Coefficients with |value| < cut_coeff_eps are dropped from the cut. 0.0 = no filtering (default).
CutDrainMode gtopt:: SDDPOptions:: cut_drain_mode
How to drain in-flight cuts after the aggregate-convergence stop signal fires in SDDPMethod::solve_async. See CutDrainMode in sddp_enums.hpp for the full rationale. Default iteration: symmetric across scenes, run-to-run reproducible.
int gtopt:: SDDPOptions:: cut_prune_interval
Number of iterations between cut pruning passes. Only used when max_cuts_per_phase > 0. Default: 10.
HotStartMode gtopt:: SDDPOptions:: cut_recovery_mode
Hot-start mode: controls both cut loading and output file handling.
none: cold start – no cuts loaded (default)keep: load cuts; keep original output file unchangedappend: load cuts; append new cuts to original filereplace: load cuts; replace original file with all cuts
CutSharingMode gtopt:: SDDPOptions:: cut_sharing
Cut sharing mode across scenes. Two modes remain (docs/formulation/sddp-cut-validity.md §7–§8):
none(default): each scene's single α is bounded only by its own cuts — the per-scene persistent-path (wait-and-see) lower bound, unconditionally valid (theorem N1).multicut: PLP-faithful per-scenario varphi columns priced at the M4 weightw_r = p_s(alpha_col_weights; = 1/N under uniform probabilities); the LB is the lower bound of the stagewise-RESAMPLED process with measureq_r = p_r, valid for any probability vector (theorems M1/M4 — an INFO notes the persistent-UB vs resampled-LB process mismatch at SDDP setup when probabilities are non-uniform).
REMOVED 2026-07-08: accumulate, broadcast_mean (alias expected), and max — KNOWN INVALID broadcasts onto the destination scene's own α that produced compounding LB > UB on distinct sample paths (the large hydrothermal case regressed at 7225× before this was diagnosed). Their names now hard-error at ingestion. See test/source/test_sddp_bounds_sanity.cpp for the regression guards and test/source/test_sddp_cut_oracle.cpp for the extensive-form certification harness.
ElasticFilterMode gtopt:: SDDPOptions:: elastic_filter_mode
Elastic filter mode: how the FORWARD pass emits feasibility cuts when a phase LP is infeasible at the trial state. Only the forward pass has an elastic branch; the backward pass produces optimality cuts exclusively. single_cut (default): one classical PLP/Birge-Louveaux Benders feasibility cut from row duals of the state-fixing equations at the elastic clone's Phase-1 optimum. Matches plp-agrespd.f. multi_cut : single_cut plus one bound-constraint cut per activated slack variable. chinneck : IIS-filtered multi-cut — runs an extra re-fix pass to narrow the cut set to the irreducible infeasible subset of relaxed bounds. Not re-validated against the row-dual fcut builder introduced in commit 0307c58e. state_repair (alias plp): PLP-exact single-variable cuts from the unit-cost (+0.01·rc tilt) elastic clone — see ElasticFilterMode::state_repair in sddp_enums.hpp and build_plp_feasibility_cuts. farkas_recursive: Füllner–Rebennack §17.2–17.3 recursive aggregated cut — installed feasibility-cut rows are elasticized with a +z slack in the clone and their intercepts folded into the emitted cut's RHS via the clone optimum V — see build_farkas_recursive_cut.
double gtopt:: SDDPOptions:: elastic_penalty
Penalty for elastic slack variables
bool gtopt:: SDDPOptions:: enable_api
Enable the monitoring API: write a JSON status file after each iteration and periodically update real-time workpool statistics. Consumers (e.g. sddp_monitor.py) can poll this file to display live charts. Default: true.
double gtopt:: SDDPOptions:: fact_eps
PLP FactEPS parity tolerance, consumed ONLY under elastic_filter_mode = state_repair (alias plp) or farkas_recursive (mirrors PLP getopts.f FactEPS, default 1e-8). Under state_repair it drives all four PLP tolerances in build_plp_feasibility_cuts:
- ray-zero threshold: |ray| < fact_eps + 2⁻³⁶ → ray = 0
- dx activation filter: |dx| < fact_eps·(|trial| + 1e-8) → dx = 0 AND ray = 0
- emission skip: |ray| ≤ 1e-3·fact_eps·|Σ rhsi| + 2⁻³⁶
- outward RHS margin: rhs += fact_eps·|rhs| Under
farkas_recursiveit drives the σ/ω zero-guard (|dual| < fact_eps + 2⁻³⁶) and the same outward RHS margin.
int gtopt:: SDDPOptions:: fact_max_cycles
PLP FactMXC parity, consumed ONLY under elastic_filter_mode = state_repair (alias plp) or farkas_recursive (default 500 — the CEN production runs' setting; PLP's own compiled default is 5000): maximum solve cycles per (scene, phase) LP within ONE forward pass. Exceeding it declares the scene infeasible for the iteration, preventing an infinite cut-retry loop. The counter resets at every forward pass, matching PLP's per-iteration cycle counter (plp-faseprim.f). Complements (does not replace) the per-scene forward_max_attempts total-solves cap.
bool gtopt:: SDDPOptions:: fcut_log
Write the PLP-style feasibility-cut debug log gtopt_fcut.log to log_directory (default: false) — gtopt's analogue of PLP's plpfact.log (gated there by FactDBL ≥ 1). One record per forward-pass infeasibility event: the INFEASIBLE detection line, the emitted cut coefficients + RHS (physical units), the INSTALLED / HOLGURAS / FAIL outcome, and ROLLBACK events from forward_infeas_rollback. Works with every elastic_filter_mode. See FcutLogWriter (fcut_log.hpp) and docs/methods/sddp.md §5.4.
bool gtopt:: SDDPOptions:: forward_fail_stop
Scene-level fail-stop forward pass (default: false — this member and the JSON-resolved PlanningOptionsLP::sddp_forward_fail_stop).
When true, an infeasible phase that produces a feasibility cut on its predecessor causes the scene's forward pass to STOP for the current iteration: the fcut is installed on phase p-1, the scene is marked failed (returned Error → caller sets scene_feasible=0), and the next iteration starts fresh from p1 with the newly accumulated cuts (preserved in the global cut store). Other scenes continue uninterrupted. Avoids the iter-0 cascade that walks back through many stages and produces degenerate cuts.
When false, restores the legacy PLP-style backtracking forward pass: after installing the fcut on p-1, phase_idx is decremented and p-1 is re-solved under the new cut. If p-1 is still infeasible, a fresh fcut is installed on p-2 and the cascade continues — bounded by forward_max_attempts. Kept available for regression tests and academic fixtures that depend on the cascade dynamics.
bool gtopt:: SDDPOptions:: forward_infeas_rollback
Per-scene rollback on forward-pass infeasibility. This member defaults to false; the JSON-resolved default that the planning path copies in (PlanningOptionsLP::sddp_forward_infeas_rollback) is true.
When true and a scene S is declared infeasible at iteration k's forward pass (scene_feasible[S] == 0):
- Every cut S has accumulated in
m_cut_store_.scene_cuts()[S]is deleted (rows removed from S's LP cells viaLinearInterface::delete_rows+record_cut_deletion, vector cleared). Both forward-pass fcuts and earlier backward-pass optcuts are dropped — the bad trajectory that produced any of them is no longer trusted. - The global stored-cut count is snapshot in
m_scene_retry_state_[S].global_cuts_at_last_failure. - At iteration k+1's forward dispatch, S retries iff the global cut count grew (peers contributed cuts via cut sharing or their own backward pass). Otherwise S is "stalled" — and if every previously-failed scene is stalled, the run aborts with
Error{SolverError, "no recovery path"}to avoid an infinite-loop on degenerate single-scene / no-progress runs.
When false (legacy): cuts S installed on its own bad trajectory persist across iterations, and the run loops until max_iterations without rollback or stall detection.
int gtopt:: SDDPOptions:: forward_max_attempts
Forward-pass backtracking cap: maximum cumulative LP solves per scene per iteration. When an elastic branch fires at phase p, gtopt (PLP-style) installs the feasibility cut on phase p-1 and BACKTRACKS to phase p-1, re-solving it under the new cut. If p-1 is also infeasible, an fcut is installed on p-2 and the backtrack continues until a feasible phase is reached, after which the pass resumes forward. forward_max_attempts caps the total number of solves to prevent an infinite backtrack/retry loop — when exceeded, the scene is declared infeasible for this iteration and excluded from UB aggregation. Matches PLP's FactMXC knob in plp-faseprim.f (getopts.f:257, default 5000). Prior gtopt default was 100 — too tight for pathological cases whose iter-0 forward pass needs to backtrack across many phases to build the initial cut set (observed on the large hydrothermal case: every scene hits 100 before phase 1 master has enough cuts to be feasible). Default now matches PLP's 5000.
ForwardSamplingMode gtopt:: SDDPOptions:: forward_sampling
How the forward pass samples stochastic scene data:
persistent(default): each scene-driver simulates its own scenario path at every phase — historical behaviour, byte-identical (the resampling code is never entered).resampled: per-phase-boundary probability-weighted re-draw applied via the bound-onlyupdate_aperturemachinery; the UB then estimates the sameq_r = p_rresampled process the multicut LB certifies. v1: one sampled path per scene-driver per iteration, deterministic in (iteration, scene, phase).
See ForwardSamplingMode (sddp_enums.hpp) for the full story.
std::optional<SolverOptions> gtopt:: SDDPOptions:: forward_solver_options
Optional LP solver options for the forward pass. When set, these override the global solver options for forward-pass solves. The options are pre-merged with the global solver options at construction time (forward takes precedence).
bool gtopt:: SDDPOptions:: free_solver_scratch
Free the CPLEX / Gurobi / MindOpt copy-out getter scratch after each solve under low_memory = off (false: keep it, the previous behaviour). Default: true.
IntegerCutsMode gtopt:: SDDPOptions:: integer_cuts
Integer-cut mode for backward-pass cells whose LP carries integer columns (integer expansion modules, unit-commitment binaries):
none(default): legacy behaviour, byte-identical. Pure-LP cells emit the certified Theorem-O1 cut; integer-bearing cells are UNSOUND (no reduced costs on a MIP — seedocs/analysis/investigations/sddp/sddip_integer_expansion_2026-07.md§1).strengthened: LP-relaxation cut + one-MIP Lagrangian intercept (Zou, Ahmed & Sun 2019). Valid by weak Lagrangian duality (Theorem SB1), never looser than the LP cut (Corollary SB2); silent LP fallback on MIP failure/timeout.
std::optional<IterationIndex> gtopt:: SDDPOptions:: iteration_offset_hint
Caller-supplied lower bound for the iteration index at which this solver should start counting. Composed with the hot-start offset via std::max, so hot-start cuts always win when they demand a higher offset. Used by CascadePlanningMethod to place each level's iteration indices in a disjoint global range (avoids in-memory cut store collisions and gives log lines a globally monotonic index). Absent = solver starts at iteration 0 (or at the hot-start offset, whichever is higher).
std::string gtopt:: SDDPOptions:: log_directory
Directory for log and error LP files (default: "logs"). Error LP files for infeasible scenes are saved here.
LowMemoryMode gtopt:: SDDPOptions:: low_memory_mode
Low memory mode: off (default), snapshot, compress, or rebuild. Trades CPU time (reconstruction + optional decompression, or full re-flatten under rebuild) for significant memory savings on large problems. Under rebuild the initial up-front build loop is skipped and each per-(scene, phase) LP is built lazily inside the same task that solves or clones it.
bool gtopt:: SDDPOptions:: lp_debug
When true, save a debug LP file for every (iteration, scene, phase) in the SDDP passes selected by lp_debug_passes. Files land in log_directory and are named using sddp_file::debug_lp_fmt (forward) / debug_backward_lp_fmt (backward) / debug_aperture_lp_fmt (aperture).
std::string gtopt:: SDDPOptions:: lp_debug_compression
Compression format for LP debug files ("gzip" / "uncompressed" / ""). Empty or "uncompressed" means no compression; any other value uses gzip.
std::string gtopt:: SDDPOptions:: lp_debug_passes
Comma-separated list of SDDP passes whose LP-debug dump is active when lp_debug=true. Empty / unset selects the legacy default "forward,aperture". Tokens (case-insensitive, comma-separated): forward, backward, aperture, all. Inspected at debug-write time via lp_debug_passes_includes(...) from lp_debug_passes.hpp — kept as a string (rather than parsed enum bitmask) to mirror the sister field lp_debug_compression, which is also a pass-through JSON string.
OptInt gtopt:: SDDPOptions:: lp_debug_scene_min
Selective LP debug filters: when set, only save LP files whose scene/phase UIDs fall within [min, max] (inclusive).
bool gtopt:: SDDPOptions:: lp_debug_simulation_only
When true, every LP-debug dump is gated on the SDDP method being in its simulation pass (m_in_simulation_ == true). Training iterations produce no LP files. Useful for diagnosing residual infeasibilities that surface only on the simulation pass after the training cuts have matured — without flooding the log directory with hundreds of intermediate iter-N forward LPs that the training loop already considered "transient" and recovered from. Combine with lp_debug_scene_min/max and lp_debug_phase_min/max for a tightly scoped capture.
bool gtopt:: SDDPOptions:: lp_error
When true, write an error LP file when a (scene, phase) is infeasible (independent of lp_debug, which gates the per-pass debug dumps).
MarkovChainConfig gtopt:: SDDPOptions:: markov
Markov-chain configuration for cut_sharing = markov (scene → state assignment + row-stochastic transition matrix). Ignored by every other mode. Validated by validate_markov_config at SDDP setup; see docs/formulation/sddp-markov.md.
int gtopt:: SDDPOptions:: max_async_spread
Maximum iteration spread between fastest and slowest scene when cut_sharing == none and multiple scenes exist. When > 0, the solver runs scenes asynchronously: each scene progresses through its own forward/backward iteration loop, and the pool's priority queue (SDDPTaskKey) naturally gives higher priority to scenes at earlier iterations, self-regulating the spread. 0 = synchronous (current behavior, default).
int gtopt:: SDDPOptions:: max_cuts_per_phase
Maximum number of retained cuts per (scene, phase) LP after pruning. 0 = unlimited (default, no pruning). When non-zero, at every cut_prune_interval iterations the solver removes inactive cuts (|dual| < prune_dual_threshold) until at most max_cuts_per_phase active cuts remain.
int gtopt:: SDDPOptions:: max_stored_cuts
Maximum total stored cuts per scene (0 = unlimited). When non-zero, the oldest cuts beyond this limit are dropped after each iteration. Default: 0 (no cap).
CompressionCodec gtopt:: SDDPOptions:: memory_codec
In-memory compression codec for low_memory compress mode. Default: auto_select (resolves to zstd level 1; lz4 selectable).
int gtopt:: SDDPOptions:: min_iterations
Minimum iterations before convergence
int gtopt:: SDDPOptions:: multi_cut_threshold
Forward-pass infeasibility counter threshold for automatic switching from single_cut / chinneck-fcut-only to multi_cut. When the forward pass has encountered infeasibility at (scene, phase) this many times without recovery, the elastic branch additionally installs build_multi_cuts bound cuts alongside the Benders fcut. = 0 always use multi_cut for any infeasibility (force multi_cut).
0 switch to multi_cut after the counter reaches this threshold. < 0 never auto-switch (disabled; use explicit mode only). Default: 100. Raised from 10 because
build_multi_cutsemitssource_col {<=,>=} dep_val_physbound cuts from the Chinneck Phase-1 LP, whosedep_val_physmay exceed the source phase's physically reachable set (observed on the large hydrothermal case after ~3 iterations: phase 0 getsreservoir_energy_1 >= 330.33while its physical cap is ~207.78 + small inflow). Keeping the IIS-filtered fcut alone for longer avoids the structurally-infeasible cuts that mcut mode can install before the master has found a good trial.
std::optional<int> gtopt:: SDDPOptions:: num_apertures
First-N selector applied to each phase's Phase::apertures list.
nullopt– no truncation; use the full per-phase list (default).0– no apertures (pure Benders).N > 0– takePhase::apertures.first(N)per phase.
Pairs with the wettest-first sort applied by plp2gtopt to Phase::apertures: num_apertures = N picks the N wettest apertures per phase. Each cascade level can override this value (e.g. L0 = 4, L1 = 8, L2 absent → all).
apertures and num_apertures compose: truncation happens on Phase::apertures first, then each surviving UID is resolved against the (possibly whitelisted) aperture pool.
double gtopt:: SDDPOptions:: pool_cpu_factor
SDDP work pool CPU over-commit factor. Multiplied by hardware_concurrency to set max pool threads. Default 4.0 — extra threads keep CPUs busy while others block on the clone mutex.
When the user did NOT set this explicitly (pool_cpu_factor_user_set == false), SDDPMethod::effective_pool_cpu_factor() caps it to 1.0 for many-scene runs (see that helper for the threshold + rationale): the scene×aperture backward tasks already saturate every core, so the 4× over-commit only adds scheduler/futex contention.
bool gtopt:: SDDPOptions:: pool_cpu_factor_user_set
True when the user explicitly set pool_cpu_factor (via --cpu-factor or sddp_options.pool_cpu_factor in JSON). When true the value above is honored verbatim; when false the scene-aware auto-cap may lower it.
double gtopt:: SDDPOptions:: pool_memory_limit_mb
Process memory limit in MB for the SDDP work pool. When non-zero, the pool blocks task dispatch if process RSS exceeds this value. 0 = no limit (default).
double gtopt:: SDDPOptions:: prune_dual_threshold
Dual-value threshold for considering a cut inactive. Cuts with |dual| below this value are candidates for removal. Default: 1e-8.
RecoveryMode gtopt:: SDDPOptions:: recovery_mode
Controls what is recovered from a previous SDDP run:
none: no recovery (cold start)cuts: recover only Benders cutsfull: recover cuts + state variable solutions (default)
bool gtopt:: SDDPOptions:: release_after_alpha
Release each low-memory backend right after alpha registration (false: keep it live until the post-initialisation sweep, the previous behaviour). Default: true.
bool gtopt:: SDDPOptions:: release_backends
Under low_memory_mode = off, release each solver backend after its solve and rebuild it from an uncompressed flat-LP snapshot on the next visit, warm-starting from the saved basis (false: keep every LP live for the whole run, the previous default). Under compress backends are always released. Default: true.
bool gtopt:: SDDPOptions:: save_aperture_lp
Save LP files for infeasible apertures to log_directory (default: false).
bool gtopt:: SDDPOptions:: save_per_iteration
Save cuts after each training iteration (default: true). When false, cuts are only saved at the end of the solve or on stop.
bool gtopt:: SDDPOptions:: save_simulation_cuts
Save feasibility cuts produced during the simulation pass (default: false). When false, only training-iteration cuts are persisted, ensuring hot-start reproducibility.
double gtopt:: SDDPOptions:: scale_alpha
Scale for α (0 = auto: max state var_scale). α itself is a free variable (no explicit bounds): per-row row-max equilibration on every Benders cut already controls LP conditioning, and α can legitimately go negative (net-revenue phases, mid-convergence cuts that haven't yet tightened LB above zero).
std::string gtopt:: SDDPOptions:: sentinel_file
Path to a sentinel file: if the file exists, the solver stops gracefully after the current iteration (analogous to PLP's userstop). All accumulated cuts are saved before stopping.
bool gtopt:: SDDPOptions:: single_cut_storage
Use single cut storage: store cuts only in per-scene vectors. Combined storage for persistence is built on demand from the per-scene vectors. Halves the memory cost of stored cuts. Default: false (backward compatible).
bool gtopt:: SDDPOptions:: skip_simulation_pass
Skip the post-training simulation pass entirely (default: false → sim pass runs). When true, solve() returns immediately after the last training iteration: no final forward pass with crossover=true, no per-cell SystemLP::write_out(), no sim-pass feasibility-cut bookkeeping.
Set to true for non-final cascade levels — their sim-pass output would be overwritten by the next level's sim pass anyway, and their crossover-quality duals are not consumed by anything (state-variable targets are read from the last training forward pass via svar.col_sol_physical(), and stored optimality cuts come from the training backward passes). See CascadePlanningMethod::solve for the orchestration. On large-case scale this saves the ~9 s/cell × 816 cells / 16-way parallel ≈ 7 min per intermediate level.
double gtopt:: SDDPOptions:: solve_timeout
Global solve timeout in seconds (0 = no timeout). When non-zero, each forward-pass LP solve is given this time limit; if exceeded, the LP is saved to a debug file, a CRITICAL message is logged, and the scene is marked as failed.
double gtopt:: SDDPOptions:: stationary_gap_ceiling
Signed relative-gap ceiling for the ΔUB-stationary (and statistical + stationary) stop: such a stop is accepted only while effective_gap() < stationary_gap_ceiling. One-sided — a negative gap (multi-cut / aperture overshoot) always passes; only a large POSITIVE gap keeps the run iterating (up to max_iterations). The stationary stop additionally needs stationary_window iterations of the solve's OWN with cuts (seeded cascade bounds do not count).
Defends against premature stops: a cold cascade level seeded with the previous level's bounds that declared "stationary" at its first iteration with a 40 % gap, large-case cascade levels that stopped with a gap of several percent, and frozen-LB states (gap = 1 flat, ΔUB = 0).
Default: 0.02 (2 %). Set to 1.0 (or more) to disable the ceiling.
double gtopt:: SDDPOptions:: stationary_tol
Tolerance for "UB stopped moving" detection (gap_change < tol). Default: 0.005 (0.5%). Set to 0.0 to disable stationarity, which makes convergence_tol the stop criterion.
int gtopt:: SDDPOptions:: stationary_window
Number of iterations to look back when checking UB stationarity. Only used when stationary_tol > 0.0. Default: 4 (one season). <= 0 disables stationarity like stationary_tol = 0.
int gtopt:: SDDPOptions:: terminal_failure_threshold
Number of consecutive iterations of structural infeasibility (Chinneck filter produces no useful fcut at the same scene) before the scene is marked terminal and skipped at dispatch until fresh cuts arrive globally. Set to 0 to disable the terminal-skip mechanism entirely (legacy behaviour: every failed scene is re-dispatched every iteration). Default: 2 — one bad iteration may be transient (state still settling), but two identical structural failures in a row indicate an LP-level issue that more iterations of the same forward-pass cannot resolve. Observed on the large hydrothermal case 2026-05-02 trace_29: 10 of 16 scenes wasted ~33 min before this guard existed.
bool gtopt:: SDDPOptions:: warm_start
Enable warm-start optimizations for SDDP resolves (forward pass, backward pass, apertures, elastic filter). When true, resolves use dual simplex + no presolve, pivoting from the saved forward-pass solution. Especially important when the initial solve uses barrier (the default).