summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Desktop.Tests
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-29 03:45:58 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-29 03:45:58 +0800
commit2c559a79a5977c19876cee58d336b7983f67fa4c (patch)
tree9607e336fc740bc840a02143f63fd7932aecedf3 /src/LivingVillage.Desktop.Tests
parenteb4fca23cabce5762fc256a659228a5d50b5e9a9 (diff)
downloadliving-village-2c559a79a5977c19876cee58d336b7983f67fa4c.tar.gz
m3r: 缩尺批验收口(50×15 流式 + systemd --user 单元 + 独立验收脚本)
缩尺口径:M3 phase2 50×100 实测 11.4h 仅完成 6/50(见 artifacts/m3-acceptance/final-candidate-20260921T095500Z/logs/*.diagnosis.txt), 改为 50 世界 × 15 模拟日、逐世界流式打印并 flush。标定据 docs/overnight-status.md (Hermes 单 worker 亲测):1×2=34.6s、1×5=87.7s、1×10=173.6s,外推 15 天 ≈260s。 注意:派单所引用 artifacts/m3-independent/20260921T105500Z 全盘查找不存在, 故改用上述仓内标定,未编造任何数据。 内容: - Headless 边缘:runSimulation 拆出 runSimulationCore 增加逐模拟日回调; evalWorld 传入回调;runBatch 每 (days/5) 天打印 `[world k] progress day=d/D elapsed=..s` 并 flush,长世界不再零进度(BatchOutput.progressLine 纯函数 + 单测)。 - 新增 deploy/living-village-m3r.service 模板:wrapper 作 MasterProcess、 StandardOutput/StandardError=append: acceptance.log、Restart=no; systemd-analyze --user verify 通过。本机 ~/.config/systemd/user 属外部目录受限, 实跑以等价属性的 systemd-run --user 瞬态单元 living-village-m3r.service 承载。 - scripts/m3r-master.sh:写 state.json(pid/unit/log/commit/workers/worlds/days/ 起止/exit),exec 2>&1 运行 batch 并回传真实退出码。 - scripts/verify-m3r.py:独立可复跑,校验 state 字段、50 条 world 行(索引/seed/ ok 与 check_a/b/c 自洽)、summary passed+failed=50 与极值一致、抽查 3 行、 [done] 50 条、progress 行、M3_ACCEPTANCE=PASS 且 ratio_min>2.0。 本次实跑(commit 895d792):12 worker,wall=4316.0s,50/50 OK, ratio_min=3.346 ratio_max=12.321 gini∈[0.412,0.548],relconn=30/18, check_a/b/c 全 PASS,M3_ACCEPTANCE=PASS,exit=0;独立脚本复跑 M3R_VERIFY=PASS。 证据:artifacts/m3r-acceptance/acceptance.log + 20260928T183215Z/state.json。 回归:Desktop 303/303 + Kernel 119/119;--performance-baseline ×3 digest=953775FAEB2F… 不变,performance_determinism=PASS。 未改 Kernel/Sim;未 push。
Diffstat (limited to 'src/LivingVillage.Desktop.Tests')
-rw-r--r--src/LivingVillage.Desktop.Tests/M3BatchOutputTests.fs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/LivingVillage.Desktop.Tests/M3BatchOutputTests.fs b/src/LivingVillage.Desktop.Tests/M3BatchOutputTests.fs
index e962e57..b1822c7 100644
--- a/src/LivingVillage.Desktop.Tests/M3BatchOutputTests.fs
+++ b/src/LivingVillage.Desktop.Tests/M3BatchOutputTests.fs
@@ -27,6 +27,11 @@ type M3BatchOutputTests () =
Assert.AreEqual<string>("[done 4/4] elapsed=600.0s world=3", BatchOutput.doneLine 4 4 600.0 3)
[<TestMethod>]
+ member _.ProgressLineReportsSteppedDayWithinWorld () =
+ Assert.AreEqual<string>("[world 7] progress day=5/15 elapsed=61.2s", BatchOutput.progressLine 7 5L 15L 61.2)
+ Assert.AreEqual<string>("[world 0] progress day=15/15 elapsed=260.0s", BatchOutput.progressLine 0 15L 15L 260.0)
+
+ [<TestMethod>]
member _.SummaryLineKeepsOldFieldsAndAppendsWallClock () =
let line = BatchOutput.summaryLine 4 3 1 4 1.100 9.900 0.010 0.400 4 610.5
// 监督器正则只读前三个字段,前缀必须逐字保持。