Skip to content

feat: v2.6.0 — E2E CRC Safe Points & Safety-Request Variants (§Phase 13 milestone 50) - #43

Merged
SoundMatt merged 1 commit into
mainfrom
feat/v2.6.0-e2e-crc-safepoints
Jul 28, 2026
Merged

SoundMatt merged 1 commit into
mainfrom
feat/v2.6.0-e2e-crc-safepoints

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

Implements ROADMAP.md milestone 50, "E2E CRC Safe Points & Safety-Request Variants (v2.6.0)" — the Phase 13 milestone the roadmap's own introduction names as "the point at which the mandatory baseline plus safe-points exist."

  • rcp/e2e.hpp REPLACED in full (per the Satellite Package Disposition table): the pre-replacement CRC-16/CCITT-FALSE + sequence-counter + replay-window wrapper around rcp.hpp's Controller is discarded, not adapted. Nothing else in the tree depended on that old API (only its own test did), so no legacy_e2e.hpp split was needed.
    • crc32 implements the actual TC18 end-to-end CRC (32-bit, polynomial 0xF4ACFB13, init 0xFFFFFFFF, final XOR 0xFFFFFFFF, both input/output reflected) via the standard table-less right-shifting construction.
    • coverage_buffer/compute_crc hash exactly stream_id + avtp_timestamp (zero-filled under NTSCF) + the ACF shared header + payload; apply_acf_length_adjustment/apply_frame_length_adjustment implement the +1 quadlet / +4 octet trailing-CRC length pre-adjustment on top of rcp/wire.hpp's existing codec, unmodified.
    • crc_required gates CRC checking per message role off regmap::EndpointGenericConfig's new ep_req_crc_enable/ep_ack_crc_enable/ep_response_crc_enable toggles; E2eErrc::crc_error is the CRC_ERROR failure path.
    • RxStreamGuard (rx_enforce_e2e drop-vs-latch), RxSequenceGuard (rx_enforce_seq monotonic check), RxWatchdog (rx_wd_enable/rx_wd_timeout_interval overflow + safe-state latch + rx_wd_info_enable).
    • apply_watchdog_overflow/apply_queue_overflow implement the purge-normal/retain-safety queue rule by calling sequencer::RequestLedger::cancel_all(true) directly — reusing v2.5.0's clear-non-safestate mechanism rather than reimplementing it.
    • endpoint_in_configured_safe_state/may_execute_now implement the load-bearing safe-state gate: a safety-tagged request only executes once its endpoint is in its configured safe state.
  • rcp/regmap.hpp: RequestStreamConfig expanded from three placeholder fields to the full eleven-field watchdog/safe-state register set (rx_wd_timeout_interval, rx_wd_enable, rx_wd_safestate_enable, rx_enforce_e2e, rx_enforce_seq, rx_seq_safestate_enable, rx_ovrflw_safestate_enable, rx_safety_measure, rx_safestate_sequencer, rx_safe_sequencer_state, rx_wd_info_enable) plus the new RxSafetyMeasure enum; EndpointGenericConfig gains the three CRC toggles.
  • rcp/sequencer.hpp: adds the three MSB-set safety-tagged opcodes — CompoundSafety (0x8F), CompoundWaitSafety (0x8B), TriggeredSafety (0x8E) — accepted by decode_request_type and mapped by category_of onto their base opcode's existing priority category; is_safety_variant and the new request_record_for factory give RequestRecord::is_safety a single, automatic source of truth.

New/updated coverage: tests/test_e2e.cpp (REQ-E2E-001..014, entirely rewritten), tests/test_sequencer.cpp (REQ-SEQ-010..012, added), tests/test_regmap.cpp (REQ-REGMAP-009 rewritten for the expanded field set, REQ-REGMAP-015 added), traced in .fusa-reqs.json. Bumps kVersion/project version to 2.6.0. ROADMAP.md gets a **Done (v2.6.0):** summary for milestone 50.

Test plan

