Repository navigation
fix: align native control and standalone packaging with browser runtime - #5
Merged
Merged
Conversation
…ompatible digests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SuperMimic 的同一份控制器在原生运行与浏览器发布时,需要绕过角速度坐标系、actuator 映射、资源身份和资产打包差异。本 PR 修复 SDK 的通用实现,使项目使用标准资源与控制 API,并直接从含 .venv、日志和旧产物的项目根目录构建站点。
改动
跨仓依赖与兼容
配套 BotLab #47 → dev,修复恢复后的 NPZ 加载,并覆盖角速度与 actuator 契约。
角速度标记来自 BotLab dev f808bfb 已有实现:运行 scripts/sync_sdk.py 后只保留本次相关的 _robot.py 镜像更新,文件与拥有者逐字节一致;未带入无关的动态 PD/preview API 更新。原生 runner 由本仓独立实现,没有从 BotLab 旧 runtime 复制。
SDK wheel 和浏览器 runtime 是两个分发物。完整端到端验收使用两仓候选版本,后续分发需使用支持此标记及 NPZ 映射的浏览器 runtime。按 SDK 现有结构提交到 main,不新增 dev;不合并、不发布。
当前分支本地验证
macOS / Python 3.12:
python -c 'import onnxruntime as ort; ort.disable_telemetry_events(); import pytest; raise SystemExit(pytest.main(["tests"]))':764 passed、1 skipped、2 deselected,56 subtests passed。ruff check .、git diff --check:通过。python -m botlab._runtime.golden_check tests/fixtures/processors.json:53 cases 在容差内。隔离 SuperMimic case 8:
python tools/verify.py --parity-steps 30完整运行 523 步,qpos/qvel/actions/关节力/ctrl 与此前基线最大差值均为 0;前 30 步独立动作 parity 最大误差 8.344650268554688e-7,跟踪检查通过。当前 SDK 配合最新候选 BotLab 构建,通过公开 CLI ui export / ui fetch 导入隔离缓存,直接从项目根目录 build --site,无项目 staging 或包内容改写。
最新候选源码重新构建站点后,case 8 浏览器运行、停止及刷新恢复通过;console 0 errors、HTTP 无 404。project 子树仍为 84 个声明文件,逐字节一致;本次自启浏览器与 HTTP 服务已关闭。
前序提交验收记录
以下在角速度兼容标记补充前的候选提交完成,区别于本次最终分支测试:
验证边界
未覆盖全部 Python 版本/操作系统。浏览器实际验收限 case 8,未做所有动作的浏览器轨迹数值比较。未运行 scripts/verify_wheel.py 完整 release gate;最后的兼容标记补充使用源码环境重跑,未重建安装候选 wheel。原项目、其他任务环境及默认 runtime 缓存未修改。
请项总审核实际改动与本地 CI 记录后,再通过 PR 决定是否合并。
CI 环境补充与最新结果(2026-10-24)
go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.7 -shellcheck= .github/workflows/ci.yml与git diff --check通过。PYTHONPATH=src uv run --no-project --with pytest --with numpy --with PyYAML --with rfc8785 python -m pytest tests/test_project.py::test_digest_matches_actual_node_for_number_and_key_boundaries:1 passed(本地 Node.js 26.5.1)。