feat(laboratory): compare M48S runtime hardening

This commit is contained in:
DCCONSTRUCTIONS
2026-08-25 19:38:11 +03:00
parent 84624ae3ea
commit 078b8421a6
8 changed files with 445 additions and 39 deletions
+16 -2
View File
@@ -38,7 +38,7 @@ def test_m48s_lab_seals_visual_comparison_and_load_evidence(tmp_path: Path) -> N
assert manifest["result_id"] == result.result_id
assert result.result_id.endswith(identity_digest)
assert manifest["identity_sha256"] == identity_digest
assert len(manifest["artifacts"]) == 31
assert len(manifest["artifacts"]) == 35
assert manifest["method"]["completeness"] == "complete"
assert manifest["bounded_question_accepted"] is True
assert manifest["ground_truth"] is False
@@ -66,6 +66,20 @@ def test_m48s_lab_seals_visual_comparison_and_load_evidence(tmp_path: Path) -> N
assert max(integrated["queue_high_watermarks"].values()) <= 2
assert integrated["additional_inference_passes"] == 0
assert integrated["failures"] == 0
hardening = manifest["metrics"]["runtime_hardening"]
assert hardening["schema_version"] == "missioncore.m48s-runtime-hardening-comparison/v1"
assert hardening["baseline"]["delivered_world_states"] == 4_480
assert hardening["baseline"]["superseded_frames"] == 9
assert hardening["hardened"]["delivered_world_states"] == 4_488
assert hardening["hardened"]["superseded_frames"] == 1
assert hardening["baseline"]["rolling_maximum_ms"] == 762.638263
assert hardening["hardened"]["rolling_maximum_ms"] == 28.044958
assert hardening["startup"]["baseline"]["detector_ms"] == 397.356888
assert hardening["startup"]["prewarmed"]["detector_ms"] == 27.662887
assert hardening["startup"]["baseline"]["world_state_ms"] == 449.893287
assert hardening["startup"]["prewarmed"]["world_state_ms"] == 60.516957
assert hardening["startup"]["prewarm_duration_ms"] == 420.721918
assert hardening["startup"]["validation_frames"] == 1_000
catalog = json.loads((result.result_root / "catalog.json").read_text("utf-8"))
assert catalog["frame_count"] == len(FRAME_IDS) == 11
@@ -85,7 +99,7 @@ def test_m48s_lab_seals_visual_comparison_and_load_evidence(tmp_path: Path) -> N
)
proof = verify_laboratory_evidence_result(definition, result.result_root)
assert proof["result_id"] == result.result_id
assert proof["artifact_count"] == 31
assert proof["artifact_count"] == 35
with pytest.raises(M48SFixedClassDetectorLabError, match="already exists"):
build_m48s_fixed_class_detector_lab(
@@ -47,20 +47,19 @@ def test_m48s_lab_api_projects_verified_result_frame_and_camera(tmp_path: Path)
result.json()["metrics"]["integrated_world_state"]["world_state_completion_age_p95_ms"]
== 74.733648
)
hardening = result.json()["metrics"]["runtime_hardening"]
assert hardening["baseline"]["delivered_world_states"] == 4_480
assert hardening["hardened"]["delivered_world_states"] == 4_488
assert hardening["startup"]["prewarmed"]["world_state_ms"] == 60.516957
assert result.json()["ground_truth"] is False
assert len(result.json()["frames"]) == 11
timeline = client.get(
f"/api/v1/laboratory/m48s/fixed-class-detector/{result_id}/timeline"
)
timeline = client.get(f"/api/v1/laboratory/m48s/fixed-class-detector/{result_id}/timeline")
assert timeline.status_code == 200
assert timeline.json()["frame_count"] == 4_489
assert timeline.json()["world_state_frame_count"] == 4_481
assert timeline.json()["superseded_frame_count"] == 8
assert (
timeline.json()["camera_point_delivery"]
== "factory-kb4-causal-registered-accumulation"
)
assert timeline.json()["camera_point_delivery"] == "factory-kb4-causal-registered-accumulation"
assert timeline.json()["camera_point_window_seconds"] == 2.0
assert timeline.json()["camera_point_sample_limit"] == 20_000
chunk = client.get(
@@ -72,9 +71,7 @@ def test_m48s_lab_api_projects_verified_result_frame_and_camera(tmp_path: Path)
assert replay_frame["world_state_available"] is True
assert replay_frame["camera_projection"] == "factory-kb4-exact"
assert replay_frame["camera_projected_sample_count"] > 0
assert any(
item["semantic_hint"] == "dog" for item in replay_frame["camera_proposals"]
)
assert any(item["semantic_hint"] == "dog" for item in replay_frame["camera_proposals"])
camera_points = client.get(
f"/api/v1/laboratory/m48s/fixed-class-detector/{result_id}"
"/timeline/frames/253/camera-points"
@@ -82,9 +79,7 @@ def test_m48s_lab_api_projects_verified_result_frame_and_camera(tmp_path: Path)
assert camera_points.status_code == 200
camera_point_payload = camera_points.json()
assert camera_point_payload["schema_version"] == "missioncore.m48s-camera-point-overlay/v1"
assert camera_point_payload["projection"] == (
"factory-kb4-causal-registered-accumulation"
)
assert camera_point_payload["projection"] == ("factory-kb4-causal-registered-accumulation")
assert camera_point_payload["source_frame_count"] > 1
assert camera_point_payload["sample_count"] > replay_frame["camera_projected_sample_count"]
assert camera_point_payload["sample_count"] <= 20_000