Skip to content

feat: add manager-based mjwarp training infrastructure - #847

Closed
TATP-233 wants to merge 2 commits into
mainfrom
feat/issue-705-manager-mjwarp
Closed

feat: add manager-based mjwarp training infrastructure#847
TATP-233 wants to merge 2 commits into
mainfrom
feat/issue-705-manager-mjwarp

Conversation

@TATP-233

@TATP-233 TATP-233 commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • 交付 contract-first 的 manager-based task API:冷路径 TaskCompiler 生成不可变 compiled plan,reference、host-fused 与 device-resident executor 共用 typed state/control/mutation contract。
  • 新增与 mujoco 完全独立的生产 mjwarp backend identity、factory、owner YAML、registry、telemetry、typed batch/reset/DR、graph recapture 与 device substep controller。
  • 打通 ppo_torch + g1_walk_flat + mjwarp + device_resident 从 policy action、physics、obs/reward/done 到 learner 的 device-resident 训练路径,并建立 policy ABI、sim2sim、checkpoint/resume/export 入口门禁。
  • 建立 Phase 0-7 claim -> evidence -> gate 体系,覆盖基线、正确性、差分、性能、DR、训练行为、入口矩阵、legacy retirement、support promotion 与最终 freshness。
  • 淘汰 G1WalkFlat + mjwarp 的手写 env lifecycle;mujoco / motrix owner 及 reference/fused/differential oracle 保留。

Linked Work

Support Boundary

唯一 Recommended 组合为:

ppo_torch + g1_walk_flat + mjwarp + device_resident
  • mjwarpmujoco 始终是两个独立 physics backend,不共享或改写 backend identity。
  • PPO MLX、其他 task 和其他 execution profile 未被提升为 Recommended。
  • mjwarp 原生 play/visualization 当前显式 unsupported,并在 materialization 前 fail closed;checkpoint load/resume 和 ONNX/JIT export 走已验证的 renderer-independent contract。
  • 未声明的 DR/Event/controller/model field 默认 fail closed。已声明能力由 field-level manifest、selected-row isolation、physics-effect、recompute 和 graph tests 约束。
  • RSS 按已批准修订仅作为 post-warmup 稳态诊断,不设置绝对 peak ceiling;transfer、allocation、地址稳定、graph、吞吐与训练行为仍为硬门禁。

Validation

  • make check(由最终 make test-all 覆盖;Ruff、mypy、pyright 均 PASS)
  • uv run pytest -m "not slow"(由最终 make test-all 覆盖)
  • Additional task-specific validation listed below

Commands run against child HEAD b98ef976acc4894e08a9c95634a0a3eb41eb035f and promoted to integration HEAD 480becc726d8c73e06669f4dc02baab2568be742(merge commit only adds ancestry):

env LD_LIBRARY_PATH=/tmp/nvidia-570.133.07/usr/lib/x86_64-linux-gnu make test-all
uv run ruff format --check .
uv run ruff check .
uv run mypy src/unilab
uv run pyright
uv run scripts/audit_ci_test_shards.py --json
uv run scripts/audit_issue705_workflow_triggers.py --json
uv run scripts/audit_issue705_claims.py --all --json
uv run scripts/audit_issue705_backend_isolation.py --json
uv run scripts/audit_issue705_support.py --json
uv run scripts/audit_issue705_task_rollout.py --json
uv run scripts/audit_issue705_legacy_retirement.py --json
uv run scripts/validate_issue705_dr_inventory.py --json
uv run scripts/validate_issue705_phase.py --phase 4 --mode gate --json
uv run scripts/validate_issue705_phase.py --phase 5 --mode gate --json
uv run scripts/validate_issue705_phase.py --phase 6 --mode gate --json
uv run scripts/validate_issue705_phase.py --phase 7 --mode gate --json
uv run scripts/validate_issue705_final.py --json
uv run scripts/validate_issue705_final.py --head-only --allow-unpromoted --json
git diff --check
git status --short --branch

