https://github.com/JuliaLang/julia

sort by:
Revision Author Date Message Commit Date
5021148 Merge branch 'master' into gb/gc-correct-constraint 14 November 2023, 14:48:42 UTC
d7c421f Whitespace 14 November 2023, 14:48:23 UTC
2732f1c Fix test that depends on heap size 14 November 2023, 12:44:53 UTC
c1f67f8 Use libuv thread instead of std::thread to avoid musl issues (#52149) See https://ariadne.space/2021/06/25/understanding-thread-stack-sizes-and-how-alpine-is-different/ and https://git.alpinelinux.org/aports/commit/?id=4ab6ef38f167f4983008f8b213e5beace8d453f0 --------- Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> 14 November 2023, 06:14:01 UTC
092f95f fix up the test case to pass custom codegen params to `code_llvm` (#52144) 14 November 2023, 02:52:03 UTC
9729f31 Tweak test LOAD_PATH and fix loading test (#52150) This does two things: 1. Give the latest addition to the loading test an active project, so that it works, even without a global one. 2. Standardize the JULIA_LOAD_PATH setting to "@:@stdlib" for both `Base.runtests` (which CI uses) and `make test-*`. Before, the former was using the default load path, while the latter was using "@stdlib" only. However, neither is great. With the default load path, test results could in theory depend on the global environment and tests that accidentally modify the global environment go undetected. The latter resolved those issues. However, without the active project on the load path, the behavior is quite weird - even if you activate a project you can't load it and even if you could, and even if you try to load something explicitly, that project can't find its dependencies. I think "@:@stdlib", is a reasonable compromise here. It has the same protections against the global environment interfering with test results, while also making the active project logic work as usual. Fixes #52148 Fixes #50055 (the remainder thereof at least) 14 November 2023, 01:14:06 UTC
d5f873f fix `--pkgimage[s]` inconsistencies (#52147) 14 November 2023, 00:25:34 UTC
2d449d4 Rewrite sortslices from scratch and add inference tests (#52039) 14 November 2023, 00:22:40 UTC
8fc47fb Merge branch 'master' into gb/gc-correct-constraint 13 November 2023, 22:51:14 UTC
9754dbb add an exception type for missing IR (#52121) This makes it possible to suppress the output and easier to catch the exception if a deployed application hits this situation. 13 November 2023, 18:40:37 UTC
6d5787a Devdocs on fixing precompile hangs, take 2 (#51895) This is #50914, with only the documentation changes, plus an improvement to the warning message. --------- Co-authored-by: Tim Holy <tim.holy@gmail.com> Co-authored-by: Ian Butterworth <i.r.butterworth@gmail.com> 13 November 2023, 16:32:10 UTC
85d7cca Bump JuliaSyntax to 0.4.7 (#52136) This fixes a whole bunch of small but annoying bugs, as described in the JuliaSyntax-0.4.7 release notes https://github.com/JuliaLang/JuliaSyntax.jl/releases/tag/v0.4.7 I've been careful about cutting the JuliaSyntax-0.4.7 release from nonbreaking changes, so we should be able to backport this to 1.10. --- Extended notes about compatibility * The public keyword in https://github.com/JuliaLang/JuliaSyntax.jl/pull/320 is released in JuliaSyntax-0.4.7 but JuliaSyntax is multi-version aware so this is disabled when used as the default parser in Julia 1.10, but is enabled in 1.11-DEV. So should be backportable. * We aim for parsing to `Expr` to always be stable in JuliaSyntax and independent of the host Julia `VERSION`, but we're not fully there yet for 1.11 / 1.10 due to https://github.com/JuliaLang/JuliaSyntax.jl/issues/377. Thus some careful management of the JuliaSyntax-0.4.x branch for now. 13 November 2023, 08:03:29 UTC
e746ba4 Fix typo in devdocs (#52128) 12 November 2023, 05:18:07 UTC
c15f4e9 🤖 [master] Bump the Pkg stdlib from 2d59169bf to debc38b9a (#52124) 11 November 2023, 13:47:41 UTC
fcd62da cfg_simplify: Avoid ambiguous magic number (#52111) This code was using the sentinel value -1 as a special marker in addition to the negative BB indices. That ambiguity was causing `cfg_simplify!` to fail on functions that merge any BB into the first basic block. This change is to use `typemin(Int)` as a marker instead. Fixes #52058 11 November 2023, 08:27:41 UTC
16e61e2 Outline potentially undefined globals during lowering (#51970) Currently [1] it is illegal [2] in IRCode to have a GlobalRef in value position that could potentially throw. This is because in IRCode, we want to assign flags to every statement and if there are multiple things with effects in a statement, we lose precision in tracking which they apply to. However, we currently do allow this in `CodeInfo`. Now that we're starting to make more use of flags in inference also, this is becoming annoying (as it did for IRCode), so I would like to do this transformation earlier. This is an attempt to do this during lowering. It is not entirely clear that this is precisely the correct place for it. We could alternatively consider doing it during the global resolve pass in method.c, but that currently does not renumber SSAValues, so doing it during the renumbering inside lowering may be easier. N.B.: This is against #51853, because this needs some of the inference precision improvements in that PR to avoid regressing the try/catch elision tests (which before that PR, we were incorrectly computing effects for statement-position GlobalRefs). [1] https://github.com/JuliaLang/julia/commit/39c278b728deb04c3a32d70e3e35dcef7822c0c0 [2] https://github.com/JuliaLang/julia/blob/2f63cc99fb134fb4adb7f11ba86a4e2ab5adcd48/base/compiler/ssair/verify.jl#L54-L58 --------- Co-authored-by: Jeff Bezanson <jeff.bezanson@gmail.com> Co-authored-by: Oscar Smith <oscardssmith@gmail.com> 11 November 2023, 00:47:53 UTC
8944a22 Mark the indexing as `@inbounds` in `triu!` (#52117) 10 November 2023, 17:53:03 UTC
b567b37 docs: Add link to external tutorials (#52104) 10 November 2023, 17:52:39 UTC
5303a7a Add `Dict` test whether key is updated on re-assignment (#52110) Tests whether key is updated even if they are equal. Refs #52066 10 November 2023, 17:51:28 UTC
9eb2770 add sizehint! for `first` and make append!/prepend! safer (#51903) First we add an optional API parameter for `sizehint!` that controls whether it is for `push!` (default) or `pushfirst!`. Secondly, we make the offset zero when using `sizehint!` to shrink an array from the end, or the trailing size zero when using it to shring from the beginning. Then we replace the prior implementations of `prepend!` and `append!` with ones that are safe even if the iterator changes length during the operation or if convert fails. The result of `prepend!` may be in an undefined order (because of the `reverse!` call) in the presence of concurrent modifications or errors, but at least all of the elements will be present and valid afterwards. Replaces and closes #49905 Replaces and closes #47391 Fixes #15868 Benchmarks show that repeated `push!` performance (with sizehint) is nearly equivalent to the old append performance: ``` julia> @benchmark append!(x, 1:1000) setup=x=Vector{Float64}(undef,0) BenchmarkTools.Trial: 10000 samples with 10 evaluations. Range (min … max): 1.027 μs … 72.871 μs ┊ GC (min … max): 0.00% … 94.57% Time (median): 1.465 μs ┊ GC (median): 0.00% Time (mean ± σ): 1.663 μs ± 1.832 μs ┊ GC (mean ± σ): 6.20% ± 5.67% ▂▃▅▆█▇▇▆▄▂▁ ▂▁▁▂▂▂▂▃▄▅▇█████████████▇▆▅▅▅▅▅▅▄▅▄▅▅▅▆▇███▆▅▄▃▃▂▂▂▂▂▂▂▂▂▂ ▄ 1.03 μs Histogram: frequency by time 2.31 μs < Memory estimate: 19.69 KiB, allocs estimate: 0. julia> @benchmark append!(x, 1:1000) setup=x=Vector{Int}(undef,0) BenchmarkTools.Trial: 10000 samples with 10 evaluations. Range (min … max): 851.900 ns … 76.757 μs ┊ GC (min … max): 0.00% … 91.59% Time (median): 1.181 μs ┊ GC (median): 0.00% Time (mean ± σ): 1.543 μs ± 1.972 μs ┊ GC (mean ± σ): 6.75% ± 5.75% ▆█▇▃ ▂▃██████▇▅▅▄▅▅▃▂▂▂▃▃▃▂▃▃▃▂▂▂▂▂▁▂▁▂▁▂▂▂▁▁▂▂▁▁▁▁▁▁▁▂▂▂▃▃▃▃▂▂▂▂ ▃ 852 ns Histogram: frequency by time 4.07 μs < Memory estimate: 19.69 KiB, allocs estimate: 0. ``` Co-authored-by: Sukera <Seelengrab@users.noreply.github.com> Co-authored-by: MasonProtter <mason.protter@icloud.com> 10 November 2023, 17:48:31 UTC
786caaa lowering: avoid calling a generated function to make new IR just for the side-effect of calling diff_names for kwarg error checking (#52081) empirically this makes a very minor difference, but it seems to be at least very slightly more optimal in bytes allocated for some tests, though I didn't check very many tests to compare broadly ``` show (6) | 15.72 | 0.18 | 1.1 | 2695.53 | 696.03 show (6) | 15.82 | 0.18 | 1.2 | 2734.35 | 707.94 ``` 10 November 2023, 17:47:44 UTC
0513228 staticdata: gc the global_roots_table contents during saving (#52088) A (very) small memory optimization to avoid saving objects that are essentially unreachable 10 November 2023, 17:45:54 UTC
d88d5cd Optimize `pop!(s::Set, x, default)` (#52023) Minor optimization to compute index in `Dict` only once. This PR should not be merged before #52017. **Master** ``` julia 126.417 μs (1 allocation: 16 bytes) 147.812 μs (1 allocation: 16 bytes) ``` **PR** ``` julia 86.494 μs (1 allocation: 16 bytes) 156.912 μs (1 allocation: 16 bytes) ``` <details> <summary><b><u>Testing code</u></b></summary> ``` julia using BenchmarkTools function PR_pop!(s::Set, x, default) dict = s.dict index = Base.ht_keyindex(dict, x) if index > 0 @inbounds key = dict.keys[index] Base._delete!(dict, index) return key else return default end end N = 10000 x = collect(1:N) x_negative = collect(-N:-1) function pop_all(s, x) for v in x pop!(s, v, -1) end end function pop_all_PR(s, x) for v in x PR_pop!(s, v, -1) end end # Master @btime pop_all(s, x) setup=(s=Set(x)) @btime pop_all(s, x_negative) setup=(s=Set(x)) # PR @btime pop_all_PR(s, x) setup=(s=Set(x)) @btime pop_all_PR(s, x_negative) setup=(s=Set(x)) ``` </details> 10 November 2023, 14:30:10 UTC
42c088b Fix errors in `sort` docstring (#52098) Two chagnes wrapped into one `Base.copymutable` => `Base.copymutable` & `collect` and `Base.copymutable` => `similar` & words. Followup for #52086 and #46104; also fixes #51932 (though we still may want to make `copymutable` public at some point) --------- Co-authored-by: Jameson Nash <vtjnash@gmail.com> 10 November 2023, 11:47:38 UTC
29d78fa inlining: stop passing `SemiConcreteResult` to `inlining_policy` (#52064) It feels a bit inconsistent that the `src` argument of `inlining_policy` needs to handle `SemiConcreteResult` while it doesn't need to handle the other container objects that propagates sources like `CodeInstance` `InferenceResult`, or `VolatileInferenceResult`. This commit makes `inlining_policy` take `result.ir::IRCode` instead when dealing with `result::SemiConcreteResult` for more consistency and clarity. 09 November 2023, 15:04:31 UTC
529e4e7 effects: improve idempotency of effects derived by post-opt analysis (#52085) Since now effects can be refined by post-opt analysis, `typeinf_edge` should propagate `frame.result.ipo_effects` instead of `frame.ipo_effects`. 09 November 2023, 09:37:35 UTC
358540c effects: improve idempotency of effects derived by post-opt analysis Since now effects can be refined by post-opt analysis, `typeinf_edge` should propagate `frame.result.ipo_effects` instead of `frame.ipo_effects`. 09 November 2023, 05:53:31 UTC
81ef12a fixed test case for #43296 09 November 2023, 05:53:31 UTC
eafa1e3 fix up test case for unmatched type param inlining 09 November 2023, 05:53:31 UTC
137783f Move profiling manual section to a new tutorials toplevel heading (#52056) 09 November 2023, 04:37:59 UTC
c95cb95 🤖 [master] Bump the SparseArrays stdlib from 3582898 to 37fc321 (#52089) Stdlib: SparseArrays URL: https://github.com/JuliaSparse/SparseArrays.jl.git Stdlib branch: main Julia branch: master Old commit: 3582898 New commit: 37fc321 Julia version: 1.11.0-DEV SparseArrays version: 1.11.0 Bump invoked by: @ViralBShah Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: https://github.com/JuliaSparse/SparseArrays.jl/compare/3582898a4efd3f504d39076f5a162b9ed1ebcdb2...37fc321e28a32f79a928c24e5739a83d92de5205 ``` $ git log --oneline 3582898..37fc321 37fc321 test: relax allocated tests (#468) bd2bda8 replace ind2sub/sub2ind by CartesianIndices/LinearIndices (#451) 7897f1f test: somewhat more permissive test_throws message (#466) 911cf6a `reverse` for sparse vector/matrix (#450) 713a260 Define algebraic operators for SparseMatrixCSCView (#458) f455a8e Add messages to DimensionMismatch errors (#461) 81fc6f3 Aggressive constprop in sparse * dense (#460) 0b36fdd fix h/vcat invoke dispatch arguments (#464) 6b23902 Add Finch to list of External Julia Sparse Array Libraries (#462) ``` Co-authored-by: Dilum Aluthge <dilum@aluthge.com> 09 November 2023, 03:42:03 UTC
f72ebec [REPLCompletions] fix `limit_aggressive_inference` code path (#52074) 09 November 2023, 03:13:32 UTC
7309756 minor fix on `getfield_nothrow` (#52083) - fixed index of `order` when there are 5 arguments - add type check for `boundscheck` argument 09 November 2023, 02:48:44 UTC
1b967b8 Mark `GenericMemory` as `IndexLinear` (#52082) 09 November 2023, 02:48:20 UTC
f99e6bf fix sorting for iterables that define copymutable (#52086) 09 November 2023, 01:44:29 UTC
f31cd8a Manual: Mention `Base.Checked` module in integer overflow handling (#52071) The `Base.Checked` module is not mentioned in this section of the manual. This helps clarify to the reader an alternative solution provided by `Base` in addition to use of `big()`. 08 November 2023, 17:27:15 UTC
449c7a2 make UndefVarError messages more precise and informative (#51979) Record the 'scope' of the variable that was undefined (the Module, or a descriptive word such as :local or :static_parameter). Add that scope to the error message, and expand the hint suggestions added by the REPL to include more specific advice on common mistakes: - forgetting to set an initial value - forgetting to import a global - creating a local of the same name as a global - not matching a static parameter in a signature subtype Fixes #17062 (although more could probably be done to search for typos using REPL.string_distance and getting the method from stacktrace) Fixes #18877 Fixes #25263 Fixes #35126 Fixes #39280 Fixes #41728 Fixes #48731 Fixes #49917 Fixes #50369 08 November 2023, 17:24:32 UTC
560ede5 Permit the construction of a 1D `StepRangeLen` of `CartesianIndex`es (#50457) 08 November 2023, 16:31:22 UTC
e1150db define and use an internal macro to introduce `Expr(:boundscheck)` (#52077) To avoid the previous uses of `eval` just to manually introduce `Expr(:boundscheck)`. The new macro is named `@_boundscheck` and is intended for internal use only, streamlining our codebase a bit. 08 November 2023, 16:15:37 UTC
cd78e6f make sigaltstack failure nonfatal and clean up on thread return (#52055) Since we already could handle recursion onto the altstack, we can also handle recursion onto the main stack as well (at the cost of losing the ability to handle stackoverflow when this allocation fails). In the future, on mach, we could consider just using a single stack for handling stackoverflow and use a `_resetstkoflw`-like and/or `collect_backtrace_fiber`-like mechanism (like Windows) to pass it from one thread to the next that sequentially needs to use it. Closes #50786 08 November 2023, 15:42:50 UTC
1972432 Make `StridedReinterpretArray`'s `get/setindex` pointer based. (#44186) This PR makes `StridedReinterpretArray`'s `get/setindex` purely pointer based if its root storage is a `Array`/`Memory`. The generated IR would be simpler and (hopefully) easier to optimize. TODO: LLVM's LV dislikes GC preserved `MemoryRef`, reinterpreted `Array`s might block auto vectorization. --------- Co-authored-by: Gabriel Baraldi <baraldigabriel@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> 08 November 2023, 15:36:24 UTC
8f8b9ca Optimizations for Memory{T} allocation calls (#51968) Special case for the Memory{T} allocation in ccall so that we can add attributes and permit method inlining when constructing an Array by removing `@noinline`. 08 November 2023, 15:20:30 UTC
6f6419c Make `pop!(::Set{A}, ::B)` return an A, not B (#52017) Previously, `pop!(::Set, x)` returned `x`, not the element in the set. This matters if multiple different elements are equal and hash to the same. Before: ```julia julia> pop!(Set([1]), 0x01) 0x01 ``` Now: ```julia julia> pop!(Set([1]), 0x01) 1 ``` 08 November 2023, 15:17:57 UTC
9f2f3ce Introduce sizehint!(s, n; shrink = true) to controll shrinkage (#51929) This is a second part of #51629 to introduce `shrink = true` argument for `sizehint!` into public API. 08 November 2023, 14:23:53 UTC
1327dfe allow destructive inlining only when the source is volatile (#52062) Destructive inlining introduced by JuliaLang/julia#51934 implicitly presupposes that inferred `CodeInfo` source has been compressed to the `String` format when cached, which is not generally true for external `AbstractInterpreter`s that may disable the `may_compress` and/or `may_discard_trees` settings. This commit adds a safeguard to ensure the eligibility of such `CodeInfo` source propagated by `VolatileInferenceResult` for destructive inlining. 08 November 2023, 00:51:16 UTC
08e5983 inference: remove the `must_be_codeinf` setting (#52059) This setting is no longer utilized in either the base or known external compiler pipelines. And what allowed by setting `must_be_codeinf = false` can now be achieved using the `cache_mode::UInt8` field, making the setting redundant. 08 November 2023, 00:46:59 UTC
140ea94 [Profile] add builtin Allocs.print and formatting equivalents to Profile.print (#51981) Defines a converter for Allocs to the types implemented by Profile for printing, allowing flamegraph report generation of allocations with just the stdlib tooling. Refs: https://github.com/JuliaLang/julia/pull/42768 For old versions of Julia, you could previously get download a copy of this code that could be included as a polyfill to add this: https://gist.github.com/vtjnash/c6aa4db9dafccb0fd28a65f87d6b1adb 07 November 2023, 18:58:47 UTC
e7345b8 Update `complex` docstring with `Missing` (#52052) The docstring of `complex(T::Type)` is a bit incorrect if `T` contains `Missing`. ```julia julia> T = Union{Int, Missing} Union{Missing, Int64} julia> complex(T) Union{Missing, Complex{Int64}} julia> typeof(complex(zero(T))) Complex{Int64} ``` 07 November 2023, 02:53:54 UTC
494da96 Add some spaces for code-readability (#52053) 07 November 2023, 02:53:35 UTC
32df25b bugfix: don't set pool_live_bytes to zero at the end of GC (#52051) 06 November 2023, 21:56:50 UTC
a3812e7 codegen: add attributes to box functions and more attrs to alloc ones (#51218) Co-authored-by: Jameson Nash <vtjnash@gmail.com> 06 November 2023, 21:44:54 UTC
b1f954c update `//` docstring (#52050) The `//` operator supports non-real numbers, so updating the docstring would be helpful. 06 November 2023, 21:08:13 UTC
fae6b78 inlining: avoid source deserialization by using volatile inference result (#51934) Currently the inlining algorithm is allowed to use inferred source of const-prop'ed call that is always locally available (since const-prop' result isn't cached globally). For non const-prop'ed and globally cached calls, however, it undergoes a more expensive process, making a round-trip through serialized inferred source. We can improve efficiency by bypassing the serialization round-trip for newly-inferred and globally-cached frames. As these frames are never cached locally, they can be viewed as volatile. This means we can use their source destructively while inline-expanding them. The benchmark results show that this optimization achieves 2-4% allocation reduction and about 5% speed up in the real-world-ish compilation targets (`allinference`). Note that it would be more efficient to propagate `IRCode` object directly and skip inflation from `CodeInfo` to `IRCode` as experimented in #47137, but currently the round-trip through `CodeInfo`-representation is necessary because it often leads to better CFG simplification while `cfg_simplify!` being expensive (xref: #51960). 06 November 2023, 15:34:11 UTC
b723f41 interpreter: Fix stacktrace for global incorrectly assumed to be in phi block (#51990) We don't fully set up the interpreter state when evaluating the phi block, because we expect all statements to be valid in value-position (using the IR definition of value position). However, the interpreter was overapproximating the size of the phi-block, leading to the possibility that the evaluation may throw. Correct that by truncating the phi block to the actual last phi. Will be tested in existing tests after #51970. 06 November 2023, 14:38:31 UTC
d834a44 bugfix: load jl_n_threads in jl_gc_pool_live_bytes (#52034) Otherwise we may just observe `gc_n_threads = 0` (`jl_gc_collect` sets it to 0 in the very end of its body) and this function becomes a no-op. 06 November 2023, 10:56:20 UTC
6d4f409 Document that `lt` must return a `Bool` (#52031) A tiny change that does not significantly increase verbosity. We already do `::Bool` checks in sort.jl 06 November 2023, 05:53:43 UTC
d2dd076 optimize `cfg_simplify!` (#51958) > Before ```julia julia> @benchmark CC.cfg_simplify!(ir) setup=(ir = CC.copy(Main.ir)) BenchmarkTools.Trial: 10000 samples with 1 evaluation. Range (min … max): 196.333 μs … 22.691 ms ┊ GC (min … max): 0.00% … 98.80% Time (median): 208.792 μs ┊ GC (median): 0.00% Time (mean ± σ): 219.824 μs ± 390.126 μs ┊ GC (mean ± σ): 4.18% ± 2.40% ▄█▃ ▁▁▁▁▁▁▁▁▁▂▂▃▆███▄▄▅▇▇▅▄▄▄▅▄▄▄▄▃▃▃▃▃▂▂▂▂▂▂▂▂▂▁▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ▂ 196 μs Histogram: frequency by time 235 μs < Memory estimate: 169.48 KiB, allocs estimate: 4005. ``` > After ```julia julia> @benchmark CC.cfg_simplify!(ir) setup=(ir = CC.copy(Main.ir)) BenchmarkTools.Trial: 10000 samples with 1 evaluation. Range (min … max): 49.541 μs … 31.882 ms ┊ GC (min … max): 0.00% … 99.66% Time (median): 54.042 μs ┊ GC (median): 0.00% Time (mean ± σ): 61.492 μs ± 392.747 μs ┊ GC (mean ± σ): 10.36% ± 1.72% ▄█▇▄▁ ▁▁▁▁▁▂▂▃▄▄▅██████▇▅▅▄▃▃▃▃▄▃▃▃▃▂▂▂▂▂▂▂▂▂▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ▂ 49.5 μs Histogram: frequency by time 67.2 μs < Memory estimate: 72.19 KiB, allocs estimate: 808. ``` with ```julia julia> ir, = only(Base.code_ircode(sin, (Float64,)); ``` 06 November 2023, 01:44:01 UTC
65a0fd0 Properly guard UpsilonNode unboxed store (#51853) In https://github.com/JuliaLang/julia/issues/51852, we are coercing a boxed `Union{@NamedTuple{progress::String}, @NamedTuple{progress::Float64}}` to `@NamedTuple{progress::String}` via convert_julia_type. This results in a jl_cgval_t that has a Vboxed that points to a boxed `@NamedTuple{progress::Float64}` but with a `@NamedTuple{progress::String}` type tag that the up upsilonnode code then tries to unbox into the typed PhiC slot. This ends up treating the Float64 as a pointer and crashing in GC. Avoid this by adding a runtime check that the converted value is actually compatible (we already had this kind of check for the non-boxed cases) and then making the unboxing runtime-conditional on the type of the union matching the type of the phic. 05 November 2023, 17:01:11 UTC
9c42df6 carefully cache freshly-inferred edge for call-site inlining (#51975) Currently call-site inlining fails on freshly-inferred edge if its source isn't inlineable. This happens because such sources are exclusively cached globally. For successful call-site inlining, it's necessary to cache these locally also, ensuring the inliner can access them later. To this end, the type of the `cache_mode` field of `InferenceState` has been switched to `UInt8` from `Symbol`. This change allows it to encode multiple caching strategies. A new caching mode can be introduced, e.g. `VOLATILE_CACHE_MODE`, in the future. @nanosoldier `runbenchmarks("inference", vs=":master")` 05 November 2023, 12:56:50 UTC
816e31a 🤖 [master] Bump the Distributed stdlib from fdf56f4 to 41c0106 (#52018) Co-authored-by: Dilum Aluthge <dilum@aluthge.com> 05 November 2023, 02:06:11 UTC
bd917bd Fix indexing boolean ranges with empty ranges (#40764) Co-authored-by: jishnub <jishnub@users.noreply.github.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> 05 November 2023, 01:18:39 UTC
9e75161 Simplify pivot selection in ScratchQuickSort (#51918) 04 November 2023, 17:53:11 UTC
a8a9ddf 🤖 [master] Bump the Pkg stdlib from 75960e509 to 2d59169bf (#52026) Co-authored-by: Dilum Aluthge <dilum@aluthge.com> 04 November 2023, 17:49:55 UTC
58c6b70 Fix bugs and some warnings triggered by clang-tidy (#52002) Most of the changes are NFC (unused variables/stores), but a couple (the change in codegen.cpp and in datatype.c) are potential bugs. It also complained that ios_readline might leak memory, and it looks like that is true While we do run clang-tidy on CI, using `bear` to make a `compile_commands.json` and running `run-clang-tidy-17.py` seems to have found some other things. (we disable dead stores in CI for some reason even though it seems to find some bugs) Co-authored-by: Jameson Nash <vtjnash@gmail.com> 04 November 2023, 13:25:45 UTC
2896759 extend escape_raw_string to allow specifying the delimiter (#52001) Similar to how `escape_raw_string` enabled users to reverse the transform done by string literals, this enables users to reverse the transform done by cmd literals by specifying an argument of a '\`'. Refs #41041 Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com> 04 November 2023, 13:24:03 UTC
bc0d888 make pool_live_bytes metric more accurate (#52015) `pool_live_bytes` was previously lazily updated during the GC, meaning it was only accurate right after a GC. Make this metric accurate if gathered after a GC has happened. 04 November 2023, 13:23:15 UTC
c377e02 doc: AbstractChannel implementation example (#47610) fixes #47608 in the manual Co-authored-by: Jameson Nash <vtjnash@gmail.com> 04 November 2023, 13:22:29 UTC
f3ae44c changed broadcast! into bitarray algorithm (#32048) Cf https://discourse.julialang.org/t/broadcast-vs-slow-performance-allocations/24259/6 for some more discussion and https://github.com/JuliaLang/julia/issues/32047 for the question of validity in view of exceptions. Before: ``` julia> using BenchmarkTools, Random julia> y=1; xsmall=[1]; Random.seed!(42); xlarge=rand(1:4, 100_003); julia> @btime broadcast(==, $xsmall, $y); @btime broadcast(==, $xlarge, $y); @show hash(broadcast(==, xlarge, y).chunks); 860.500 ns (3 allocations: 4.31 KiB) 152.971 μs (3 allocations: 16.59 KiB) hash((broadcast(==, xlarge, y)).chunks) = 0xaa3b5a692968e128 ``` After: ``` julia> @btime broadcast(==, $xsmall, $y); @btime broadcast(==, $xlarge, $y); @show hash(broadcast(==, xlarge, y).chunks); 65.466 ns (2 allocations: 128 bytes) 42.927 μs (2 allocations: 12.41 KiB) hash((broadcast(==, xlarge, y)).chunks) = 0xaa3b5a692968e128 ``` Co-authored-by: Jameson Nash <vtjnash@gmail.com> 04 November 2023, 13:20:35 UTC
d75a00f Simplify, 16bit PDP-11 isn't going to be supported (#45763) PDP_ENDIAN isn't used. Co-authored-by: Viral B. Shah <ViralBShah@users.noreply.github.com> 04 November 2023, 02:27:31 UTC
7df8781 Fix GC.gc docstring (#52008) GC.gc(true) will perform a full mark (note the use of [recollect in gc.c ](https://github.com/JuliaLang/julia/blob/5eaad532f961d4d1a1630b5c5b60499d2a7b9ae5/src/gc.c#L3338)if the previous sweep was not full). Fixes https://github.com/JuliaLang/julia/issues/51796. --------- Co-authored-by: Kristoffer Carlsson <kcarlsson89@gmail.com> Co-authored-by: Kiran Pamnany <kpamnany@users.noreply.github.com> 04 November 2023, 01:54:03 UTC
4462257 lowering: Fix accidental clearing of never-undef flag in closure convert (#51991) This code dates back all the way to the original closure conversion code [1]. At the time, the 0x4 bit of the vinfo was used for tracking whether a variable is assigned in an inner function [2], which apparently needed to be cleared during closure conversion. However, shortly afterwards, the bit was removed [3] and subsequently re-used for never-undef [4]. However, the magic number in the closure conversion pass was never updated, causing the new never-undef flag to be accidentally cleared unconditionally. [1] https://github.com/JuliaLang/julia/commit/a1ee8676f00fc14bd67aaf7eb20ce46ff99f322e [2] https://github.com/JuliaLang/julia/blob/a1ee8676f00fc14bd67aaf7eb20ce46ff99f322e/src/ast.scm#L217-L218 [3] https://github.com/JuliaLang/julia/commit/7e7d74332953497cd0dba278aa243f3efc284cee [4] https://github.com/JuliaLang/julia/commit/3d8f8d14787e697fab4543e1bca1ce4519977281 Co-authored-by: Jeff Bezanson <jeff@juliahub.com> 03 November 2023, 19:09:39 UTC
3886803 Properly guard UpsilonNode unboxed store In #51852, we are coercing a boxed `Union{@NamedTuple{progress::String}, @NamedTuple{progress::Float64}}` to `@NamedTuple{progress::String}` via convert_julia_type. This results in a jl_cgval_t that has a Vboxed that points to a boxed `@NamedTuple{progress::Float64}` but with a `@NamedTuple{progress::String}` type tag that the up upsilonnode code then tries to unbox into the typed PhiC slot. This ends up treating the Float64 as a pointer and crashing in GC. Avoid this by adding a runtime check that the converted value is actually compatible (we already had this kind of check for the non-boxed cases) and then making the unboxing runtime-conditional on the type of the union matching the type of the phic. Fixes #51852 03 November 2023, 18:41:52 UTC
9c63250 doc: correct apparent inconsistency in describing redefining globals (#47083) The documentation stated that built-in constants and functions could both be redefined and _not_ be redefined, while it seemed to more nearly mean shadowed in the former case. Co-authored-by: Jameson Nash <vtjnash@gmail.com> 03 November 2023, 14:58:49 UTC
1a4a3a0 Fix task suspension in GC for JL_TIMING (#52005) The timing system does not currently support nesting task suspensions, so this `JL_TIMING_SUSPEND_TASK` added in #51489 is not permitted since it is called from within the GC suspension. This was causing Tracy to crash upon recording with "zone ended twice" 03 November 2023, 14:56:30 UTC
b3fe970 Fixup static analyzer warnings in staticdata.c (#51984) 03 November 2023, 14:55:26 UTC
09cbae8 Revise Windows implementation of splitdrive (#42204) This PR makes three improvements to the Windows `splitdrive` implementation: 1. The matched regex is split into pieces and annotated. 2. Forward and backward slashes are considered equivalent. This fixes #38492. 3. The patterns in the regex are reordered so that long UNC paths and long drive letters are once more recognized. This has been broken since #19695 (Julia 0.5). Co-authored-by: Jameson Nash <vtjnash@gmail.com> 03 November 2023, 14:53:33 UTC
746cfdf abstractdict: Create separate error type wrong-key insertions (#41778) Previously we were trying to do string formatting in Core.Compiler, where this functionality is unavailable. Create a separate type that can be thrown regardless of whether string processing is available. 03 November 2023, 14:46:22 UTC
e98aaba Mention export from InteractiveUtils in docs (#36971) I recently had a frustrating experience where seemingly valid code that worked in the REPL did not work in my own packages. Specifically, it is not mentioned in the documentation that `subtypes` was being automatically exported from `InteractiveUtils` when using the REPL. Thanks to @oheil for pointing this out (see exchange [here](https://discourse.julialang.org/t/error-with-base-generic-function-calls/44174)). Although in my case I figured out that `subtypes` wasn't exactly what I needed, I still feel the documentation should be explicit about what functions are in Base and what functions aren't to avoid the kind of off-putting experience I had. Co-authored-by: Dilum Aluthge <dilum@aluthge.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> 03 November 2023, 14:45:32 UTC
f2a5fb9 tweak outdated test cases (#51994) Now those concretized calls are DCE-ed even though they are inlineable. So we don't need to call e.g. `cfg_simplify!`. 03 November 2023, 04:01:17 UTC
5eaad53 Remove `ArgumentError()` in `parse_cache_header()` when `@depot` cannot be resolved (#51989) In the original implementation of relocatable package cache files, `parse_cache_header()` was made responsible for resolving `@depot/`-relative paths, and it threw an `ArgumentError()` if it could not find one. However, this could happen for a few reasons: 1. The `JULIA_DEPOT_PATH` could be set incorrectly, so the appropriate source text files could not be found in an appropriate `packages/` directory. 2. The package could have been upgraded, leaving a cache file for an older version on-disk, but no matching source files. For a concrete example of (2), see the following `bash` script: #!/bin/bash set -euo pipefail TEMP_PATH=$(mktemp -d) JULIA=${JULIA:-julia} echo JULIA: ${JULIA} export JULIA_DEPOT_PATH="${TEMP_PATH}" trap 'rm -rf ${TEMP_PATH}' EXIT # Create a `Foo.jl` that has an `internal.jl` within it FOO_DIR=${JULIA_DEPOT_PATH}/dev/Foo mkdir -p ${FOO_DIR}/src cat >${FOO_DIR}/Project.toml <<EOF name = "Foo" uuid = "00000000-0000-0000-0000-000000000001" version = "1.0.0" EOF cat >${FOO_DIR}/src/Foo.jl <<EOF module Foo include("internal.jl") end EOF cat >${FOO_DIR}/src/internal.jl <<EOF # Nothing to see here, folks EOF ${JULIA} -e "import Pkg; Pkg.develop(\"Foo\"); Pkg.precompile()" # Change `Foo` to no longer depend on `internal.jl`; this should invalidate its cache files cat >${FOO_DIR}/src/Foo.jl <<EOF module Foo end EOF rm -f ${FOO_DIR}/src/internal.jl # This should print `SUCCESS!`, not `FAILURE!` ${JULIA} -e 'using Foo; println("SUCCESS!")' || echo "FAILURE!" This pull request removes the `ArgumentError()`, as it seems reasonable to require `parse_cache_header()` to not throw errors in cases like these. We instead rely upon a higher level validation to reject a cachefile whose depot cannot be found, which should happen when `stale_cachefile()` later checks to ensure that all includes are found on-disk, (which will be false, as these paths start with `@depot/`, an unlikely path prefix to exist). 02 November 2023, 21:35:20 UTC
2a84214 Revert "add more methods and tests for reductions over empty arrays" (#52003) Reverts JuliaLang/julia#29919 CI was older than I realized on this, so this needed some updates to tests and docstrings 02 November 2023, 20:10:57 UTC
9bc6994 [Artifacts] Pass artifacts dictionary to `ensure_artifact_installed` dispatch (#51995) The artifacts dict is not lowered to ensure_artifact_installed which causes to load the ".toml" during runtime for lazy artifacts 02 November 2023, 20:07:01 UTC
09617ac add more defaults for reductions over empty arrays (#29919) From discussion in #28535 02 November 2023, 19:31:46 UTC
dabb93a Document the fields of `VersionNumber` (#50179) `VersionNumber`'s fields are currently not documented, and therefore, private by default. However, if people want to use `VersionNumber` for anything other than the documented comparison operations, users will have to access the fields. 02 November 2023, 14:06:48 UTC
55e5ee3 Clarify conversion-and-promotion.md example code for `convert` (#50274) Closes: https://github.com/JuliaLang/julia/issues/50273 Co-authored-by: Jameson Nash <vtjnash@gmail.com> 02 November 2023, 14:00:23 UTC
924aac9 macroexpand: handle const/atomic struct fields correctly (#51980) Fixes #51899 02 November 2023, 13:53:26 UTC
54996ca add function `Sys.username()` (#51897) The commit introduces a new function to Base which returns the current user's username retrieved from the password database. Resolves #48302 Closes #48928 Co-authored-by: Steven G. Johnson <stevenj@mit.edu> 02 November 2023, 13:48:16 UTC
ad86772 test: eachindex for arbitrary number of arguments (#51941) added test cases for `eachindex` to cover arbitrary number of arguments ![image](https://github.com/JuliaLang/julia/assets/49565677/fa39cb8c-2523-40c0-90f3-e3f90f54397e) 02 November 2023, 09:34:08 UTC
7c74274 fix `pointer` for `Memory` by deleting incorrect method (#51963) The fallback method for `AbstractArray` was correct and the custom one for `Memory` wasn't. 02 November 2023, 09:32:23 UTC
8b97aa1 Improve style in Base/experimental.jl [NFC] (#51965) Make the checks line up with the error messages. 02 November 2023, 08:47:14 UTC
2994463 Stop test printing LLVM IR to stdout (#51974) Fixes https://github.com/JuliaLang/julia/issues/51971 02 November 2023, 08:46:12 UTC
58a2a45 make NEWS.md link style more consistent (#51978) Minor PR to make the PR link punctuation a bit more consistent in the NEWS file, and adds a couple of missing PR links. 02 November 2023, 08:45:48 UTC
06de99e Make Scope immutable (#51976) Addresses keno review comment in https://github.com/JuliaLang/julia/pull/50958#discussion_r1378513975 02 November 2023, 08:44:49 UTC
013311c compiler: use `_uncompressed_ir` instead of direct `ccall` (#51972) 02 November 2023, 00:32:29 UTC
c019132 Update documentation for min and max with missing values (#48906) With respect to https://github.com/JuliaLang/julia/pull/25403 , `min` and `max` methods are supposed to return "missing" whenever we pass "missing" value as one of the arguments, this PR updates the inline documentation to reflect the same. 01 November 2023, 20:20:40 UTC
405ce11 further fix to the new promoting method for AbstractDateTime subtraction (#51967) 01 November 2023, 17:18:08 UTC
e2a6424 clean up identifiers defined in `Main` (#51878) A re-do of #51411 that should be non-breaking. - Loaded packages do not need explicit bindings - The name `MainInclude` does not need to be visible - Put Main's eval and include in the module like all other modules and hide them explicitly instead 01 November 2023, 17:16:12 UTC
5185487 When ASAN is enabled, disable DebugObjectManagerPlugin on JITLink+ELF (#51917) 01 November 2023, 16:16:33 UTC
5db9dbd docs: add some clarifications to methods.md (#51938) Closes #40650 Rebase of https://github.com/JuliaLang/julia/pull/40667 with edits, since upstream deleted their repo Co-authored-by: Patrick Toche <contact@patricktoche.com> 01 November 2023, 14:42:48 UTC
2adf54a [devdocs] Improve documentation about building external forks of LLVM (#50207) Suggested by @vchuravy. --------- Co-authored-by: Jameson Nash <vtjnash@gmail.com> 01 November 2023, 14:28:55 UTC
back to top