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
//! SDDP training-phase passes and the iterative training loop.
//!
//! This directory clusters everything that runs during training — the
//! orchestrating loop, the per-pass execution kernels, and the per-pass scratch
//! state — as a sibling to [`crate::simulation`]:
//!
//! - `training` — `train`: wires the forward pass, forward sync, state exchange,
//! backward pass, cut sync, lower-bound evaluation, and convergence check into
//! a single iterative loop.
//! - `session` — `TrainingSession`: owns all scratch buffers for one `train`
//! call and drives `run_iteration`.
//! - `forward` / `backward` — the forward and backward pass kernels.
//! - `forward_pass_state` / `backward_pass_state` — pre-allocated per-pass
//! scratch state and the borrowed-inputs bundles their `run` boundaries take.
//! - `lower_bound` — `evaluate_lower_bound`.
//! - `state_exchange` — `ExchangeBuffers`: `allgatherv` of trial points between
//! the forward and backward passes.
//! - `trajectory` — `TrajectoryRecord`: the forward→backward data unit.
//! - `visited_states` — archived trial-point states for dominated cut selection.
//! - `training_output` — converts the training summary plus event log into the
//! structured output the `cobre-io` writers consume.
// Rationale: the training-loop file keeps its established `training` basename
// inside this `training/` cluster, so the submodule shares its parent's name.
// Renaming it (e.g. to `loop`) would break the `crate::training::train` /
// `crate::training::TrainingResult` re-export paths the call sites and intra-doc
// links rely on, the `cobre_sddp::training::{train, TrainingResult,
// TrainingOutcome}` curated surface, and the `training/training.rs` hot-path
// pointer in `CLAUDE.md` for no behavioural gain.
pub
pub
pub
pub
pub
pub
pub
pub
pub use SyncResult;
pub use ExchangeBuffers;
pub use ;
pub use build_training_output;
pub use TrajectoryRecord;
// Crate-internal re-export: keeps the `crate::training::broadcast_basis_cache`
// path resolving verbatim for its sole consumer, `session/mod.rs`, after the
// loop file became the `training` submodule. `pub(crate)` keeps this MPI
// basis-cache helper off the curated public surface.
pub use broadcast_basis_cache;