JSON, tensor and trajectory regression assertions with explicit tolerances and structured differences.
bash scripts/check-local.sh # 核心、数值数组、RL、文件 CLI
bash scripts/check-local.sh --integration # 加上固定版本 MoonXi CPU 集成bash scripts/json-regress.sh compare examples/files/baseline.json examples/files/candidate.json examples/files/json.rules.json --format jsonmoon add willzhang/json_regress@0.1.0///|
import {
"willzhang/json_regress" @regress,
}///|
test "readme regression example" {
let rules = @json_regress.Rules::new(ignore_paths=["/request_id"], tolerances=[
{ path: "/score", absolute: 0.01, relative: 0.0, },
])
@json_regress.assert_matches(
{ "request_id": "old", "score": 0.8, "count": 100 },
{ "request_id": "new", "score": 0.805, "count": 100 },
rules~,
)
let differences = @json_regress.compare({ "count": 100 }, { "count": 99 })
assert_eq(differences[0].path, "/count")
assert_eq(differences[0].reason, @json_regress.ValueMismatch)
}"/loss": OutsideTolerance; expected=0.25; actual=0.28
"/sample_count": ValueMismatch; expected=100; actual=99| 能力 | 可运行证据 | 说明 |
|---|---|---|
| numeric.Tensor | 可执行用法 | 显式 shape/dtype/data;整块容差、坐标和有上限的错误样本 |
| MoonXi CPU Linear | 集成入口 | 真实第三方前向计算与独立 Python 参考比较 |
| 一步与三步世界模型 | 场景说明 | 真实 Linear/ReLU 层的小型未训练动力学示例 |
| 文件 CLI 与检查点 | 文件接口 | 标准报告、退出码、按层/步诊断、失败比较重放 |
| trajectory 与 RL | 场景说明 | 实际运行自建小环境;独立参考和时间/终止语义检查 |
Install
Download zipJSON, tensor and trajectory regression assertions with explicit tolerances and structured differences.