Median aggregation overflows for large finite middle values
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ó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- data
Hướng nghiên cứu
Bắt đầu với phép tính trung vị trong packages/table-core/src/features/row-aggregation/aggregationFns.ts và các bài kiểm thử hồi quy Vitest tập trung được mô tả trong issue. Kiểm tra cách phép tính xử lý các cặp giá trị hữu hạn lớn cùng với đầu vào dưới chuẩn, bằng không, NaN và vô cực. Công việc hoàn tất khi các trường hợp tràn số trả về trung vị hữu hạn và các trường hợp đối chứng được liệt kê vẫn giữ nguyên hành vi hiện tại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
TanStack Table version
@tanstack/table-core 9.3.1, main at c14e0221b1e656c7bb35e7b3d4cdf188719a3599.
Framework/Library version
Framework-independent aggregation API; reproduced with Node 24.19.0.
Describe the bug and the steps to reproduce it
The even-length median adds the two middle values before dividing by two. That intermediate addition can overflow even when the median is finite and representable.
For example, the median of [Number.MAX_VALUE, Number.MAX_VALUE] is Number.MAX_VALUE, but the current implementation returns Infinity. The negative equivalent returns -Infinity. Unequal large finite pairs have the same issue.
The fix should also preserve tiny/subnormal results: always dividing both operands first would turn the median of [Number.MIN_VALUE, Number.MIN_VALUE] into zero. The existing zero, NaN and infinity behavior should remain unchanged.
Your Minimal, Reproducible Example
Run this with Node 24 from a checkout; this source module only has type imports and needs no framework setup:
import { aggregationFn_median } from './packages/table-core/src/features/row-aggregation/aggregationFns.ts'
const context = values => ({
rows: values.map(value => ({ value })),
getValue: row => row.value,
})
console.log(aggregationFn_median.aggregate(context([
Number.MAX_VALUE,
Number.MAX_VALUE,
]))) // Infinity; expected Number.MAX_VALUE
Source of the current median calculation.
Four focused Vitest overflow regressions fail on main, while six controls pass (opposite signs, subnormal values, ordinary numbers, signed zero and non-finite inputs).
Do you intend to try to help solve this bug with your own PR?
Yes. I am preparing a small fallback for intermediate overflow and will complete the repository's required checks before opening a PR.
- Ngôn ngữ chính
- TypeScript
- Star
- 28.5k
- Fork
- 3.6k
- Merge trung bình
- 18 giờ 5 phút
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- 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 TanStack/table
-
Column resize does not end if mouseup is missed (screenshot, switching tabs)Có thể đã có người làm @lx3133584 đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
svelte-table: controlled expanded and pagination state resets straight after every changeCó thể đã có người làm @NickSpag đã nhận 15 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
TanStack/table#6601 · 5 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Cast required to access custom options when defining a custom plugin/featureCó thể đã có người làm @sorena-paydar đã nhận 45 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`aggregatedCell` not typed against bound `cellComponents` in `createAppColumnHelper`Có thể đã có người làm @cpruijsen đã nhận 56 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TanStack/table
Issue tương tự
-
Add: ESP 2 ROĐang mởapproved check:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ipaas: Configure form shows "Deploy to apply." and "Overrides selected Link" when they don't applyĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
wso2/integration-control-plane#1118 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
File reporting form UI DesignĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
UTDNebula/utd-notebook#311 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ 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 1 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