- feat(client): 增加裁判比赛计时、技术暂停与选手端局域网同步 - feat(armor): 红蓝共用通用固件,按客户端选队并显示网络连接状态 - feat(armor): 仅在对局进行中允许扣血,其他阶段保留受击闪烁 - feat(client): 将计时置于血条中间并增加开赛前五秒全屏动画 - fix(client): 修复连续血条、对手镜像和图传断连灰度遮罩 - fix(client): 统一界面中文字体并整理各页面文案 - fix(maintenance): 备份迁移装甲板分区,恢复 SDK 构建与固件打包 - refactor(repo): 按 armor、vt 和 client 整理工程与脚本,移除旧参考实现 - test: 补充线路、受击许可、回环 UDP、维护和 HUD 验证 - docs: 同步构建、协议、比赛控制和硬件验证边界 验证:前端构建与 19 项相关测试通过;核心 91 项单元测试与 2 项回环 UDP 集成测试通过;装甲板规则 25 项、线路 26 项、Tauri 51 项测试通过;独立探测器 5 项与目录回归 4 项通过。完成 C3 两组阈值实际编译、导出与 ZIP 校验,检查 900×600 / 1280×720 页面、倒计时和随包中文字体。 未执行烧录、板上运行、跨电脑广播或硬件稳定性验证。
81 lines
3.6 KiB
Python
81 lines
3.6 KiB
Python
#!/usr/bin/env python3
|
|
"""Summarize opt-in client marker reports using explicit, half-open row ranges."""
|
|
import argparse
|
|
import json
|
|
import math
|
|
from pathlib import Path
|
|
import statistics
|
|
|
|
|
|
def describe(values):
|
|
ordered = sorted(values)
|
|
if not ordered:
|
|
raise ValueError('No valid marker samples in the selected range')
|
|
return {
|
|
'count': len(ordered),
|
|
'mean': statistics.mean(ordered),
|
|
'p50': statistics.median(ordered),
|
|
'p95': ordered[int((len(ordered)-1)*.95)],
|
|
'p99': ordered[int((len(ordered)-1)*.99)],
|
|
'minimum': ordered[0],
|
|
'maximum': ordered[-1],
|
|
}
|
|
|
|
|
|
def summarize(rows, selection):
|
|
start, end = selection['start_row'], selection['end_row']
|
|
if not 0 <= start < end <= len(rows):
|
|
raise ValueError('Range must select complete rows from the report')
|
|
samples = rows[start:end]
|
|
seen = set()
|
|
for sample in samples:
|
|
if not all(isinstance(v, (int, float)) and math.isfinite(v) for v in sample.values()):
|
|
raise ValueError('Sample contains a nonfinite value')
|
|
if not 0 <= sample['lowerMs'] <= sample['upperMs'] <= 5000:
|
|
raise ValueError('Invalid refresh bracket')
|
|
key = (sample['counter'], sample['sourceDrawMs'])
|
|
if key in seen:
|
|
raise ValueError('A source marker was counted more than once')
|
|
seen.add(key)
|
|
return {
|
|
**selection,
|
|
'samples': len(samples),
|
|
'sample_span_seconds': (samples[-1]['drawMs']-samples[0]['drawMs'])/1000,
|
|
'marker_event_to_paint_ms': describe([(s['lowerMs']+s['upperMs'])/2 for s in samples]),
|
|
'lower_bound_ms': describe([s['lowerMs'] for s in samples]),
|
|
'upper_bound_ms': describe([s['upperMs'] for s in samples]),
|
|
'refresh_bracket_width_ms': describe([s['upperMs']-s['lowerMs'] for s in samples]),
|
|
'decoded_to_draw_ms': describe([s['decodeToDrawMs'] for s in samples]),
|
|
'marker_analysis_ms': describe([s['analysisMs'] for s in samples]),
|
|
}
|
|
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
parser.add_argument('--report', type=Path, required=True)
|
|
parser.add_argument('--range', type=Path, action='append', required=True, dest='ranges')
|
|
parser.add_argument('--out', type=Path, required=True)
|
|
args = parser.parse_args()
|
|
rows = [json.loads(line) for line in args.report.read_text().splitlines() if line.strip()]
|
|
trials = [summarize(rows, json.loads(path.read_text())) for path in args.ranges]
|
|
result = {
|
|
'method': '50 ms source marker events; first decodable echo on production VideoSurface; midpoint of adjacent-rAF brackets',
|
|
'scope': 'Source-screen marker to camera exposure/capture, Wi-Fi/UDP, native reassembly, local WebSocket, JPEG decode and canvas draw',
|
|
'limitations': [
|
|
'rAF brackets estimate display scheduling; panel scanout and pixel response are not measured',
|
|
'Mixed-exposure or unrecognized markers are excluded; first decodable echo can follow an earlier ambiguous image',
|
|
'Not every displayed frame is a sample; accepted samples describe this calibration scene and network',
|
|
'decodeToDrawMs starts after JPEG decoding, not at UDP or WebSocket arrival',
|
|
],
|
|
'physical_panel_response_measured': False,
|
|
'trials': trials,
|
|
}
|
|
args.out.parent.mkdir(parents=True, exist_ok=True)
|
|
args.out.write_text(json.dumps(result, ensure_ascii=False, indent=2)+'\n', encoding='utf-8')
|
|
for trial in trials:
|
|
print(json.dumps({k: trial[k] for k in ('fb_count', 'samples', 'marker_event_to_paint_ms')}))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|