H1W0XXX commited on
Commit ·
5fbc173
1
Parent(s): ec20773
Fix evaluation persistence and update leaderboard with DeepSeek and GLM results
Browse filesFiles changed (8)
- .gitignore+2-1
- README.md+6-8
- README_EN.md+6-8
- run_eval.py+118-18
- src/checkpoint.pyAdded+110
- tools/checkpoint_selftest.pyAdded+60
- tools/response_selftest.pyAdded+53
- tools/run_pair.pyAdded+94
36 unmodified lines373839404142424336 unmodified lines
# Project specificeval_result_*.jsonruns/
# Helper Scriptspush_all.ps1push_all.ps1163 unmodified lines164165166167168169170171172173174167168169170171172173174175163 unmodified lines
## 📊 评测榜单 (Leaderboard)
| 模型 (Model) | 加权准确率 (Weighted Acc) | 备注 (Notes) || :--- | :---: | :--- || **Qwen3.5-35B-A3B** | 40.23% | Retries: 3 || **Qwen3-VL-32B-Instruct** | 35.16% | Retries: 3 || **gemma-4-31B-it** | 33.98% | Retries: 3 || **GLM-4.5V-INT8** | 19.53% | Retries: 3 |
*注:数据更新于 2026.4.5,基于 v1.0 数据集 (25题).*| 模型 (Model) | 梁 (Beam) | 刚架 (Frame) | 桁架 (Truss) | 总得分 (Score) | 加权准确率 (Weighted Acc) || :--- | :---: | :---: | :---: | :---: | :---: || **deepseek-v4.1-flash** | 100.00% | 50.00% | 100.00% | 50.50 / 64 | **78.91%** || **glm-5.3-flash** | 100.00% | 46.30% | 100.00% | 49.50 / 64 | **77.34%** |
*注:数据更新于 2026-10-21,基于 v1.0 数据集,共 25 题(梁 5 题、刚架 10 题、桁架 10 题),总难度权重 64。评测参数:输出额度 32,768 tokens(包含思考与最终答案),reasoning_effort=high,每个模型并发 8,最多重试 2 次(每题最多请求 3 次)。各类别准确率均按难度加权计算。*
## 许可证
142 unmodified lines143144145146147148149150151152153146147148149150151152153154142 unmodified lines
## 📊 Leaderboard
| Model | Weighted Accuracy | Notes || :--- | :---: | :--- || **Qwen3.5-35B-A3B** | 40.23% | Retries: 3 || **Qwen3-VL-32B-Instruct** | 35.16% | Retries: 3 || **gemma-4-31B-it** | 33.98% | Retries: 3 || **GLM-4.5V-INT8** | 19.53% | Retries: 3 |
*Note: Data updated on 2026.4.5, based on v1.0 dataset (25 tasks).*| Model | Beam | Frame | Truss | Score | Weighted Accuracy || :--- | :---: | :---: | :---: | :---: | :---: || **deepseek-v4.1-flash** | 100.00% | 50.00% | 100.00% | 50.50 / 64 | **78.91%** || **glm-5.3-flash** | 100.00% | 46.30% | 100.00% | 49.50 / 64 | **77.34%** |
*Note: Updated on 2026-10-21 using the v1.0 dataset: 25 tasks (5 beam, 10 frame, and 10 truss), with a total difficulty weight of 64. Evaluation settings: 32,768 output tokens (including reasoning and the final answer), reasoning_effort=high, concurrency of 8 per model, and up to 2 retries (3 attempts per task). Category accuracies are also weighted by difficulty.*
## License
14 unmodified lines1516171819202139 unmodified lines616263636465646566676869707172737475767778798081828384858687888990918 unmodified lines1001011028010310410510610710810911011111211311411511611711811912012112212312490911251261271281291301311321331341351361371381391401411421431441456 unmodified lines152153154155156157158159160161162163164165130 unmodified lines29629729824729930030130230345 unmodified lines3493503513523533543553563573043583593603613623633643653663675 unmodified lines37337437537637737837938038138238338438538638738838939031839139239332132239439539639739890 unmodified lines4894904914194924934944954 unmodified lines5005015024305035045055065075085095105115127 unmodified lines52052152252352452552652710 unmodified lines53853954054154254354454554654754854955055155255355455555655715 unmodified lines57357457548548657657757857958058158258358458558658758858959059159259359436 unmodified lines63163263353253353463463563663714 unmodified linesfrom src.metrics import compute_scorefrom src.data_loader import BenchmarkDataLoaderfrom src.prompts import PROMPT_REGISTRYfrom src.checkpoint import CheckpointStore, StreamProgress, append_event, atomic_json
# 尝试引入 json_repair,如果没有安装则退化到 jsontry:39 unmodified lines match = re.search(r'```(.*?)```', response_text, re.DOTALL) if match: return match.group(1).strip()
# 5. 找最外层大括号 match = re.search(r'\{.*?\}', response_text, re.DOTALL) if match: return match.group(0).strip() # 5. 按括号层级提取完整对象,忽略字符串内部的括号与转义引号。 start = response_text.find('{') if start >= 0: depth = 0 in_string = False escaped = False for index in range(start, len(response_text)): char = response_text[index] if in_string: if escaped: escaped = False elif char == '\\': escaped = True elif char == '"': in_string = False elif char == '"': in_string = True elif char == '{': depth += 1 elif char == '}': depth -= 1 if depth == 0: return response_text[start:index + 1].strip() # 保留完整的未闭合片段供 json_repair 尝试恢复。 return response_text[start:].strip()
return None
8 unmodified lines return compact[:max_len - 3] + "..."
def run_chat_completion(client, model_name, messages, temperature=0.2, stream_output=False):def run_chat_completion(client, model_name, messages, temperature=0.2, stream_output=False, max_tokens=8192, metadata=None, reasoning_effort=None, progress_label=None, events_path=None, progress_interval=15): """封装 API 调用,默认只收集完整回复,不逐 token 打印。""" if metadata is None: metadata = {} metadata.update(finish_reason=None, usage=None, reasoning_chars=0, error=None) progress = StreamProgress(progress_label, events_path, progress_interval) if progress_label else None if progress: progress.start() stream = None try: if stream_output: print(f"\n[Model Output Start]:")
request_options = {} if reasoning_effort: request_options['reasoning_effort'] = reasoning_effort stream = client.chat.completions.create( model=model_name, messages=messages, temperature=temperature, max_tokens=8192, stream=True max_tokens=max_tokens, stream=True, stream_options={"include_usage": True}, **request_options, ) full_content = [] for chunk in stream: if progress: delta = chunk.choices[0].delta if chunk.choices else None progress.received(getattr(delta, 'content', None), getattr(delta, 'reasoning_content', None)) if chunk.usage: metadata['usage'] = chunk.usage.model_dump() if chunk.choices: choice = chunk.choices[0] if choice.finish_reason: metadata['finish_reason'] = choice.finish_reason metadata['reasoning_chars'] += len(getattr(choice.delta, 'reasoning_content', None) or '') delta = chunk.choices[0].delta.content if delta: if stream_output:6 unmodified lines return "".join(full_content)
except Exception as e: metadata['error'] = str(e) print(f"\n[API Error] {e}") return None finally: if stream is not None and hasattr(stream, 'close'): stream.close() if progress: progress.close()
def keep_best_retry_score(130 unmodified lines
loader = BenchmarkDataLoader() solver = TrussSolver("bin/framecalc.wasm") client = OpenAI(api_key=args.api_key, base_url=args.api_base) if not args.debug else None client = OpenAI(api_key=args.api_key, base_url=args.api_base, timeout=args.api_timeout, max_retries=0) if not args.debug else None
# Load Raw GT Model for diagnosis gt_raw_json = loader.load_raw_model_by_id(task_id)45 unmodified lines messages = base_messages + retry_context
tqdm.write(f"[{task_id}] attempt {attempts_used}/{args.max_retries + 1}: requesting API") response_metadata = {} response_text = run_chat_completion( client, args.model, messages, temperature=current_temp, stream_output=args.verbose_response stream_output=args.verbose_response, max_tokens=args.max_tokens, metadata=response_metadata, reasoning_effort=args.reasoning_effort, progress_label=f'{task_id} attempt {attempts_used}', events_path=args.events_path, progress_interval=args.progress_interval, ) attempt_log = { "attempt": attempts_used,5 unmodified lines "details": {}, "failure": None } attempt_log.update(response_metadata) # 保存原始回复后再调用求解器;即使本地诊断中断也有可审计记录。 append_event(args.events_path, dict(event='attempt_response', task_id=task_id, **attempt_log)) tqdm.write(f"[{task_id}] attempt {attempts_used}: finish={response_metadata['finish_reason']}, " f"content_chars={len(response_text or '')}, reasoning_chars={response_metadata['reasoning_chars']}, " f"usage={response_metadata['usage']}")
if response_metadata['finish_reason'] == 'length': fail_reason = "Output Token Limit" attempt_log['failure'] = fail_reason attempt_logs.append(attempt_log) tqdm.write(f"[{task_id}] attempt {attempts_used}: output limit reached ({args.max_tokens} tokens)") continue if not response_text: fail_reason = "API Failure" fail_reason = "API Failure" if response_metadata['error'] else "Empty Response" attempt_log["failure"] = fail_reason attempt_logs.append(attempt_log) tqdm.write(f"[{task_id}] attempt {attempts_used}: API failure") break tqdm.write(f"[{task_id}] attempt {attempts_used}: {fail_reason}") continue
json_str = extract_json(response_text) attempt_log["extracted_json"] = json_str90 unmodified lines return result
def run_task_batch(tasks, concurrency, task_runner, show_progress=True):def run_task_batch(tasks, concurrency, task_runner, show_progress=True, on_result=None): """ 题目级调度。并发完成顺序可能不同,但返回结果始终保持输入任务顺序。 """4 unmodified lines iterator = enumerate(tasks) if show_progress: iterator = tqdm(iterator, total=len(tasks), desc="Evaluating", ascii=True) return [task_runner(index, task) for index, task in iterator] results = [] for index, task in iterator: result = task_runner(index, task) if on_result: on_result(result) results.append(result) return results
results = [None] * len(tasks) with ThreadPoolExecutor(max_workers=concurrency) as executor:7 unmodified lines for future in iterator: index = future_to_index[future] results[index] = future.result() if on_result: on_result(results[index])
return results
10 unmodified lines parser.add_argument("--filter", type=str, default=None, help="Filter tasks") parser.add_argument("--verbose-response", action="store_true", help="Print full streaming model responses to console") parser.add_argument("--concurrency", type=int, default=1, help="Number of tasks to evaluate concurrently") parser.add_argument("--max-tokens", type=int, default=8192, help="Output token budget including reasoning") parser.add_argument("--output", type=str, default=None, help="Result JSON path") parser.add_argument("--reasoning-effort", choices=["low", "medium", "high"], default=None, help="Requested reasoning effort") parser.add_argument("--resume", action="store_true", help="Skip durably completed tasks from matching checkpoint") parser.add_argument("--progress-interval", type=float, default=15, help="Stream heartbeat interval in seconds") parser.add_argument("--api-timeout", type=float, default=120, help="API socket inactivity timeout in seconds")
args = parser.parse_args() if args.concurrency < 1: parser.error("--concurrency must be >= 1") if args.max_tokens < 1: parser.error("--max-tokens must be >= 1") if args.progress_interval <= 0 or args.api_timeout <= 0: parser.error("progress interval and API timeout must be positive")
# 1. System Prompt current_system_prompt = PROMPT_REGISTRY.get(args.prompt_type)15 unmodified lines if args.concurrency > 1 and args.verbose_response: print("[Warning] --verbose-response output may interleave when --concurrency > 1.")
results = run_task_batch( tasks, output_filename = args.output or f"eval_result_{'DEBUG' if args.debug else args.model.replace('/', '_')}.json" config = dict(model=args.model, api_base=args.api_base, max_tokens=args.max_tokens, reasoning_effort=args.reasoning_effort, prompt_type=args.prompt_type, system_prompt=current_system_prompt, max_retries=args.max_retries, debug=args.debug, task_ids=[t['id'] for t in tasks]) checkpoint = CheckpointStore(output_filename, config, resume=args.resume) args.events_path = str(checkpoint.directory / 'events.jsonl') pending = [t for t in tasks if t['id'] not in checkpoint.results] print(f"Checkpoint: {len(checkpoint.results)}/{len(tasks)} completed; {len(pending)} pending", flush=True) run_task_batch( pending, args.concurrency, lambda index, task: evaluate_task(task, args, current_system_prompt), on_result=checkpoint.save, ) results = [checkpoint.results[t['id']] for t in tasks]
# Summary total_score = sum(r['score'] for r in results)36 unmodified lines print(f"{'OVERALL':<15} | {len(results):<8} | {total_score:<10.2f} | {total_possible:<10.0f} | {weighted_acc:<9.2f}%") print("=" * 60) output_filename = f"eval_result_{'DEBUG' if args.debug else args.model.replace('/', '_')}.json" with open(output_filename, "w") as f: json.dump(results, f, indent=2) atomic_json(output_filename, results) print(f"Results saved to {output_filename}")
if __name__ == "__main__":123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110"""Durable task results and stream heartbeats, independent of API credentials."""import datetimeimport jsonimport osfrom pathlib import Pathimport threadingimport time
def atomic_json(path, value): path = Path(path) path.parent.mkdir(parents=True, exist_ok=True) temporary = path.with_suffix(path.suffix + '.tmp') with temporary.open('w', encoding='utf-8') as handle: json.dump(value, handle, ensure_ascii=False, indent=2) handle.flush() os.fsync(handle.fileno()) os.replace(temporary, path)
class CheckpointStore: def __init__(self, output, config, resume=False): self.output = Path(output) self.directory = Path(str(output) + '.checkpoint') self.directory.mkdir(parents=True, exist_ok=True) manifest = self.directory / 'config.json' if manifest.exists(): if not resume: raise ValueError('Checkpoint exists; use --resume or a new --output') if json.loads(manifest.read_text(encoding='utf-8')) != config: raise ValueError('Resume configuration does not match checkpoint') else: if self.output.exists(): raise ValueError('Output exists without a checkpoint; choose a new --output') atomic_json(manifest, config) self.ids = config['task_ids'] self.results = {} for index, task_id in enumerate(self.ids): path = self.directory / f'{index:04d}.json' if path.exists(): result = json.loads(path.read_text(encoding='utf-8')) if result['id'] != task_id: raise ValueError('Checkpoint task ID mismatch') self.results[task_id] = result
def save(self, result): index = self.ids.index(result['id']) atomic_json(self.directory / f'{index:04d}.json', result) self.results[result['id']] = result atomic_json(self.output, [self.results[k] for k in self.ids if k in self.results])
_event_lock = threading.Lock()
def append_event(path, event): if path is None: return event = dict(event, timestamp=datetime.datetime.now().astimezone().isoformat()) with _event_lock: with open(path, 'a', encoding='utf-8') as handle: handle.write(json.dumps(event, ensure_ascii=False) + '\n') handle.flush() os.fsync(handle.fileno())
class StreamProgress: def __init__(self, label, path=None, interval=15): self.label = label self.path = path self.interval = interval self.started = time.monotonic() self.last_chunk = None self.chunks = self.content_chars = self.reasoning_chars = 0 self.lock = threading.Lock() self.stopped = threading.Event() self.thread = threading.Thread(target=self._heartbeat, daemon=True)
def emit(self, phase): with self.lock: current = time.monotonic() event = dict(label=self.label, phase=phase, elapsed_s=round(current - self.started, 1), idle_s=round(current - (self.last_chunk or self.started), 1), chunks=self.chunks, content_chars=self.content_chars, reasoning_chars=self.reasoning_chars) print(f"[{self.label}] stream {phase}: elapsed={event['elapsed_s']}s idle={event['idle_s']}s " f"chunks={event['chunks']} content_chars={event['content_chars']} reasoning_chars={event['reasoning_chars']}", flush=True) append_event(self.path, event)
def start(self): self.emit('connecting') self.thread.start()
def received(self, content='', reasoning=''): with self.lock: self.chunks += 1 first = self.chunks == 1 self.last_chunk = time.monotonic() self.content_chars += len(content or '') self.reasoning_chars += len(reasoning or '') if first: self.emit('first_chunk')
def _heartbeat(self): while not self.stopped.wait(self.interval): self.emit('receiving')
def close(self): self.stopped.set() self.thread.join() self.emit('closed')123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960import jsonfrom pathlib import Pathimport sysimport tempfileimport timeimport unittest
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))from src.checkpoint import CheckpointStore, StreamProgressfrom run_eval import run_task_batch
class CheckpointSelfTest(unittest.TestCase): def test_completed_task_survives_later_failure_and_resumes(self): with tempfile.TemporaryDirectory() as temp: output = Path(temp) / 'result.json' config = {'task_ids': ['a', 'b'], 'max_tokens': 32768} store = CheckpointStore(output, config) def runner(index, task): if task == 'b': raise RuntimeError('interrupted') return {'id': task, 'ratio': 1} with self.assertRaises(RuntimeError): run_task_batch(['a', 'b'], 1, runner, show_progress=False, on_result=store.save) self.assertEqual(json.loads(output.read_text())[0]['id'], 'a') resumed = CheckpointStore(output, config, resume=True) pending = [t for t in config['task_ids'] if t not in resumed.results] self.assertEqual(pending, ['b']) run_task_batch(pending, 2, lambda i, t: {'id': t, 'ratio': 0.5}, show_progress=False, on_result=resumed.save) self.assertEqual([r['id'] for r in json.loads(output.read_text())], ['a', 'b'])
def test_resume_rejects_changed_config_and_no_resume_overwrite(self): with tempfile.TemporaryDirectory() as temp: output = Path(temp) / 'result.json' config = {'task_ids': ['a'], 'max_tokens': 32768} CheckpointStore(output, config) with self.assertRaises(ValueError): CheckpointStore(output, config) with self.assertRaises(ValueError): CheckpointStore(output, dict(config, max_tokens=8192), resume=True)
def test_heartbeat_records_idle_and_stream_activity(self): with tempfile.TemporaryDirectory() as temp: events = Path(temp) / 'events.jsonl' progress = StreamProgress('task attempt 1', events, interval=0.01) progress.start() try: progress.received('abc', 'thinking') time.sleep(0.04) finally: progress.close() records = [json.loads(s) for s in events.read_text().splitlines()] self.assertIn('receiving', [r['phase'] for r in records]) self.assertEqual(records[-1]['content_chars'], 3) self.assertEqual(records[-1]['reasoning_chars'], 8) self.assertEqual(records[-1]['chunks'], 1)
if __name__ == '__main__': unittest.main(verbosity=2)1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253import jsonfrom pathlib import Pathfrom types import SimpleNamespaceimport sysimport unittestfrom unittest.mock import Mock
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))from run_eval import extract_json, run_chat_completion
class ResponseSelfTest(unittest.TestCase): def test_nested_bare_json_with_escaped_strings(self): model = {'points': [{'id': 'P1', 'label': 'a } { " \\ b'}], 'links': [], 'supports': [], 'loads': []} text = json.dumps(model) self.assertEqual(json.loads(extract_json(text)), model) self.assertEqual(json.loads(extract_json('Answer:\n' + text + '\nDone.')), model)
def test_existing_wrappers(self): text = '{"points": [{"id": "P1"}], "links": []}' for wrapped in [f'<json>{text}</json>', f'```json\n{text}\n```', f'```\n{text}\n```', f'<|begin_of_box|>{text}<|end_of_box|>']: self.assertEqual(extract_json(wrapped), text)
def test_no_json(self): self.assertIsNone(extract_json('No answer'))
def test_stream_records_reasoning_limit_and_usage(self): client = Mock() usage = Mock() usage.model_dump.return_value = {'completion_tokens': 32768} client.chat.completions.create.return_value = [ SimpleNamespace(usage=None, choices=[SimpleNamespace(finish_reason=None, delta=SimpleNamespace(content=None, reasoning_content='thinking'))]), SimpleNamespace(usage=None, choices=[SimpleNamespace(finish_reason='length', delta=SimpleNamespace(content=None))]), SimpleNamespace(usage=usage, choices=[]), ] metadata = {} self.assertEqual(run_chat_completion(client, 'model', [], max_tokens=32768, metadata=metadata, reasoning_effort='high'), '') self.assertEqual(metadata['finish_reason'], 'length') self.assertEqual(metadata['reasoning_chars'], 8) self.assertEqual(metadata['usage']['completion_tokens'], 32768) self.assertEqual(client.chat.completions.create.call_args.kwargs['max_tokens'], 32768) self.assertEqual(client.chat.completions.create.call_args.kwargs['reasoning_effort'], 'high')
def test_api_exception_is_distinct_from_empty_response(self): client = Mock() client.chat.completions.create.side_effect = RuntimeError('test failure') metadata = {} self.assertIsNone(run_chat_completion(client, 'model', [], metadata=metadata)) self.assertEqual(metadata['error'], 'test failure')
if __name__ == '__main__': unittest.main(verbosity=2)12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394"""Run both models concurrently; restart interrupted workers from task checkpoints."""import argparsefrom collections import Counterimport datetimeimport jsonimport osfrom pathlib import Pathimport runpyimport subprocessimport sysimport time
ROOT = Path(__file__).resolve().parents[1]sys.path.insert(0, str(ROOT))from src.checkpoint import atomic_json
MODELS = ['neolink/deepseek-v4.1-flash', 'neolink/glm-5.3-flash']
def now(): return datetime.datetime.now().astimezone().isoformat()
def main(): parser = argparse.ArgumentParser() parser.add_argument('--run-dir', required=True) parser.add_argument('--worker', choices=MODELS) args = parser.parse_args() run = Path(args.run_dir).resolve() run.mkdir(parents=True, exist_ok=True) os.chdir(ROOT) if args.worker: output = run / ('eval_result_' + args.worker.replace('/', '_') + '.json') sys.argv = [str(ROOT / 'run_eval.py'), '--model', args.worker, '--api-base', 'https://vnet.neolink.com/api/v1', '--api-key', os.environ['STRUCTURAL_EVAL_API_KEY'], '--concurrency', '8', '--max-retries', '2', '--max-tokens', '32768', '--reasoning-effort', 'high', '--output', str(output), '--resume', '--progress-interval', '15', '--api-timeout', '120'] runpy.run_path(str(ROOT / 'run_eval.py'), run_name='__main__') return
state = dict(started_at=now(), launcher_pid=os.getpid(), max_tokens=32768, reasoning_effort='high', concurrency_per_model=8, models=[]) processes = {} def launch(model, entry): log_path = run / (model.replace('/', '_') + '.log') with log_path.open('a', encoding='utf-8') as log: log.write(f'\n=== launch {now()} (resume enabled) ===\n') log.flush() process = subprocess.Popen([sys.executable, '-u', str(Path(__file__).resolve()), '--run-dir', str(run), '--worker', model], stdout=log, stderr=subprocess.STDOUT, stdin=subprocess.DEVNULL) processes[model] = process entry.update(pid=process.pid, status='running', log=str(log_path)) for model in MODELS: entry = dict(model=model, restarts=0, started_at=now()) state['models'].append(entry) launch(model, entry) while True: active = False for entry in state['models']: model = entry['model'] output = run / ('eval_result_' + model.replace('/', '_') + '.json') if output.exists(): results = json.loads(output.read_text(encoding='utf-8')) entry['completed_tasks'] = len(results) entry['result'] = str(output) entry['reasons'] = dict(Counter(r['reason'] for r in results)) entry['weighted_accuracy_on_completed'] = 100 * sum(r['score'] for r in results) / sum(r['difficulty'] for r in results) if results else 0 code = processes[model].poll() if code is None: active = True elif entry['status'] == 'running': if code != 0 and entry['restarts'] < 2: entry['restarts'] += 1 launch(model, entry) active = True else: entry.update(exit_code=code, finished_at=now(), status='completed' if code == 0 and entry.get('completed_tasks') == 25 else 'failed') state['updated_at'] = now() if not active: state['finished_at'] = now() atomic_json(run / 'status.json', state) if not active: if any(e['status'] != 'completed' for e in state['models']): raise SystemExit(1) break time.sleep(15)
if __name__ == '__main__': main().gitignore+2-1
README.md+6-8
README_EN.md+6-8
run_eval.py+118-18
src/checkpoint.pyAdded+110
tools/checkpoint_selftest.pyAdded+60
tools/response_selftest.pyAdded+53
tools/run_pair.pyAdded+94