21 lines
1.2 KiB
Markdown
21 lines
1.2 KiB
Markdown
# core/contract/ — frozen, versioned IPC data contract (todo 2)
|
|
|
|
Shared-memory frame contract (`contract.h`/`contract.cpp` + the ctypes mirror in
|
|
`tracker/contract.py`): a triple-buffered, newest-wins `FrameContract` with a
|
|
monotonic (seqlock-style) sequence counter guarding each slot, a 20-joint
|
|
`SkeletonFrame` (position + per-joint tracking state + tracking id + quality
|
|
flags), depth/player-index and color buffer descriptors, a frame number, a
|
|
QPC-style monotonic `timestamp_micros`, and a named-pipe/socket control-plane
|
|
message schema (`HANDSHAKE_VERSION`/`CONFIG`/`CALIBRATION`/`HEARTBEAT`, each
|
|
behind a versioned `ControlMessageHeader`).
|
|
|
|
Every struct is `#pragma pack(push, 1)`-packed with no implicit padding, and
|
|
`static_assert`s in `contract.h` pin each struct's `sizeof`/`offsetof` to a
|
|
golden table; `contract_layout_dump` (built alongside the library) prints that
|
|
same table so `tests/test_contract_py.py` can check the Python mirror against
|
|
the CURRENT compiled C layout rather than a hardcoded, driftable copy.
|
|
`CONTRACT_VERSION` bumps only via an explicit contract-version commit.
|
|
|
|
Frame data never travels on the control channel - only handshake/config/
|
|
calibration/heartbeat messages do.
|