fix: address M3 verifier findings on soak invariants and probe tests

This commit is contained in:
2026-07-22 02:21:33 -04:00
parent fdd36e0e1f
commit 3c9f306ea3
8 changed files with 126 additions and 12 deletions
+15 -4
View File
@@ -139,6 +139,8 @@ async def _worker_async(args: argparse.Namespace, worker_idx: int) -> None:
telemetry_db=_ROOT / "data/soak/generate_questions_telemetry.db",
frames_root=_ROOT / "data/soak/vt_frames",
images_root=_ROOT / "data/soak/chs_images",
# P7 只需 images: chains/replays 的 base64 负载曾把起跑 RSS 顶到 ~690MB(verifier I1)
modalities=("images",) if args.scenario == "P7" else ("chains", "replays", "images"),
)
generator = SCENARIOS[args.scenario](corpus, f"{run_id}-w{worker_idx}")
sem = asyncio.Semaphore(args.concurrency)
@@ -297,6 +299,8 @@ def _p7_checks(args, env, results, rows, calls, verdicts, check) -> None:
check("坏源尝试占比 ≤15%(P7)", sb.inv_fault_share, rows, fault_names, max_share=0.15)
check("故障混编生效(P7)", sb.inv_fault_errors_present, rows, fault_source_names=fault_names)
check("错误全部可分类(P7)", sb.inv_errors_classified, rows, _KNOWN_ERROR_PREFIXES)
for r in results:
check("RSS 绝对值 <500MB(P7)", sb.inv_rss_absolute, r["rss_current_mb"], max_mb=500.0)
cancelled = sum(r["stats"]["cancelled"] for r in results)
verdicts.append(
("零取消泄漏(P7)", "PASS" if cancelled == 0 else f"FAIL — cancelled={cancelled}")
@@ -388,11 +392,18 @@ async def _live_checks(
lease_ttl_s=settings.lease_ttl_s,
)
gate = RedisGate.from_url(env["REDIS_URL"], config=settings.breaker, scope=settings.scope)
checks = [
("记账归零(inflight)", sb.inv_accounting_zeroed(limiter, names)),
("gate 可再准入(探针不悬挂)", sb.inv_gate_reenterable(gate, names)),
]
if args.scenario == "P7":
fault = {
s.strip() for s in env.get(f"{args.scope}_FAULT_SOURCES", "").split(",") if s.strip()
}
healthy = [n for n in names if n not in fault]
checks.append(("真源门态 CLOSED(P7 零误熔)", sb.inv_healthy_gates_closed(gate, healthy)))
try:
for name, invariant in (
("记账归零(inflight)", sb.inv_accounting_zeroed(limiter, names)),
("gate 可再准入(探针不悬挂)", sb.inv_gate_reenterable(gate, names)),
):
for name, invariant in checks:
try:
await invariant
verdicts.append((name, "PASS"))