Results:

  • Full gate: 2348 passed, 26 skipped, 449 deselected, 1 xfailed; coverage 68%; Ruff, mypy and pyright PASS.
  • Standard CI equivalent shards: A 870 passed, 15 skipped, 281 deselected, 1 xfailed; B 551 passed, 1 skipped, 114 deselected; C 285 passed, 8 skipped, 12 deselected; D 636 passed, 2 skipped, 48 deselected; all PASS.
  • CI shard audit: 8 shards / 227 test files / exactly 6 local evidence nodes / 0 errors; final remote merged coverage 67%, --fail-under=25 PASS.
  • Benchmark smoke: module mode 36/37, script mode 37/38; only the platform-optional MLX entry skipped in each mode.
  • Final gate: ok=true, 12 mandatory command runs, A/B/C/D lanes complete, errors=[].
  • Phase 7: 6 verified / 0 planned; Phase 0-6 owner validators PASS.
  • Support: 1 combination / 1 Recommended / 0 errors.
  • Task rollout: 1 entry / 27 prerequisites / 0 errors.
  • Claims: 51 claims / 115 entries / 115 existing / 0 targets / 49 supporting.
  • Legacy retirement, backend isolation, workflow trigger, DR inventory and sim2sim audits PASS.
  • Child worktree clean; remote integration HEAD is 480becc726d8c73e06669f4dc02baab2568be742; no main-only commit remains after chore: sync main before issue 705 final regression #845.

Remote CI Status

  • Real run 30698393464 on 30d69111ebab8dab2743ea4d4299c3ff96c87fa3: Ruff、mypy、pyright、Docs、shard A/B passed; shard C/D and aggregate failed.
  • Root causes were shallow Git history for evidence ancestry and Python 3.11/3.13 throughput ULP roundoff. PR fix: make issue 705 CI evidence portable #864 fixed both without changing evidence thresholds or the six-node local allowlist.
  • Final CI run 30742715153 and Docs run 30742715151 on integration HEAD 5a8a26691e33bb3c9af1d088c89bb7a36c221d62 both succeeded; all eight shards and aggregate test (ubuntu-slim) are green.

CI Evidence Boundary

  • Hardware fields remain required and structurally validated, but CPU/GPU model、UUID、capacity、driver 和 affinity 与冻结 profile 的差异仅作为 provenance warning,不再是 equality gate。
  • Artifact、execution、worker 与 profiler 必须对实际记录的硬件和 affinity 保持内部一致;线程环境、source freshness、raw recomputation、process isolation、依赖和矩阵完整性仍 fail closed。
  • Phase 5/6/7 的数值性能阈值保持硬门禁;本次未修改 threshold manifest,也未把失败诊断提升为 evidence。

Issue #877 Update

  • Fixes Work: 证据链硬件 profile 从 equality gate 降级为 provenance metadata(去除固定硬件 / NVIDIA driver 版本耦合) #877
  • 将 Phase 0/4/5/6/7 的冻结硬件逐字段 equality gate 降级为 provenance metadata + UserWarning;当前主机的实际 CPU/GPU/driver/affinity 会写入 artifact。
  • GPU memory ratio 使用实际记录的 device capacity;runtime affinity 优先使用本机可用的冻结 CPU 子集,否则记录当前 allowed cpuset。
  • correctness、backend、thread environment、freshness、raw recomputation、process isolation 和性能阈值 contract 均未放宽。
  • Phase 3 evidence 已刷新;Phase 4 的 45 个 host benchmark 进程、raw artifact 和 gate 已刷新。

#877 Validation

  • Targeted suite:196 passed;Ruff format/check、mypy、pyright 和 benchmark smoke 通过(合并最新 integration 前)。
  • 合并最新 integration 后:Ruff + mypy 通过;managed policy ABI / RSL-RL adapter 聚焦测试 17 passed, 13 deselected
  • Phase 3 acceptance:2 passed
  • Phase 4:45/45 benchmark workers PASS;acceptance 2 passed
  • Phase 5:40/40 GPU workers PASS,硬件差异仅产生 advisory;冻结性能 gate 失败:
    • batch 128 p50 ratio 1.1596,要求 <= 1.05
    • batch 128 p95 ratio 1.1539,要求 <= 1.05
    • batch 128 FPS ratio 0.8623,要求 >= 0.95238
  • Diagnostic artifact 的 non-threshold validation errors 为 ();未修改或新增 threshold amendment。

