fuel_dispatch/judge_report_path.rs
1// SPDX-License-Identifier: MIT OR Apache-2.0
2//! The on-disk path for the Judge's persisted [`fuel_ir::dispatch::ProfileReport`].
3//!
4//! Moved from `fuel-core::judge::mod::default_report_path` (fuel-core
5//! dissolution, plan item 8): pure path-joining logic with zero coupling to
6//! `fuel-core`'s `Tensor`/`Device` or to the Judge struct itself, so it moves
7//! independently of the rest of `judge/mod.rs` (which stays in fuel-core).
8//! Kept UNGATED (not under the `telemetry` feature) because
9//! `fuel-tensor::judge::cache` and `fuel-tensor::scheduling` call it
10//! unconditionally, regardless of whether `telemetry` is enabled.
11
12/// Filename of the persisted profile report, alongside the probe report in
13/// the same hardware-keyed cache directory.
14pub const PROFILE_REPORT_FILENAME: &str = "judge.json";
15
16/// The default on-disk path for the Judge's persisted profile report —
17/// the same hardware-keyed cache directory [`fuel_hardware::probe`] uses,
18/// with the profile report's own filename joined on.
19pub fn default_report_path() -> Option<std::path::PathBuf> {
20 fuel_hardware::probe::default_report_path().and_then(|p| {
21 p.parent()
22 .map(|parent| parent.join(PROFILE_REPORT_FILENAME))
23 })
24}