Skip to content

Fix broadcast failure for VectorOfArray with SVector{1} - #406

Merged
ChrisRackauckas merged 3 commits into
SciML:masterfrom
huiyuxie:fix
Oct 29, 2024
Merged

ChrisRackauckas merged 3 commits into
SciML:masterfrom
huiyuxie:fix

Conversation

@huiyuxie

@huiyuxie huiyuxie commented Oct 28, 2024 •

Copy link
Copy Markdown
Contributor

Fix #378.

The corner case was considered but was never included in tests, so the error was not caught during development.

@huiyuxie

Copy link
Copy Markdown
Contributor Author

Approval is required @ChrisRackauckas

@jlchan

jlchan commented Oct 28, 2024

Copy link
Copy Markdown
Contributor

Out of curiosity @huiyuxie, does the MWE in #378 work under this PR?

@huiyuxie

Copy link
Copy Markdown
Contributor Author

Yes it worked locally and I added it to the tests. But the CI seems need approval to be triggered.

@jlchan

jlchan commented Oct 28, 2024 •

Copy link
Copy Markdown
Contributor

Thanks for checking! Lets be patient; Chris is very responsive to PRs and will approve the workflow, he just gets a ton of PRs/issues/messages between all the packages in the SciML ecosystem.

@huiyuxie

Copy link
Copy Markdown
Contributor Author

Sure 👌

@ChrisRackauckas

Copy link
Copy Markdown
Member

https://github.com/SciML/RecursiveArrayTools.jl/actions/runs/11546823342/job/32141320198?pr=406#step:6:419

Looks like this gets a test failure. Look at LTS since the non-LTS inference failure has not been investigated.

@huiyuxie

Copy link
Copy Markdown
Contributor Author

Thanks! Looks like my version doesn’t work for constant broadcasting. I’ll fix it tomorrow.

Comment thread src/vector_of_array.jl
arr_type = StaticArraysCore.similar_type(dest[:, i])
dest[:, i] = if length(unpacked) == 1
dest[:, i] = if length(unpacked) == 1 && length(dest[:, i]) == 1
arr_type(unpacked[1])

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added one more condition to deal with our special case - it worked in my place please rerun CI @ChrisRackauckas

There might be room for improvement, but for now, I just need to make it pass all tests.

@huiyuxie

Copy link
Copy Markdown
Contributor Author

@jlchan

jlchan commented Oct 28, 2024

Copy link
Copy Markdown
Contributor

https://github.com/SciML/RecursiveArrayTools.jl/actions/runs/11562374105/job/32187348125?pr=406 This error seems not related to this PR

Just to double check, does the same error show up on a “dummy” PR too?

@huiyuxie

Copy link
Copy Markdown
Contributor Author

Just to double check, does the same error show up on a “dummy” PR too?

Yes before I ran this branch I also tested master branch forked from upstream master - it showed this error

@ChrisRackauckas

Copy link
Copy Markdown
Member

It just needed a rebase, and seems fine now on v1.10. I'll track down the inference issue separately.

@ChrisRackauckas
ChrisRackauckas merged commit 3819dee into SciML:master Oct 29, 2024
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.

Broadcasted assignment fails for VectorOfArray(Array{<:SVector{1}})

3 participants