Repository navigation
Join chunk element types in ChainedVector map like Base's map - #139
Open
quinnj-bot[bot] wants to merge 2 commits into
Open
quinnj-bot[bot] wants to merge 2 commits into
quinnj-bot[bot] wants to merge 2 commits into
Conversation
Fails on main; passes with the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
map promoted chunks with different result eltypes with promote_type,
which converts Int to Float64 and can lose precision, while Base's map
joins element types. Join chunk eltypes with Base.promote_typejoin and
convert only to that type. With no chunks, map an empty Vector{T} so
the result eltype matches Base.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
quinnj-bot
Bot
force-pushed
the
claude/chainedvector-map-eltype
branch
from
November 19, 2026 06:32
da386b2 to
a140a75
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A
ChainedVectorshould give the same answers as the same data in aVector.mapmapped each chunk and then joined the chunks with numeric promotion. When the chunks produced different element types, values were converted, which can lose precision. The result eltype also differed from Base'smap, which joins types without converting:mapon aChainedVectorwith no chunks also threwMethodErrorwhen Julia could not infer the mapped chunk type.What changed
mapjoins the chunk eltypes withBase.promote_typejoin, the rule Base'smapuses for element types, and converts only to that joined type.mapmaps an emptyVector{T}to get Base's result eltype.Scope
Blast radius
Code that relied on
mappromoting mixed Int and Float chunks toFloat64now gets the same eltype asmapover aVector.Verification
mainand passes on this branch (Julia 1.12.6).convertreturns them unchanged.ChainedVector,SentinelVector, andMissingVector, compared withVector) reports this mismatch onmainand not with the fixes applied.🤖 Generated with Claude Code