* feat(platform): add tvOS runtime and Apple artifacts * test(memory): add isolated process benchmark and peak monitoring Add frozen-input Release ABI probes, kernel footprint peaks, fault calibration and resumable owned-container runs. Fix UDP facility fan-in and scheduling bottlenecks with a bounded process-wide sender, allocation-free peer address checks, per-flow official Mihomo listeners and eight peer vCPUs. Preserve default buffers, full payload checks and single-flow acceptance as a separate gate. Validation: 25 expected facility outcomes, 18 repeated zero-loss UDP calibrations, 198 script tests, Ruff and Go vet. No full-CN or mobile Provider memory acceptance. * fix(geodata): support complete enhanced cn within bounded storage The enhanced CN category exceeded the old 65,536-record work bound. Raise it to 131,072 without changing value or shared allocation budgets, and account for old/new vector buffers during growth. Add exhaustive independent CN semantics, production-ABI route and memory evidence, and bounded-resource regressions. Verify forwarding by the origin peer identity rather than guest-wide TCP counters. Three fresh macOS processes pass with a worst lifetime footprint of 9,191,976 bytes; mobile and high-rate acceptance remain separate. * test(memory): add cold-start geodata attribution * perf(memory): complete SOCKS5 load drivers and index GeoSite matches * perf(memory): add external dual-stack TUN workloads and reliable shutdown * test(memory): add protocol profiles and same-process transport reuse workloads * test(memory): add lifecycle cancellation and update endurance scenarios * docs(memory): retain standard policy pending complete candidate acceptance * test(memory): freeze candidates and orchestrate final acceptance matrix * test: move container experiments to independent benchmark * test(geodata): isolate HTTP benchmark fixtures from production delivery * perf(tun): streamline packet processing and UDP flow routing Add real Linux TUN support and shared bounded packet batching across platforms. Separate UDP ingress from TCP netstack maintenance while preserving cancellation and synchronous shutdown. Optimize GeoData category lookup and compatibility, pin TUN UDP rule actions per five-tuple, and track authenticated QUIC connection changes with independent idle reclamation. Align runtime resource policies, documentation, and regressions with the validated memory and throughput workload. * perf(runtime): isolate socket setup and expand UDP burst capacity Run synchronous physical socket setup on tracked blocking tasks with cancellation and shutdown barriers. Increase the shared ordinary TUN UDP response queue to 4096 while retaining independent DNS capacity and nonblocking saturation. Align resource contracts, documentation, and regression coverage. * build: restore boring release dependencies for PR * feat: cap mobile GeoData and separate external test tooling Share a 1,280,000-record iOS/tvOS allowance across GeoIP and GeoSite, preferring GeoIP. Keep VCore scripts compilation-only, move external validation responsibilities to the benchmark, and refresh public contracts and CI/build tooling. * fix: complete GeoData matching and bound socket initialization * fix: align Android bindgen targets and lazily resolve SDK defaults NDK 30 rejects unversioned bindgen targets even when CC/CXX and CMake already use an API level. Supply the same versioned compiler target through bindgen target-scoped arguments while preserving effective extra flags. Avoid querying Path.home when ANDROID_HOME is configured, which fixes hermetic helper tests on Windows. Cover API and argument precedence, missing home, and fallback behavior with regressions.
5.4 KiB
服务端测试隔离规则
自 2026-09-23 起,后续所有服务端测试均在隔离容器中执行。本文件是服务端测试部署方式的权威规则,优先于历史脚本和验收记录中的宿主运行说明。
范围
- 协议服务端(Mihomo、Xray、V2Ray、Hysteria、Shadowsocks 等)、UDP echo / TCP / HTTP / DNS 测试原站,以及故障注入中的服务端角色,全部容器化。
- 对照客户端若提供 SOCKS/HTTP 等测试入口,该入口也放在容器中。宿主只运行待测客户端、测试驱动和只读观察工具。
- 纯内存、编解码、离线配置或 mock 单元测试不属于外部服务端互通测试。不能把宿主网络服务改称 mock 来规避隔离。
- 尚未完成容器化、容器不可用或平台不支持的服务端用例记为
BLOCKED/NOT RUN,不得回退到宿主启动。Linux 测试对端不代表 VCore 新增 Linux 产品支持。
工程边界与结果保留
协议互通的容器编排、对端下载、网络消费者和压力测试统一由公开的
container-benchmark 管理。
互通入口为 container-benchmark interop --source vcore=PATH,压力入口为
container-benchmark stress --source vcore=PATH;真实执行必须显式指定 checkout,
不推断父项目或相邻路径。VCore 的 vcore-scripts 仅编译平台产物,Rust 的
离线/纯内存回归仍保留在内核;独立工程不存在不影响 VCore 编译。
优先 Mihomo listener;不支持的代表场景由官方 Xray-core、Hysteria2、V2Ray 或
Caddy/Xray 分层拓扑补验。--backend / --protocol 筛选,--list 只作离线列举。
当前入口在 Apple Silicon 的 Apple Container 上,每轮独立构建一次,再顺序运行
各对端组的原站、协议对端、生产 ABI 消费者三个 Linux 容器;全部为 NAT、5 CPU /
8 GiB。此入口不代表历史完整字段、代理链、长测或设备矩阵已恢复。
互通、压力和两核性能对比是分别执行的入口,不用其中一项通过抵扣另一项;
迁移代码或离线列表通过不代表本轮已经重新执行网络用例。
每轮结束(成功、失败、超时或中断)先回收本轮自有进程、容器和临时网络/镜像,再清理 本轮生成的构建目录、下载包、规则、证书、日志、采样及原始流量数据,仅保留脱敏 文字结论。结论记录实际命令、源码/锁文件/对端身份、指标、失败原因和清理结果; 后续复验重新取得输入并执行,不把已清除产物的记录作为可恢复候选。 生产发布产物与受版本控制的测试源文件不属于本轮临时数据。带所有权标记的共享 NAT 网络及按日检查身份/校验值的公共依赖缓存可以跨轮保留;本轮配置、证书、构建和日志 不得混入该缓存。
执行要求
- 使用本次任务独占、可识别所有权的容器;测试网络仅使用 NAT 或 bridge,禁止 host-only。macOS 的 Apple Container 使用带所有权标签的共享 NAT 网络;不发布宿主端口,不改宿主 VPN、路由、DNS 或防火墙。共享网络可跨轮保留,不清理其他任务的网络。
- 协议对端使用官方最新稳定发行二进制,通过官方
latest下载链接获取;不查版本 API、不本地编译、不修改第三方源码、不静默复用旧缓存。镜像使用官方稳定标签,在当次运行记录解析后的 digest。记录容器内实际版本、二进制和下载包校验值。 - 保留 Mihomo 回环保护和第三方默认 socket 行为;不能通过关闭保护、放宽数据正确性/超时或重试业务包掩盖失败。
- 原站和协议对端的地址必须来自本次容器网络。配置、证书与测试凭据仅放临时目录,fixture 只读挂载,日志保持有界且脱敏。
- 注册清理后再启动资源。成功、失败、超时、SIGINT 和部分启动都必须停止并删除本次拥有的容器,检查剩余资源;不得停止或清理其他任务的容器。
- 报告分别记录隔离拓扑、真实流量结果、源码身份和清理结果。基础设施/清理失败不能记为互通通过;定向诊断通过不等于阶段签收。
当前 H3/mTLS 代表用例使用标准官方 Caddy 预编译二进制,真实
require_and_verify 客户端认证后,通过 H2C 转发到同一个原生 Xray XHTTP handler;
Caddy 不实现代理协议 decoder,不将两个独立 XHTTP listener 当作共享下载会话。
历史批准过的局部例外仍仅限必要时用官方 latest xcaddy 编译官方 latest Caddy,
记录 go.mod/go.sum 摘要、工具版本、构建结果和 hash;不修改第三方源码,
也不允许编译 Mihomo/Xray 等对端或将自编产物称为官方预编译产物。
正例须核对真实双向业务与原站所见对端来源。Hysteria2 跳跃保持同一 UDP 关联 至少 16.5 秒,并观测至少两个实际目的端口;仅配置端口集合不是跳跃通过。 mTLS 拒绝、服务端禁用 UDP 等负例须证明被拒绝业务在原站零交付,不能只以 客户端超时作为认证或限制生效证据。所有这些见证也须保持容器隔离和本轮清理。
历史宿主测试保留为历史证据,不追改为容器测试。旧脚本即使有 --container,若原站或反向服务仍在宿主,也不满足本规则;迁移前不得用于新的服务端验收。