https://github.com/JuliaLang/julia

sort by:
Revision Author Date Message Commit Date
c1bf6b1 alignment-hack jl_task_t to bring it back from the size 400 to the size 368 pool 13 February 2024, 19:34:59 UTC
ba34d89 Add `conj!` for arrays of arrays (#53303) Apparently, `broadcast!(conj!, A, A)` is not allocation-free, so I spelled it out, but perhaps there's a more elegant solution. 13 February 2024, 15:33:06 UTC
d7b9ac8 change IOBuffer to use Memory internally (#53192) An Array is often still allocated on output, but this gives the compiler a chance to potentially elide that in certain cases. For measurement, it seems about 10% faster as a string builder: ``` julia> @btime repr("hello\nworld"^10); 1.096 μs (10 allocations: 640 bytes) # master 973.000 ns (9 allocations: 608 bytes) # PR 994.000 ns (8 allocations: 576 bytes) # also PR, after Revise-ing Base.wrap ``` 13 February 2024, 15:32:15 UTC
81c3474 Revert "More consistent return value for annotations" (#53309) Reverts JuliaLang/julia#53281 as it appears to have broken CI on all subsequent commits: https://github.com/JuliaLang/julia/pull/53281#issuecomment-1938071915 According to the CI logs, it is this test that aborts early on in the rr-trace log: ``` Pkg.test(TEST_PKG.name; coverage = coverage_path) ``` 13 February 2024, 14:45:02 UTC
d211398 Fix FileWatching tests on FreeBSD (#53307) #49937 optimistically enabled some file watcher tests on FreeBSD due to changes made in libuv that suggested it should work, but unfortunately it does not. 13 February 2024, 12:43:21 UTC
38065a4 Set LLVM issue tracker URL to Julia's issue tracker (#53128) This patch sets the default issue tracker URL for LLVM to Julia's issue tracker. LLVM issues coming from Julia should probably go through Julia's issue tracker first and then can be reported upstream if there is an issue with something in upstream LLVM. Having this set to the default is moderately confusing for users as it refers to the LLVM issue tracker, which probably isn't wanted. 13 February 2024, 04:26:46 UTC
69f16a2 Update logging.jl to add docstrings for exported symbols (#53299) This is a part of issue #52725. 13 February 2024, 02:19:55 UTC
54e9728 llvmunwind: use LLVM_PATH instead of LLVM_CONFIG_PATH variable (#53304) with llvm-16, the `--src-root` argument of llvm-config has been removed. see https://github.com/llvm/llvm-project/commit/c061892fcdbdfe46884c54a7a7bfe6df54d1df12 but `llvmunwind` was using it for configuration. so prefer to use `LLVM_PATH` and explicitly pass the llvm source directory. 13 February 2024, 02:18:25 UTC
1fd0981 Trim hash map size when pruning type caches (#53296) This doesn't make much of a difference for the smaller type caches (many of which have exactly 1 element actually), but it does offer up to ~75% savings (8192 -> 2048, 4096 -> 512) for some of the larger type caches in our sysimage. 13 February 2024, 02:17:37 UTC
75cb2a5 eliminate the dead `iterate` branch in `_unsafe_(get)setindex!`. (#52809) It's sad that compiler can't do this automatically. Some benchmark with `setindex!`: ```julia julia> a = zeros(Int, 100, 100); julia> @btime $a[:,:] = $(1:10000); 1.340 μs (0 allocations: 0 bytes) #master: 3.350 μs (0 allocations: 0 bytes) julia> @btime $a[:,:] = $(view(LinearIndices(a), 1:100, 1:100)); 10.000 μs (0 allocations: 0 bytes) #master: 11.000 μs (0 allocations: 0 bytes) ``` BTW optimization for `FastSubArray` introduced in #45371 still work after this change as the parent array might have their own `copyto!` optimization. 13 February 2024, 02:16:16 UTC
e8bf9bc Add more @showarg examples (#52410) Adds a few more examples to show how `@showarg` works with literals and interpolated string expressions. 13 February 2024, 02:12:56 UTC
dba215f Strengthen docs for `reinterpret` (#52157) As suggested in #52135, I've added some to the `reinterpret` docs. 13 February 2024, 02:11:58 UTC
e6992f7 Add `Iterators.cycle(iter, n)` (#47354) At present `Iterators.repeated(iter, n)` is the lazy cousin of `fill(iter, n)`, but there is no iterator for `repeat(iter, n)`. This PR proposes that `Iterators.cycle(iter, n)` should fill that role. This relates to the one-argument form in the same way as `Iterators.repeated`. That is, `cycle(iter)` means `cycle(iter, Inf)` in the same way that `repeated(iter)` means `repeated(iter, Inf)`... or would be if Inf were an integer. The implementation uses `flatten(repeated(xs, n))`. It could instead use `take(cycle(xs), n * length(xs))` but that only works when the contents has known length. `take(cycle...)` tends to be faster, perhaps it should be used when possible? Some timing below. But perhaps this detail is a secondary question. <details> ```julia julia> takecycle(x, n::Int) = Iterators.take(Iterators.cycle(x), n * length(x)); julia> flatrep(x, n::Int) = Iterators.flatten(Iterators.repeated(x, n)); # as in PR, first commit julia> takecycle(1:10, 100) |> length 1000 julia> flatrep(1:10, 100) |> Base.haslength # and won't be helped by 47353 false julia> @btime collect(takecycle(1:10, 100)); min 1.642 μs, mean 2.554 μs (1 allocation, 7.94 KiB) julia> @btime collect(flatrep(1:10, 100)); min 6.617 μs, mean 9.107 μs (6 allocations, 21.86 KiB) julia> flatrep(Tuple(1:10), 100) |> Base.haslength # behaves better with tuples, but not faster: true julia> @btime collect(takecycle($(Tuple(rand(10))), 100)); min 1.100 μs, mean 1.977 μs (1 allocation, 7.94 KiB) julia> @btime collect(flatrep($(Tuple(rand(10))), 100)); min 10.458 μs, mean 11.220 μs (1 allocation, 7.94 KiB) ``` </details> 13 February 2024, 01:50:05 UTC
56e193e tempdir: error on non-directory result (#33593) Potential more graceful handling of https://github.com/JuliaLang/julia/issues/33382. I thought about creating the directory if it doesn't exist, but that seems aa bit questionable. Probably better to let the user know about the situation in a clear way so they can mitigate it. An even better improvement would be if we could tell them which environment variable to look at. I tried setting `TEMP` in the environment on macOS but it didn't seem to have any effect on the result. --------- Co-authored-by: Jameson Nash <vtjnash@gmail.com> Co-authored-by: Dilum Aluthge <dilum@aluthge.com> 13 February 2024, 00:12:46 UTC
81c6526 Fix typo in `Sys.total_memory` docstring. (#53301) Fixes #53298. 12 February 2024, 18:44:06 UTC
f8d5947 Documentation update for LinearAlgebra functions (#52934) Documentation update for LinearAlgebra functions, see #52725 - [X] Pivoting strategies - [X] `NoPivot` - [X] `RowNonZero` - [X] `ColumnNorm` - [X] `RowMaximum` - [X] Matrix multiplication functions - [X] `copy_transpose!` - [X] `copyto!` Note: `copyto!` is not mentioned in the original issue. However, it is felt that `copy_transpose!` without the complementing `copyto!` will be confusing for a reader. - [X] Exceptions - [X] `LAPACKException` - [X] `RankDeficientException` Co-authored-by: Steven G. Johnson <stevenj@mit.edu> Co-authored-by: Daniel Karrasch <daniel.karrasch@posteo.de> 12 February 2024, 17:21:15 UTC
29a58d5 Improve docstrings for `Int`, `Float64`, `^`, and friends (#45221) This extends the docs for `Int`, `Float64` etc, to * Note that Int is the default, mention that it can overflow * Explain what `1f0` means, and that Float64 is the default Similarly extends docs for `^`, `+`, `*` aiming to * Point out that `1.2 * 10^3` is a bad habit, warn about overflow * Give an example for what `literal_pow` is doing since the explanation is quite technical * Also point out overflow in `+`, as [suggested here](https://github.com/JuliaLang/julia/pull/45141#discussion_r862808888) * While there, mention that you can add vectors, and that vararg `+(1,2,3,4)` has a default binary behaviour * Similarly mention that vararg `*(1,2,3,4)` has a default order, from the left * While there, mention `1/2pi` and `v'v` as examples of `*`. --------- Co-authored-by: Lilith Orion Hafner <lilithhafner@gmail.com> 12 February 2024, 14:03:37 UTC
61bf208 follow up #52868 and fix up doc/src/base/base.md (#53294) 12 February 2024, 10:56:26 UTC
0a89164 Restrict vector indexing of views to 1-based ranges (#53249) This will be an offset array in general, so we need to restrict the method to 1-based ranges. This restores the behavior on `v"1.10"`. The method was added in #45371 12 February 2024, 02:14:23 UTC
d6396f1 doc: in constructors, note the correspondence with callable objects (#53051) 12 February 2024, 02:11:28 UTC
987d6f3 Update probes.md to remove workaround mention (#53160) Given #41616 merged, remove reference to it in doc example 12 February 2024, 01:43:52 UTC
8500356 Add more doc examples for `cat` (#47409) - `cat` 2 2D arrays - `cat` 2 3D arrays - `cat` 2 strings 12 February 2024, 01:41:41 UTC
a459926 Make zero on array of arrays etc apply recursively (#51458) I wonder if this breaks things, in practice. It shouldn't. Since old code behavior errored for the cases I am aware of. As discussed in #38064, this definition is needed to be consistent with our other linear algebra operations, and with us considering a vector of vectors etc as a vector space. Closes #38064 12 February 2024, 01:41:01 UTC
57f02bf Add `Lockable` to Base, to bundle a lock with its resource (#52898) I am not sure about a `lock(f, ::Lockable)` method: it is nice because it unpacks the value for you, but it is weird because it unpacks the value for you. For a `Lockable`, `f` must accept one argument, whereas for a `Lock`, `f` must be 0-arg. A `Lockable` is not `<:AbstractLock` here, so maybe this is allowed, but if we deleted this `lock` method, we could inherit from `AbstractLock` and just use the generic one (requiring folks to unpack the value within the locked region themselves, as is the case for `@lock`). I think it is preferred these days to use `@lock` anyway, so having the `lock(f, ::Lockable)` method may be of limited value anyway. I searched Base and came up with two places that could currently use this internally, `TEMP_CLEANUP` and `env_dict`. We didn't add them both as usages yet, to avoid external breakage from delaying this PR. Similarly, this is not exported yet, to avoid breakage with older releases of ConcurrentUtilities.jl. redo of https://github.com/JuliaLang/julia/pull/34400 First commit copied from https://github.com/JuliaServices/ConcurrentUtilities.jl/blob/main/src/lockable.jl, Closes #52897 Co-authored-by: Jacob Quinn <quinn.jacobd@gmail.com> Co-authored-by: Dilum Aluthge <dilum@aluthge.com> 12 February 2024, 01:33:29 UTC
a86edf1 Add existing 3-arg `*` docstring to the manual (#53288) PR #37898 added methods to `*` for chained matrix multiplication. They have a descriptive docstring but I don't think this is mentioned in the manual. 12 February 2024, 01:24:59 UTC
3412c86 Fix seekend method of AnnotatedIOBuffer (#53282) A minor oversight had it returning the underlying IOBuffer originally. 12 February 2024, 01:08:47 UTC
e1a76bb More consistent return value for `annotations` (#53281) This is a generally nice simplification, that tweaks the `annotations` API. It also requires the adjustment in https://github.com/JuliaLang/StyledStrings.jl/pull/38 to be made, hence the bump. 12 February 2024, 00:56:30 UTC
86c0191 Tests: rename Foo test pkg (#53289) Encountered another instance of a flaky `Foo.jl` test pkg which caused me trouble locally. Xref: https://github.com/JuliaLang/julia/issues/53103#issuecomment-1915458694 11 February 2024, 23:25:48 UTC
002f07a Improve the annotated join method and dispatch (#51914) With the initial implementation, join could work for AnnotatedStrings, however only when the eltype of the iterator or delim was itself a Annotated{String,Char}. This was better than nothing, but seems inconsistent in the face of mixed iterators. Furthermore, the implementation of an annotated join was far from optimised, relying on zipping and then calling annotatedstring(xs...). By contrast, the non-annotated implementation relies on printing to IO and even has manually defined alternative methods for optional arguments to minimise code generation. With the advent of AnnotatedIOBuffer and _isannotated, we can improve on both those aspects. The new AnnotatedIOBuffer type allows us to re-use the optimised join(::IO, ...) methods, and we can more reliably dispatch to them with _isannotated. Since this is a type-based decision, the Julia compiler is kind enough to work out which branch is taken at compile-time, making this zero-overhead in the unannotated case. 11 February 2024, 22:42:31 UTC
efa77cc Predicate versions of `allequal` & `allunique` (#47679) First, use `Iterators.peel` to improve `allequal(itr)` as suggested by jlapeyre in here: https://github.com/JuliaLang/julia/issues/47005#issuecomment-1276477572 After that, `allequal(f, xs) = allequal(f(x) for x in xs)` should never call `f` twice on the same `x`, nor more times than necessary. For `allunique`, at present this has a path which collects short iterators (<32) as this is faster than making a `Set`. Thus calling `allunique(f(x) for x in xs)` will sometimes call `f` more times than it has to. This PR doesn't change that, just adds a method `allunique(f, xs)`. Since generators tend to have eltype `Any`, it pays to use `Set{@default_eltype(C)}()` now. I think this ought to be safe. Finally, methods `allequal(f, xs::Tuple)` and `allunique(f, xs::Tuple)` seem to be worthwhile. [This gist](https://gist.github.com/mcabbott/69c0b85cdf0a37d97eecba3edb18bdc0) times a few variants. Closes #47005, and does the same for `allunique` 11 February 2024, 22:33:43 UTC
c4bec9a Missing tests for TwicePrecision (#34938) Co-authored-by: Tim Holy <tim.holy@gmail.com> 11 February 2024, 18:44:25 UTC
3560036 Docs: add `Logging.BelowMinLevel` and `Logging.AboveMaxLevel` to the manual page for the Logging stdlib (#52232) According to the source code file, `Logging.BelowMinLevel` and `Logging.AboveMaxLevel` are already part of the public API of the Logging stdlib: https://github.com/JuliaLang/julia/blob/c8ca350832030992fca113ed56d979b6a8ff7fd3/stdlib/Logging/src/Logging.jl#L85-L91 Additionally, Logging currently exports `BelowMinLevel` and `AboveMaxLevel`: https://github.com/JuliaLang/julia/blob/c8ca350832030992fca113ed56d979b6a8ff7fd3/stdlib/Logging/src/Logging.jl#L61-L81 However, `Logging.BelowMinLevel` and `Logging.AboveMaxLevel` are not currently in the manual. This PR adds them to the manual. --------- Co-authored-by: Jameson Nash <vtjnash@gmail.com> 11 February 2024, 18:43:47 UTC
1f1436d Prefer `# Examples` in docstrings (#53276) ... as suggested by the Julia manual and by `CONTRIBUTING.md` In one case `# Example` was dropped (instead of appending an `s`) because it was redundant. 11 February 2024, 18:16:40 UTC
790a4eb document exactness for `typeintersect(T, S)` when `T <: S` (#53283) As per the discussion in #53265. 11 February 2024, 18:16:25 UTC
a37d626 Clarify that command-line switches need to be manually set in `addprocs` (#50843) Co-authored-by: Max Horn <max@quendi.de> 11 February 2024, 15:52:54 UTC
37ed82b Mark codeinstance.specsigflags as atomic (#53275) A correctness fix from #53255 This shouldn't matter much as that field is only accessed from the runtime, but this synchronizes the C-header definition, with the Julia native definition. 11 February 2024, 14:08:13 UTC
af90dac Add unary negation in table of operator precedence and associativity (#49438) Co-authored-by: Jameson Nash <vtjnash@gmail.com> 11 February 2024, 03:56:08 UTC
b8540d1 [REPL] Fix typo in using/import completion (#53273) Co-authored-by: Keno Fischer <keno@juliahub.com> 11 February 2024, 03:53:23 UTC
4be67e4 export `IdSet` and document it (#53262) It feels kind of odd to have `IdDict` exported and documented and not `IdSet`. 11 February 2024, 01:34:59 UTC
a3e0b62 Use tagged CodeInstances for AbstractInterpreter caching (#52233) Currently external AbstractInterpreters all follow the pattern that `CACHE = IdDict{MethodInstance,CodeInstance}`. The NativeInterpreter has the benefit that each `MethodInstance` carries an inline cache of `CodeInstances`. `CodeInstances` pull triple duty, they contain validity information (`min_world`, `max_world`), the inference state cache and the compilation state cache. When we currently create a CodeInstance we don't record the owner and we thus construct detached CodeInstances. In this PR I introduce the notion of tagging the code instances with the owner (nothing meaning native), thus allowing foreign code instances to be stored in the inline cache. GPUCompiler/CUDA would change it's caching strategy from `IdDict{MethodInstance, CodeInstance}` to `IdDict{CodeInstance, LLVM.Module}` or similar. Ideally we would allow polymorphism for the compilation state part of the code instance, but that seems to invasive for now. This has the benefit that CodeInstances are handled by caching and it would allow us to cache inference results from foreign abstract interpreters across sessions. The downside is that the cache walk now is a bit slower since we need to filter on owner. If this turns out to be a large bottleneck we could bifurcate the cache on owner. Co-authored-by: Shuhei Kadowaki <aviatesk@gmail.com> 10 February 2024, 22:35:36 UTC
e5496e0 update libuv to v2-1.48.0 (#49937) Notable additions: - Linux now uses io_uring for many fs calls - Windows now supports WTF-8 - new cross-platform uv_clock_gettime API - Windows now emits a coredump when sending SIGQUIT, if configured - Windows now can execute file given by an exact path name that do not contain a `.` (unlike cmd.exe, which cannot) Closes #47611 Fixes #33486 10 February 2024, 20:26:47 UTC
604609a Add docstring to constants in `Base.Filesystem` (#53247) A first step towards https://github.com/JuliaLang/julia/issues/52725 for `Base.Filesystem`. 10 February 2024, 19:26:18 UTC
a78b8e3 bypass assignments in edit, code_warntype and friends (#52046) It was suggested in the original issue that the binding should still occur, but for consistency with `@edit f(2)` which doesn't actually call `f`, this does not. Fixes #20270 10 February 2024, 19:17:53 UTC
5114441 [GMP_jll] Upgrade to v6.3.0 (#53270) 10 February 2024, 19:10:09 UTC
a59f219 doc: float: add note for NaN compare with egal (#53194) Current documentation seems to imply that one should use `===` for NaN comparisons. But non-normalized NaNs will give unexpected results: `NaN32p1 !== NaN32`. 10 February 2024, 18:26:28 UTC
8e70bf1 Add documentation for some documentation forms. (#50679) There are a couple of documentation forms that are used in the wild but not covered by the documentation. Here I describe them. 10 February 2024, 18:23:09 UTC
65ffa79 `names` docstring: qualify non-exported cross-refs (#52745) It seems like cross-references to non-exported symbols, like `ispublic`, should be qualified — otherwise it is confusing since looking them up fails. Co-authored-by: Max Horn <max@quendi.de> 10 February 2024, 18:11:40 UTC
35768c2 Fix interpreter_exec.jl test (#53218) This test was supposed to check that we correctly handled PhiNodes in uninferred code in both the interpreter and the compiler. However, the compiler path wasn't actually exercised, because the `inferred=true` part of this forced it to be skipped. Drop that and fix the exposed issues in the compiler where we didn't handle PhiNodes properly. --------- Co-authored-by: Shuhei Kadowaki <aviatesk@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> 10 February 2024, 17:41:57 UTC
3a283d9 document Base.Chars arguments of startswith/endswith (#52741) Since Julia 0.3 (#6779), the `startswith` and `endswith` functions have accepted not only a string as the prefix/suffix, but also a character or a tuple/vector/set of characters. However, this wasn't fully documented. (The docstring actually mentioned vectors and sets of characters, but this was inconsistent with the given signature.) Also updates `Base.Chars` to allow `AbstractSet` types, not just `Set`, which seems to have been an oversight. 10 February 2024, 14:55:04 UTC
baa36e4 add --compiled-modules=strict option (#52174) This is useful for ensuring that all modules were precompiled successfully. 10 February 2024, 14:47:20 UTC
a333f1c Update `unique` and `unique!` docstrings to mention `hash` function (#52159) 10 February 2024, 09:44:38 UTC
5d9a472 additional clarification on cfunction embedding (#52315) Additional clarification to #45208 — in addition to some punctuation tweaks, I added a sentence noting that using `@cfunction` to construct and C function pointers, unlike `jl_call`, eliminates the overhead of dynamic dispatch. See also [this discourse thread](https://discourse.julialang.org/t/jl-call-function-call-latency/106791). 10 February 2024, 09:06:15 UTC
e177fc3 Fix sortperm(::OffsetRange) (#53208) 10 February 2024, 06:37:32 UTC
8922eaa Allow overriding default value of `JL_STACK_SIZE` (#53254) Occasionally, users may want to be able to customize the default per-task stack size. While this is a somewhat unusual thing to do, this plumbs through support for this to be set at the `Make.user` level, rather than having to modify `CFLAGS` or `src/options.h` directly. 10 February 2024, 03:48:27 UTC
bdf9830 Tests for isassigned for a SubArray (#53267) 10 February 2024, 03:46:32 UTC
7baaafe Truecolor terminal capability detection for Windows (#53257) ``` for i in 0:255 print("\x1b[38;2;$i;0;0m█") end ``` shows on Windows Terminal ![image](https://github.com/JuliaLang/julia/assets/7318249/d742b739-9645-4daa-8572-d4c28803013e) so it does have true-color support. With this PR, `Base.ttyhastruecolor()` returns `true` on Windows Terminal and Cygwin64 Terminal, those are the ones I tried out. Notes: https://devblogs.microsoft.com/commandline/24-bit-color-in-the-windows-console/ says > in Windows 10 Insiders Build # 14931, we’ve updated the Windows Console to support full, glorious 24-bit RGB true color! 10 February 2024, 03:45:25 UTC
3952e78 LU factorization: add allowsingular keyword argument (#52957) Currently the `check` argument of `lu` conflates failed factorization (invalid factors) and valid factorizations that have a rank-deficient factor, and the `show` value for the factorization is misleading in the latter case. This PR adds an `allowsingular` keyword argument to `lu` and the corresponding `issuccess` method to treat valid but rank-deficient factors as success. It also changes `show` to show the factors as usual in such cases, but with a "rank-deficient" note. The invalid vs rank-defficient factors are distinguished using negative `info` values in the rank-deficient case, as proposed in #27657. Fixes #27657 Co-authored-by: Daniel Karrasch <daniel.karrasch@posteo.de> Co-authored-by: Jishnu Bhattacharya <jishnub.github@gmail.com> 10 February 2024, 03:12:10 UTC
250916f Use StyledStrings for Logging (#51829) Transition from printstyled to the new approach to styling provided by StyledStrings. This both makes it possible for the styling used to be customised, and allows for other styled content to inherit/re-use the logging styles. 10 February 2024, 03:09:31 UTC
9284e57 Add `Vector{<:AbstractString}` method for `Cmd()` (#49531) Was annoyed that `Cmd` wouldn't take a vector containing SubStrings. So I here add a constructor that converts an `AbstractString` vector to `String`s. 10 February 2024, 03:08:04 UTC
5547305 Fix duplicate error when using generator in Dict (#53151) Fixes: #33147 Replaces/Closes: #40445 The difference here, compared to past implementations, is that we use the zero-cost `isiterable` check on every intermediate step, instead of wrapping the call in a try/catch and then trying to re-approximate the `isiterable` afterwards. Some samples: ```julia julia> Dict(i for i in 1:3) ERROR: ArgumentError: AbstractDict(kv): kv needs to be an iterator of 2-tuples or pairs Stacktrace: [1] _throw_dict_kv_error() @ Base ./dict.jl:118 [2] grow_to! @ ./dict.jl:132 [inlined] [3] dict_with_eltype @ ./abstractdict.jl:592 [inlined] [4] Dict(kv::Base.Generator{UnitRange{Int64}, typeof(identity)}) @ Base ./dict.jl:120 [5] top-level scope @ REPL[1]:1 julia> Dict(i => error("$i") for i in 1:3) ERROR: 1 Stacktrace: [1] error(s::String) @ Base ./error.jl:35 [2] (::var"#3#4")(i::Int64) @ Main ./none:0 [3] iterate @ ./generator.jl:48 [inlined] [4] grow_to! @ ./dict.jl:124 [inlined] [5] dict_with_eltype @ ./abstractdict.jl:592 [inlined] [6] Dict(kv::Base.Generator{UnitRange{Int64}, var"#3#4"}) @ Base ./dict.jl:120 [7] top-level scope @ REPL[2]:1 ``` The other unrelated change here is that `dest = empty(dest, typeof(k), typeof(v))` is made conditional, so we do not unconditionally construct an empty Dict in order to discard it and allocate an exact duplicate of it, but only do so if inference wasn't precise originally. Co-authored-by: Curtis Vogt <curtis.vogt@gmail.com> 10 February 2024, 03:03:26 UTC
b43edb7 Updated MethodError to show closest candidates more reliably (#53165) Updated version of #33793. Always show up to 3 methods, even if no arguments types match on some of them, but rank ones with fewer arguments before those with more arguments. Closes #33793 Fixes #33793 Fixes #46236 Co-authored-by: Eric Wright <efwright@udel.edu> (this diff best viewed with whitespace ignored) 10 February 2024, 03:02:29 UTC
f3d6904 less jl_get_global reflection (#53250) 10 February 2024, 03:01:05 UTC
9523361 Document & expose printing of custom `AbstractTestSet` (#53215) This was previously alluded to in the docs as being possible ("just record if we're not the top-level parent"), but trying to do that didn't actually do anything because the printing in the `DefaultTestSet` ignored anything that wasn't a `Test.Result` or `Test.DefaultTestSet`. This is particularly problematic if any of the child-testsets had failures, because those failures would never be shown to a user. Co-authored-by: Sukera <Seelengrab@users.noreply.github.com> Co-authored-by: Ian Butterworth <i.r.butterworth@gmail.com> 09 February 2024, 15:18:03 UTC
65d4ce2 implement convert from NamedTuple to Tuple (#49879) See the discussion from Discourse: https://discourse.julialang.org/t/construct-tuple-containing-namedtuple-from-tuple 09 February 2024, 15:14:44 UTC
daac6a6 doc: Rephrase some text referring to `DArray` (#53244) Some parts of `distributed-computing.md` were somewhat unclear/confusing after `DArray` was moved to `DistributedArrays.jl`. 09 February 2024, 15:13:33 UTC
36b7d3b Add PGO+LTO Makefile (#45641) Adds a convenient way to enable PGO+LTO on Julia and LLVM together: 1. `cd contrib/pgo-lto` 2. `make -j$(nproc) stage1` 3. `make clean-profiles` 4. `./stage1.build/julia -O3 -e 'using Pkg; Pkg.add("LoopVectorization"); Pkg.test("LoopVectorization")'` 5. `make -j$(nproc) stage2` <details> <summary>* Output looks roughly like as follows</summary> ```c++ $ make -C contrib/pgo-lto top make: Entering directory '/dev/shm/julia/contrib/pgo-lto' llvm-profdata show --topn=50 /dev/shm/julia/contrib/pgo-lto/profiles/merged.prof | c++filt Instrumentation level: IR entry_first = 0 Total functions: 85943 Maximum function count: 7867557260 Maximum internal block count: 3468437590 Top 50 functions with the largest internal block counts: llvm::BitVector::operator|=(llvm::BitVector const&), max count = 7867557260 LateLowerGCFrame::ComputeLiveness(State&), max count = 3468437590 llvm::hashing::detail::hash_combine_recursive_helper::hash_combine_recursive_helper(), max count = 1742259834 llvm::SUnit::addPred(llvm::SDep const&, bool), max count = 511396575 llvm::LiveRange::overlaps(llvm::LiveRange const&, llvm::CoalescerPair const&, llvm::SlotIndexes const&) const, max count = 508061762 llvm::StringMapImpl::LookupBucketFor(llvm::StringRef), max count = 505682177 std::map<llvm::BasicBlock*, BBState, std::less<llvm::BasicBlock*>, std::allocator<std::pair<llvm::BasicBlock* const, BBState> > >::operator[](llvm::BasicBlock* const&), max count = 395628888 llvm::LiveRange::advanceTo(llvm::LiveRange::Segment const*, llvm::SlotIndex) const, max count = 384642728 llvm::LiveRange::isLiveAtIndexes(llvm::ArrayRef<llvm::SlotIndex>) const, max count = 380291040 llvm::PassRegistry::enumerateWith(llvm::PassRegistrationListener*), max count = 352313953 ijl_method_instance_add_backedge, max count = 349608221 llvm::SUnit::ComputeHeight(), max count = 336604330 llvm::LiveRange::advanceTo(llvm::LiveRange::Segment*, llvm::SlotIndex), max count = 331030109 llvm::SmallPtrSetImplBase::insert_imp(void const*), max count = 272966545 llvm::LiveIntervals::checkRegMaskInterference(llvm::LiveInterval&, llvm::BitVector&), max count = 257449540 LateLowerGCFrame::ComputeLiveSets(State&), max count = 252096274 /dev/shm/julia/src/jltypes.c:has_free_typevars, max count = 230879464 ijl_get_pgcstack, max count = 216953592 LateLowerGCFrame::RefineLiveSet(llvm::BitVector&, State&, std::vector<int, std::allocator<int> > const&), max count = 188013152 /dev/shm/julia/src/flisp/flisp.c:apply_cl, max count = 174863813 /dev/shm/julia/src/flisp/builtins.c:fl_memq, max count = 168621603 ``` </details> This results quite often in spectacular speedups for time to first X as it reduces the time spent in LLVM optimization passes by 25 or even 30%. Example 1: ```julia using LoopVectorization function f!(a, b) @turbo for i in eachindex(a) a[i] *= b[i] end return a end f!(rand(1), rand(1)) ``` ```console $ time ./julia -O3 lv.jl ``` Without PGO+LTO: 14.801s With PGO+LTO: 11.978s (-19%) Example 2: ```console $ time ./julia -e 'using Pkg; Pkg.test("Unitful");' ``` Without PGO+LTO: 1m47.688s With PGO+LTO: 1m35.704s (-11%) Example 3 (taken from issue #45395, which is almost only LLVM): ```console $ JULIA_LLVM_ARGS=-time-passes ./julia script-45395.jl ``` Without PGO+LTO: ``` ===-------------------------------------------------------------------------=== ... Pass execution timing report ... ===-------------------------------------------------------------------------=== Total Execution Time: 101.0130 seconds (98.6253 wall clock) ---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name --- 53.6961 ( 54.7%) 0.1050 ( 3.8%) 53.8012 ( 53.3%) 53.8045 ( 54.6%) Unroll loops 25.5423 ( 26.0%) 0.0072 ( 0.3%) 25.5495 ( 25.3%) 25.5444 ( 25.9%) Global Value Numbering 7.1995 ( 7.3%) 0.0526 ( 1.9%) 7.2521 ( 7.2%) 7.2517 ( 7.4%) Induction Variable Simplification 6.0541 ( 5.1%) 0.0098 ( 0.3%) 5.0639 ( 5.0%) 5.0561 ( 5.1%) Combine redundant instructions #2 ``` With PGO+LTO: ``` ===-------------------------------------------------------------------------=== ... Pass execution timing report ... ===-------------------------------------------------------------------------=== Total Execution Time: 72.6507 seconds (70.1337 wall clock) ---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name --- 36.0894 ( 51.7%) 0.0825 ( 2.9%) 36.1719 ( 49.8%) 36.1738 ( 51.6%) Unroll loops 16.5713 ( 23.7%) 0.0129 ( 0.5%) 16.5843 ( 22.8%) 16.5794 ( 23.6%) Global Value Numbering 5.9047 ( 8.5%) 0.0395 ( 1.4%) 5.9442 ( 8.2%) 5.9438 ( 8.5%) Induction Variable Simplification 4.7566 ( 6.8%) 0.0078 ( 0.3%) 4.7645 ( 6.6%) 4.7575 ( 6.8%) Combine redundant instructions #2 ``` Or -28% time spent in LLVM. `perf` reports show this is mostly fewer instructions and reduction in icache misses. --- Finally there's a significant reduction in binary sizes. For libLLVM.so: ``` 79M usr/lib/libLLVM-13jl.so (before) 67M usr/lib/libLLVM-13jl.so (after) ``` And it can be reduced by another 2MB with `--icf=safe` when using LLD as a linker anyways. - [x] Two out-of-source builds would be better than a single in-source build, so that it's easier to find good profile data --------- Co-authored-by: Oscar Smith <oscardssmith@gmail.com> Co-authored-by: Lilith Orion Hafner <lilithhafner@gmail.com> 09 February 2024, 14:37:01 UTC
27b31d1 Reroute algebraic functions for `Symmetric`/`Hermitian` through triangular (#52942) This ensures that only the triangular indices are accessed for strided parent matrices. Fix #52895 ```julia julia> M = Matrix{Complex{BigFloat}}(undef, 2, 2); julia> M[1,1] = M[2,2] = M[1,2] = 2; julia> H = Hermitian(M) 2×2 Hermitian{Complex{BigFloat}, Matrix{Complex{BigFloat}}}: 2.0+0.0im 2.0+0.0im 2.0-0.0im 2.0+0.0im julia> H + H # works after this 2×2 Hermitian{Complex{BigFloat}, Matrix{Complex{BigFloat}}}: 4.0+0.0im 4.0+0.0im 4.0-0.0im 4.0+0.0im ``` This also provides a speed-up in several common cases (allocations mentioned only when they differ): ```julia julia> H = Hermitian(rand(ComplexF64,1000,1000)); julia> H2 = Hermitian(rand(ComplexF64,1000,1000),:L); ``` | Operation | master | PR | | ---- | ---- | ---- | |`-H` |2.247 ms | 1.384 ms | | `real(H)` |1.544 ms |1.175 ms | |`H + H` |2.288 ms |1.978 ms | |`H + H2` |5.139 ms |3.287 ms | | `isdiag(H)` |23.042 ns (1 allocation: 16 bytes) |16.778 ns (0 allocations: 0 bytes) | I'm not entirely certain why `isdiag(H)` allocates on master, as union splitting should handle this automatically, but manually splitting the union appears to help. 09 February 2024, 10:56:32 UTC
63e95d4 Add nested precomp highlight debug (#53111) 09 February 2024, 07:34:34 UTC
e507785 Support escape expressions in @kwdef (#53230) `@kwdef` currently does not handle escaped type names and default values correctly. This makes it impossible to write a (correctly escaped) macro that internally uses `@kwdef`: ```julia julia> module M macro define_struct(name) quote @kwdef struct $(esc(name)) field::Int end end end end; julia> @macroexpand M.@define_struct(Foo) ERROR: Invalid usage of @kwdef Stacktrace: [1] error(s::String) @ Base ./error.jl:35 [2] var"@kwdef"(__source__::LineNumberNode, __module__::Module, expr::Any) @ Base ./util.jl:603 [3] #macroexpand#66 @ Base ./expr.jl:122 [inlined] [4] top-level scope @ REPL[5]:1 ``` This PR patches `@kwdef` so various types of escaping are handled correctly. Specifically, all of the following now works (see new test case [here](https://github.com/ettersi/julia/blob/adf7e20378ae7d0c3cf24a2cc3c815e560913b78/test/misc.jl#L1290-L1332)): ```julia module KwdefWithEsc const Int1 = Int const val1 = 42 macro define_struct() quote @kwdef struct $(esc(:Struct)) a b = val1 c::Int1 d::Int1 = val1 $(esc(quote e f = val2 g::Int2 h::Int2 = val2 end)) $(esc(:(i = val2))) $(esc(:(j::Int2))) $(esc(:(k::Int2 = val2))) l::$(esc(:Int2)) m::$(esc(:Int2)) = val1 n = $(esc(:val2)) o::Int1 = $(esc(:val2)) $(esc(:p)) $(esc(:q)) = val1 $(esc(:s))::Int1 $(esc(:t))::Int1 = val1 end end end end module KwdefWithEsc_TestModule using ..KwdefWithEsc const Int2 = Int const val2 = 42 KwdefWithEsc.@define_struct() end ``` --------- Co-authored-by: inky <git@wo-class.cn> 08 February 2024, 22:30:27 UTC
aba8afc Improve truecolor terminal capability detection (#53235) Terminal color detection is a fickle beast, but it should behave as expected more often with these changes. Note to self: don't go "investigating" informal terminal standards again if I value my time, or sanity. 08 February 2024, 20:35:32 UTC
dd83530 deps/csl: Use platform-dependent path separator (#52687) When building julia from source in MSYS2, you need to use `;` as a path separator, otherwise you won't be able to find the required DLLs! ## pr changes - On win, use `;` as path separator - Always search for DLLs in the `bin/` directory ### test steps Clean csl first: `make -C deps/ USE_SYSTEM_CSL=1 clean-csl` Before pr: ```sh $ make -C deps/ USE_SYSTEM_CSL=1 install-csl make: Entering directory '/d/jl/julia/deps' make: [/d/jl/julia/deps/csl.mk:59: /d/jl/julia/usr/bin/libgfortran-3.dll] Error 1 (ignored) make: [/d/jl/julia/deps/csl.mk:60: /d/jl/julia/usr/bin/libgfortran-4.dll] Error 1 (ignored) make: [/d/jl/julia/deps/csl.mk:61: /d/jl/julia/usr/bin/libgfortran-5.dll] Error 1 (ignored) make: [/d/jl/julia/deps/csl.mk:64: /d/jl/julia/usr/bin/libquadmath-0.dll] Error 1 (ignored) make: [/d/jl/julia/deps/csl.mk:65: /d/jl/julia/usr/bin/libstdc++-6.dll] Error 1 (ignored) make: [/d/jl/julia/deps/csl.mk:66: /d/jl/julia/usr/bin/libssp-0.dll] Error 1 (ignored) make: [/d/jl/julia/deps/csl.mk:67: /d/jl/julia/usr/bin/libatomic-1.dll] Error 1 (ignored) make: [/d/jl/julia/deps/csl.mk:68: /d/jl/julia/usr/bin/libgomp-1.dll] Error 1 (ignored) make: [/d/jl/julia/deps/csl.mk:75: /d/jl/julia/usr/bin/libgcc_s_seh-1.dll] Error 1 (ignored) make: [/d/jl/julia/deps/csl.mk:86: /d/jl/julia/usr/bin/libwinpthread-1.dll] Error 1 (ignored) make: Leaving directory '/d/jl/julia/deps' ``` After pr: ```sh $ make -C deps/ USE_SYSTEM_CSL=1 install-csl make: Entering directory '/d/jl/julia/deps' make: [/d/jl/julia/deps/csl.mk:59: /d/jl/julia/usr/bin/libgfortran-3.dll] Error 1 (ignored) make: [/d/jl/julia/deps/csl.mk:60: /d/jl/julia/usr/bin/libgfortran-4.dll] Error 1 (ignored) make: [/d/jl/julia/deps/csl.mk:66: /d/jl/julia/usr/bin/libssp-0.dll] Error 1 (ignored) make: Leaving directory '/d/jl/julia/deps' ``` ## Env - Win 11 - MSYS2 `STD_LIB_PATH` ``` $ uname -a MINGW64_NT-10.0-22631 A309-Y9000P 3.4.10.x86_64 2023-11-30 06:09 UTC x86_64 Msys $ make -C deps/ print-PATHSEP print-STD_LIB_PATH make: Entering directory '/d/jl/julia/deps' PATHSEP=; STD_LIB_PATH=D:/env/msys64/mingw64/bin/../bin/gcc/x86_64-w64-mingw32/13.2.0/;D:/env/msys64/mingw64/bin/../bin/gcc/;D:/env/msys64/mingw64/bin/../bin/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/x86_64-w64-mingw32/13.2.0/;D:/env/msys64/mingw64/bin/../bin/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ ;D:/env/msys64/mingw64/bin/../bin/gcc/x86_64-w64-mingw32/13.2.0/;D:/env/msys64/mingw64/bin/../bin/gcc/;D:/env/msys64/mingw64/bin/../bin/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/x86_64-w64-mingw32/13.2.0/;D:/env/msys64/mingw64/bin/../bin/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/../bin/;D:/env/msys64/mingw64/bin/../bin/gcc/x86_64-w64-mingw32/13.2.0/../../../x86_64-w64-mingw32/13.2.0/;D:/env/msys64/mingw64/bin/../bin/gcc/x86_64-w64-mingw32/13.2.0/../../../../bin/;D:/a/msys64/mingw64/bin/x86_64-w64-mingw32/13.2.0/;D:/a/msys64/mingw64/bin/../bin/;D:/env/msys64/mingw64/bin/../bin/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/;D:/env/msys64/mingw64/bin/../bin/gcc/x86_64-w64-mingw32/13.2.0/../../../;D:/a/msys64/mingw64/bin/ make: Leaving directory '/d/jl/julia/deps' ``` 08 February 2024, 18:47:15 UTC
a0989f4 Added tests for kron! for diagonal matrices (#53184) Co-authored-by: Jishnu Bhattacharya <jishnub.github@gmail.com> 08 February 2024, 16:25:54 UTC
95df060 Qualify public, unexported bindings in REPL help (#52524) Fixes #52472, which was caused by `names` being changed to also return public, unexported symbols in #50105. Note that this restores previous behavior. A case could be made to instead add the public, unexported bindings as suggestions with the appropriate qualification. Not entirely sure how to test this so I'd welcome any suggestions. --------- Co-authored-by: Jameson Nash <vtjnash@gmail.com> 08 February 2024, 16:15:15 UTC
3dadada Allow using an unexported custom `AbstractTestSet` in `@testset` (#53212) Co-authored-by: Sukera <Seelengrab@users.noreply.github.com> 08 February 2024, 12:53:28 UTC
667cdde compiler: fix the XXX test case in ssair.jl (#53245) This should live in test/compiler/inline.jl instead. 08 February 2024, 12:39:13 UTC
2b939f7 Add Debian terminfo directory default to find_terminfo_file (#51809) Without this, `Base.current_terminfo` returns `TermInfo(String[]; 0 flags, 0 numbers, 0 strings)` because it cannot find the correct terminfo files. In the regular terminal, there was basic color and formatting functionality because `$TERM`s starting with `xterm` are treated specially, but in a tmux session, where the `$TERM = tmux-256color`, there was no color at all. This also has the side-effect of enabling strikethrough and italics in the default gnome terminal emulator. The readme found in `/etc/terminfo/README` (as mentioned in `terminfo(5) "Fetching Compiled Descriptions"`) says the following: ``` /etc/terminfo/README This directory is for system-local terminfo descriptions. By default, ncurses will search ${HOME}/.terminfo first, then /etc/terminfo (this directory), then /lib/terminfo, and last not least /usr/share/terminfo. ``` I believe the manual might be different depending on the distro. 08 February 2024, 12:26:11 UTC
815cfd5 Added documentation to libdl module (#52825) Part of #52725 --------- Co-authored-by: RichieWilynnton <richiewilynton@gmail.com> Co-authored-by: Steven G. Johnson <stevenj@mit.edu> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Co-authored-by: inky <git@wo-class.cn> Co-authored-by: Max Horn <max@quendi.de> 08 February 2024, 12:13:23 UTC
c1a7bb2 🤖 [master] Bump the Pkg stdlib from f3b81f1aa to 6dd0e7c9e (take 2) (#53220) Replaces https://github.com/JuliaLang/julia/pull/53216 (I can't push to that repo branch) Adds - making pkgimages for REPLExt - Fixes PkgCompletionProvider location Stdlib: Pkg URL: https://github.com/JuliaLang/Pkg.jl.git Stdlib branch: master Julia branch: master Old commit: f3b81f1aa New commit: 6dd0e7c9e Julia version: 1.11.0-DEV Pkg version: 1.11.0 Bump invoked by: @IanButterworth Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: https://github.com/JuliaLang/Pkg.jl/compare/f3b81f1aac77acf08f5d847ead29ad0a228dec67...6dd0e7c9e99d578aa5477e2c78c91a161ce4c357 ``` $ git log --oneline f3b81f1aa..6dd0e7c9e 6dd0e7c9e Revert "add test for recurring precompile" (#3779) dbf114fa9 Merge pull request #3777 from JuliaLang/kc/repl_extension a49d47981 fixup e3edf3917 avoid prompting for git creds on CI (#3778) 510454343 make the `REPL` specific code into an extension 12d2de14e make `pkgstr` independent of REPL ``` --------- Co-authored-by: Dilum Aluthge <dilum@aluthge.com> Co-authored-by: Valentin Churavy <vchuravy@users.noreply.github.com> Co-authored-by: Kristoffer Carlsson <kcarlsson89@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> 08 February 2024, 12:05:47 UTC
ebe947e Add docstring for InteractiveUtils module (#53206) Handles the `InteractiveUtils` part of https://github.com/JuliaLang/julia/issues/52725. cc @stevengj 08 February 2024, 11:57:22 UTC
e68e432 allow printing some TOML dictionaries inline by marking them with an IdSet (#53233) This was one way I came up with to "mark" what dictionaries one wants to print inline. I am not sure `IdSet` is even considered public but it seemed the most reasonable for this. 08 February 2024, 11:56:45 UTC
4c2df21 Add `Pipe` to the documentation (#53202) The reasoning is that `Pipe` is specifically documented in other functions that are part of the public API (e.g. `redirect_stdio()`), so it should be documented too. Same goes for `link_pipe!()` since it's mentioned in the `Pipe` docstring. The other function that could be documented is `open_pipe!()`, but that specifically applies to `PipeEndpoint`'s and I could imagine that we want it to be difficult to create a half-initialized `Pipe` :sweat_smile: I wrote a docstring for `link_pipe!()` based off the libuv docs: https://docs.libuv.org/en/v1.x/pipe.html#c.uv_pipe 08 February 2024, 11:55:17 UTC
b5bd10e Add `track_content` option to allow hashing of `include_dependency`s (#51798) Continuation of #49866. Fixes #52462 So far any `include_dependency` was tracked by `mtime`. A package using `include_dependency` can't be relocated without recompilation if the dependency also needs to be relocated. With `include_dependency(path, track_content=true)` the tracking works like for `include`, i.e. recompilation is only triggered when the file's content changes. In case `path` is a directory we use the string `join(readdir(path))` as content. --------- Co-authored-by: Valentin Churavy <vchuravy@users.noreply.github.com> 08 February 2024, 11:54:08 UTC
15e2af2 Added docstring for Artifacts.jl (#52913) This is a part of issue #52725. --------- Co-authored-by: Steven G. Johnson <stevenj@mit.edu> Co-authored-by: Max Horn <max@quendi.de> 08 February 2024, 11:52:35 UTC
c5ad467 Document --heap-size-hint in Command-line Interface (#50480) Almost a direct copy of the output in `julia --help`. Closes #50588 Co-authored-by: Max Horn <max@quendi.de> 08 February 2024, 11:44:55 UTC
2673c14 Clarify `==` docs for collections (#52495) Alright, here's my spitball at fixing https://github.com/JuliaLang/julia/issues/52484. This also clarifies the non-missing behaviors, and adds a reference to `all` which should be a useful breadcrumb. I don't want to say `all(x .== y)` because that has all sorts of broadcasting semantics, but we could perhaps add a comparison to `all(splat(==), zip(x, y))` or `all(map(==, x, y))`, but even those feel sketchy to reference as they may miss other properties (like array shape). --------- Co-authored-by: Jameson Nash <vtjnash@gmail.com> Co-authored-by: inky <git@wo-class.cn> Co-authored-by: Max Horn <max@quendi.de> 08 February 2024, 11:39:42 UTC
41a6e7b [LibCURL_jll] Upgrade to v8.6.0 (#53222) 08 February 2024, 10:03:05 UTC
5cb5cd8 code_warntype docs: more neutral reference to @code_warntype (#51361) fix #51358 --------- Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com> Co-authored-by: Max Horn <max@quendi.de> 08 February 2024, 09:25:36 UTC
4414599 Fix PkgId repr (#52795) Fixes #52793 ``` % ./julia --startup-file=no -E 'repr(Base.PkgId(Base.UUID("295af30f-e4ad-537b-8983-00126c2a3abe"), "Revise"))' "Base.PkgId(UUID(\"295af30f-e4ad-537b-8983-00126c2a3abe\"), \"Revise\")" ``` ``` julia> Base.PkgId(Base.UUID("295af30f-e4ad-537b-8983-00126c2a3abe"), "Revise") Revise [295af30f-e4ad-537b-8983-00126c2a3abe] ``` 08 February 2024, 09:24:39 UTC
4d0a469 SubArray: avoid invalid elimination of singleton indices (#53228) close #53209 08 February 2024, 06:22:48 UTC
2bd4cf8 Avoid allocations in views of views (#53231) Currently, views-of-views construct their re-indexed indices by slicing into the parent indices. This PR changes this to use views of the parent indices instead. This makes the operation faster and non-allocating if the `parentindices` for the original view are `Vector`s. ```julia julia> a = rand(200, 200); julia> av = view(a, collect.(axes(a))...); julia> @btime view($av, axes($av)...); 312.393 ns (4 allocations: 3.25 KiB) # master 7.354 ns (0 allocations: 0 bytes) # PR ``` Indexing into the resulting view seems equally fast in simple cases: ```julia julia> av2 = view(av, axes(av)...); julia> @btime sum($av2); 66.883 μs (0 allocations: 0 bytes) # master 66.888 μs (0 allocations: 0 bytes) # PR julia> av2 = view(av, collect.(axes(av))...); julia> @btime sum($av2); 66.886 μs (0 allocations: 0 bytes) # master 66.891 μs (0 allocations: 0 bytes) # PR ``` --------- Co-authored-by: N5N3 <2642243996@qq.com> 08 February 2024, 06:22:24 UTC
a6ce761 add docs and jldoctests for `Base.shell_split` and `Base.rstrip_shell` (#52520) These were undocumented and I have seen `Base.shell_split` used in the package ecosystem. This adds some docs for clarity although neither of these functions are part of Base's exports. --------- Co-authored-by: Jameson Nash <vtjnash@gmail.com> 08 February 2024, 04:50:19 UTC
72d3abe Fix potential instability/invalidation in dlpath (#53232) While debugging some invalidations and instabilities in code in packages I work on, one of the issues I stumbled over is this code in this `dlpath` method: ```julia function dlpath(libname::Union{AbstractString, Symbol}) handle = dlopen(libname) path = dlpath(handle) dlclose(handle) return path end ``` The `dlopen` modified in this PR can in principle return `nothing`. But there is no `dlpath` method for this. If one loads just a plain Julia, all is fine, but under certain conditions (deep in a call chain analyzed with Cthulhu.jl) it ended up not being able to prove that `path` will be a string, and only inferred it as `Any`. But if `throw_error` is set to `true` (the default, and used in the relevant code path) then `dlopen` cannot return `nothing`, it always returns a `String`. But the Julia compiler can't know that, as the exception is thrown by a C helper. So instead modify the Julia code a bit to help Julia deduce this fact by itself. 07 February 2024, 21:28:09 UTC
18df941 doc: cosmetic whitespace changes in documentation.md (#53183) 07 February 2024, 20:44:57 UTC
e2c8809 Disambiguate get_world_counter and get_inference_world (#53088) Add brief docs to `Base.get_world_counter` and add `Base.tls_wold_age`. Furthermore to disambiguate `get_world_counter` from the inference world rename the abstract interpreter accessor to `get_inference_world` 07 February 2024, 19:36:12 UTC
d24316a Fix Int8(-128) // Int8(-128) (#51944) Fixes #51731 and #51730 Also fixes one of the previously broken tests: ```julia @test_broken Rational{Int64}(UInt(1), typemin(Int32)) == Int64(1) // Int64(typemin(Int32)) ``` This PR ensures the `Rational{T}` constructor with concrete `T` will only throw if the final numerator and denominator cannot be represented by `T`, or are both zero. If the `T` in `Rational{T}` is not concrete, this PR tries to ensure the numerator and denominator are promoted to the same type. This means `-1*Rational{Integer}(-1, 0x01) == 1` doesn't throw now. A side effect of this is that `Rational{Integer}(Int8(-1), 0x01)` now throws. Also, related to <https://github.com/JuliaLang/julia/pull/25702#issuecomment-359821951>, now `divgcd` doesn't change the types of its inputs and can handle `typemin`, but it still throws a `DivideError` if both inputs are zero. 07 February 2024, 15:53:14 UTC
736eeda docs: remove outdated discussion about externally changing module bindings (#53170) As of Julia 1.9, bindings in modules can be changed directly. See https://discourse.julialang.org/t/clarify-the-documentation-about-modifying-module-variables/109668/3 07 February 2024, 15:03:21 UTC
bead1d3 fix spurious overflow for Float16(::Rational) (#52395) Fixes #52394. Also fixes `Float32` for `UInt128`, since currently `Float32((typemax(UInt128)-0x01) // typemax(UInt128))` gives `Nan32`. 07 February 2024, 14:50:51 UTC
d765ad1 Added documentation for the Markdown Macro (#52607) Co-authored-by: Jameson Nash <vtjnash@gmail.com> 07 February 2024, 13:56:14 UTC
e22db88 [deps] Do not build OpenBLAS Bfloat16 kernels in from source build (#53221) Not clear why OpenBLAS build fails, GCC 10 should be sufficient to compile the Bfloat16 kernels and [from what I can tell](https://github.com/JuliaLang/julia/issues/53172#issuecomment-1930144786) that's the compiler version used in CI, but I don't know how to verify it since this is a nightly job. If someone who knows more about the setup can chime in, that'd be great. In the meantime, disabling these kernels should fix #53172. 07 February 2024, 13:08:24 UTC
d453af8 Fix escaping of docstring in `@__DIR__` (#53225) This issue was introduced in #52442. The markdown parser had issues with the triple-quotes. Usually you can use quadruple-quotes to fix this, but this does not appear to be supported, so we escape each with backslash. Here is the corrected docstring rendered: ```julia-repl help?> @__DIR__ @__DIR__ -> String Macro to obtain the absolute path of the current directory as a string. If in a script, returns the directory of the script containing the @__DIR__ macrocall. If run from a REPL or if evaluated by julia -e <expr>, returns the current working directory. Example ≡≡≡≡≡≡≡ The example illustrates the difference in the behaviors of @__DIR__ and pwd(), by creating a simple script in a different directory than the current working one and executing both commands: julia> cd("/home/JuliaUser") # working directory julia> # create script at /home/JuliaUser/Projects open("/home/JuliaUser/Projects/test.jl","w") do io print(io, """ println("@__DIR__ = ", @__DIR__) println("pwd() = ", pwd()) """) end julia> # outputs script directory and current working directory include("/home/JuliaUser/Projects/test.jl") @__DIR__ = /home/JuliaUser/Projects pwd() = /home/JuliaUser ``` 07 February 2024, 04:53:09 UTC
back to top