Skip to content

Bump in-tree mctp-rs to dymk/mctp-rs @ 1b8b7f5#844

Merged
jerrysxie merged 5 commits into
OpenDevicePartnership:v0.2.0from
dymk:dymk/phase-32-mctp-rs-bump
May 14, 2026
Merged

Bump in-tree mctp-rs to dymk/mctp-rs @ 1b8b7f5#844
jerrysxie merged 5 commits into
OpenDevicePartnership:v0.2.0from
dymk:dymk/phase-32-mctp-rs-bump

Conversation

@dymk
Copy link
Copy Markdown
Contributor

@dymk dymk commented May 14, 2026

Bump in-tree mctp-rs to dymk/mctp-rs @ 1b8b7f5

Bumps the in-tree mctp-rs/ source from 3d941ba (current v0.2.0 baseline imported in #823) to 1b8b7f5 (the head of dymk/mctp-rs main). This brings the in-tree copy to parity with the dymk fork's main, after which dymk/mctp-rs will be archived.

The high-level MctpPacketContext::deserialize_packet/serialize_packet API signatures are identical between 3d941ba and 1b8b7f5 (only internal MctpMedium::deserialize/serialize cursor types changed). All 4 in-tree consumers (uart-service, espi-service, embedded-service, plus macro re-exports) use the high-level MctpPacketContext API, so zero consumer source changes were required. Consumer test counts are unchanged at 128.

What's picked up

  • BufferEncoding trait + EncodingDecoder/EncodingEncoder cursor wrappers (src/buffer_encoding.rs, NEW) — stateless cross-medium encoding abstraction; threads through MctpMedium::deserialize/serialize internals
  • MctpSerialMedium DSP0253 byte-stuffed serial framer with CRC-16/X-25 FCS (src/medium/serial.rs, NEW; gated behind opt-in serial feature)
  • wire_size_of chunk-sizing fix in src/serialize.rs (correctly accounts for encoding overhead during packet chunking)
  • SerialEncoding byte-stuffing implementation (in medium/serial.rs)

Source lineage

Source: dymk/mctp-rs main @ 1b8b7f5
Bumps from: 3d941ba (v0.2.0 baseline imported in #823)

Carry-forwards from #823

These edits are preserved across the bump:

  • Dropped cargo-husky from [dev-dependencies] (workspace-root build script incompatibility; the source at 1b8b7f5 still has cargo-husky declared but the in-tree copy must drop it)
  • Did NOT re-introduce per-crate mctp-rs/rustfmt.toml (workspace style governs; source at 1b8b7f5 has a rustfmt.toml for nightly rustfmt, but the workspace uses stable rustfmt with max_width = 120)
  • [package.metadata.cargo-machete] ignored block updated to add "crc" (now an opt-in optional dep behind the serial feature; cargo-machete would otherwise false-positive at default features)
  • Source reformatted under the workspace style (separate fmt-only commit; no semantic change)

Test results

Suite Pre-bump Post-bump Delta
Workspace total passed 178 185 +7
mctp-rs unit tests ~47 54 +7
mctp-rs doctests 3 3 0
Consumer crates (sum) 128 128 0

cargo test --workspace exits 0. New mctp-rs tests come from buffer_encoding.rs cursor unit tests at default features. The 41+ medium/serial.rs golden-fixture tests live behind opt-in --features serial and are exercised by the hack-clippy cargo-hack feature-powerset job in check.yml.

Cargo.lock churn

  • Workspace Cargo.lock regenerated via cargo build --workspace. mctp-rs entry remains source-less (path-pinned).
  • NEW transitive entries in Cargo.lock: crc 3.4.0 and crc-catalog 2.4.0 (both gated behind opt-in serial; neither is reachable from cargo build --workspace at default features).
  • cargo tree -p mctp-rs is byte-identical pre/post at default features (verified via diff).
  • Example lockfiles regenerated via cd examples/<name> && cargo update -p mctp-rs: examples/std, examples/rt685s-evk, examples/pico-de-gallo updated. examples/rt633 does not depend on mctp-rs and is untouched.

cargo-vet

cargo vet --locked reports: Vetting Succeeded (220 fully audited, 1 partially audited, 15 exempted).

Added one new exemption for crc 3.4.0 as safe-to-deploy in supply-chain/config.toml (alphabetically interleaved via cargo vet fmt). crc-catalog 2.4.0 did not require a new exemption — already audited via imports.lock (OpenDevicePartnership-imported audit by Jerry Xie, Microsoft).

CI matrix coverage (hack-clippy)

check.yml's hack-clippy job runs cargo hack --feature-powerset --mutually-exclusive-features=log,defmt,defmt-timestamp-uptime workspace-wide across {stable,beta} × {x86_64-unknown-linux-gnu, thumbv8m.main-none-eabihf}. Since mctp-rs is a workspace member, this matrix automatically exercises the new serial feature (16 feature combinations total).

dymk added 3 commits May 13, 2026 13:54
Snapshot replacement of `mctp-rs/src/` and `mctp-rs/Cargo.toml` with
dymk/mctp-rs main @ 1b8b7f5 (post-Phase-25/25.5 head). Picks up
BufferEncoding trait + EncodingDecoder/Encoder cursors,
MctpSerialMedium DSP0253 byte-stuffed framer with CRC-16/X-25 FCS
behind opt-in `serial` feature, and `wire_size_of` chunk-sizing fix.

High-level `MctpPacketContext::deserialize_packet/serialize_packet`
signatures are UNCHANGED between 3d941ba and 1b8b7f5 — zero consumer
source changes expected.

Carry-forwards from Phase 31 IMPORT-03 preserved:
- cargo-husky DROPPED from [dev-dependencies] (workspace-root build
  script incompatibility)
- per-crate rustfmt.toml NOT re-introduced (workspace style governs)
- [package.metadata.cargo-machete] ignored block updated to add
  `crc` (now an opt-in optional dep behind `serial` feature)

Source: dymk/mctp-rs main @ 1b8b7f5
Bumps from: 3d941ba (v1.6 baseline)
No semantic change. The source at 1b8b7f5 was formatted under dymk/mctp-rs's
nightly rustfmt config (per-crate rustfmt.toml); embedded-services workspace
uses stable rustfmt with max_width = 120. Reformat brings the bumped source
into line with the workspace style.

Source: dymk/mctp-rs main @ 1b8b7f5 (no semantic change)
…-rs bump

- Workspace Cargo.lock regenerated via `cargo build --workspace`.
  mctp-rs entry remains source-less (path-pinned per Phase 31).
  New transitive entries: crc 3.4.0 + crc-catalog 2.4.0 (both gated
  behind opt-in `serial` feature; not in default-features cargo-tree).
- examples/{std, rt685s-evk, pico-de-gallo}/Cargo.lock regenerated via
  `cd examples/<name> && cargo update -p mctp-rs`. examples/rt633
  does not depend on mctp-rs and is untouched.
- supply-chain/config.toml: added `safe-to-deploy` exemption for
  crc 3.4.0. crc-catalog 2.4.0 is already audited via
  imports.lock (OpenDevicePartnership/Microsoft, Jerry Xie).
  `cargo vet --locked` confirms `Vetting Succeeded`
  (220 fully audited, 1 partially audited, 15 exempted).

Source: dymk/mctp-rs main @ 1b8b7f5
@dymk dymk marked this pull request as ready for review May 14, 2026 18:29
@dymk dymk requested a review from a team as a code owner May 14, 2026 18:29
Copilot AI review requested due to automatic review settings May 14, 2026 18:29
@dymk dymk requested a review from a team as a code owner May 14, 2026 18:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the in-tree mctp-rs workspace member to a newer upstream snapshot, adding an internal buffer-encoding abstraction so media can transparently apply byte-stuffing, and introducing an opt-in DSP0253 serial medium (CRC/FCS + framing) while keeping the high-level MctpPacketContext::{deserialize_packet,serialize_packet} API surface stable for existing consumers.

Changes:

  • Add BufferEncoding + EncodingDecoder/EncodingEncoder cursors and thread them through MctpMedium (de)serialization.
  • Fix packet chunk sizing in serialization to account for encoding overhead (stuffing) when computing per-packet body size.
  • Add a new serial feature implementing DSP0253 serial framing + CRC-16/X-25 (with new crc dependency + vet exemption).

Reviewed changes

Copilot reviewed 11 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
supply-chain/config.toml Adds a cargo-vet exemption for crc 3.4.0.
mctp-rs/Cargo.toml Introduces optional crc dep and serial feature; updates cargo-machete ignored list.
mctp-rs/src/buffer_encoding.rs New encoding abstraction and encoder/decoder cursors (+ unit tests).
mctp-rs/src/deserialize.rs Transport-header parsing updated to read via encoding-aware decoder.
mctp-rs/src/lib.rs Wires in new module and re-exports encoding types; re-exports serial medium behind feature.
mctp-rs/src/mctp_packet_context.rs Decodes packet bodies via EncodingDecoder to support stuffed media.
mctp-rs/src/medium/mod.rs Extends MctpMedium trait with Encoding and updates serialize/deserialize signatures.
mctp-rs/src/medium/smbus_espi.rs Adapts SMBus/eSPI medium to encoding-aware cursors (passthrough encoding).
mctp-rs/src/medium/serial.rs New DSP0253 serial medium implementation + fixtures and tests (feature-gated).
mctp-rs/src/serialize.rs Adjusts chunk sizing to account for encoding wire overhead; writes through encoder.
mctp-rs/src/test_util.rs Updates test medium to the new encoding-aware MctpMedium signature.
Cargo.lock Adds/updates lock entries for new optional crc dependency.
examples/std/Cargo.lock Regenerated example lockfile (git pin churn).
examples/rt685s-evk/Cargo.lock Regenerated example lockfile (git pin churn).
examples/pico-de-gallo/Cargo.lock Regenerated example lockfile (git pin churn).

Comment thread mctp-rs/src/buffer_encoding.rs Outdated
Comment thread mctp-rs/src/serialize.rs
Comment thread mctp-rs/src/medium/smbus_espi.rs
Comment thread mctp-rs/src/medium/serial.rs
The doc previously described InvalidEscape as 'currently unreachable' —
that's now stale: SerialEncoding can produce it when the byte following
an escape (0x7D) is neither 0x5E nor 0x5D, per RFC1662 §4.2 / DSP0253 §6.4.

Addresses code review feedback on the in-tree mctp-rs bump.
Copy link
Copy Markdown
Collaborator

@williampMSFT williampMSFT left a comment

Choose a reason for hiding this comment

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

:shipit:

@jerrysxie jerrysxie enabled auto-merge (squash) May 14, 2026 20:30
@jerrysxie jerrysxie merged commit 1e820b1 into OpenDevicePartnership:v0.2.0 May 14, 2026
16 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.

6 participants