-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Backports for 1.12.0-beta2 #58009
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
Backports for 1.12.0-beta2 #58009
Conversation
Makes the sysimage more resistant to method invalidation, when defining a new `Integer` subtype with a right bitshift method. (cherry picked from commit 69a22cf)
… defined) (#57925) Fixes a discrepancy between the code in C before #57230 and in Julia afterwards, making sure to sequence these method definitions correctly. Not sure how to write a reliable test since it is specific to when this generated function is defined relative to the helpers used by this thunk, but the issue/fix is visible with: ``` $ ./julia -e 'code_lowered(ntuple, (Returns{Nothing}, Val{1000000}))' ``` Fix #57301 (cherry picked from commit a3c48d7)
Without this change `prevpow` and `nextpow` fail for, e.g., `BigInt`; incorrectly throwing a `MethodError`. For example, calls like `prevpow(3, big"10")` or `nextpow(3, big"10")` fail. The issue is that the code incorrectly assumes the existence of a `typemax` method. Another issue was a missing promote for the arguments of a `mul_with_overflow` call. Fixes #57906 (cherry picked from commit 3627a85)
… to 4e7c3f4 (#58031) Stdlib: LinearAlgebra URL: https://github.com/JuliaLang/LinearAlgebra.jl.git Stdlib branch: release-1.12 Julia branch: backports-release-1.12 Old commit: f0f7a46 New commit: 4e7c3f4 Julia version: 1.12.0-beta1 LinearAlgebra version: 1.12.0 Bump invoked by: @dkarrasch Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: JuliaLang/LinearAlgebra.jl@f0f7a46...4e7c3f4 ``` $ git log --oneline f0f7a46..4e7c3f4 4e7c3f4 Backports release v1.12 (#1237) e909af2 Before running any `@allocations` tests, run the workload 2ce3f73 Move `alg` to a keyword argument in symmetric eigen (#1214) 4f203c3 Make use of `mul` indirection (#1215) ``` Co-authored-by: dkarrasch <26658441+dkarrasch@users.noreply.github.com>
After #55575, inference for basic statements got inlined into `typeinf_local`. But external abstract interpreters like JET.jl need to overload this inference to customize this behavior. So this commit extracts the inlined inference logic back out into a separate `abstract_eval_basic_statement` method.
Edge invalidations of the form ```julia Package InvalidA: module InvalidA f(::Integer) = 1 invokesfs(x) = invoke(f, Tuple{Signed}, x) end Package InvalidB: module InvalidB using InvalidA InvalidA.invokesfs(1) # precompile end ``` used as ```julia using PkgA InvalidA.f(::Signed) = 4 using PkgB ``` did not formerly attribute a "cause": ``` ... Tuple{typeof(InvalidA.f), Signed} "insert_backedges_callee" CodeInstance for MethodInstance for InvalidA.invokesfs(::Int64) nothing ... ``` This fills in the new method that replaced the previous dispatch. --------- Co-authored-by: Jameson Nash <vtjnash@gmail.com> (cherry picked from commit 15e0deb)
Closes #57376 Closes #34037 - Adds a lock in `SimpleLogger` and `ConsoleLogger` for use on maxlog tracking and stream writes to improve threadsafety. Closely similar to #54497 - Turns the internal `_min_enabled_level` into a `Threads.Atomic`. There are [some direct interactions](https://juliahub.com/ui/Search?type=code&q=_min_enabled_level&w=true) to this internal in the ecosystem, but they should still work ``` julia> Base.CoreLogging._min_enabled_level[] = Logging.Info+1 LogLevel(1) ``` - Brings tests over from #57448 Performance seems highly similar: ### Master ``` julia> @time for i in 1:10000 @info "foo" maxlog=10000000 end [ Info: foo ... 0.481446 seconds (1.33 M allocations: 89.226 MiB, 0.49% gc time) ``` ### This PR ``` 0.477235 seconds (1.31 M allocations: 79.002 MiB, 1.77% gc time) ``` (cherry picked from commit 9af9650)
(cherry picked from commit 75d5588)
- Use `local` where variable names accidentally overlapped and caused boxes - Use `@lock` to avoid closures - Move out some recursive closures to top-level normal function to avoid boxing them - Use explicit boxes (`Ref`) instead of relying on the typeassert on the `Core.Box` because it it hard to determine if a `Core.Box` is benign or not. - Only assign to `io` once to avoid boxing it. - Type assert some `Tuple{Int, Int}` on `IO`. The two remaining boxes after this is `t_print` and `monitor_std`. (cherry picked from commit 4a3eba3)
By moving the optional `assume_bindings_static` refinement logic into `abstract_eval_partition_load` and removing the redirect via `abstract_eval_globalref_partition`. Also adds test cases with `assume_bindings_static=true`.
also add more fast path.
(cherry picked from commit d9764d6)
We already have an excellent framework for selective code reuse, so use that tool instead of a sledgehammer for inserting selective coverage and malloc instrumentation. As a small bonus, this should also be significantly more accurate by not being vulnerable to precompilation inserting incorrect (uninstrumented) contents into the caches. (cherry picked from commit 5fedf47)
I've created an [Install](https://julialang.org/install/) page separate from the [Downloads](https://julialang.org/downloads/) page on the website. This updates various references to point to the correct pages. (cherry picked from commit 48660a6)
(cherry picked from commit caa97c9)
fd8213d
to
9d454dc
Compare
A Julia thread runs Julia's scheduler in the context of the switching task. If no task is found to switch to, the thread will sleep while holding onto the (possibly completed) task, preventing the task from being garbage collected. This recent [Discourse post](https://discourse.julialang.org/t/weird-behaviour-of-gc-with-multithreaded-array-access/125433) illustrates precisely this problem. A solution to this would be for an idle Julia thread to switch to a "scheduler" task, thereby freeing the old task. This PR uses `OncePerThread` to create a "scheduler" task (that does nothing but run `wait()` in a loop) and switches to that task when the thread finds itself idle. Other approaches considered and discarded in favor of this one: #57465 and #57543. (cherry picked from commit 0d4d6d9)
This unfortunately passed tests because it segfaults (sometimes) on another thread while the main thread successfully executes. Soon we'll have a general solution for tasks but this fixes it for now. (cherry picked from commit df1b07e)
For model simplicity (and eventually for better unspecialized compilation), try to backdate initial module operations back to world 0 if nobody could have observed them before (no using statements depend on the module yet), rather than putting each incremental operation in a separate, but unobserved (and unobservable) world increment. (cherry picked from commit 3e063f6)
After: ``` julia> convert(Core.Binding, GlobalRef(Base, :Intrinsics)) Binding Base.Intrinsics 617:∞ - implicit `using` resolved to constant Core.Intrinsics 0:616 - undefined binding - guard entry julia> convert(Core.Binding, GlobalRef(Base, :Math)) Binding Base.Math 22128:∞ - constant binding to Base.Math 0:22127 - backdated constant binding to Base.Math ``` There is a bit of trickiness here. In particular, the question is, "when do we check" whether the partition next to the one we currently looked at happens to have the same implicit resolution as our current one. The most obvious answer is that we should do it on access, but in practice that would require essentially scanning back and considering every possible world age state at every lookup. This is undesirable - the lookup is not crazy expensive, but it can add up and most world ages we never touch, so it is also wasteful. This instead implements a different approach where we only perform the resolution for world ages that somebody actually asked about, but can then subsequently merge partitions if we do find that they are identical. The logic for that is a bit involved, since we need to be careful to keep the datastructure valid at every point, but does address the issue. Fixes #57923 (cherry picked from commit 1c3878c)
@nanosoldier |
The package evaluation job you requested has completed - possible new issues were detected. Report summary❗ Packages that crashed15 packages crashed only on the current version.
✖ Packages that failed433 packages failed only on the current version.
23 packages failed on the previous version too. ✔ Packages that passed tests1 packages passed tests only on the current version.
49 packages passed tests on the previous version too. |
- add missing `@nospecialize` annotation - add more type annotations to functions - fixed capturing uninferrable variables
(cherry picked from commit 7341098)
Changed the `::Function` signature to the `::F where F` pattern to allow specialization of `scan_specified_partitions`. The changes in `scan_leaf_partitions` and `scan_partitions` are not actually necessary because those methods are simple and are basically inlined and optimized down to calling `scan_specified_partitions`. However, considering the possibility of other code being added in the future and also for consistency, the same changes were applied. (cherry picked from commit 39d7483)
Makes this query more accurate for the rare nonfunction_mt dispatch, but otherwise not expected to be a visible change. (needed for future followup work, so splitting this out into a small change since it can be done independently) (cherry picked from commit fb31b3c)
(cherry picked from commit 4766133)
# Overview As we add REPL features, bugs related to the ad-hoc parsing done by `REPLCompletions.completions` have crept in. This pull request replaces most of the manual parsing (regex, `find_start_brace`) with a new approach that parses the entire input buffer once, before and after the cursor, using JuliaSyntax. We then query the parsed syntax tree to determine the kind of completion to be done. # Changes - New, JuliaSyntax-based completions mechanism. - The `complete_line` interface now has the option of replacing arbitrary regions of text in the input buffer by returning a `Region` (`Pair{Int, Int}` for consistency with the convention in LineEdit, and `pos` being a 0-based byte offset). - Fixes parsing-related bugs: - fix #55420 - fix #55429 - fix #55518 - fix #55520 - fix #55842 - fix #56389 - fix #57307 - fix #57611 - fix #57624 - fix #58099 - Fixes some bugs that exist on 28d3bd5 that were found by fuzzing: - `x \"` + `TAB` throws a `FieldError` exception - String completion would sometimes delete the entire input buffer. - Completions should not happen inside comments. - The duplicate code for path completion in strings, `Cmd`-strings, and the shell has been removed, causing paths to complete the same way for all three. Now, `~` is expanded in two situations: - If `foo` exists, or if `foo` does not exist but there are no possible completions: ``` "~/foo/b|" =TAB=> "~/foo/bar|" "~/foo/bar|" =TAB=> "/home/user/foo/bar|" OR "~/foo/bar"| =TAB=> "/home/user/foo/bar"| ``` - If the current path ends with a `/` and you hit TAB again: ``` "~/foo/|" =TAB=> "/home/user/foo/|" OR "~/foo/"| =TAB=> "/home/user/foo/"| ``` # Future work - Method completions could be changed to look for methods with exactly the given number of arguments if the closing `)` is present, and search for signatures with the right prefix otherwise. - It would be nice to be able to search by type as well as value (perhaps by putting `::T` in place of arguments). - Other REPL features could benefit from JuliaSyntax, so it might be worth sharing the parse tree between completions and other features: - Emacs-style sexpr navigation: `C-M-f`/`C-M-b`/`C-M-u`, etc. - Improved auto-indent. - It would be nice if hints worked even when the cursor is between text. - `CursorNode` is a slightly tweaked copy of `SyntaxNode` from JuliaSyntax that tracks the parent node but includes all trivia. It is used with `seek_pos`, which navigates to the innermost node at a given position so we can examine nearby nodes and the parent. This could probably duplicate less code from JuliaSyntax. (cherry picked from commit ff0a931)
After discussion with Cody, this is an attempt at a more minimal version of #56194. The intent is to work around the invalidation issue introduced by the split design with AnnotatedStrings, resolving the headache for 1.12. Paired with JuliaLang/StyledStrings.jl#115 Many thanks to @topolarity for working out this approach, the discussion on balancing the short/long term fixes for this issue. ------ From my understanding of the problem, this should fix the `write`/`print`/`show` invalidations, but this needs to be checked. --------- Co-authored-by: Cody Tapscott <topolarity@tapscott.me> (cherry picked from commit 6d78a4a)
This commit removes `jl_reinit_ccallable` whose purpose is unclear. Specifically, the function re-adds C-callable functions to the execution engine during the loading of sysimages/pkgimages, but the consensus is that the function is largely unnecessary because `ccall` can find symbols via `dlsym`. The function's only apparent use case is a contrived `llvmcall` example, only because we currently don't add the sysimage symbols to the JIT, but we could do anyway. `llvmcall` has always been experimental, and if it is truly needed, the functionality for finding the symbols should be properly implemented later.
Backported PRs:
append_c_digits
: typeassertInt
to improve inference #57950string
(which is not always defined) #57925nextpow
,prevpow
for types withouttypemax
#49669@time_imports
@trace_compile
@trace_dispatch
#58011invokelatest
#58056reverse!
#58086--project=@script
when outside script directory #56351IOBuffer
skip
regression #57963abstract_eval_globalref
#58026jl_set_precompile_field_replace
for 0-size fields #58155scan_specified_partitions
#58165Need manual backport:
reinit_ccallable
#56987Non-merged PRs with backport label:
bind
inChannel
method doc string #58113IteratorSize
method forGenerator
#58110transcode
: prevent Windows sysimage invalidation #58038@nospecialize
forstring_index_err
#57604maxthreadid
fromThreads
#57490