feat(laboratory): publish M48S load envelope
This commit is contained in:
@@ -2,6 +2,7 @@ import type { LaboratoryFetch } from "./advancedResults";
|
||||
|
||||
const RESULT_ID = /^m48s-fixed-class-detector-lab-[a-f0-9]{64}$/;
|
||||
const FRAME_ID = /^[0-9]{6}$/;
|
||||
const SHA256 = /^[a-f0-9]{64}$/;
|
||||
const MODES = ["source", "yolox", "dfine", "rf-detr"] as const;
|
||||
const DETECTOR_MODES = ["yolox", "dfine", "rf-detr"] as const;
|
||||
const RESULT_STATUSES = [
|
||||
@@ -105,6 +106,48 @@ export interface M48SRuntimeHardeningComparison {
|
||||
};
|
||||
}
|
||||
|
||||
export interface M48SLoadEnvelopeScenario {
|
||||
id: "production-10fps" | "reserve-12fps" | "limit-15fps";
|
||||
loadPurpose: "production-rate" | "reserve-gate" | "limit-discovery";
|
||||
requestedSourceRateHz: number;
|
||||
sourceFramesAdmitted: number;
|
||||
deliveredWorldStates: number;
|
||||
supersededFrames: number;
|
||||
deliveryRatio: number;
|
||||
effectiveWorldStateFps: number;
|
||||
worldStateCompletionAgeP95Ms: number;
|
||||
worldStateCompletionAgeP99Ms: number;
|
||||
worldStateCompletionAgeMaximumMs: number;
|
||||
decodeP95Ms: number;
|
||||
decodeMaximumMs: number;
|
||||
detectorP95Ms: number;
|
||||
detectorMaximumMs: number;
|
||||
gpuUtilizationMeanPercent: number;
|
||||
gpuUtilizationMaximumPercent: number;
|
||||
gpuMemoryMaximumMib: number;
|
||||
processPeakRssMib: number;
|
||||
queueHighWatermarks: Readonly<Record<"detector" | "geometry" | "temporal" | "rolling" | "threat", number>>;
|
||||
queueCapacity: number;
|
||||
additionalInferencePasses: number;
|
||||
integrityGatePassed: boolean;
|
||||
operatingTargetGatePassed: boolean;
|
||||
thresholds: {
|
||||
minimumDeliveryRatio: number;
|
||||
minimumEffectiveWorldStateFps: number;
|
||||
maximumWorldStateCompletionP95Ms: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface M48SLoadEnvelopeComparison {
|
||||
productionRateRepeatabilityPassed: false;
|
||||
reserve12FpsPassed: true;
|
||||
limit15FpsPassed: true;
|
||||
loadEnvelopeAccepted: false;
|
||||
computeCapacityAtLeastFps: 15;
|
||||
bottleneckInterpretation: "rare-source-decode-or-scheduling-tail-not-steady-gpu-saturation";
|
||||
scenarios: readonly M48SLoadEnvelopeScenario[];
|
||||
}
|
||||
|
||||
export interface M48SFixedClassDetectorResult {
|
||||
resultId: string;
|
||||
createdAtUtc: string;
|
||||
@@ -144,6 +187,7 @@ export interface M48SFixedClassDetectorResult {
|
||||
};
|
||||
integratedWorldState: M48SIntegratedWorldState | null;
|
||||
runtimeHardening: M48SRuntimeHardeningComparison | null;
|
||||
loadEnvelope: M48SLoadEnvelopeComparison | null;
|
||||
};
|
||||
decision: {
|
||||
selectedCandidate: "rf-detr";
|
||||
@@ -151,6 +195,11 @@ export interface M48SFixedClassDetectorResult {
|
||||
integratedWorldStateGateEvaluated: boolean;
|
||||
integratedWorldStateGatePassed: boolean;
|
||||
detectorReplacementAuthorized: false;
|
||||
loadEnvelopeEvaluated: boolean;
|
||||
productionRateRepeatabilityPassed: boolean;
|
||||
reserve12FpsPassed: boolean;
|
||||
limit15FpsPassed: boolean;
|
||||
loadEnvelopeAccepted: boolean;
|
||||
productionAccepted: false;
|
||||
};
|
||||
limitations: readonly string[];
|
||||
@@ -457,6 +506,96 @@ function runtimeHardeningComparisonValue(value: unknown): M48SRuntimeHardeningCo
|
||||
};
|
||||
}
|
||||
|
||||
function loadEnvelopeComparisonValue(value: unknown): M48SLoadEnvelopeComparison {
|
||||
const comparison = objectValue(value, "M4.8S.metrics.load_envelope");
|
||||
exact(
|
||||
comparison.schema_version,
|
||||
"missioncore.m48s-load-envelope-comparison/v1",
|
||||
"M4.8S.metrics.load_envelope.schema_version",
|
||||
);
|
||||
exact(comparison.production_rate_repeatability_passed, false, "M4.8S.load_envelope.production_rate_repeatability_passed");
|
||||
exact(comparison.reserve_12_fps_passed, true, "M4.8S.load_envelope.reserve_12_fps_passed");
|
||||
exact(comparison.limit_15_fps_passed, true, "M4.8S.load_envelope.limit_15_fps_passed");
|
||||
exact(comparison.load_envelope_accepted, false, "M4.8S.load_envelope.load_envelope_accepted");
|
||||
exact(comparison.compute_capacity_at_least_fps, 15, "M4.8S.load_envelope.compute_capacity_at_least_fps");
|
||||
exact(
|
||||
comparison.bottleneck_interpretation,
|
||||
"rare-source-decode-or-scheduling-tail-not-steady-gpu-saturation",
|
||||
"M4.8S.load_envelope.bottleneck_interpretation",
|
||||
);
|
||||
const ids = ["production-10fps", "reserve-12fps", "limit-15fps"] as const;
|
||||
const purposes = ["production-rate", "reserve-gate", "limit-discovery"] as const;
|
||||
const targetGates = [false, true, true] as const;
|
||||
const scenarios = arrayValue(comparison.scenarios, "M4.8S.load_envelope.scenarios").map((value, index) => {
|
||||
const label = `M4.8S.load_envelope.scenarios[${index}]`;
|
||||
const scenario = objectValue(value, label);
|
||||
const id = ids[index];
|
||||
const purpose = purposes[index];
|
||||
if (id === undefined || purpose === undefined) {
|
||||
throw new M48SFixedClassDetectorContractError("M4.8S.load_envelope.scenarios: лишний сценарий.");
|
||||
}
|
||||
exact(scenario.id, id, `${label}.id`);
|
||||
exact(scenario.load_purpose, purpose, `${label}.load_purpose`);
|
||||
exact(scenario.integrity_gate_passed, true, `${label}.integrity_gate_passed`);
|
||||
exact(scenario.operating_target_gate_passed, targetGates[index], `${label}.operating_target_gate_passed`);
|
||||
exact(scenario.additional_inference_passes, 0, `${label}.additional_inference_passes`);
|
||||
const queues = integerRecordValue(scenario.queue_high_watermarks, `${label}.queue_high_watermarks`);
|
||||
for (const key of ["detector", "geometry", "temporal", "rolling", "threat"] as const) {
|
||||
if (!(key in queues)) {
|
||||
throw new M48SFixedClassDetectorContractError(`${label}.queue_high_watermarks.${key}: отсутствует.`);
|
||||
}
|
||||
}
|
||||
const thresholds = objectValue(scenario.thresholds, `${label}.thresholds`);
|
||||
const frameEvidenceSha256 = textValue(scenario.frame_evidence_sha256, `${label}.frame_evidence_sha256`);
|
||||
if (!SHA256.test(frameEvidenceSha256)) {
|
||||
throw new M48SFixedClassDetectorContractError(`${label}.frame_evidence_sha256: нарушен SHA-256.`);
|
||||
}
|
||||
return {
|
||||
id,
|
||||
loadPurpose: purpose,
|
||||
requestedSourceRateHz: numberValue(scenario.requested_source_rate_hz, `${label}.requested_source_rate_hz`),
|
||||
sourceFramesAdmitted: integerValue(scenario.source_frames_admitted, `${label}.source_frames_admitted`),
|
||||
deliveredWorldStates: integerValue(scenario.delivered_world_states, `${label}.delivered_world_states`),
|
||||
supersededFrames: integerValue(scenario.superseded_frames, `${label}.superseded_frames`),
|
||||
deliveryRatio: numberValue(scenario.delivery_ratio, `${label}.delivery_ratio`),
|
||||
effectiveWorldStateFps: numberValue(scenario.effective_world_state_fps, `${label}.effective_world_state_fps`),
|
||||
worldStateCompletionAgeP95Ms: numberValue(scenario.world_state_completion_age_p95_ms, `${label}.world_state_completion_age_p95_ms`),
|
||||
worldStateCompletionAgeP99Ms: numberValue(scenario.world_state_completion_age_p99_ms, `${label}.world_state_completion_age_p99_ms`),
|
||||
worldStateCompletionAgeMaximumMs: numberValue(scenario.world_state_completion_age_maximum_ms, `${label}.world_state_completion_age_maximum_ms`),
|
||||
decodeP95Ms: numberValue(scenario.decode_p95_ms, `${label}.decode_p95_ms`),
|
||||
decodeMaximumMs: numberValue(scenario.decode_maximum_ms, `${label}.decode_maximum_ms`),
|
||||
detectorP95Ms: numberValue(scenario.detector_p95_ms, `${label}.detector_p95_ms`),
|
||||
detectorMaximumMs: numberValue(scenario.detector_maximum_ms, `${label}.detector_maximum_ms`),
|
||||
gpuUtilizationMeanPercent: numberValue(scenario.gpu_utilization_mean_percent, `${label}.gpu_utilization_mean_percent`),
|
||||
gpuUtilizationMaximumPercent: numberValue(scenario.gpu_utilization_maximum_percent, `${label}.gpu_utilization_maximum_percent`),
|
||||
gpuMemoryMaximumMib: numberValue(scenario.gpu_memory_maximum_mib, `${label}.gpu_memory_maximum_mib`),
|
||||
processPeakRssMib: numberValue(scenario.process_peak_rss_mib, `${label}.process_peak_rss_mib`),
|
||||
queueHighWatermarks: queues as M48SLoadEnvelopeScenario["queueHighWatermarks"],
|
||||
queueCapacity: integerValue(scenario.queue_capacity, `${label}.queue_capacity`),
|
||||
additionalInferencePasses: 0,
|
||||
integrityGatePassed: true,
|
||||
operatingTargetGatePassed: targetGates[index],
|
||||
thresholds: {
|
||||
minimumDeliveryRatio: numberValue(thresholds.minimum_delivery_ratio, `${label}.thresholds.minimum_delivery_ratio`),
|
||||
minimumEffectiveWorldStateFps: numberValue(thresholds.minimum_effective_world_state_fps, `${label}.thresholds.minimum_effective_world_state_fps`),
|
||||
maximumWorldStateCompletionP95Ms: numberValue(thresholds.maximum_world_state_completion_p95_ms, `${label}.thresholds.maximum_world_state_completion_p95_ms`),
|
||||
},
|
||||
};
|
||||
});
|
||||
if (scenarios.length !== ids.length) {
|
||||
throw new M48SFixedClassDetectorContractError("M4.8S.load_envelope.scenarios: неполный набор.");
|
||||
}
|
||||
return {
|
||||
productionRateRepeatabilityPassed: false,
|
||||
reserve12FpsPassed: true,
|
||||
limit15FpsPassed: true,
|
||||
loadEnvelopeAccepted: false,
|
||||
computeCapacityAtLeastFps: 15,
|
||||
bottleneckInterpretation: "rare-source-decode-or-scheduling-tail-not-steady-gpu-saturation",
|
||||
scenarios,
|
||||
};
|
||||
}
|
||||
|
||||
function parseResult(value: unknown, resultId: string): M48SFixedClassDetectorResult {
|
||||
const payload = objectValue(value, "M4.8S");
|
||||
exact(
|
||||
@@ -475,6 +614,9 @@ function parseResult(value: unknown, resultId: string): M48SFixedClassDetectorRe
|
||||
const metrics = objectValue(payload.metrics, "M4.8S.metrics");
|
||||
const load = objectValue(metrics.detector_load, "M4.8S.metrics.detector_load");
|
||||
const decision = objectValue(payload.decision, "M4.8S.decision");
|
||||
const loadEnvelope = metrics.load_envelope === undefined
|
||||
? null
|
||||
: loadEnvelopeComparisonValue(metrics.load_envelope);
|
||||
const cameraRaster = arrayValue(source.camera_raster, "M4.8S.source.camera_raster");
|
||||
if (cameraRaster.length !== 2) {
|
||||
throw new M48SFixedClassDetectorContractError("M4.8S.source.camera_raster: нарушен размер.");
|
||||
@@ -503,6 +645,13 @@ function parseResult(value: unknown, resultId: string): M48SFixedClassDetectorRe
|
||||
exact(decision.detector_replacement_authorized, false, "M4.8S.decision.detector_replacement_authorized");
|
||||
}
|
||||
exact(decision.production_accepted, false, "M4.8S.decision.production_accepted");
|
||||
if (loadEnvelope !== null) {
|
||||
exact(decision.load_envelope_evaluated, true, "M4.8S.decision.load_envelope_evaluated");
|
||||
exact(decision.production_rate_repeatability_passed, false, "M4.8S.decision.production_rate_repeatability_passed");
|
||||
exact(decision.reserve_12_fps_passed, true, "M4.8S.decision.reserve_12_fps_passed");
|
||||
exact(decision.limit_15_fps_passed, true, "M4.8S.decision.limit_15_fps_passed");
|
||||
exact(decision.load_envelope_accepted, false, "M4.8S.decision.load_envelope_accepted");
|
||||
}
|
||||
const frames = arrayValue(payload.frames, "M4.8S.frames").map(descriptorValue);
|
||||
const evidenceFrameCount = integerValue(source.evidence_frame_count, "M4.8S.source.evidence_frame_count");
|
||||
if (frames.length !== evidenceFrameCount || new Set(frames.map((frame) => frame.frameId)).size !== frames.length) {
|
||||
@@ -551,6 +700,7 @@ function parseResult(value: unknown, resultId: string): M48SFixedClassDetectorRe
|
||||
runtimeHardening: metrics.runtime_hardening === undefined
|
||||
? null
|
||||
: runtimeHardeningComparisonValue(metrics.runtime_hardening),
|
||||
loadEnvelope,
|
||||
},
|
||||
decision: {
|
||||
selectedCandidate: "rf-detr",
|
||||
@@ -558,6 +708,11 @@ function parseResult(value: unknown, resultId: string): M48SFixedClassDetectorRe
|
||||
integratedWorldStateGateEvaluated: integratedGate,
|
||||
integratedWorldStateGatePassed: integratedGate,
|
||||
detectorReplacementAuthorized: false,
|
||||
loadEnvelopeEvaluated: loadEnvelope !== null,
|
||||
productionRateRepeatabilityPassed: false,
|
||||
reserve12FpsPassed: loadEnvelope?.reserve12FpsPassed ?? false,
|
||||
limit15FpsPassed: loadEnvelope?.limit15FpsPassed ?? false,
|
||||
loadEnvelopeAccepted: false,
|
||||
productionAccepted: false,
|
||||
},
|
||||
limitations: arrayValue(payload.limitations, "M4.8S.limitations").map((item, index) => textValue(item, `M4.8S.limitations[${index}]`)),
|
||||
|
||||
Reference in New Issue
Block a user