1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! Cut management data structures for the SDDP Future Cost Function (FCF).
//!
//! This module provides the per-stage cut pool, the all-stages FCF container,
//! the wire format for MPI exchange, cut-row construction for the LP, and
//! supporting types used to store, query, and prune Benders cuts during the
//! SDDP training loop.
//!
//! ## Contents
//!
//! - [`pool`] — [`CutPool`]: pre-allocated per-stage cut storage with
//! deterministic slot assignment, activity tracking, and state evaluation.
//! [`CutPool::set_active`] is the canonical toggle for the activity flag;
//! [`CutPool::cuts_in_lp`] returns the LP-row-count metric (populated count).
//! - [`fcf`] — [`FutureCostFunction`]: all-stages container wrapping one
//! [`CutPool`] per stage; provides the high-level API for the training loop,
//! including [`FutureCostFunction::set_active`] and
//! [`FutureCostFunction::cuts_in_lp`].
//! - [`wire`] — [`CutWireHeader`] and serialization functions for the MPI
//! cut-exchange wire format (24-byte header + variable coefficient tail).
//! - [`row`] — cut-row construction for the SDDP LP; owns the cut-sign
//! convention (`push_scaled_coefficient`
//! negates the raw subgradient). Entry points:
//! [`build_cut_row_batch_into`](row::build_cut_row_batch_into),
//! [`append_new_cuts_to_lp`](row::append_new_cuts_to_lp),
//! [`append_slots_to_lp`](row::append_slots_to_lp).
//! - [`row_map`] — [`CutRowMap`]: slot-to-LP-row mapping that preserves cut-pool
//! slot identity for warm-start basis reconstruction.
//! - [`cut_selection`] — [`CutSelectionStrategy`] (and `CutMetadata`): per-cut
//! activity tracking and the LML1/LML2 dominated-cut selection strategies.
//! - [`dcs`] — Dynamic Cut Selection: scores all resident cuts per stage.
//! - [`cut_sync`] — [`CutSyncBuffers`]: MPI cut-synchronization scratch space.
//! - [`basis_reconstruct`] — warm-start basis reconstruction for the baked
//! hot path and the DCS path.
//!
//! ## Sentinel value
//!
//! [`WARM_START_ITERATION`] is the sentinel stored in
//! [`CutMetadata::iteration_generated`](crate::cut_selection::CutMetadata::iteration_generated) for every cut loaded from a policy
//! checkpoint. Cut selection strategies may inspect this sentinel to apply
//! warm-start-specific pruning policies (e.g., exempt warm-start cuts from
//! LML1 deactivation).
pub use CutSelectionStrategy;
pub use CutSyncBuffers;
pub use FutureCostFunction;
pub use ;
pub use CutRowMap;
pub use CutWireHeader;
/// Sentinel value stored in [`crate::cut_selection::CutMetadata::iteration_generated`]
/// for warm-start cuts loaded from a policy checkpoint.
///
/// Set to [`u64::MAX`] so that `WARM_START_ITERATION != current_iteration` is
/// always true for any valid training iteration, allowing cut selection
/// strategies to distinguish warm-start cuts from training-generated cuts
/// without special casing.
pub const WARM_START_ITERATION: u64 = u64MAX;