Explicit PR Gate Override

用户于 2026-08-03 明确要求“跳过性能阈值的 gate,直接 PR”。因此本次更新在以下状态下推送:

  • 未通过最终 make test-all / Issue Work: 统一规划 manager-based task API 与独立 mjwarp 后端 #705 final evidence gate。
  • Phase 5/6、support、legacy retirement 和 final evidence 仍有 freshness failure。
  • 未把 diagnostic artifact 提升为正式 evidence,未伪造 PASS,也未降低性能阈值。
  • Reviewer/merger 需显式接受该 override;后续若要恢复全绿 evidence,需要独立 threshold amendment 或在满足现有阈值的证据主机重新采集。

Impact

  • Backend impact: new independent mjwarp; additive shared contracts for mujoco; motrix/drake remain fail-closed where unsupported.
  • Platform impact: Linux/CUDA for the Recommended path; optional Warp imports remain cold-path, while standard non-CUDA CI uses static artifact validation.
  • Training effect expected: yes. The production G1 PPO route uses manager-owned device buffers and avoids per-step CPU round trips.
  • Compatibility: existing NpEnv NumPy contract and non-mjwarp G1 owners remain available; backend-specific behavior stays in backend/config owner layers.

Artifacts

  • Final gate: tests/acceptance/issue_705/artifacts/phase_7_gate.json
  • Final gate source: dc69b4fa7c2f364af0b4792d7d1e2f9e9513279e
  • Final gate SHA256: 35afe4ae98eaa80ed61726e161505caa1189b4cae0d48c5d544abac1edbb58db
  • Phase 4 gate source: cd8c1733352487e156cd2941fe7e31733b42a64a
  • Phase 4 gate SHA256: 7e412aebc093fc58875061fe3aa8c1c23d9e1493a800469dafce1c745acd0bc7
  • Legacy retirement SHA256: beb06b4e663d88f60bc8fa343b0dec13505a3f6036c7494717d13ec54f2a83e5
  • Phase 5 gate source: 8fd55434482cc597aa250c54c94a6cde68f3d43e
  • Phase 5 gate SHA256: eeaf3efcbff0f8fad3211f5b3690d745378f5168c1e82fdd9c816b805d8598d2
  • Phase 6 gate SHA256: 7e42e18f218d5befa5dc27da9ddc405f56d2bea794f7b563e260049ecca60da6
  • Paired-seed training behavior SHA256: 13c3a37c5fe587ad1f0e6890f19791d12f4ac428ba0aaf16df59c8d59b3f51a7
  • DR performance SHA256: 58dea886865aee7fb011e07bdaf7fc33aef7a33d5adb1b0391892da336bb8481
  • W&B: N/A; evidence is frozen in repository artifacts and independently recomputed by validators.
  • ONNX/checkpoint: exercised by the entrypoint/task-rollout gates; no release model is attached to this PR.

Checklist

  • Added or updated tests where needed
  • Updated docs and support matrix
  • Linked the driving issue
  • Noted unsupported routes and support limits explicitly
  • Synced latest main with merge ancestry before final evidence
  • Completed two local reviews: owner/hot-path structure and claim-to-artifact provenance
  • GitHub CI passes on integration HEAD 5a8a26691e33bb3c9af1d088c89bb7a36c221d62 (run 30742715153; Docs 30742715151)
  • User review/approval received

Final Remote Acceptance

  • PR fix: declare CI aggregate audit dependencies #870 fixed the aggregate dependency contract by declaring pyyaml in the isolated dev group and adding fail-closed workflow/dependency tamper tests. It merged into the integration branch as 5a8a26691e33bb3c9af1d088c89bb7a36c221d62.
  • Final local gate: 2352 passed, 26 skipped, 449 deselected, 1 xfailed, coverage 68%; Ruff, mypy, pyright and benchmark smoke passed.
  • Final evidence: source dc69b4fa7c2f364af0b4792d7d1e2f9e9513279e, SHA256 35afe4ae98eaa80ed61726e161505caa1189b4cae0d48c5d544abac1edbb58db, 12/12 mandatory A/B/C/D runs and zero mandatory skip/xfail/xpass/deselect.
  • Real aggregate ran on Python 3.12.3 with only uv sync --only-group dev, installed PyYAML 6.0.3, audited 8 shards / 227 test files / 6 local-evidence nodes, combined A-H coverage to 67%, and passed --fail-under=25.

