Skip to content

Update core snapshot to netft-cpp 0.3.3 - #6

Merged
han-xudong merged 2 commits into
mainfrom
chore/core-0.3.2
Aug 1, 2026
Merged

Update core snapshot to netft-cpp 0.3.3#6
han-xudong merged 2 commits into
mainfrom
chore/core-0.3.2

Conversation

@han-xudong

@han-xudong han-xudong commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary

  • synchronize the private core snapshot with netft-cpp 0.3.3
  • remove obsolete NETFT_BUILD_CLI configuration left after the upstream CLI split
  • update snapshot metadata and project documentation

Verification

  • pixi run check

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The project pins netft-cpp 0.3.3, removes CLI build configuration, and adds deferred Client::Impl destruction when cleanup starts on the worker callback thread.

Changes

Native core upgrade

Layer / File(s) Summary
Version and packaging updates
core/UPSTREAM, core/CMakeLists.txt, CMakeLists.txt, README.md, CHANGELOG.md, core/SNAPSHOT.sha256, .github/workflows/ci.yml
Pins netft-cpp to v0.3.3, updates project references and snapshot hashes, and removes CLI build configuration and installation.
Worker-thread detection contract
core/include/netft/client.hpp, core/src/detail/client_impl.hpp
Documents callback-related destruction rules and adds called_from_worker_thread().
Deferred client destruction
core/src/client.cpp
Queues implementations for asynchronous destruction when the destructor runs on the worker thread. Other destruction paths remain synchronous.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SampleCallback
  participant Client
  participant ClientImpl
  participant DeferredDestroyer
  SampleCallback->>Client: destroy Client
  Client->>ClientImpl: called_from_worker_thread()
  Client->>ClientImpl: stop()
  Client->>DeferredDestroyer: queue Impl
  DeferredDestroyer->>ClientImpl: destroy Impl asynchronously
Loading

Possibly related PRs

  • netft/pyNetFT#1: Updates the pinned core and modifies the same client lifecycle files.
  • netft/pyNetFT#2: Updates the pinned core and modifies related CMake and lifecycle files.
  • netft/pyNetFT#5: Directly precedes the pinned netft-cpp snapshot update from v0.3.1 to v0.3.3.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: updating the core snapshot to netft-cpp 0.3.3.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/core-0.3.2

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
core/src/client.cpp (1)

14-57: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Note the serialization behavior of the shared DeferredDestroyer.

DeferredDestroyer<Impl> is a single, process-lifetime static shared across all Client instances. run() processes one queued Impl at a time, and each stop() call can block on join() until that particular worker thread exits. If several Client instances are deferred-destroyed from their worker threads around the same time, their destruction is fully serialized on this one background thread.

This is unlikely to matter for a small number of sensor clients, but consider documenting the constraint, or using one worker per pending item if many concurrent Client instances are expected.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/src/client.cpp` around lines 14 - 57, Document the serialization
constraint of the shared DeferredDestroyer<Impl>: its single worker processes
pending stop() calls sequentially, so deferred destruction across concurrent
Client instances is serialized. If the expected client count requires concurrent
cleanup, revise DeferredDestroyer to dispatch each pending item independently
while preserving safe shutdown and completion behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/CMakeLists.txt`:
- Around line 3-9: Remove all stale NETFT_BUILD_CLI references from the project
CMake configuration and CI workflow, including its option/setting and any
conditional uses, while leaving unrelated build options and workflow behavior
unchanged.

In `@core/src/detail/client_impl.cpp`:
- Around line 289-293: Update Client::Impl::called_from_worker_thread() to use
the active-worker predicate based on worker_exited_ and active_worker_id_,
matching the logic in start() and stop(), rather than worker_.joinable() and
worker_.get_id(). Add a regression test covering the interval after stop() moves
worker_ but before join completes, ensuring callback-triggered Client
destruction does not destroy Impl while handle_record() is still running.

---

Nitpick comments:
In `@core/src/client.cpp`:
- Around line 14-57: Document the serialization constraint of the shared
DeferredDestroyer<Impl>: its single worker processes pending stop() calls
sequentially, so deferred destruction across concurrent Client instances is
serialized. If the expected client count requires concurrent cleanup, revise
DeferredDestroyer to dispatch each pending item independently while preserving
safe shutdown and completion behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7976aa6d-04cb-4e0f-8986-76aa9f38c2c8

📥 Commits

Reviewing files that changed from the base of the PR and between 41ae795 and eb723c4.

📒 Files selected for processing (9)
  • CHANGELOG.md
  • README.md
  • core/CMakeLists.txt
  • core/SNAPSHOT.sha256
  • core/UPSTREAM
  • core/include/netft/client.hpp
  • core/src/client.cpp
  • core/src/detail/client_impl.cpp
  • core/src/detail/client_impl.hpp

Comment thread core/CMakeLists.txt Outdated
Comment thread core/src/detail/client_impl.cpp Outdated
@han-xudong han-xudong changed the title Update core snapshot to netft-cpp 0.3.2 Update core snapshot to netft-cpp 0.3.3 Aug 1, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/UPSTREAM`:
- Around line 2-3: Align the release version across core/UPSTREAM,
core/CMakeLists.txt, and the PR summary so they all name the same netft-cpp
version; either update the summary to 0.3.3 or change the pinned and declared
version consistently to 0.3.2.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c2bf37a5-8506-4f55-8109-a3421b39972e

📥 Commits

Reviewing files that changed from the base of the PR and between eb723c4 and 74d47fd.

📒 Files selected for processing (9)
  • .github/workflows/ci.yml
  • CHANGELOG.md
  • CMakeLists.txt
  • README.md
  • core/CMakeLists.txt
  • core/SNAPSHOT.sha256
  • core/UPSTREAM
  • core/src/client.cpp
  • core/src/detail/client_impl.hpp
💤 Files with no reviewable changes (2)
  • .github/workflows/ci.yml
  • CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (5)
  • README.md
  • CHANGELOG.md
  • core/SNAPSHOT.sha256
  • core/CMakeLists.txt
  • core/src/client.cpp

Comment thread core/UPSTREAM
@han-xudong
han-xudong merged commit e02b71d into main Aug 1, 2026
27 checks passed
@han-xudong
han-xudong deleted the chore/core-0.3.2 branch August 1, 2026 06:48
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