Skip to content

Harden DSM WNN telemetry enforcement and close rollback edge-case faults#24

Merged
dfeen87 merged 3 commits into
mainfrom
copilot/harden-and-fix-wnn-telemetry
May 7, 2026
Merged

Harden DSM WNN telemetry enforcement and close rollback edge-case faults#24
dfeen87 merged 3 commits into
mainfrom
copilot/harden-and-fix-wnn-telemetry

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 7, 2026

WNN telemetry enforcement in the DSM could accept invalid numeric inputs and had brittle rollback-path assumptions. This update hardens the WNN-to-DSM safing path so malformed telemetry and rollback-store edge cases fail safe and remain auditable.

  • WNN telemetry validation and safing behavior

    • Added explicit non-finite (NaN/Inf) detection for WnnTelemetry fields before threshold evaluation.
    • Unified WNN breach handling so both invalid telemetry and threshold violations drive deterministic rollback safing.
    • Added explicit DSM diagnostics for threshold-triggered WNN safing events.
  • ITL logging hardening for invalid telemetry

    • Sanitized non-finite WNN telemetry values before ITL commit using a named sentinel (DSM_Config::INVALID_TELEMETRY_SENTINEL) to avoid ambiguous raw invalid values in the log stream.
    • Kept WNN alert + rollback commit emission behavior intact for audit continuity.
  • Rollback-path safety guards

    • Hardened trigger_wnn_immediate_rollback(...) to return safely when rollback storage is unavailable (nullptr) or empty (rollback_count == 0), avoiding unsafe dereference assumptions in WNN-triggered rollback flow.
  • SIL coverage for regression boundaries

    • Extended rollback tests with WNN-specific edge cases:
      • null rollback store with non-zero count,
      • empty rollback store behavior.
inline bool trigger_wnn_immediate_rollback(
    const RollbackPlan* rollback_store,
    uint32_t rollback_count,
    PhysicsState& active_state_pointer
) {
    if (rollback_count == 0 || rollback_store == nullptr) {
        return false;
    }
    // existing rollback execution path...
}

@dfeen87 dfeen87 marked this pull request as ready for review May 7, 2026 11:48
Copilot AI review requested due to automatic review settings May 7, 2026 11:48
@dfeen87 dfeen87 merged commit 9a1bded into main May 7, 2026
2 checks passed
@dfeen87 dfeen87 deleted the copilot/harden-and-fix-wnn-telemetry branch May 7, 2026 11:48
Copy link
Copy Markdown

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

This PR hardens the DSM WNN telemetry enforcement and the WNN-triggered rollback path to fail safely on malformed telemetry and rollback-store edge cases, while preserving auditable ITL logging.

Changes:

  • Added explicit non-finite (NaN/Inf) detection for WNN telemetry and unified safing behavior for invalid inputs vs threshold breaches.
  • Sanitized non-finite WNN telemetry before ITL logging using a named sentinel value.
  • Guarded WNN rollback execution against nullptr rollback stores and zero rollback counts, with SIL regression tests covering both cases.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/sil/test_rollback_execution.cpp Adds SIL regression tests for trigger_wnn_immediate_rollback when rollback storage is nullptr or empty.
src/raps/rollback_execution.hpp Adds a nullptr guard to prevent unsafe dereference in WNN-triggered rollback execution.
include/raps/safety/deterministic_safety_monitor.hpp Adds WNN telemetry validity checks, threshold helper, ITL logging sanitization, and clearer DSM diagnostics for WNN rollback safing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants