@@ -486,6 +486,41 @@ async def test_report_includes_paired_bootstrap_uncertainty_and_pareto_selection
486486 assert robust_checks ["validation_gain_ci_lower_bound" ].passed is True
487487
488488
489+ @pytest .mark .asyncio
490+ async def test_unknown_latency_is_not_treated_as_zero_for_pareto_or_markdown (tmp_path : Path , ) -> None :
491+ EvalOptimizePipeline , PipelineSpec = _load_public_interface ()
492+ report = await EvalOptimizePipeline (
493+ PipelineSpec .from_file (
494+ _EXAMPLE_DIR / "pipeline.json" ,
495+ output_dir = tmp_path / "unknown-latency" ,
496+ )).run ()
497+
498+ from eval_optimize_loop .loop .analysis import RegressionAnalyzer
499+ from eval_optimize_loop .loop .reporting import render_markdown
500+
501+ robust = next (item for item in report .candidates if item .candidate_id == "robust" )
502+ unknown_latency = robust .model_copy (deep = True )
503+ measured_latency = robust .model_copy (deep = True )
504+ unknown_latency .candidate_id = "unknown-latency"
505+ measured_latency .candidate_id = "measured-latency"
506+ unknown_latency .audit .resources .p95_latency_ms = None
507+ measured_latency .audit .resources .p95_latency_ms = 8.0
508+
509+ RegressionAnalyzer (seed = 91 , bootstrap_samples = 100 ,
510+ confidence_level = 0.95 ).mark_pareto ([unknown_latency , measured_latency ])
511+ assert unknown_latency .pareto_optimal is False
512+ assert measured_latency .pareto_optimal is True
513+
514+ report_for_rendering = report .model_copy (deep = True )
515+ rendered_robust = next (item for item in report_for_rendering .candidates if item .candidate_id == "robust" )
516+ rendered_robust .audit .resources .p95_latency_ms = None
517+ markdown = render_markdown (report_for_rendering )
518+ resource_section = markdown .split ("### Candidate evaluation resources" , maxsplit = 1 )[1 ]
519+ resource_row = next (line for line in resource_section .splitlines () if line .startswith ("| `robust` |" ))
520+ assert "| unavailable |" in resource_row
521+ assert "0.0 ms" not in resource_row
522+
523+
489524@pytest .mark .asyncio
490525async def test_data_quality_fails_closed_on_cross_split_near_duplicate (tmp_path : Path , ) -> None :
491526 EvalOptimizePipeline , PipelineSpec = _load_public_interface ()
0 commit comments