snap_hysteresis's tolerance band is asymmetric at two of its eight edges
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
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- embedded-iot
Hướng nghiên cứu
Start with src/lib.rs and run ops_tests::hysteresis::the_band_edges_are_asymmetric, which records the current behavior. Decide whether the tolerance policy should remain approximate or change to midpoint, scaled tolerance, or inclusive slack. Done means a deliberate behavior choice, updated tests, and a changelog-visible commit if behavior changes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
ops::snap_hysteresis (src/lib.rs) rejects an input further than
HYSTERESIS_TOLERANCE from the nearest legal setting. The constant is
0.05f32, whose exact value is 0.05000000074505805969, and the
comparison is against a subtraction whose result depends on which side
of its decimal value each f32 literal rounded to.
Measured
Both functions were transcribed verbatim into a scratch binary and run
under rustc -O rather than reasoned about on paper:
| Setting | −0.05 edge | diff | +0.05 edge | diff |
|---|---|---|---|---|
| 0 °C | accepted | 0.05 |
accepted | 0.05 |
| 1 °C | rejected | 0.050000012 |
accepted | 0.049999952 |
| 2 °C | accepted | 0.049999952 |
accepted | 0.049999952 |
| 4 °C | accepted | 0.049999952 |
rejected | 0.05000019 |
Six of eight edges are accepted, and the two rejections fall on
opposite sides — the low edge at 1 °C, the high edge at 4 °C. No
single description of the band is correct for all four settings.
So a caller asking for 0.95 °C of hysteresis gets InvalidInput, while
one asking for 1.05 °C gets Hysteresis::OneC. Both are the same
distance from 1 °C as written; only their f32 representations differ.
Status
Pinned as measured by
ops_tests::hysteresis::the_band_edges_are_asymmetric, added while
closing #66, so any change to it is deliberate rather than silent.
Whether it should change is this issue.
Note the ±0.05 °C band is driver policy, not a datasheet tolerance —
SBOS663A §7.5.3.1 Table 9 specifies the four discrete encodings and
says nothing about how an arbitrary float should reach one. #66 Part 2
records the band as a legal choice.
Options
Roughly in increasing order of disruption:
- Leave it. Document the band as approximate. A caller sitting
within 0.05 °C of an edge is already asking for a setting it did not
name, and the four settings are 1 °C apart. - Compare against the midpoint between adjacent settings, or
against a tolerance scaled per setting, so the decision does not
turn on one constant's representation. - Make the comparison inclusive with slack — e.g.
>against
HYSTERESIS_TOLERANCE + f32::EPSILON, making all eight edges
accept.
Any of 2 or 3 changes behaviour for callers currently on the rejected
side of an edge, so it needs a changelog-visible commit.
Provenance
Raised while closing #66. Not a regression — the behaviour predates
that work; it was simply never asserted.
- Ngôn ngữ chính
- Rust
- Star
- 2
- Fork
- 7
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của OpenDevicePartnership/tmp108
-
audit:SBOS663A bug impact:field-visible
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
audit:SBOS663A bug documentation impact:field-visible verdict:contradicts
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
audit:SBOS663A bug enhancement impact:documentation
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
-
audit:SBOS663A impact:latent question verdict:unsupported
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Tất cả issue của OpenDevicePartnership/tmp108
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
rubys/roundhouse#1917 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[cosmic-applet-battery] Division by zero displays NaN% when UPower reports max_brightness = 0Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
pop-os/cosmic-applets#1619 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
binding:python bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày