缓存功能windows平台适配
This commit is contained in:
1 parent
151e6e4b97
commit
22579e51c9
8 files changed
+333
-1
No files matched your search
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"host": "Linux-6.8.0-111-generic-x86_64-with-glibc2.39",
|
||||
"windowsRuntimeExecuted": false,
|
||||
"case": "Corrected eight-branch 0-10 s with os.utime rejecting follow_symlinks=False, real Linux GCC/CVODE execution.",
|
||||
"success": true,
|
||||
"simulatedUntil": 10,
|
||||
"method": "BDF",
|
||||
"rtol": 1e-08,
|
||||
"bitwiseValuesCompared": 1790486,
|
||||
"allBitsEqual": true,
|
||||
"coldCacheHit": false,
|
||||
"subsequentCacheHit": true,
|
||||
"timestampUpdates": 14,
|
||||
"solveSeconds": 2.510730743408203,
|
||||
"buildSeconds": 2.51858819834888,
|
||||
"sourceSha256": "ace0843c8fe84b687c7dedce9eecae1ab2a9174a0f321f047d99089cfa15b301",
|
||||
"tests": {
|
||||
"buildAndStorage": {
|
||||
"passed": 40,
|
||||
"seconds": 8.174
|
||||
},
|
||||
"realToolchainIntegration": {
|
||||
"passed": 1,
|
||||
"seconds": 1.399,
|
||||
"windowsDllBranchExecuted": false
|
||||
},
|
||||
"windowsCi": "Configured; not executed from this Linux session."
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
# Windows 与 Linux 功能交付约定
|
||||
|
||||
2026-09-12 用户明确要求:后续功能补全同时注意 Windows 平台适配。
|
||||
|
||||
Windows x64 与 Linux x86_64 都是当前应用的使用平台。涉及文件系统、缓存、编译器、进程、动态库、环境安装或启动脚本的功能修改,应同时检查两侧的实现和测试入口。
|
||||
|
||||
- 文件系统可选能力应按运行环境检测,例如 `os.supports_follow_symlinks`,不能因为 Linux 接受某个参数就假设 Windows 也接受。缓存目录仍需验证普通目录、符号链接与 Windows reparse point;权限和真实 I/O 错误不能当成兼容问题随意吞掉。
|
||||
- 编译与运行应覆盖 Windows 的 `.exe`、导入库/DLL、工具链路径、带空格路径和换行行为。进程锁、并发清理、异常退出应有可在 Windows 执行的测试。
|
||||
- 平台专用的小型测试夹具可以明确限定平台,但不能代替跨平台集成测试。Windows CI 中必需的工具链缺失应失败,不能以整组跳过得到成功结论。
|
||||
- 交付记录分别列出兼容代码、模拟测试、实际 Windows 测试的状态。只有实际 Windows 运行通过,才能声称 Windows 验收通过。缺少 Windows 环境时继续完成可做的修复和测试准备,并明确实机验证仍待完成。
|
||||
- 本地虚拟环境、编译器、便携运行时和构建缓存保留在 Git 忽略目录,不随源码提交。
|
||||
|
||||
当前缓存检查入口:
|
||||
|
||||
```powershell
|
||||
$env:SIMULATION_NATIVE_REQUIRE_TOOLCHAIN = '1'
|
||||
.\.venv-win\Scripts\python.exe -m unittest tests.test_native_cache_storage tests.test_native_cache_platform -v
|
||||
```
|
||||
|
||||
该入口使用现有 `SIMULATION_NATIVE_CC` / `SUNDIALS_ROOT` 或构建器的默认探测;CI 配置在 `.github/workflows/solver-regression.yml` 的 `native-windows` 作业。
|
||||
@@ -1,5 +1,8 @@
|
||||
# 2026-09-12:按需编译与分层缓存
|
||||
|
||||
后续 Windows 修复:用户实际运行报 `utime: follow_symlinks unavailable on this platform`。根因是缓存最近使用时间更新无条件传入可选参数,与数值求解无关。按 [Python 平台能力接口](https://docs.python.org/3.12/library/os.html#os.supports_follow_symlinks) 改为能力检测后选择调用,保留目录/reparse 校验和真实权限错误。新增回归在修复前复现同一异常;修复后构建/存储 40 项通过(8.174 s,Linux 环境)。新增真实工具链的跨平台缓存集成入口,本机 1 项完整序列通过(1.399 s),已加入 Windows CI。修正八路在模拟不支持该参数的条件下完成 0~10 s BDF 求解,1,790,486 个 binary64 值与已接受参考逐位一致,随后完整缓存命中成功;[修复摘要](../other/assets/2026-09-12/native-cache-windows-utime-fix.json) 保留证据,原始记录在 `test/windows-cache-utime-20260912/`。并将 [跨平台交付约定](../standard/跨平台交付约定.md) 写入仓库。本机没有 Windows 运行环境,本次不能声称 Windows 实机已验收;下文为此前优化阶段的记录。
|
||||
|
||||
|
||||
原生构建改为按实际引用选择功能模块,复用内容校验的目标文件,保留完整模型缓存。两池默认预算分别为 128 MiB 和 256 MiB,按最近使用时间清理;跨进程使用锁保护活跃构建/运行,超大单条目和在用内容允许暂时超额。旧根级缓存单独保留,新代码不继续追加旧格式。
|
||||
|
||||
冻结原版本同机对照,八路首次构建 3.7742→2.4875 s(-34.09%)、修改一个管长参数 3.9009→2.4838 s(-36.33%)、切四路 2.4908→1.1109 s(-55.40%)。完整模型命中检查增加约 0.13 s,已披露。八路原生 1,790,486 个 binary64 值逐位一致;网页三次中位可查看 3.7586 s、保存 3.8605 s、CSV 1.0348 s,四轮完整结果/下载/刷新一致。
|
||||
|
||||
Reference in new issue
Block a user