Per #705, this PR must remain open for user review/approval. Do not squash/rebase the final merge because evidence receipts depend on preserved commit ancestry.

Issue #853 Repository Cleanup

  • Fixes Chore: 清理 #847 的 issue-id 命名、入口膨胀、临时文件与 artifact 体积 #853
  • 将 manager/mjwarp acceptance 的 issue-specific 命名改为语义化命名,并把产品 support evidence 移到 src/unilab/support/ + conf/support/
  • 将 acceptance 命令收敛为 scripts/audit_acceptance.pyscripts/capture_acceptance.py;相对 main 的顶层新增脚本总数为 3。
  • 新增入口不导入、不注册 src/unilab/cli.py
  • 禁止 Git LFS:未新增 .gitattributes 或 LFS pointer,并增加 no-LFS / changed-file 1 MiB repository policy 与 CI gate。
  • 删除 6 个多 MB、可再生成的 raw JSON,改用小型 receipt;原文件仍可从 Git 历史恢复。
  • src/conf/docs/ 不再包含 issue.?705 命名。

#853 Validation

通过:

uv run ruff check .
uv run ruff format --check .
uv run mypy src/unilab
uv run pyright
uv run pytest --collect-only -q
uv run --no-sync scripts/audit_ci_test_shards.py
# targeted hygiene/support/entrypoint/repository-policy tests
git diff --check

make test-all 已执行但未通过:2185 passed, 35 failed, 14 errors, 29 skipped, 652 deselected, 1 xfailed。失败集中在已删除 raw artifact / 旧冻结 hash,以及一个单独运行可通过的顺序相关 Motrix 测试。用户于 2026-08-03 明确要求跳过这些非关键失败并尽快更新 PR,因此未重复执行 full gate;本节记录该显式 override,不将失败表述为通过。

Cleanup commit: 28c619af.


Phase 0 delivery (2026-08-04)

本 PR 分支历史已按 #887 重写(force-push 28c619af71946170,purge tests/acceptance/ 大型 raw artifacts,源码提交保持不变),顶层提交完成 #886 Phase 0 scope reset(production device-resident mjwarp 路径退役 + 显式退役诊断)。原交付 PR #890 因 head 已被本分支包含而自动关闭。

Closes #886
Closes #887

Closes #888(交付 PR: #892,合入本分支后随本 PR 合并 main 自动关闭)

@TATP-233
TATP-233 requested a review from caozx1110 as a code owner August 1, 2026 05:35
This was referenced Aug 1, 2026
@TATP-233
TATP-233 force-pushed the feat/issue-705-manager-mjwarp branch from 28c619a to 7194617 Compare August 4, 2026 06:09
@TATP-233

TATP-233 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

History rewrite notice (#887): 本分支历史已于 2026-08-04 重写并 force-push(28c619af71946170)。

协作者请重新同步本地分支:

git fetch origin
git switch feat/issue-705-manager-mjwarp
git reset --hard origin/feat/issue-705-manager-mjwarp

注意:旧提交(含 artifact)在本仓库 GitHub 对象库中可能仍经 PR ref 缓存可达,彻底 GC 需 GitHub 侧处理;新可达历史已不再包含这些对象。

Deliver the subtractive integration result as one main-based commit. Keep the PPO and SAC G1 owners plus offline recording while excluding the retired manager and typed-runtime history.
@TATP-233

TATP-233 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

#883

@TATP-233 TATP-233 closed this Aug 5, 2026
@TATP-233 TATP-233 reopened this Aug 5, 2026
@TATP-233
TATP-233 force-pushed the feat/issue-705-manager-mjwarp branch from 7e0d141 to eb4e9f2 Compare August 5, 2026 10:53
Apply the manager-based mjwarp infrastructure as one feature commit on top of the squashed mjwarp host-adapter delivery.
@TATP-233
TATP-233 force-pushed the feat/issue-705-manager-mjwarp branch from eb4e9f2 to 63fa962 Compare August 5, 2026 11:00
@TATP-233 TATP-233 closed this Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment