-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch supertype of CodeUnits from DenseVector to AbstractVector #54002
base: master
Are you sure you want to change the base?
Conversation
This is a breaking change, but it was a bug that it subtyped `DenseVector` previsouly, as there is no guarantee that CodeUnits are stored densely in memory.
As mentioned in #53996, since this is a breaking bugfix, this needs a PkgEval + Nanosoldier run in case someone relied on its supertype. |
@nanosoldier @nanosoldier Can we do both in the same comment? |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. |
Nanosoldier report looks fine - some suspicious numbers for |
Those are a couple benchmarks going from 10ns on master to 20ns and the rest of the benchmarks on |
The package evaluation job you requested has completed - possible new issues were detected. |
There are some legitimate package errors in there: PyCall, StringViews, StrBase, Base58. |
This PR is too breaking. However, we have a (In 2.0?, we should probably just? remove DenseVector and make it a trait/interface) |
It is not enough to look at if a package tests starts to fail based on a change to call it a "legitimate package error". Many times, packages directly test the buggy behavior in the test itself which causes the error while the package code itself is completely fine. For example: StrBase is literally a direct call to Or StringViews.jl is directly testing the change that is done here: PyCall is also just a test that isn't testing any real functionality in the package https://github.com/JuliaPy/PyCall.jl/blob/2f600fbebee50ab0672e153455e3c0fda1694fba/test/runtests.jl#L563 I guess the people calling this "too breaking" just looked at the list of PkgEval results and decided it based upon that but as someone who has to do this a lot of releases, that is insufficient to make any decision at all. I would say that the current behavior is buggy, it should be changed, and the packages just need to tweak their tests a bit (not change any code in their package) to pass with this. |
Some of these failures are significant. The failures you link to, which seem less significant, are just the first to fail in their test suite.
StrBase though, does pass its tests when removing that one test for |
I agree with Kristoffer (I can't make that triage time :( ). This is a bug, not a behaviour change we are doing willy nilly, if someone expects codeunits do be a dense vector and it's not that's UB, i.e passing it to a C function which then might segfault. |
is there some reason triage's suggested fix wouldn't also fix the bug? |
IMO triages change is more breaking and more subtle because it seems it would basically that that codeunits doesn't take an AbstractString as it's argument but something like a |
That seems less likely to actually break existing code -- is there even any extant nontrivially used |
I mean, the point of this PR was precisely to do this experiment. It is one possible fix, but not necessarily the fix.
Yes. The issue in #53996 is InlineStrings.jl — those are backed by non-mutable structs that don't necessarily land on the heap with a memory address. They do have support for grabbing a pointer through a It's very much worth noting that
|
so the triage suggested change would be to define |
Looking through current uses of the type specifically, it seems like It really seems like packages are using So that's at the root of the question, really. Is |
Originally, So, given that:
I think we should consider |
From triage:
|
I'll keep this PR open, so it can be revisited later when the situation changes w.r.t. the isdense trait |
This is a breaking change, but it was a bug that it subtyped
DenseVector
previsouly, as there is no guarantee that CodeUnits are stored densely in memory.Test failures currently seem unrelated
See #53996