pub(crate) fn engine_files_for_sm(
engine_dir: &Path,
sm: Option<&str>,
) -> Vec<PathBuf>Expand description
Returns full paths of .engine files under engine_dir that match the
requested SM, or all .engine files when sm is None.
Single source of truth for engine enumeration: every other function in
this module that needs to enumerate engine plans (count, basenames,
operator log line) delegates here. Centralising the filter is the design
constraint behind the SM-aware refactor — a future caller that grew its
own read_dir loop would silently regress the heterogeneous-SM safety
invariant.
Failure modes (directory missing or unreadable) collapse to an empty
Vec, mirroring the legacy count_engine_files behaviour and the
“operator-visible, not load-bearing” stance of this module.