Skip to content

Size adapted operations over their full axes - #6240

Closed
xkykai wants to merge 1 commit into
mainfrom
xk/size-of-adapted-operations
Closed

xkykai wants to merge 1 commit into
mainfrom
xk/size-of-adapted-operations

Conversation

@xkykai

@xkykai xkykai commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #6237. Fixes the docs build, which has failed since #6228 in examples/global_wind_driven_gyres.jl: argmin of a field on a GPU TripolarGrid failed to compile (InvalidIRError, jl_f_throw_methoderror).

size(::AbstractField) uses indices(f), but operations adapted for a kernel see their fields' indices as nothing, so axes → size inside the broadcast kernel of findmin/findmax indexed nothing. size now falls back to the full axes through axes_indices, as axes already does.

grid = TripolarGrid(GPU(); size = (8, 10, 1), z = (0, 1))
c = Field{Center, Center, Nothing}(grid)
set!(c, (λ, φ) -> φ)
argmin(c) # InvalidIRError on main

🤖 Generated with Claude Code

Fields adapted for a kernel drop their indices, so the size of an
operation on such a field indexed `nothing` inside a broadcast kernel,
e.g. in `findmin` of a field on a `TripolarGrid` on the GPU. Size now
falls back to the full axes as `axes` already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xkykai
xkykai marked this pull request as ready for review October 13, 2026 02:46
@xkykai
xkykai requested review from giordano and navidcy and removed request for navidcy October 13, 2026 02:46
@xkykai

xkykai commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

close as duplicate of #6238!

@xkykai xkykai closed this Oct 13, 2026
@giordano
giordano deleted the xk/size-of-adapted-operations branch October 13, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Since #6228 the global_wind_gyres.jl example seems to break

1 participant