refactor: revisit the triplicated buffer implementations across the tokio / embassy / wasm adapters

Đang mở
#459 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
backend, embedded-iot

Hướng nghiên cứu

Read docs/design/035-review-followups-deferred.md §2.3 and docs/design/038-technical-debt-and-simplification-review.md §2.3 / §3.2, then compare the buffer read paths in the three adapter files named in the issue. Check whether the documented tripwire has been hit by the late-join snapshot and record.get changes. Done means either recording a re-confirmation in 035 and closing the issue, or writing the shared core implementation design described in 038.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

🏗️ core enhancement

Problem

The three runtime adapters each hand-build the same three buffer semantics (SPMC ring, single-latest, mailbox):

File Lines Of which inline tests start at
aimdb-tokio-adapter/src/buffer.rs 1,634 line 611
aimdb-embassy-adapter/src/buffer.rs 963 line 628
aimdb-wasm-adapter/src/buffer.rs 757 line 478

Each also carries a high density of feature gates (32, 29 and 26 cfg(feature …) occurrences respectively). This is the largest structural duplication left in the workspace: a behavioural fix or a new buffer feature has to be written and tested three times, and parity between them is only enforced by tests.

Prior decisions

This is not new:

  • docs/design/038-technical-debt-and-simplification-review.md §2.3 / §3.2 proposed one portable buffer implementation in core and estimated about 2,000 lines net removed (breaking for adapter authors only).
  • docs/design/035-review-followups-deferred.md §2.3 decided "keep, with a tripwire" for the buffer-ext trait triplication.

So this issue is a request to re-check that decision, not to overturn it by default.

Suggested work

  • Check whether the tripwire condition recorded in 035 §2.3 has been hit since (e.g. by the recent late-join snapshot and record.get changes, which touched buffer read paths).
  • If it has, or if the cost has grown, write the design for a shared core implementation as 038 §3.2 sketched.
  • If not, record the re-confirmation in 035 and close this.

Notes

Line counts are from the tree at d9c7be0. I did not diff the three implementations line by line, so the amount of truly shareable code is the 038 estimate, not something I measured.

Ngôn ngữ chính
Rust
Star
101
Fork
20
Merge trung bình
2 giờ 33 phút
Pull request đã merge (30 ngày)
90

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aimdb-dev/aimdb

Tất cả issue của aimdb-dev/aimdb

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.