Skip to content

Add device sessions with shared channel ownership and scheduling - #24

Merged
soulteary merged 3 commits into
mainfrom
feat/device-session-isolation
Nov 6, 2026
Merged

soulteary merged 3 commits into
mainfrom
feat/device-session-isolation

Conversation

@soulteary

@soulteary soulteary commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Behavior

Devices sharing a CAN channel can now use separate logical sessions while retaining one physical connection and the existing Session writer. Closing one device gates its submissions, waits for registered SDK work, drains its claimed sends and closes its inboxes. The last logical lease releases the physical connection; failed explicit closes remain retryable.

The runtime checks shared channel configuration, coordinates recovery and supports logical device rebind without reopening the backend. A device can require detachment before physical recovery. Old handles remain invalid after close or recovery, and channel-instance metadata distinguishes recreated connections.

Scheduling additions use the same native Job storage:

  • Shared admission domains count FIFO batches or frames and latest slots. Optional domain round robin prevents one domain's priorities from controlling another domain's turns.
  • Device pacing applies within atomic batches and releases the writer during final cooldown. Device-local error thresholds leave peer devices connected.
  • A dispatch-entry deadline policy and separate accepted/dispatch-completed progress support the Python business timing boundaries while retaining existing C++ policies.
  • Registered, thread-bound operations can finish restoration sends after public close begins. Transport close adds no motor, brake or calibration policy.

Masked routes reject actual wire overlap with existing owners. Bounded discovery observers receive copies without taking normal route ownership or receive-budget slots. Receive quotas, terminal reasons, compatibility sequence gaps and device/channel diagnostics have regression coverage.

Existing C++ entry points and defaults remain available. Python source values are documented as configuration baselines, not applied as replacement defaults. This PR does not migrate the Python SDKs or provide Python bindings, protocol transactions, hardware timestamps or hardware acceptance results.

Validation

Local Linux ARM64 / GCC 13 Debug:

  • 330/330 CTest cases passed, including concurrent initialization, recovery, close retries, allocation rollback, routing isolation and pacing.
  • Production line coverage: 5451/5501 (99.09107%, before rounding).
  • 4/4 installed-consumer tests passed, including the new runtime API and existing Session consumer.
  • Strict Clang 18 tidy checks passed for the changed production and Catch2 test translation units.

All 36 CI checks passed on commit 8ab8659, including the full quality report, sanitizers, Windows native tests, relocated ZIP consumers, Ubuntu packages and ROS1 consumers. No unresolved review threads were present at the final check. Fake transports and injected failures do not establish device/firmware/driver compatibility.

@soulteary soulteary changed the title Add logical device sessions and shared admission domains Add device sessions with shared channel ownership and scheduling Nov 6, 2026
@soulteary
soulteary marked this pull request as ready for review November 6, 2026 07:31
@soulteary
soulteary merged commit 660cc98 into main Nov 6, 2026
36 checks passed
@soulteary
soulteary deleted the feat/device-session-isolation branch November 6, 2026 07:34
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