Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions docs/TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
builds. MSBuild can retain flare-winui.exe after the bridge library changes;
verify loose and single-file outputs without requiring /t:Rebuild.

[ ] Expose the selected deployment's rebuild metadata in flare inspect --json.
Payload cores report rebuild: null even when DeploymentBody.rebuild is present.

[ ] Validate GLM TP4/TP8 A16 expert preparation through export and native replay.
Verify DirectWeightLoader.load_nvfp4_experts keeps only final scale layouts
in persistent storage when loading expanded CSF scales.
Expand Down
2 changes: 2 additions & 0 deletions helios/src/runtime_core/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ fn unverified_payload(
};
deployment_values.push(json!({
"id": body.deployment_id,
"rebuild": body.rebuild,
"frontend": frontend_detail,
"vision": vision_detail,
"tensor_parallel": body.tensor_parallel,
Expand Down Expand Up @@ -377,6 +378,7 @@ fn unverified_payload(
"development": publisher.development,
})),
},
"rebuild": capacity("rebuild"),
"model": {
"model_id": core.model_identity,
"identity": core.model_identity,
Expand Down
61 changes: 60 additions & 1 deletion helios/src/runtime_core/protection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2120,6 +2120,10 @@ impl PayloadVerifiedCore {
/// not carry them, and a destination offset is never a payload source offset.
fn inspection_descriptor(&self) -> Result<wire::ModelIndex> {
let mut index = self.descriptor()?;
index.rebuild = self
.verified
.deployment()
.and_then(|body| body.rebuild.clone());
for (bundle, (body, core)) in index
.ranks
.iter_mut()
Expand Down Expand Up @@ -3335,7 +3339,11 @@ mod payload_core_tests {
..Default::default()
}),
cluster: None,
rebuild: None,
rebuild: (tp == 2).then(|| crate::runtime_core::wire::RebuildManifest {
version: 99,
source_identity: "tp2-source".into(),
..Default::default()
}),
engram: None,
payloads: vec![],
ranks: vec![],
Expand Down Expand Up @@ -3955,6 +3963,57 @@ mod payload_core_tests {
let _ = std::fs::remove_dir_all(root);
}

#[test]
fn payload_inspection_reports_selected_deployment_rebuild_metadata() {
let (root, publishers, _) = two_deployment_core();
let packed = root.with_extension("safetensors");
crate::core::conversion::pack(&root, &packed).unwrap();
for path in [&root, &packed] {
for (tp, rank, expected_version, expected_source) in [
(1, None, None, None),
(2, None, Some(99), Some("tp2-source")),
(2, Some(1), Some(99), Some("tp2-source")),
] {
let verified =
VerifiedCore::open_tensor_parallel(path, &publishers, tp, rank).unwrap();
let description = verified
.describe(crate::runtime_core::InspectionOptions::default())
.unwrap();
assert_eq!(description["rebuild"]["version"].as_u64(), expected_version);
assert_eq!(
description["rebuild"]["source_identity"].as_str(),
expected_source
);
let unverified = crate::runtime_core::unverified_metadata_selected(
path,
crate::runtime_core::InspectionOptions::default(),
rank.map(|value| value as usize),
Some(tp),
)
.unwrap();
assert_eq!(unverified["core"]["signatures_verified"], false);
assert_eq!(unverified["rebuild"]["version"].as_u64(), expected_version);
assert_eq!(
unverified["rebuild"]["source_identity"].as_str(),
expected_source
);
}
let catalog = crate::runtime_core::unverified_metadata_selected(
path,
crate::runtime_core::InspectionOptions::default(),
None,
None,
)
.unwrap();
assert!(catalog["rebuild"].is_null());
let deployments = catalog["deployments"].as_array().unwrap();
let tp2 = deployments.iter().find(|d| d["tensor_parallel"] == 2).unwrap();
assert_eq!(tp2["rebuild"]["source_identity"], "tp2-source");
}
std::fs::remove_file(packed).unwrap();
std::fs::remove_dir_all(root).unwrap();
}

#[test]
fn rank_selected_descriptor_resolves_only_the_selected_engram_shard() {
let (root, publishers) = engram_core();
Expand Down