Repository navigation
proto: C1-G airborne = "AP would mix", layout-independent version handshake, protocol v5 - #18
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The semantic contract, version gate, layout hash, documentation, and compatibility tests are consistent.
0 open findings
What changed in this PR
Updates the split-core protocol contract for C1-G ground-idle semantics and rejects incompatible v3 peers.
Changes:
- Redefines
RateCommand.airborneas “ArduPilot would mix.” - Bumps the protocol version to 4 with the corresponding layout hash.
- Adds v3 incompatibility coverage to layout and multiprocess tests.
| File | Description |
|---|---|
CubePilotFW/SplitProtocol.h |
Bumps the protocol version to 4. |
proto/Rc.proto |
Documents the revised airborne semantics. |
docs/cuberacer-split.md |
Updates the protocol contract and compatibility guidance. |
tests/split_layout_test.cpp |
Updates golden values and v3 rejection checks. |
tests/posix_multiprocess_test.cpp |
Tests v3 rejection in both core roles. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
bugobliterator
force-pushed
the
feat/c1g-airborne-spool
branch
from
October 10, 2026 03:10
fc72b25 to
e1947a7
Compare
bugobliterator
force-pushed
the
feat/c1g-airborne-spool
branch
from
October 10, 2026 03:21
e1947a7 to
5d720cd
Compare
bugobliterator
force-pushed
the
feat/c1g-airborne-spool
branch
from
October 10, 2026 03:41
5d720cd to
38aa771
Compare
bugobliterator
force-pushed
the
feat/c1g-airborne-spool
branch
from
October 10, 2026 03:46
38aa771 to
8996d60
Compare
The meaning of RateCommand.airborne changes, so the version moves to 4 and kLayoutHash changes through the version seed only (0xFC153163; slots unchanged). The CoreInfo gate refuses a v3 peer on both cores: a v3 M7 with a C1-G M4 would cut M4 authority when land_complete_maybe flickers in flight. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit fc72b25)
…l v5 Each core publishes magic, protocol version, layout hash, session and mismatchSeen in its own 32-byte half (M7 at 0, M4 at 32), written as a seqlock without HSEM. Its layout is frozen, so cores with different slot layouts can still compare versions. Slots move up by 64 bytes; golden total 1984 and hash 0x901359E1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KqxcxgduRYDCp2rs1XqK5M
start() takes the protocol version and layout hash to publish (default: this build) so SITL overrides reach the bootstrap area. The test peer emulates builds with other versions and moved slots: both cores report the mismatch from the bootstrap area and see the peer's mismatchSeen, where CoreInfo alone times out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KqxcxgduRYDCp2rs1XqK5M
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KqxcxgduRYDCp2rs1XqK5M
publishBootstrap and setBootstrapMismatchSeen write nothing and readPeerBootstrap returns Absent, before deriving the half pointer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KqxcxgduRYDCp2rs1XqK5M
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KqxcxgduRYDCp2rs1XqK5M
posix_peer legacy-v4 publishes no bootstrap half, registers the v4 slots (64 bytes lower) and sends v4 CoreInfo. In either role the v5 side reports "not connected" and the v4 side times out; the v5 half and CoreInfo frame are checked afterwards. The bootstrap mode returns 39 if CoreInfo arrives without a peer half. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KqxcxgduRYDCp2rs1XqK5M
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KqxcxgduRYDCp2rs1XqK5M
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KqxcxgduRYDCp2rs1XqK5M
bugobliterator
force-pushed
the
feat/c1g-airborne-spool
branch
from
October 10, 2026 04:06
8996d60 to
ee84385
Compare
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.


C1-G:
RateCommand.airborneis true when ArduPilot would mix (spool state), not when it believes it is flying; the M4 uses it to hold ground idle with zero differential authority while armed and not airborne. Semantics only (no field or size change).Layout-independent version handshake (review finding on #9): a frozen 64 B bootstrap area at offset 0 of the split region (one 32 B half per core: magic, sequence, protocol version, layout hash, session, mismatchSeen), written seqlock-style by its single owner. Each core reads the peer half, so peers with different slot layouts now report VERSION_MISMATCH instead of appearing as "M4 not connected". Versioned slots start at 64. Protocol version 5,
kLayoutHash0x901359E1.Pre-v5 peers publish no bootstrap half and use slots 64 bytes lower: they still appear disconnected (arming refused), not mismatched. Covered by a legacy-v4 peer in the POSIX multiprocess tests.
Also: null-base guards in the bootstrap functions; reverse (M4-TX/M7-RX) duplex coverage for
registerAll.Companion updates needed to pair with this release (v5):
SplitLayout::publishBootstrap()afterregisterAll()and pollreadPeerBootstrap()into the VERSION_MISMATCH pre-arm path (SITL gets the publish throughPosixSplit::start).lib/modules/CubeFrameworkSplitto this commit; same publish/poll on hardware.Testing: host CTest 19/19 on macOS and on Linux gcc 13 with ASan/UBSan; POSIX multiprocess tests 5/5 repeated on both; sim self-tests pass; SplitLayout/ShMemTransport/HSEM cross-compile for cortex-m7 and cortex-m4 without warnings. Not tested on hardware.
AI-assisted: implemented with Claude Code; reviewed with Copilot.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KqxcxgduRYDCp2rs1XqK5M