All run locally against this branch (AppleClang 21; the repo's alire/gnat g++ 16.1.0 toolchain hits a pre-existing, unrelated sim.hpp build failure reproducible on unmodified main — not something this PR touches or introduces):

  • cmake --build build --parallel — full project builds clean
  • ctest --test-dir build -j1 — 53/53 tests pass
  • cpfusa check — 0 errors
  • cpfusa lint — 0 errors (against a clean checkout, matching CI's no-prior-build environment)
  • cpfusa cyber — 0 errors
  • cpfusa trace --req-coverage 100 — 438/438 requirements annotated and tested (100%/100%)
  • cpfusa verify — 53/53 tests pass, evidence generated
  • RELAY conformance gate (relay conform --strict build/cpp-rcp) — PASS (§12.1–12.3)

…13 milestone 50)

Replaces rcp/e2e.hpp in full, per the Satellite Package Disposition
table's entry for this file: the pre-replacement CRC-16/CCITT-FALSE +
sequence-counter + replay-window wrapper around rcp.hpp's Controller is
discarded, not adapted. Nothing else in the tree depended on that old
API, so no legacy_e2e.hpp split was needed the way legacy_wire.hpp was
at v2.0.0.

- crc32/detail::crc32_update implement the specification's actual
  end-to-end CRC (32-bit, polynomial 0xF4ACFB13, init 0xFFFFFFFF, final
  XOR 0xFFFFFFFF, both input and output reflected) via the standard
  table-less right-shifting construction for a RefIn=true/RefOut=true
  CRC.
- coverage_buffer/compute_crc assemble and hash exactly stream_id +
  avtp_timestamp (zero-filled under NTSCF) + the full ACF shared header
  + payload; apply_acf_length_adjustment/apply_frame_length_adjustment
  implement the +1 quadlet / +4 octet trailing-CRC length
  pre-adjustment, layered on top of rcp/wire.hpp's existing ACF codec
  without changing its core framing.
- crc_required gates CRC checking per message role off
  regmap::EndpointGenericConfig's new ep_req_crc_enable/
  ep_ack_crc_enable/ep_response_crc_enable toggles; E2eErrc::crc_error
  is the CRC_ERROR failure path.
- RxStreamGuard implements rx_enforce_e2e's per-request-drop-vs-whole-
  stream-latch choice; RxSequenceGuard implements rx_enforce_seq's
  monotonic check, orthogonal to the watchdog; RxWatchdog implements
  rx_wd_enable/rx_wd_timeout_interval overflow detection, the
  safe-state latch, and rx_wd_info_enable's repeating-notification
  flag.
- apply_watchdog_overflow/apply_queue_overflow implement the
  purge-normal/retain-safety queue rule for their respective triggers
  by calling rcp::sequencer::RequestLedger::cancel_all(true) directly
  — that call already existed from v2.5.0's clear-non-safestate
  support.
- endpoint_in_configured_safe_state implements both rx_safety_measure
  strategies (ForceHighImpedance vs. RunSafeSequencer);
  may_execute_now is the load-bearing safe-state gate for safety-tagged
  requests.

rcp/regmap.hpp's RequestStreamConfig is expanded from its three
placeholder fields to the full eleven-field watchdog/safe-state
register set (plus the new RxSafetyMeasure enum); EndpointGenericConfig
gains the three CRC toggles above.

rcp/sequencer.hpp gains the three MSB-set safety-tagged opcodes —
CompoundSafety (0x8F), CompoundWaitSafety (0x8B), TriggeredSafety
(0x8E) — accepted by decode_request_type and mapped by category_of onto
their base opcode's existing priority category; is_safety_variant is
the single source of truth for which opcodes are safety-tagged, and the
new request_record_for factory derives RequestRecord::is_safety from it
automatically.

New/updated coverage: tests/test_e2e.cpp (REQ-E2E-001..014, entirely
rewritten), tests/test_sequencer.cpp (REQ-SEQ-010..012, added),
tests/test_regmap.cpp (REQ-REGMAP-009 rewritten, REQ-REGMAP-015 added),
traced in .fusa-reqs.json (100% requirement coverage verified locally
via cpfusa trace --req-coverage 100). Bumps kVersion/project version to
2.6.0. Updates ROADMAP.md with a Done (v2.6.0) summary for milestone 50.

Signed-off-by: Matt <47545907+SoundMatt@users.noreply.github.com>
@SoundMatt
SoundMatt merged commit 3a88f91 into main Jul 28, 2026
20 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