整合求解器活动监控与步长回归证据
同步远端 PNL0003 诊断和大采样网格能力,语义合并活动感知的 60 秒真停滞判定与旧后端 15 分钟兼容兜底。 纳管热路径优化、15 单元运行证据、浏览器与 API 报告,并补充北京时间更新日志和遗留问题。
This commit is contained in:
1 parent
c19cf77aee
commit
e18399c022
46 files changed
+181589
-170
No files matched your search
@@ -166,7 +166,7 @@ class MaxStepMatrixTests(unittest.TestCase):
|
||||
DEFAULT_MANIFEST_PATH,
|
||||
horizon_case_ids=("1s", 2.0),
|
||||
max_steps=(0.01, 0.05),
|
||||
additional_checkpoint_times=(1.0885267285, 1.0997760276),
|
||||
additional_checkpoint_times=(1.08, 1.10),
|
||||
expected_projection_count=2,
|
||||
case_executor=execute,
|
||||
)
|
||||
@@ -180,7 +180,7 @@ class MaxStepMatrixTests(unittest.TestCase):
|
||||
custom_requests = [request for request in requests if request.stop_time == 2.0]
|
||||
self.assertEqual(
|
||||
custom_requests[0].checkpoint_times,
|
||||
(0.0, 0.04, 0.8, 1.0, 1.0885267285, 1.0997760276, 2.0),
|
||||
(0.0, 0.04, 0.8, 1.0, 1.08, 1.1, 2.0),
|
||||
)
|
||||
self.assertEqual(
|
||||
report["configuration"]["horizons"][1]["horizonCaseId"],
|
||||
@@ -248,6 +248,50 @@ class MaxStepMatrixTests(unittest.TestCase):
|
||||
prefix_comparisons[0]["stateProjection"]["valueMismatchCount"], 0
|
||||
)
|
||||
|
||||
def test_cross_horizon_comparison_excludes_short_terminal(self) -> None:
|
||||
def execute(request: RegressionCaseRequest) -> dict[str, object]:
|
||||
result = _fake_completed(request)
|
||||
if request.stop_time <= 1.0:
|
||||
checkpoints = result["worker"]["summary"]["physicalContract"][
|
||||
"checkpoints"
|
||||
]
|
||||
for checkpoint in checkpoints:
|
||||
if checkpoint["requestedTime"] == request.stop_time:
|
||||
checkpoint["stateValues"]["state.a"] += 1.0
|
||||
return result
|
||||
|
||||
report = run_max_step_matrix(
|
||||
DEFAULT_MANIFEST_PATH,
|
||||
horizon_case_ids=("1s", 2.0),
|
||||
max_steps=(0.01,),
|
||||
expected_projection_count=2,
|
||||
case_executor=execute,
|
||||
)
|
||||
|
||||
comparison = report["comparisons"]["sameMaxStepAcrossHorizons"][0]
|
||||
self.assertTrue(comparison["strictPrefix"])
|
||||
self.assertTrue(comparison["passed"])
|
||||
self.assertNotIn(
|
||||
1.0,
|
||||
comparison["stateProjection"]["commonCheckpointTimes"],
|
||||
)
|
||||
|
||||
def test_same_horizon_comparison_keeps_terminal_checkpoint(self) -> None:
|
||||
report = run_max_step_matrix(
|
||||
DEFAULT_MANIFEST_PATH,
|
||||
horizon_case_ids=("1s",),
|
||||
max_steps=(0.01, 0.05),
|
||||
expected_projection_count=2,
|
||||
case_executor=_fake_completed,
|
||||
)
|
||||
|
||||
comparison = report["comparisons"]["sameHorizonAcrossMaxSteps"][0]
|
||||
self.assertFalse(comparison["strictPrefix"])
|
||||
self.assertIn(
|
||||
1.0,
|
||||
comparison["stateProjection"]["commonCheckpointTimes"],
|
||||
)
|
||||
|
||||
def test_horizons_must_increase_and_timeout_override_is_bounded(self) -> None:
|
||||
with self.assertRaisesRegex(
|
||||
RegressionManifestError, "strictly increasing"
|
||||
@@ -259,6 +303,20 @@ class MaxStepMatrixTests(unittest.TestCase):
|
||||
expected_projection_count=2,
|
||||
case_executor=_fake_completed,
|
||||
)
|
||||
|
||||
def test_off_grid_checkpoint_is_rejected_before_execution(self) -> None:
|
||||
with self.assertRaisesRegex(
|
||||
RegressionManifestError,
|
||||
"not represented by the .* output grid",
|
||||
):
|
||||
run_max_step_matrix(
|
||||
DEFAULT_MANIFEST_PATH,
|
||||
horizon_case_ids=("1s",),
|
||||
max_steps=(0.01,),
|
||||
additional_checkpoint_times=(0.0489,),
|
||||
expected_projection_count=2,
|
||||
case_executor=_fake_completed,
|
||||
)
|
||||
with self.assertRaisesRegex(RegressionManifestError, "must exceed"):
|
||||
run_max_step_matrix(
|
||||
DEFAULT_MANIFEST_PATH,
|
||||
|
||||
Reference in new issue
Block a user