← Back to Pull requests

[Humble] Remove pessimizing moves (backport #2353) #3310

Open
Miko997 opened this pull request with 8 lines diff across 3 files
View on GitHub
Miko997 Miko997 commented on Oct 04, 2026 16:59 UTC
Author

Description

Humble consumers calling Publisher::publish() with GCC 13+ and -Wall receive two -Wpessimizing-move warnings from intra_process_manager.hpp. Pass the two temporary MessageUniquePtr arguments directly. This follow-up also passes loaned_msg.release() directly in the publisher and its protected test helper, completing the upstream changes for consistency.

Backport of Chris Lalancette's #2353, upstream commit 7f411371b367ea402e2066c2af1ccbac6b4eb5bc (original commit 41d51dff2c0cc15f95e5677017490129a0430bb8). The existing attributed commit is unchanged; Chris's original sign-off, Miko's sign-off, and upstream references are retained. Moves from named LoanedMessage objects remain intact.

Fixes #3308.

Is this user-facing behavior change?

Removes consumer warnings and unnecessary moves while preserving message ownership and delivery.

Did you use Generative AI?

OpenAI Codex (GPT-6) assisted with implementation.

Additional Information

  • Original intra-process validation, retained from October 4: GCC 15.2 syntax-only Int32 publisher consumer with -Wall, repeated with -Werror=pessimizing-move, using checkout headers first and explicit Humble dependency includes. The original Humble baseline emitted two target warnings/errors at 465:51 and 507:68; the published intra-process patch passed with no target diagnostics. One unrelated dependency deprecation remained unsuppressed.

  • Follow-up validation, October 6: compared previous PR head eee46290b388fd6ea00c9a13dff05bf819123cce with follow-up commit 94525e17e319c94739c422faaa51ecfd092260a9 (the validated two-line patch) under the same GCC 15.2 compiler and Humble includes, using -std=c++17 -fsyntax-only -Wall -H -Werror=pessimizing-move. The unchanged ordinary-publishing fixture passed on both. A bounded fixture instantiated public loaned publication and the protected helper copied from each source version: the previous head emitted two pessimizing-move errors; the follow-up passed with no target diagnostics. All four runs retained the same unrelated std::wstring_convert deprecation warning. Include traces confirmed the intended source headers and Humble dependencies. These are syntax-only checks, not GCC 15 linking/runtime validation.

  • Reused the isolated Ubuntu 22.04/Humble, GCC 11.4, Fast DDS build:

  •   cmake --build /work/build/rclcpp --parallel 2
      ctest --test-dir /work/build/rclcpp --output-on-failure -j 1 -V
      git diff --check
      

    Incremental build passed. The full package suite passed: 102 CTest entries, zero failures, 200.65 seconds. This includes test_publisher and its protected loaned-publish error path, test_loaned_message, test_intra_process_manager, test_intra_process_manager_with_allocators, and test_publisher_with_type_adapter. Seven benchmarks were skipped by default. Ament skipped cppcheck 2.7; other package linters passed. Aggregate results: 2,381 tests, zero errors/failures, 336 skips. Compile dependencies and loaded libraries confirm checkout headers, the rebuilt library, and Humble dependencies.
  • The original full-suite and installed-package two-subscriber smoke evidence is retained. The installed-package smoke was not rerun for this follow-up. Local Linux amd64/Fast DDS validation only; other middleware and multi-platform CI remain for maintainers.
  • Diff: 8 lines (+4 / -4) across 3 files Reviewer: fujitatomoya Review duration: 4429m
    All Vouch review confidence checks passed
    Residual risk 0.03 = Change Risk (0.24) × (1 − Review Confidence (0.89)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.24 · 8 lines diff across 3 files
    0.24
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.89 · 1 substantive comment(s)
    0.89
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    89%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.131
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    3 items
    fujitatomoya fujitatomoya commented on Oct 05, 2026 22:37 UTC
    Reviewer

    the independent loaned-message publisher/test changes are excluded.

    why? can we just inlcude loaned related parts, so what we can keep the history consistent?

    Miko997 Miko997 commented on Oct 06, 2026 14:10 UTC
    Author

    I initially limited this to the two reported intra-process warnings. Added the remaining loaned-message changes from #2353 in 94525e1 for consistency, preserving the original attribution.

    Local validation with Codex completed all 102 Humble CTest entries with zero failures; existing skips are documented. GCC 15 reproduced both remaining warnings before the change and passed afterward.

    Reviewers
    Assignees
    Miko997 Miko997
    Labels
    risk: low confidence: 89.1% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 24.1% (LOW) · Higher = larger blast radius
    24.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 89.1% · Lower = rushed or shallow review
    89.1%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 2.6% · Safe to merge
    2.6%
    Repository