https://github.com/JuliaLang/julia

sort by:
Revision Author Date Message Commit Date
0c804bd Add InteractiveUtils in doc refs to define_editor (#52927) Otherwise since `define_editor` is not exported, it's hard for the user to find what it's referring to. (Another possibility would be to export `define_editor`) 07 February 2024, 02:37:53 UTC
76b8b2a improve return type inference for `string` (#52806) Packages like URIs.jl overload `joinpath` with methods that return non-strings. This prevents good return type inference for `string` when the types of its arguments are unknown. Even if this is a URIs.jl bug, it makes sense to be defensive about this in the Julia implementation. Also note that URIs.jl is widely-used, JuliaHub says it's got in excess of a thousand (indirect) dependents. So, IMO, this is a Julia bug that we should fix: ```julia-repl julia> all(T -> T <: AbstractString, Base.return_types(string)) true julia> import URIs julia> all(T -> T <: AbstractString, Base.return_types(string)) false ``` Fixed by adding a `::String` type assertion in `base/libdl.jl`. 07 February 2024, 02:36:51 UTC
fc1c1cd Add missing artifact functions to docs output (#52698) Fixes #52688 Co-authored-by: re1san <kathareaniket47@gmail.com> 07 February 2024, 02:31:00 UTC
32687b0 Clarify the docs of @__DIR__ (#52442) The original docs start with `Expand`, which is already a concept that might not be clear to the reader. Furthermore, in this version there is an example to illustrate how this macro is different from `pwd()`. 07 February 2024, 00:59:21 UTC
101aa39 Remove allocation from PermutedDimsArray constructor (#53185) Remove allocation from PermutedDimsArray constructor by replacing `all(map(pred, ...))` with `all(pred, ...)`. 06 February 2024, 21:49:05 UTC
34f1496 rename init.c func `abspath` -> `absrealpath` (#52574) For clarification given its behavior is not the same as julia's `abspath` Related https://github.com/JuliaLang/julia/issues/52458 06 February 2024, 21:45:41 UTC
522cf3b add docstring and doctest for `Base.format_bytes` (#52976) There are many uses of this function throughout the package ecosystem. In addition, it is common to see it re-implemented. This adds some docstrings and tests for `Base.format_bytes`. 06 February 2024, 21:40:20 UTC
321cc2d add specialized `reverse` implementation for `NTuple` (#50113) This adds a specialized version of `reverse` for NTuple using a simple constructor. 1.9: ``` julia> a = tuple(rand(Int, 256)...); julia> @benchmark reverse($a) BenchmarkTools.Trial: 7099 samples with 1 evaluation. Range (min … max): 611.280 μs … 5.698 ms ┊ GC (min … max): 0.00% … 0.00% Time (median): 670.392 μs ┊ GC (median): 0.00% Time (mean ± σ): 700.950 μs ± 144.952 μs ┊ GC (mean ± σ): 1.37% ± 5.70% ▃▄██▇▆▆▆▆▄▂ ▂ ▇███████████▇▇▆▄▇█▅▅▅▃▄▁▁▁▁▃▄▄▁▁▁▃▁▃▁▁▄▃▄▅▆▅▆▆▅▅▆▇▆▆▇▇▇█▇▆▇▇▆ █ 611 μs Histogram: log(frequency) by time 1.33 ms < Memory estimate: 794.42 KiB, allocs estimate: 33663. ``` This commit: ``` julia> @benchmark reverse($a) BenchmarkTools.Trial: 10000 samples with 995 evaluations. Range (min … max): 26.252 ns … 52.545 ns ┊ GC (min … max): 0.00% … 0.00% Time (median): 26.285 ns ┊ GC (median): 0.00% Time (mean ± σ): 26.578 ns ± 0.940 ns ┊ GC (mean ± σ): 0.00% ± 0.00% █▆▂ ▁ ▁ ████▆▅▆▅▄▄▄▂▃▄███▇▆▆▆▅▆▄▅▅▆█▇▆▄▅▆▆▅▆██▅▅▅▄▅▅▄▅▄▅▅▅▄▅▃▅▂▄▄██ █ 26.3 ns Histogram: log(frequency) by time 30.2 ns < Memory estimate: 0 bytes, allocs estimate: 0. ``` 06 February 2024, 21:35:49 UTC
0c49003 Update LLVM version to 16.0.6+4 (#53195) This has a build change for enzyme, but should be NFC 06 February 2024, 18:56:33 UTC
9bafc53 Profile: add notes to `print()` docs (#53205) 06 February 2024, 18:36:53 UTC
eb82072 deps/ittapi: Update ittapi clean target (#52693) Change: - clean `libittnotify` and `libjitprofiling`, not `libopenlibm` c.f. https://github.com/JuliaLang/julia/blob/0f62824530feb9ab39c179175b3fc4702d21c552/deps/ittapi.mk#L23-L25 06 February 2024, 18:19:25 UTC
31ae775 fix typo in AnnotatedChar constructor (#53204) Found randomly when using JET for something completely different. 06 February 2024, 16:12:40 UTC
da8a441 Improved terminfo parser (#51198) This bundles up the following changes: - Rejiged TermInfo struct - Read the extended terminfo table using the same method as the non-extended table - Use signed integer types for most numeric values, as per term(5) - More robust get(::TermInfo, ...) methods - Better match the terminfo(5) "Fetching Compiled Descriptions" behaviour 06 February 2024, 16:11:32 UTC
94fd312 Add `:greedy` scheduler to `@threads` (#52096) 06 February 2024, 13:32:19 UTC
353884c Don't tell people to use Pkg to install Pkg (#53197) 06 February 2024, 13:30:35 UTC
28db6c7 AnnotatedIOBuffer: prevent despecialization of annotations list (#53155) In f117a500ca93 code modifying annotations via list comprehensions was introduced. However, when (1) there are annotations present and (2) all annotations are filtered out, this comprehension is inferred to a wider type incompatible with the AnnotatedString constructor. This can be fixed by changing the first element of the tuple to directly use the UnitRange{Int} constructor, which stops it being inferred as an Any. 05 February 2024, 22:36:10 UTC
cfcf8a0 Bump SparseArrays to use SuiteSparse 7.6.0 (#53180) This is using commits that are on a branch of SparseArrays.jl. The PR for SuiteSparse 7.6 in SparseArrays.jl - https://github.com/JuliaSparse/SparseArrays.jl/pull/502 - should be merged first. Then the commits should be updated here, and then this PR should be merged. 05 February 2024, 05:41:46 UTC
26d17a8 Remove Matrix constructor for AbstractTriangular (#53167) This seems redundant, as the fallback constructor does the same. ```julia julia> using LinearAlgebra julia> Revise.track(LinearAlgebra) julia> U = UpperTriangular(rand(4,4)) 4×4 UpperTriangular{Float64, Matrix{Float64}}: 0.798171 0.484117 0.988126 0.986837 ⋅ 0.186955 0.827882 0.600041 ⋅ ⋅ 0.344573 0.344545 ⋅ ⋅ ⋅ 0.29875 julia> Matrix(U) 4×4 Matrix{Float64}: 0.798171 0.484117 0.988126 0.986837 0.0 0.186955 0.827882 0.600041 0.0 0.0 0.344573 0.344545 0.0 0.0 0.0 0.29875 julia> @which Matrix(U) (Array{T, N} where T)(x::AbstractArray{S, N}) where {S, N} @ Core boot.jl:599 ``` 05 February 2024, 04:57:48 UTC
6defd59 Implement empty! for Channel (#53137) 05 February 2024, 02:30:50 UTC
914de06 improve error when broadcast failed due to axistype (#45922) 05 February 2024, 02:27:55 UTC
9aba4a8 try improving check_top_bit error message (#53166) Fixes #30247 @staticfloat this was your issue, so what do you think of this? I think the main problem was already solved (showing the wrong type), but I am wondering if this wording is still clearer, since it tries to align it with functions users might actually have encountered (trunc, convert, signbit) 05 February 2024, 01:17:26 UTC
d91a7fa further improve clarity of MethodError printing (#53164) Distinguish some of the cases of manually thrown MethodError by looking for a method in the specified world. Also refactor some of the kwcall handling to be closer to supporting `invoke`d calls (although it does not guaranteed to have a value for `f`, which is often required later). Fixes #36182 05 February 2024, 01:03:52 UTC
37a0e65 Do not resolve binding `Module` in Main during sysimg generation (#53162) Currently, the use of `Module` in the precompilation scripts makes the Module binding automatically resolved in Main because it is embedded in the sysimage. This prevents users from using the name Module for their own variables in Main. 05 February 2024, 01:01:31 UTC
8db1294 add atomic operators for globals, memory, and setonce (#52868) This implements `AtomicMemory`, atomic operations for globals, and the class of atomic function for setting a field or global or memory exactly once (setting undef => value). It is quite similar to an `@atomicreplace`, but where there was not a previous value. This is not needed for pointers, since it is simply calling C_NULL => pointer in that case, since there is no "undef" value that throws after load. plenty of future work still, for a later PR: - syntax lowering for `@atomic global x = y` and `@atomic closedover = y` - adding `Core.AtomicBox` for closure capture - generic functions for `atomicsetindex` & friends - macro for `@atomic x = y` and `@atomic x[] = y`, etc - design for `@atomiconce f()` 05 February 2024, 00:51:02 UTC
3d8b107 Improve printing for length and size method error (#53146) 04 February 2024, 03:58:55 UTC
6be4235 Write test result data to static location, and log (#53173) 04 February 2024, 03:53:45 UTC
47663bd Normalize indices in promote_shape error messages (#41311) Seeing implementation details like `Base.OneTo` in error messages may be confusing to some users (cf discussion in #39242, [discourse](https://discourse.julialang.org/t/promote-shape-dimension-mismatch/57529/)). This PR turns ```julia julia> ones(2, 3) + ones(3, 2) ERROR: DimensionMismatch("dimensions must match: a has dims (Base.OneTo(2), Base.OneTo(3)), b has dims (Base.OneTo(3), Base.OneTo(2)), mismatch at 1") ``` into ```julia julia> ones(2, 3) + ones(3, 2) ERROR: DimensionMismatch("dimensions must match: a has size (2, 3), b has size (3, 2), mismatch at 1") ``` Fixes #40118. (This is basically #40124, but redone because I made a mess rebasing). --------- Co-authored-by: Jameson Nash <vtjnash@gmail.com> 04 February 2024, 01:32:02 UTC
831cc14 Fix typo in BuildKite test data generation CI code (#53168) 03 February 2024, 19:48:55 UTC
6f7cfa7 Collect test results into BuildKit-compatible JSON (#53145) 03 February 2024, 15:12:52 UTC
fc06291 Improve error message for `which(fn, types)` (#47369) Error messages for `MethodError` are much more helpful in determining why the method was not successfully dispatched than simply "No unique matching method found." Fixes #47322 03 February 2024, 02:49:59 UTC
fda9321 stdlib: make dot product of Hermitian matrices real (#52318) Co-authored-by: Daniel Karrasch <daniel.karrasch@posteo.de> 03 February 2024, 01:07:49 UTC
12c5d2d Add count of lock conflicts to `@time` etc. Add `@lock_conflicts` (#52883) 02 February 2024, 23:48:54 UTC
98e4f01 Fix `size` on `GenericMemory` with non-`Int` `Integer` argument (#53161) I found this through fuzzing. The nature of the issue indicates to me that this was untested, but coverage doesn't seem to have run for the past three months so I can't check, which is why I added an explicit test. I'm not sure `arrayops.jl` is the best place for tests related to `GenericMemory`, so feel free to suggest a better one. Co-authored-by: Sukera <Seelengrab@users.noreply.github.com> 02 February 2024, 21:11:16 UTC
f2e168a Add filter(f, ::Namedtuple) (#50795) 02 February 2024, 16:59:15 UTC
d54a455 Hoist boundscheck in vector setindex for arrays (#53149) As noted by @N5N3 in https://github.com/JuliaLang/julia/issues/40962#issuecomment-1921469633, the bounds-check on the elementwise `setindex!` prevents vectorization. Explicitly performing the bounds-check and marking the `setindex!` as `@inbounds` speeds up the operation. ```julia julia> A = zeros(1000); B = rand(1000); julia> @btime $A[1:end] = @view $B[1:end]; 689.940 ns (0 allocations: 0 bytes) # master 97.629 ns (0 allocations: 0 bytes) # PR ``` 02 February 2024, 07:09:12 UTC
058b511 deps/libsuitesparse: fix source build (#53150) fix #53122 02 February 2024, 06:42:19 UTC
6e7db14 Update and load styledstrings in REPL (#51869) This has some value by itself, but mainly serves as a prerequisite for #51811, #51816, and #51829, along with two other PRs that have yet to be made. 01 February 2024, 18:19:57 UTC
f117a50 Introduce AnnotatedIOBuffer (#51807) This allows for styled content to be constructed incrementally, without resorting to repeated concatenation. It operates very similarly to IOContext, just with a special `write` method and specifically wrapping an IOBuffer. 01 February 2024, 15:38:38 UTC
c16472b Change to streaming out the heap snapshot data (#52854) This PR is to continue the work on the following PR: Prevent OOMs during heap snapshot: Change to streaming out the snapshot data (https://github.com/JuliaLang/julia/pull/51518 ) Here are the commit history: ``` * Streaming the heap snapshot! This should prevent the engine from OOMing while recording the snapshot! Now we just need to sample the files, either online, before downloading, or offline after downloading :) If we're gonna do it offline, we'll want to gzip the files before downloading them. * Allow custom filename; use original API * Support legacy heap snapshot interface. Add reassembly function. * Add tests * Apply suggestions from code review * Update src/gc-heap-snapshot.cpp * Change to always save the parts in the same directory This way you can always recover from an OOM * Fix bug in reassembler: from_node and to_node were in the wrong order * Fix correctness mistake: The edges have to be reordered according to the node order. That's the whole reason this is tricky. But i'm not sure now whether the SoAs approach is actually an optimization.... It seems like we should probably prefer to inline the Edges right into the vector, rather than having to do another random lookup into the edges table? * Debugging messed up edge array idxs * Disable log message * Write the .nodes and .edges as binary data * Remove unnecessary logging * fix merge issues * attempt to add back the orphan node checking logic ``` --------- Co-authored-by: Nathan Daly <nathan.daly@relational.ai> Co-authored-by: Nathan Daly <NHDaly@gmail.com> 01 February 2024, 14:59:17 UTC
8b88e3b delete unnecessary abstract type in `Base.Rounding` (#53093) 01 February 2024, 14:57:13 UTC
88218c6 Clarify error when arrays are too big for the system bit width (#52545) On Slack, was helping someone who encountered an "Invalid Array size" error message on a 32-bit system. The cause wasn't clear, so I had to dig around and realized that it only triggers if an array is created that is too large for the bit width of the system. So I figured it would be better to clarify that in the error message. --------- Co-authored-by: Steven G. Johnson <stevenj@mit.edu> Co-authored-by: Ian Butterworth <i.r.butterworth@gmail.com> 01 February 2024, 14:39:45 UTC
453e9d0 `typemin`, `typemax` for irrationals (#50894) Fixes #36978 01 February 2024, 14:35:22 UTC
30ccace Load StyledStrings in REPL By loading the StyledStrings stdlib in REPL, we load the privateered print/show methods for the Annotated{String,Char} types defined there. This is nice to have, because it means that styled annotated strings can be constructed in Base and elsewhere without loading the StyledStrings stdlib, but they will be displayed as intended in the REPL. 01 February 2024, 12:54:33 UTC
1552116 Update StyledStrings version This gets us two particular commits of interest: - Replace within-module eval with hygienic eval: which makes it possible to include StyledStrings in the sysimage without running into precompile errors. - Load the JULIA_*_COLOR env vars for compat: which mirrors the current behaviour to the relevant faces. 01 February 2024, 12:54:31 UTC
e7a1c7f 🤖 [master] Bump the Pkg stdlib from ba4955e2e to f3b81f1aa (#53138) Stdlib: Pkg URL: https://github.com/JuliaLang/Pkg.jl.git Stdlib branch: master Julia branch: master Old commit: ba4955e2e New commit: f3b81f1aa Julia version: 1.11.0-DEV Pkg version: 1.11.0 Bump invoked by: @KristofferC Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: https://github.com/JuliaLang/Pkg.jl/compare/ba4955e2e0eb64e47861d0a7d96569c05d41f1f5...f3b81f1aac77acf08f5d847ead29ad0a228dec67 ``` $ git log --oneline ba4955e2e..f3b81f1aa f3b81f1aa disable `julia_version` tests (#3773) b13bd2ddf support the "path" key in Project.toml, (#3756) 731105126 why: show more when package is both a direct and indirect dep (#3771) a83783ecb Avoid deleting existing artifacts when ignoring hashes. (#3768) b43187590 ignore tree hashes on Windows w/o symlink capability (#3764) ``` Co-authored-by: Dilum Aluthge <dilum@aluthge.com> 01 February 2024, 09:46:54 UTC
f064e1b forward `repeat(A, cts..)` to `repeat(A; kw..)` (#49830) This would mean that custom array types that seek to extend `repeat` only need to add the method `repeat(A::CustomArray; kw...)` 01 February 2024, 06:12:14 UTC
6db867b Better libuv error message for ENOENT ~ (#22647) 01 February 2024, 05:16:57 UTC
353d7b7 Define valtype(::Tuple) and keytype(::Tuple) (#49179) Same as https://github.com/JuliaLang/julia/pull/46555, but for Tuples Co-authored-by: Oscar Smith <oscardssmith@gmail.com> 01 February 2024, 02:46:09 UTC
08e3c2e Access only stored inds in `copy` for strided `AbstractTriangular` (#52907) 31 January 2024, 20:38:30 UTC
444e14e Make FDWatcher check for file descriptors equal to -1 (#52902) 31 January 2024, 20:37:53 UTC
2b9839b Use insert! not splice! for new annotations Co-authored-by: Jameson Nash <vtjnash@gmail.com> 31 January 2024, 17:54:29 UTC
39839ac Update the mention of annotated features in NEWS 31 January 2024, 17:54:29 UTC
2e6ebb9 Tests for AnnotatedIOBuffer 31 January 2024, 17:54:29 UTC
d49ba4f Writing from one AnnotatedIOBuffer to another 31 January 2024, 17:54:29 UTC
f4c5e13 Also read AnnotatedChars from an AnnotatedIOBuffer The `read(::AnnotatedIOBuffer, AnnotatedString)` method is intended as an approximate analogue to `read(::IOBuffer, String)`. In the same sense, it makes sense to define `read(::AnnotatedIOBuffer, AnnotatedChar)` as an analogue to `read(::IOBuffer, Char)`. 31 January 2024, 17:54:23 UTC
c2b441b Make AnnotatedIOBuffer reading more generic While `String` is the only concrete type for which `read(::IOBuffer, ::Type{<:AbstractString})` is defined, is is entirely conceivable that some other custom string type could define a similar `read` method. Since making reading an `AnnotatedString` from an `AnnotatedIOBuffer` more generic is as easy as replacing the hardcoded `String` with a type parameter, we may as well do so. 31 January 2024, 17:53:42 UTC
886d7a4 get_bool_env: add method with a lazy default option. Add kwarg to throw (#52950) Based on need here https://github.com/JuliaLang/Pkg.jl/pull/3764#discussion_r1456534459 31 January 2024, 17:19:45 UTC
95ae27f Try to fix incorrect documentation of `nthreads` (#53117) Since https://github.com/JuliaLang/julia/pull/49094, the docstring of `nthreads` has been incorrect. It currently states that > The threads in default have id numbers `1:nthreads(:default)`. whereas that is no longer true: ```julia julia> filter(i -> Threads.threadpool(i) == :interactive, 1:Threads.maxthreadid()) 3-element Vector{Int64}: 1 2 3 julia> filter(i -> Threads.threadpool(i) == :default, 1:Threads.maxthreadid()) 6-element Vector{Int64}: 4 5 6 7 8 9 ``` 31 January 2024, 17:10:30 UTC
8304111 Add `Base.checked_pow(x,y)` to `Base.Checked` library (#52849) Fixes #52262. Performs `^(x, y)` but throws OverflowError on overflow. Example: ```julia julia> 2^62 4611686018427387904 julia> 2^63 -9223372036854775808 julia> checked_pow(2, 63) ERROR: OverflowError: 2147483648 * 4294967296 overflowed for type Int64 ``` Co-authored-by: Jameson Nash <vtjnash@gmail.com> Co-authored-by: Shuhei Kadowaki <aviatesk@gmail.com> 31 January 2024, 16:49:59 UTC
81deb5e fix pkgimage.mk tree (#53133) Taken from https://github.com/JuliaLang/julia/pull/53111 31 January 2024, 16:01:30 UTC
cc74d24 Inplace transpose for unit Triangular may skip diagonal (#53101) Since the diagonal elements of a `UnitUpperTriangular` are given by `onelement`, these should be unchanged under `transpose/adjoint`, and we don't need to access these elements in the parent array when performing in-place operations. Fixes ```julia julia> using LinearAlgebra julia> M = Matrix{BigFloat}(undef, 2, 2); julia> M[1,2] = 3; julia> U = UnitUpperTriangular(M) 2×2 UnitUpperTriangular{BigFloat, Matrix{BigFloat}}: 1.0 3.0 ⋅ 1.0 julia> transpose!(U) ERROR: UndefRefError: access to undefined reference Stacktrace: [1] getindex @ ./essentials.jl:882 [inlined] [2] getindex @ ./array.jl:915 [inlined] [3] copytri! @ ~/packages/julias/julia-latest/share/julia/stdlib/v1.11/LinearAlgebra/src/matmul.jl:414 [inlined] [4] transpose!(A::UnitUpperTriangular{BigFloat, Matrix{BigFloat}}) @ LinearAlgebra ~/packages/julias/julia-latest/share/julia/stdlib/v1.11/LinearAlgebra/src/triangular.jl:470 [5] top-level scope @ REPL[5]:1 ``` After this PR: ```julia julia> transpose!(U) 2×2 UnitLowerTriangular{BigFloat, Matrix{BigFloat}}: 1.0 ⋅ 3.0 1.0 ``` 31 January 2024, 12:09:57 UTC
cb9b00d follow up #53127, fix the broken test case (#53134) 31 January 2024, 08:18:01 UTC
311553e Make AnnotatedIOBuffer behave more like IOBuffer A few extra methods help a lot. It also turns out that we don't actually need to implement lock/unlock, the fallback implementations are enough. 31 January 2024, 06:22:20 UTC
2730f29 Introduce AnnotatedIOBuffer This allows for styled content to be constructed incrementally, without resorting to repeated concatenation. It operates very similarly to IOContext, just with a special `write` method and specifically wrapping an IOBuffer. 31 January 2024, 06:22:20 UTC
dc474d8 inference: avoid adding duplicate edges as invoke targets (#53121) This was inefficient, though not wrong. Fixes #53020 31 January 2024, 01:28:11 UTC
1295379 put a try catch around calls to `propertynames` in tab completion. (#53127) fixes https://github.com/JuliaLang/julia/issues/53126 31 January 2024, 01:24:10 UTC
9df7a67 🤖 [master] Bump the ArgTools stdlib from 4eccde4 to 997089b (#53124) Stdlib: ArgTools URL: https://github.com/JuliaIO/ArgTools.jl.git Stdlib branch: master Julia branch: master Old commit: 4eccde4 New commit: 997089b Julia version: 1.11.0-DEV ArgTools version: 1.1.2(Does not match) Bump invoked by: @vtjnash Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: https://github.com/JuliaIO/ArgTools.jl/compare/4eccde45ddc27e4f7fc9094b2861c684e062adb2...997089b9cd56404b40ff766759662e16dc1aab4b ``` $ git log --oneline 4eccde4..997089b 997089b fix tests for TEMP_CLEANUP, which might be a Lockable (#35) 4a5f003 build(deps): bump actions/cache from 3 to 4 (#36) 84ba9e8 Hardcode doc edit backlink (#34) 9238839 build(deps): bump actions/checkout from 3 to 4 (#33) ``` Co-authored-by: Dilum Aluthge <dilum@aluthge.com> 30 January 2024, 23:09:05 UTC
4b1bbeb make `Base.reduced_indices` more type-stable (#52905) This fixes #35199 by rewriting `Base.reduced_indices` to be type stable (and grounded). I was also able to remove a method since that case is covered by the general case. The changes are illustrated by the following quick benchmarks: ```julia julia> VERSION v"1.10.0" julia> using BenchmarkTools julia> M = [1 2; 3 4] 2×2 Matrix{Int64}: 1 2 3 4 julia> @btime sum($M, dims=$(2)) 194.816 ns (5 allocations: 160 bytes) 2×1 Matrix{Int64}: 3 7 julia> @btime sum($M, dims=$((2,))) 209.385 ns (5 allocations: 224 bytes) 2×1 Matrix{Int64}: 3 7 julia> function my_reduced_indices(inds::Base.Indices{N}, region) where N rinds = inds for i in region isa(i, Integer) || throw(ArgumentError("reduced dimension(s) must be integers")) d = Int(i) if d < 1 throw(ArgumentError("region dimension(s) must be ≥ 1, got $d")) elseif d <= N rinds = let rinds_=rinds ntuple(j -> j == d ? Base.reduced_index(rinds_[d]) : rinds_[j], Val(N)) end end end rinds end my_reduced_indices (generic function with 1 method) julia> Base.reduced_indices(inds::Base.Indices{N}, region::Int) where N = my_reduced_indices(inds, region) julia> Base.reduced_indices(inds::Base.Indices{N}, region) where N = my_reduced_indices(inds, region) julia> @btime sum($M, dims=$(2)) 43.582 ns (1 allocation: 80 bytes) 2×1 Matrix{Int64}: 3 7 julia> @btime sum($M, dims=$((2,))) 43.882 ns (1 allocation: 80 bytes) 2×1 Matrix{Int64}: 3 7 ``` I also rewrote `Base.reduced_indices0` in the same fashion. I wasn't sure how to add tests for this since the improvements are to type-groundedness. Since these changes affect all reductions I hope this solution is robust. 30 January 2024, 22:27:09 UTC
432d248 Restrict some argument types for _truncate_at_width_or_chars (#53031) This resolved some invalidations for me in a package 30 January 2024, 22:13:49 UTC
9f643a0 Fix invalid let syntax from LHS views (#53108) When the frontend lowers an expression like `lhs .+= rhs`, it needs to prevent evaluating the LHS more than once before re-writing to `lhs .= lhs .+ rhs`. If the LHS was a `let` block — commonly generated by `@views` and (since #53064) `@view` — the lowering pass had previously been emitting an invalid `let` temporary. This very directly addresses that case. Fixes #53107. Fixes #44356. 30 January 2024, 21:06:19 UTC
fdb342c make `keytype` and `valtype` work for `UnionAll` `AbstractDict`s (#53116) Fixes #53115 30 January 2024, 20:40:35 UTC
ef69db6 Don't mention __precompile__(false) in error message (#53099) I am fairly sure nothing in my dep tree uses `__precompile__(false)` so this message is misleading. I know we changed another of them a while ago 30 January 2024, 20:40:16 UTC
3510f4e Improve inferrability of large unions, as seen in `LinearAlgebra.wrap` (#53084) The `LinearAlgebra.wrap` makes a large (5 element) union with some almost-similar types. This was intended to be permitted currently in `tmerge`, but due to some unintended interactions in some heuristics, was not. Closes https://github.com/JuliaLang/julia/issues/53075 30 January 2024, 18:58:40 UTC
9f5f540 remove length from Stateful (#51747) Stateful iterators do not have a consistent notion of length, as it is continuously changing as elements are removed. As the main purpose of Stateful is to take elements from multiple places, any notion of HaveShape is invalid for those cases, and thus not useful in general. Fix #47790 30 January 2024, 18:58:00 UTC
b7520d9 `stale_cachefile`: account for path separator when checking @depot (#53058) 30 January 2024, 14:55:20 UTC
75c38e3 Make relocatedepot test more robust (#53110) As discussed in the `#ci-dev` call (see https://github.com/JuliaLang/julia/issues/53103#issuecomment-1915458694 and https://github.com/JuliaLang/julia/pull/53104#discussion_r1470021366) there were two problems: * the use of `Base.require` caused the package to be loaded * the name of the package was a generic placeholder, and clashed with other packages loaded during the tests called with the same generic name. The solution was to rename test module with a more specific name, and replace `Base.require` with `Base.compilecache`, the latter only compiles the package without loading it. Should fix #53103, close #53104. 30 January 2024, 08:30:00 UTC
9816a0b Reland "Don't export Dates.adjust" (#53092) 30 January 2024, 05:34:15 UTC
8cb5854 fix fd_in_limits test on Windows (#52779) Closes #52506 Note that this test dates back to #26341 30 January 2024, 02:42:51 UTC
2f845bb some minor code cleanup of getHostCPUName handling (#53083) Try to minimize the places the code depends on this library function, since it is useful for generic code as long as LLVM is available, but we would also be happy with returning the text "native" here in most cases. Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> 30 January 2024, 02:36:22 UTC
8fdda09 reorder the code in LinearAlgebra.wrap to be slightly more inferrable abstractly By adding a type-assert at the end, we can try to ensure that eltype and ndims info is preserved, even if inference decides not to preserve the giant Union in detail. This avoids complete loss of precision in the subsequent calls (generic_matmatmul! -> _generic_matmatmul!), which has a type-assert on each input of AbstractVecOrMat. Closes #53075 30 January 2024, 02:35:12 UTC
eeebb6e inference: slightly relax union complexity limit Permits forming AbstractVecOrMat from tmerge(AbstractVector, AbstractMatrix}. With the standard limit of 3, this now permits a maximum of either: - 2 dispatch-leaf types + 1 other type - 2 non-dispatch-leaf types 30 January 2024, 02:33:23 UTC
aa10573 inference: avoid having one over-widened type poison the whole union I observed `UnitLowerTriangular{T, AbstractMatrix{T}} where T` being widened to `UnitLowerTriangular{F64, <:Matrix}`, which then forced it to become `Any`. Avoid that by only widening at most to the wrapper as required by the earlier check in this function. 30 January 2024, 02:33:23 UTC
fbd14a2 post-opt: fix minor logic errors (#53100) I've identified and am addressing some minor bugs and optimizations in the post-opt analysis code upon reviewing it. 30 January 2024, 00:57:05 UTC
3f468cd Add a test to avoid #53054 regressions (#53079) Tests issue #53054. The same test is included in backport #53074. 30 January 2024, 00:39:11 UTC
9edf1dd Ensure elision of `require_one_based_indexing` with high-dim array views (#53091) Closes #49332 --------- Co-authored-by: Denis Barucic <barucic.d@gmail.com> 30 January 2024, 00:25:02 UTC
a3357cd Docs: cross-reference `username` and `homedir` (#52451) To improve discoverability (mainly) of `username`. 29 January 2024, 21:04:24 UTC
a26bd7f optimize away `ifelse` when given values are egal (#53102) 29 January 2024, 19:29:12 UTC
b16c4d4 extend `divrem(x, y)` for `BigInt` to `divrem(x, y, rm)` (#53106) Previously `divrem(x, y, rm)` was dispatched to a more generic code path that called `div`, causing unnecessary allocation. Xref #45159. Also replaced the `big` call with `BigInt`, which seems more correct to me. The issue is that a user may define some `<:Integer` type for which `big` doesn't convert to `BigInt`, which seems like it would lead to infinite recursion in this case. 29 January 2024, 19:28:38 UTC
67f7320 builtin: allow equal types in set_global_type without error (#53086) Use the julia notion of equality (type-equal) instead of the strictly C notion (pointer-equal). Also add tests and docs for this function. 29 January 2024, 17:35:30 UTC
aec8823 gf: small perf optimization to jl_method_table_add_backedge (#53085) If this table gets very large, doing a jl_types_equal against every element can be costly. Often they might all be the same signature also, just from different specializations. Try to short-circuit the comparisons to scan in a more optimal order. 29 January 2024, 17:35:06 UTC
08d229f Extensions: make loading of extensions independent of what packages are in the sysimage (#52841) When triggers of extension are in the sysimage it is easy to end up with cycles in package loading. Say we have a package A with exts BExt and CExt and say that B and C is in the sysimage. - Upon loading A, we will immidiately start to precompile BExt (because the trigger B is "loaded" by virtue of being in the sysimage). - BExt will load A which will cause CExt to start precompiling (again because C is in the sysimage). - CExt will load A which will now cause BExt to start loading and we get a cycle. This is fixed in this PR by instead of looking at what modules are loaded, we look at what modules are actually `require`d and only use that to drive the loading of extensions. Fixes https://github.com/JuliaLang/julia/issues/52132. 29 January 2024, 11:51:55 UTC
9669eec Drop support for LLVM 14 (#53094) 29 January 2024, 08:34:37 UTC
741b5da forward-port #53096 to nightly, fix the intermittent REPL test failure (#53097) While the original issue #52739 has been observed only in v1.10, the necessity to enhance the robustness of the corresponding test code is still applicable in the nightly. See #53096 for the details. 29 January 2024, 06:28:39 UTC
0588cd4 remove unnecessary `true &&` part from `at-view` macro (#53064) The modification that expands `@view A[i]` to `true && view(A, i)` appears to go back as far as #20247. However, I'm not entirely sure why this is necessary. Considering that just expanding it to `view(A, i)` still seems to pass the base test suite, I wonder if it might be just better to get rid of that part. 29 January 2024, 02:21:47 UTC
5b64a0d forward-port the test cases added in #53076 (#53077) The fix for #53062 was included in #50805, but it lacked explicit test cases added. This commit cherry-picks the test cases from #53076 to prevent future regression. 29 January 2024, 02:15:18 UTC
746fad0 doc: replace harr HTML entity by unicode (#53066) Documenter does not support HTML entities. See discussion in PR #52078 for further background. Co-authored-by: Dilum Aluthge <dilum@aluthge.com> 29 January 2024, 01:43:22 UTC
dcb196e Revert "Don't export Dates.adjust" (#53089) Reverts JuliaLang/julia#53027 #53027 broke the `doctest` job in CI. 28 January 2024, 21:53:31 UTC
0ce62fe Document the generic functions nextind() and prevind() (#52658) Co-authored-by: inky <git@wo-class.cn> Co-authored-by: Denis Barucic <barucic.d@gmail.com> Co-authored-by: Lilith Orion Hafner <lilithhafner@gmail.com> 28 January 2024, 21:38:20 UTC
d298c44 Document that findnext(f,x,i) and findprev(f,x,i) work for strings. (#52625) 28 January 2024, 16:27:37 UTC
35a5711 Added reference to UnionAll manual for UnionAll docstrings. (#52838) 28 January 2024, 15:43:26 UTC
back to top