Skip to content

Consolidate Open Duck Rust policy runtime - #12

Merged
MiaoDX merged 5 commits into
mainfrom
dongxu/dev-0831-squash
Sep 2, 2026
Merged

MiaoDX merged 5 commits into
mainfrom
dongxu/dev-0831-squash

Conversation

@MiaoDX

@MiaoDX MiaoDX commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • consolidate research and architecture contract foundations
  • harden runtime admission, generation, timeline, TTL, and policy ABI evidence
  • add the Rust Open Duck policy worker with pinned ONNX Runtime provisioning
  • add Rust/Python parity, runtime metrics, and rejection attribution evidence
  • align architecture and status documentation with the current runtime

Verification

  • scripts/cargo-mujoco test --workspace
  • cargo fmt --all -- --check
  • final tree verified identical to the pre-squash tree

This PR supersedes the prior 22-commit branch history with one five-commit reviewable stack.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-02T09:06:26.488125Z 25d8feb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25d8feb469

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +77 to +80
pending = CommandInput::Rejected {
sequence: rejection.sequence,
reason: RejectionReason::Invalid,
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retain valid targets across later ingress rejections

When a valid target and then a malformed public request arrive within the same 20 ms control period, the bounded drain first stores the target but this assignment replaces it with Rejected; consequently, tick_ingress never admits the valid target. Keep rejection evidence separately from the latest valid target so a noisy or malformed publisher cannot discard another publisher's command and distort requested/admitted/applied evidence.

AGENTS.md reference: AGENTS.md:L35-L36

Useful? React with 👍 / 👎.

Comment on lines +392 to +393
target[i] = (OPEN_DUCK_DEFAULT_POSE[i] + action[i] * OPEN_DUCK_ACTION_SCALE)
.clamp(self.previous[i] - max_delta, self.previous[i] + max_delta);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Enforce the oracle's absolute target bound in Rust

For repeated finite but very large model actions, this slew clamp advances each actuator by about 0.105 rad per policy tick and can exceed the Python oracle's ±10 rad limit after roughly two seconds. OpenDuckSimPlant accepts every finite value, so the Rust default can continue applying targets that the oracle rejects; apply the same absolute bound before returning the target to preserve the claimed safety and parity behavior.

Useful? React with 👍 / 👎.

Comment on lines 49 to 51
} else {
rejection_evidence.record_decode_failure();
rejection_latched = true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Forward malformed Duck payloads to rejection accounting

This new decode-failure accounting is not reached for malformed targets received through the supported Zenoh path: open-duck-runtime.rs lines 26-37 drops any payload for which decode_target fails and forwards only valid bytes to this socket. Thus a malformed or non-finite public target still leaves rejection_counts.decode at zero and reports a clean run; the runtime must forward an attributable rejection event or account for it before filtering.

Useful? React with 👍 / 👎.

Comment on lines +100 to +101
if drained == MAX_INGRESS_PER_TICK {
timing.ingress_drops = timing.ingress_drops.saturating_add(1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Count actual ingress drops instead of drain-cap hits

Whenever exactly eight datagrams are available, this increments ingress_drops even if the queue is now empty; when more than eight are available, the remainder stays queued for the next tick rather than being dropped. Workloads that reach the drain cap therefore publish fabricated drop counts, making the newly added timing/backpressure evidence unsuitable for experiment comparisons.

Useful? React with 👍 / 👎.

@MiaoDX
MiaoDX merged commit 8c9eb52 into main Sep 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant