Median aggregation overflows for large finite middle values
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 68/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript
- Domínio
- data
Direção de pesquisa
Comece pelo cálculo da mediana em packages/table-core/src/features/row-aggregation/aggregationFns.ts e pelos testes de regressão focados do Vitest descritos na issue. Verifique como o cálculo lida com pares de valores finitos grandes junto com entradas subnormais, zero, NaN e infinito. O trabalho estará concluído quando os casos de overflow retornarem medianas finitas e os controles listados mantiverem o comportamento atual.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 28.5k
- Forks
- 3.6k
- Merge médio
- 18h 5min
- PRs com merge (30d)
- 12
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de TanStack/table
-
Column resize does not end if mouseup is missed (screenshot, switching tabs)Talvez já em andamento @lx3133584 assumiu hoje. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
Mantenedores costumam responder em até 1 dia
-
svelte-table: controlled expanded and pagination state resets straight after every changeTalvez já em andamento @NickSpag assumiu há 15 dias. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 38/100
TanStack/table#6601 · 5 comentários · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
Cast required to access custom options when defining a custom plugin/featureTalvez já em andamento @sorena-paydar assumiu há 45 dias. Aberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
Mantenedores costumam responder em até 1 dia
-
`aggregatedCell` not typed against bound `cellComponents` in `createAppColumnHelper`Talvez já em andamento @cpruijsen assumiu há 56 dias. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
Todas as issues de TanStack/table
Issues semelhantes
-
Add: ESP 2 ROAbertaapproved check:passed streams:add
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
Mantenedores costumam responder em até 1 dia
-
ipaas: Configure form shows "Deploy to apply." and "Overrides selected Link" when they don't applyAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
wso2/integration-control-plane#1118 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
UTDNebula/utd-notebook#311 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
binding:python bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia