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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
//! SDDP solver for hydrothermal dispatch.
//!
//! Implements the SDDP algorithm: forward/backward passes, Benders cuts, risk measures,
//! convergence monitoring, and policy simulation. Parallelized via rayon (intra-rank)
//! and ferrompi (inter-rank).
// Relax strict production lints for test builds.
// Module visibility policy:
//
// - `pub mod` modules are accessed by name from outside the crate.
// `setup` and `policy_export` are reached by qualified path from
// `cobre-cli` / `cobre-python` / examples; the others are reached by
// qualified path from this crate's own integration tests in `tests/`
// (which compile as separate crates and so need pub visibility).
// Downstream crates SHOULD prefer the curated re-exports below; the
// `pub mod` namespaces are not a semver-stable API.
// - `pub(crate)` modules are pure internals — never named from outside
// this crate (verified by grep against `tests/`, `examples/`, and the
// other workspace crates).
pub
pub
// Crate-root submodule shim: re-exposes the inner `context` file module (now
// `workspace::context` after the `workspace/` cluster move) at the pre-move
// `cobre_sddp::context` path, so the in-crate `crate::context::{StageContext,
// TrainingContext}` call sites resolve verbatim without per-site edits.
pub use context;
// Crate-root submodule shim: re-exposes the inner `solver_phase` / `stage_solve`
// file modules (now `solve::solver_phase` / `solve::stage_solve` after the
// `solve/` cluster move) at their pre-move crate-root paths, so the in-crate
// `crate::solver_phase::Phase` use in `simulation/state.rs` and the
// `crate::stage_solve::{fill_unscaled, fill_unscaled_dual, StageInputs,
// run_stage_solve}` uses in `training/forward/`, `training/backward/`, and
// `simulation/pipeline.rs` resolve verbatim without per-site edits.
// `stage_solve` keeps `pub(crate)` visibility — it has no external raw-path
// consumer.
pub use solver_phase;
pub use stage_solve;
// Crate-root submodule shim: preserves the pre-move
// `cobre_sddp::risk_measure::` / `cobre_sddp::stopping_rule::` raw paths
// verbatim for the integration tests in `tests/conformance.rs`, which import
// these submodules by qualified path.
pub use ;
// Crate-root submodule shims for the `cut/` cluster move (`cut_selection`,
// `cut_sync`, `dcs`, `basis_reconstruct` were flat at the crate root; they now
// live under `cut/`). Each shim re-exposes a moved submodule at its pre-move
// crate-root path so consumers resolve verbatim without per-site edits:
//
// - `cut_selection` — `cobre_sddp::cut_selection::` in `benches/cut_selection_kernel.rs`
// and the integration tests `tests/{cut_selection_kernel_perf,cut_selection_determinism_realistic}.rs`,
// the internal `crate::cut_selection::` call sites across `training/backward/`,
// `training/backward_pass_state.rs`, `config.rs`, `cut/pool.rs`, `cut/dcs.rs`,
// `training/forward/`, `simulation/pipeline.rs`, `training/training.rs`, and
// `training/session/mod.rs`, plus the `crate::cut_selection::CutMetadata`
// intra-doc links in `cut/mod.rs`.
// - `cut_sync` — the internal `crate::cut_sync::CutSyncBuffers` references
// (reached via grouped `use crate::{ … }` imports) in `training/backward/`,
// `training/backward_pass_state.rs`, and `training/session/mod.rs`.
// - `dcs` — `cobre_sddp::dcs::` in `benches/dcs_batched_scoring.rs` plus the
// internal `crate::dcs::` call sites across `training/backward/`,
// `training/forward/`, `setup/{accessors,mod}.rs`, `simulation/pipeline.rs`,
// and `workspace/workspace.rs`.
// - `basis_reconstruct` — `cobre_sddp::basis_reconstruct::` in
// `tests/hybrid_reconstruction.rs` (plus the doc-comment intra-doc links in
// `tests/basis_reconstruct_churn.rs` and `cobre-python/src/run.rs`), and the
// internal `crate::basis_reconstruct::` call sites in `cut/dcs.rs`,
// `training/forward/`, and `workspace/workspace.rs`.
pub use ;
// Crate-root submodule shims for the `lp/` cluster move (`indexer` /
// `generic_constraints` / `lp_builder` were flat at the crate root; they now
// live under `lp/`). Each shim re-exposes a moved submodule at its pre-move
// crate-root path so consumers resolve verbatim without per-site edits:
//
// - `indexer` — covers the external raw-path consumers (`cobre_sddp::indexer::`
// in 4 integration tests + 2 benches) AND the internal `crate::indexer::`
// call sites across 13 files (including `lp/generic_constraints.rs` itself).
// - `lp_builder` (alias of `lp::builder`) — keeps the 27 internal
// `crate::lp_builder::Symbol` references across 11 files resolving to the
// moved subtree without editing those files.
// - `generic_constraints` — keeps `pub(crate)` visibility; covers the internal
// `crate::generic_constraints::` references in `lp/builder/matrix.rs` and
// `lp/builder/layout.rs`, which moved into the cluster and still reach the
// constraint-lowering module by its pre-move crate-root path.
pub use builder as lp_builder;
pub use generic_constraints;
pub use indexer;
// Crate-root submodule shim: preserves the pre-`policy/`-relocation raw
// `cobre_sddp::<module>::` / `crate::<module>::` paths verbatim so consumers
// resolve without edits. Each re-exported module has raw-path callers that the
// curated re-exports above do not cover:
// - `orchestration` — production callers `write_checkpoint`,
// `CheckpointParams`, `export_stochastic_artifacts` in
// `cobre-cli/src/commands/run/{outputs,setup}.rs` and
// `cobre-python/src/run.rs`.
// - `policy_export` — `tests/{boundary_cuts,decomp_integration,warm_start}.rs`
// plus the intra-crate `crate::policy_export::` use in `orchestration`.
// - `resolved_parameters` — `crate::resolved_parameters::` paths in
// `lp_builder/{layout,patch,matrix,template}.rs` and `setup`.
// - `scaling_report` — `crate::scaling_report::` paths in
// `setup/{template_postprocess,mod}.rs`.
pub use ;
// Crate-root submodule shim: preserves the pre-`production/`-relocation raw
// `cobre_sddp::<module>::` / `crate::<module>::` paths verbatim so consumers
// resolve without edits. Each re-exported module has raw-path callers that the
// curated re-exports above do not cover:
// - `energy_conversion` — `cobre_sddp::energy_conversion::` in the integration
// tests `tests/{scalar_parameters_declaration_order,simulation_pipeline_integration}.rs`,
// plus intra-crate `crate::energy_conversion::` uses.
// - `hydro_models` — `cobre_sddp::hydro_models::prepare_hydro_models_from_artifacts`
// in `cobre-cli/src/commands/{run/setup,validate}.rs` and
// `cobre-python/src/{io,run}.rs` (this symbol is intentionally NOT in the
// curated re-export above; the shim is its sole resolution path), plus
// intra-crate `crate::hydro_models::` uses.
// - `fpha_fitting` — `crate::fpha_fitting::FphaFittingError` in the non-moved
// `error.rs` plus intra-cluster uses in `hydro_models` and
// `energy_conversion`; `pub(crate)` keeps its crate-private visibility.
pub use fpha_fitting;
pub use ;
// Crate-root submodule shim: preserves the pre-`stochastic/`-relocation raw
// `cobre_sddp::<module>::` / `crate::<module>::` paths verbatim so consumers
// resolve without edits. Every one of the six modules has raw-path callers in
// non-moved files that the curated re-exports below do not cover:
// - `estimation` — `crate::estimation::` in `error.rs`,
// `policy/{orchestration,provenance}.rs`, and
// `setup/stochastic_pipeline.rs`.
// - `inflow_method` — `crate::inflow_method::` in `indexer.rs`, `training/forward/`,
// and `lp_builder/{template,matrix}.rs`, `simulation/pipeline.rs`.
// - `lag_transition` — `cobre_sddp::lag_transition::precompute_stage_lag_transitions`
// in `cobre-cli/src/commands/run/setup.rs` (this symbol is intentionally NOT
// in the curated re-export; the shim is its sole resolution path), plus
// `crate::lag_transition::` uses in `workspace/context.rs` and
// `setup/{stochastic_pipeline,stage_data,mod}.rs`.
// - `noise_key_diag` — `crate::noise_key_diag::` in `setup/mod.rs`.
// - `noise` — `crate::noise::` in `workspace/context.rs`, `training/forward/`, and
// `simulation/pipeline.rs`; `pub(crate)` keeps its crate-private visibility.
// - `stochastic_summary` — `crate::stochastic_summary::` in
// `policy/orchestration.rs`; `pub(crate)` keeps its crate-private visibility.
pub use ;
pub use ;
// Crate-root submodule shim: preserves the pre-`training/`-relocation raw
// `crate::<module>::` paths verbatim for the internal references that the
// curated re-exports below do not cover, so the consumer files resolve without
// per-site edits. The pass files moved into `training/`; their pre-move
// crate-root paths are re-exposed here:
// - `forward` — `crate::forward::{ForwardResult, SyncResult}` in
// `training/session/mod.rs`, the `crate::forward::sync_forward` use there and
// its intra-doc links in `convergence/convergence.rs`, and the
// `crate::forward::build_delta_cut_row_batch_into` intra-doc link in
// `cut/row.rs`. Keeps `pub` to match its pre-move visibility.
// - `backward` — `crate::backward::StagedCut` in `workspace/workspace.rs`,
// `crate::backward::BackwardResult` in `training/session/mod.rs`, and the
// `crate::backward::duals_extraction::extract_duals_from_view` intra-doc link
// in `cut/row.rs`.
// - `backward_pass_state` — `crate::backward_pass_state::BackwardPass{State,Inputs}`
// in `training/backward/` and the doc reference in `cut/cut_selection.rs`.
// - `forward_pass_state` — `crate::forward_pass_state::{ForwardPassInputs,
// ForwardPassState}` in `training/forward/`.
// - `lower_bound` — `crate::lower_bound::evaluate_lower_bound` intra-doc links
// in `convergence/convergence.rs`. Keeps `pub` to match its pre-move visibility.
// - `state_exchange` — `crate::state_exchange::ExchangeBuffers` in
// `training/backward_pass_state.rs`, `training/backward/trial_point.rs`, and
// `training/session/mod.rs` (load-bearing; do not remove).
// - `trajectory` — `crate::trajectory::TrajectoryRecord` in `training/forward/`
// and `training/state_exchange.rs`.
// - `visited_states` — `crate::visited_states::VisitedStatesArchive` in
// `training/training.rs`, `training/session/mod.rs`, and `policy/policy_export.rs`.
pub use ;
pub use ;
// Crate-root submodule shim: aliases the nested `training/session/` subtree at
// the pre-move `crate::training_session::` path so the
// `crate::training_session::{iteration_scratch, rank_distribution, runtime}`
// references in `training/forward_pass_state.rs` resolve verbatim.
pub use session as training_session;
// ── config ────────────────────────────────────────────────────────────────────
pub use TrainingConfig;
// ── convergence ───────────────────────────────────────────────────────────────
pub use ConvergenceMonitor;
// ── cut ───────────────────────────────────────────────────────────────────────
pub use ;
pub use ;
// ── cut_selection ─────────────────────────────────────────────────────────────
pub use CutSelectionStrategy;
// ── cut_sync ──────────────────────────────────────────────────────────────────
pub use CutSyncBuffers;
// ── cut::row ──────────────────────────────────────────────────────────────────
pub use build_cut_row_batch_into;
// ── energy_conversion ─────────────────────────────────────────────────────────
pub use ;
// ── error ─────────────────────────────────────────────────────────────────────
pub use SddpError;
// ── estimation ────────────────────────────────────────────────────────────────
pub use ;
// ── forward ───────────────────────────────────────────────────────────────────
pub use SyncResult;
// ── hydro_models ──────────────────────────────────────────────────────────────
pub use ;
// ── indexer ───────────────────────────────────────────────────────────────────
pub use ;
// ── inflow_method ─────────────────────────────────────────────────────────────
pub use InflowNonNegativityMethod;
// ── lp_builder ────────────────────────────────────────────────────────────────
pub use ;
// ── policy_load ───────────────────────────────────────────────────────────────
pub use ;
// ── provenance ────────────────────────────────────────────────────────────────
pub use ;
// ── risk_measure ──────────────────────────────────────────────────────────────
pub use ;
// ── setup ─────────────────────────────────────────────────────────────────────
pub use ;
// ── simulation ────────────────────────────────────────────────────────────────
pub use ;
// ── solver_phase ─────────────────────────────────────────────────────────────
pub use Phase;
pub use ;
// ── solver_stats ──────────────────────────────────────────────────────────────
pub use ;
// ── stochastic_summary ────────────────────────────────────────────────────────
pub use ;
// ── stopping_rule ─────────────────────────────────────────────────────────────
pub use ;
// ── training ──────────────────────────────────────────────────────────────────
pub use ;
// ── training_output ───────────────────────────────────────────────────────────
pub use build_training_output;
// ── resolved_parameters ───────────────────────────────────────────────────────
pub use ;
// ── state_exchange ────────────────────────────────────────────────────────────
pub use ExchangeBuffers;
// ── trajectory ────────────────────────────────────────────────────────────────
pub use TrajectoryRecord;
// ── workspace ─────────────────────────────────────────────────────────────────
pub use ;