Median aggregation overflows for large finite middle values
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- data
調査の方向性
packages/table-core/src/features/row-aggregation/aggregationFns.ts の中央値計算と、issue に記載された対象を絞った Vitest 回帰テストから始めてください。計算が、大きな有限値のペアと、サブノーマル値、ゼロ、NaN、無限大の入力をどのように処理するか確認してください。オーバーフローのケースで有限の中央値が返され、列挙された対照ケースで既存の動作が維持されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 28.5k
- フォーク
- 3.6k
- 平均マージ
- 18時間 5分
- マージ済み PR(30日)
- 12
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/table のほかの issue
-
Column resize does not end if mouseup is missed (screenshot, switching tabs)対応中かも @lx3133584 が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
svelte-table: controlled expanded and pagination state resets straight after every change対応中かも @NickSpag が 15 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
TanStack/table#6601 · コメント 5 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Cast required to access custom options when defining a custom plugin/feature対応中かも @sorena-paydar が 46 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
`aggregatedCell` not typed against bound `cellComponents` in `createAppColumnHelper`対応中かも @cpruijsen が 56 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
Add: ESP 2 ROオープンapproved check:passed streams:add
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
ipaas: Configure form shows "Deploy to apply." and "Overrides selected Link" when they don't applyオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
wso2/integration-control-plane#1118 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
UTDNebula/utd-notebook#311 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
binding:python bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信