https://github.com/JuliaLang/julia

sort by:
Revision Author Date Message Commit Date
808d7ac inference: fix exception type of `typename` call 21 November 2023, 09:51:17 UTC
da1258c `typeinf_local`: factor into `update_cycle_worklists!` utility 21 November 2023, 09:51:17 UTC
15ab026 inference: add reflection utility for exception type analysis This commit defines functions that mirror our tools for analyzing return types and computational effects. The key point to discuss is that this commit introduces two functions: `Base.exception_types` and `Base.exception_type`. `Base.exception_types` acts like `Base.return_types`, giving a list of exception types for each method that matches with the given call signature. On the other hand, `Base.exception_type` is akin to `Base.infer_effects`, returning a single exception type that covers all potential outcomes entailed by the given call signature. I personally lean towards the latter for its utility, particularly in testing scenarios, but I included `exception_types` too for consistency with `return_types`. I'd welcome any feedback on this approach. 21 November 2023, 09:15:27 UTC
65090d1 tweak the error printed for `PrecompileError` to indicate that it doesn't have to be due to `__precompile__(false)` (#51367) 21 November 2023, 02:08:45 UTC
67161a3 Silence noisy test in `test/cmdlineargs.jl` (#52225) This is spamming ([example](https://buildkite.com/julialang/julia-master/builds/30247#018be235-0cd3-43bb-ba43-cc378ac0d682/792-1056)) ``` From worker 12: ERROR: LoadError: UndefVarError: `@which` not defined in `Main` From worker 12: Stacktrace: From worker 12: [1] top-level scope From worker 12: @ :0 From worker 12: [2] lower From worker 12: @ ./meta.jl:163 [inlined] From worker 12: [3] eval_user_input(errio::IOContext{Base.PipeEndpoint}, ast::Any, show_value::Bool) From worker 12: @ Base ./client.jl:141 From worker 12: [4] run_main_repl(interactive::Bool, quiet::Bool, banner::Symbol, history_file::Bool, color_set::Bool) From worker 12: @ Base ./client.jl:477 From worker 12: [5] repl_main From worker 12: @ Base ./client.jl:561 [inlined] From worker 12: [6] _start() From worker 12: @ Base ./client.jl:535 From worker 12: in expression starting at none:1 ``` in all jobs 20 November 2023, 17:10:15 UTC
5cb0e51 build: ASAN fixes for glibc (#51755) For the `sigsetjmp` bypass; looks like glibc removed the `__libc_siglongjmp` symbol in glibc 2.34, so change to using the approach taking by our `dlopen` wrapper instead. Adopts topolarity's fixes from #50170 Resolves #47698 Co-authored-by: Jameson Nash <vtjnash@gmail.com> 20 November 2023, 15:45:21 UTC
7327a8f effects: add some more test cases for `Base.@propagate_inbounds` (#52236) 20 November 2023, 13:23:39 UTC
72cd63c jitlayers: reduce excess alignment of #52182 (#52210) 20 November 2023, 03:03:15 UTC
c8ca350 inference: Model type propagation through exceptions (#51754) Currently the type of a caught exception is always modeled as `Any`. This isn't a huge problem, because control flow in Julia is generally assumed to be somewhat slow, so the extra type imprecision of not knowing the return type does not matter all that much. However, there are a few situations where it matters. For example: ``` maybe_getindex(A, i) = try; A[i]; catch e; isa(e, BoundsError) && return nothing; rethrow(); end ``` At present, we cannot infer :nothrow for this method, even if that is the only error type that `A[i]` can throw. This is particularly noticable, since we can now optimize away `:nothrow` exception frames entirely (#51674). Note that this PR still does not make the above example particularly efficient (at least interprocedurally), though specialized codegen could be added on top of this to make that happen. It does however improve the inference result. A second major motivation of this change is that reasoning about exception types is likely to be a major aspect of any future work on interface checking (since interfaces imply the absence of MethodErrors), so this PR lays the groundwork for appropriate modeling of these error paths. Note that this PR adds all the required plumbing, but does not yet have a particularly precise model of error types for our builtins, bailing to `Any` for any builtin not known to be `:nothrow`. This can be improved in follow up PRs as required. 19 November 2023, 22:11:17 UTC
f5d189f effects: don't taint `:noub` for `:new` allocations (#52222) After #52169, the UB previously associated with allocations with uninitialized fields has been addressed, so there's no longer a need to taint `:noub` for `:new` allocations during abstract interpretation. I believe, even without #52169, uninitialized field does not inherently leads to UB, but just causes inconsistency of the program, since what actually causes UB is `getfield` that accesses into whatever object, but not the allocation itself. 19 November 2023, 15:50:33 UTC
c07893d Cartesian indexing for SubArrays with non-integer AbstractRanges (#52094) With #50457 now merged, an `AbstractRange` of `CartesianIndex`es should use `CartesianIndexing` in constructing a `SubArray`. I've limited the method to integer ranges, as this is the case where we know for sure that the indexing may be linear. Fixes ```julia julia> view(1:2, StepRangeLen(CartesianIndex(1), CartesianIndex(1), 0)) 0-element view(::UnitRange{Int64}, StepRangeLen(CartesianIndex(1,), CartesianIndex(1,), 0)) with eltype Int64 ``` --------- Co-authored-by: N5N3 <2642243996@qq.com> 19 November 2023, 10:09:19 UTC
ec3911c Add `lmul!` and `rmul!` for `Bidiagonal` (#51777) 19 November 2023, 08:36:43 UTC
19ca07d cfg_simplify: Fix phi node renaming corner case bug (#52224) Depending on the order of basic block, cfg_simplify! could occasionally forget to renumber a phinode edge, causing at best a downstream assertion and at worst a miscompile. The root of this issue is that ordinarily, we detect whether a phinode edge requires later renaming by looking at the last inserted index, and since we process all indices by order, detecting whether we have already inserted a certain value is a simple comparison. However, cfg_simplify! re-arranges the order of basic blocks, so this check no longer works. Instead, we check whether the incoming edge has already been scheduled. This is slightly less precise (because it is possible for the edge itself to not have been scheduled, even though the value has been), but correct and a slight imprecision here at worst causes a negligible compile-time increase. 19 November 2023, 08:29:29 UTC
41a6f26 Thread lattice through escape analysis (#52223) As of #51494 is used in the base pipeline, so external abstract interpreters inherit it by default. To avoid breaking them, make sure we properly pass down the lattice. 19 November 2023, 08:29:15 UTC
e75dd47 [nghttp2_jll] Upgrade to v1.58.0 (#52218) Usual memo to self: * update version in `stdlib/nghttp2_jll/Project.toml` and `deps/nghttp2.version` * update test in `stdlib/nghttp2_jll/test/runtests.jl` * refresh checksums with `make -f contrib/refresh_checksums.mk -j nghttp2` 18 November 2023, 11:32:51 UTC
959b474 docs: update latest stable version (#52215) 18 November 2023, 10:43:17 UTC
e754f20 Add missing type annotation reported by JET (#52207) We already know from https://github.com/lgoettgens/julia/blob/d0a3edddda407302930f3b2a742a7c8ebbcafb5b/base/loading.jl#L1212 that the value is not `nothing`. However, type inference does not know that as the check lives in a different function. 18 November 2023, 06:30:38 UTC
81afdbc codegen: remove UB from uninitialized bitstypes in new (#52169) In the time since the creation of issue #26764, there _is_ now 'a way to say to llvm "I don't care what this value is, but it always has to be the same"' using the `freeze` instruction, so we can use that to instruct LLVM to not give us undefined behavior when users are using uninitialized memory. There should not be an impact if users were already avoiding this paradigm and are fully initializing their structs. Fixes #26764 17 November 2023, 23:44:45 UTC
625bbde build: disable DT_TEXTREL warning for i686 (#52211) This warning was distracting and annoying me, so I looked into whether it was a bug. Turns out the warning is harmless (loading the object just will make a copy of the ~2kb text field into memory). So add the code to disable it, either with different assembly or different linker flags. Default to continuing to use the same assembly. 17 November 2023, 23:43:52 UTC
20440fd Move "Creating Packages" from Pkg.jl docs (#52102) 17 November 2023, 19:46:52 UTC
9aa7980 codegen: ensure i1 bool is widened to i8 before storing (#52189) Teach value_to_pointer to convert primitive types to their stored representation first, to avoid exposing undef bits later (via memcpy). Take this opportunity to also generalizes the support for zext Bool to anywhere inside any struct for changing any bitwidth to a multiple of 8 bytes. This would change a vector like <2 x i4> from occupying i8 to i16 (c.f. LLVM's LangRef), if such an operation were expressible in Julia today. And take this opportunity to do a bit of code cleanup, now that codegen is better and using helpers from LLVM. Fixes #52127 17 November 2023, 18:58:01 UTC
045b6f9 invmod(n::BitInteger): efficient native modular inverses (#52180) Implement algorithm described in https://arxiv.org/pdf/2204.04342.pdf. The algorithm is pleasingly simple and efficient and the generic Julia implementation is also really enjoyable. 17 November 2023, 16:46:13 UTC
234a758 post-opt-analysis: use EA to refine `:effect_free` (#51494) This commit is aiming to integrate EA into the Base compiler pipeline by using it during the post-opt analysis to refine `:effect_free` information. In doing so, this also generalizes `argescapes` field of `Union{InferenceResult,CodeInstance}` to `analysis_results::AnalysisResults` so that it can hold results of multiple post-optimization analyses, where `AnalysisResults` is designed to be linked-list like data structure. This is because an external `AbstractInterpreter`, like `EscapeAnalyzer`, might perform several post-optimization analyses. Honestly speaking, however, I’m not completely satisfied with this solution yet. It might make more sense to require a single post-optimization analysis for every `AbstractInterpreter` always, as like what we do for the other fields like `rettype`. Co-authored-by: Keno Fischer <keno@juliacomputing.com> 17 November 2023, 16:25:51 UTC
1134315 effects: taint :noub for memory operations (#52186) Currently our effects system does not track `:noub` about memory operations. While this sounds unsafe, it's actually not problematic in most contexts. We restrict concrete-evaluation for anything involing memory operations anyway, as mutable values aren't propagated as compile-time constants (except `Symbol`s). However, it turns out that this is actually causing very dangerous situations in REPL completion context, where `REPLInterpreter` enables aggressive concrete-evaluation that propagates mutable values as constants and ignores the `:consisten`-cy requirement that is usually tainted by memory operations. This commit addresses this issue by tainting `:noub` for memory operations. This commit ends up being somewhat extensive because it would cause significant regression in REPL completions if we make memory ops naively taint `:noub`. Complicating this further is the Base's uses of `boundscheck=false` for peak performance of core memory operations, where bounds checking is conducted separately before performing actual memory operations, e.g.: > essentials.jl ```julia function getindex(A::Array, i::Int) @boundscheck ult_int(bitcast(UInt, sub_int(i, 1)), bitcast(UInt, length(A))) || throw_boundserror(A, (i,)) memoryrefget(memoryref(getfield(A, :ref), i, false), :not_atomic, false) end ``` Here `boundscheck=false` should generally taint `:noub` immediately, but in this kind of case `:noub` can actually be `NOUB_IF_NOINBOUNDS` since it has `@boundscheck` that asserts safety of the memory ops. Note that we could employ a similar technique to `getfield` if we change the above implementation to something like: ```julia function getindex(A::Array, i::Int) memoryrefget(memoryref(getfield(A, :ref), i, @_boundscheck), :not_atomic, @_boundscheck) end ``` although this would end up being slower (check the difference at the code LLVM emits on each implementation if interested). To this end, this commit also introduces new `:noub_if_noinbounds` setting to `@assume_effects` and use it within the base implementation. Now `UInt8` is not enough to represent `EffectsOverride` information, the bit is enlarged to `UInt16`. While this approach might not be ideal, I don't think there is a better way to do this. An alternative I tried before making this commit was to introduce new semantics for `Expr(:boundscheck, ...)` where `Expr(:boundscheck, nothing)` will be constant folded to `false` during codegen while during inference time it does not taint `:noub`. I felt this further complicates the already complex complext `:boundscheck` situation, so I decided to go with the approach to expand the settings set of `@assume_effects`. 17 November 2023, 16:21:29 UTC
03bbf91 remove `switch_[to|from]_irinterp` mechanism (#52204) This seems to cause (probably not very profitable) union-splitting all over the place and complicate code generation. Let's just remove it. As a result, this would slightly reduce image sizes too. 17 November 2023, 15:00:13 UTC
8af47bd irinterp: check if `IRCode` has been compacted (#52203) Adds assertion that checks if `IRCode` passed to irinterp or post-opt analysis has been compacted. And using the invariant from the assertion, this commit also propagates `inst::Instruction` for `scan!` callbacks instead of `stmt` and removes `idx::Int` argument since it is redundant with `inst.idx`. 17 November 2023, 14:58:49 UTC
f1f84a2 [OpenBLAS_jll] Upgrade to v0.3.25 (#52178) See the [release notes of v0.3.25](https://github.com/OpenMathLib/OpenBLAS/releases/tag/v0.3.25). Usual memo to self for the upgrade: * update version number in `stdlib/OpenBLAS_jll/Project.toml` * run `make -f contrib/refresh_checksums.mk -j openblas` to update the checksums * update version number and commit hash in `deps/openblas.version` 17 November 2023, 14:23:49 UTC
29be3ef Move heap_size batching code into pair of functions (#51611) Co-authored-by: Gabriel Baraldi <baraldigabriel@gmail.com> 17 November 2023, 13:21:50 UTC
a65bc9a jitlayers: replace sharedbytes intern pool with one that respects alignment (#52182) The llvm optimizations may increase alignment beyond the initial MAX_ALIGN. This pool's alignment was previously only `sizeof(struct { atomic<int> RefCount; size_t Length; char Data[]; })` however, potentially resulting in segfaults at runtime. Fixes #52118. Should make CI much happier. 17 November 2023, 02:55:10 UTC
1cb85ad Revert "Support sorting iterators (#46104)" (#52010) Co-authored-by: Lilith Orion Hafner <lilithhafner@gmail.com> 17 November 2023, 02:41:28 UTC
f26947b cap the number of GC threads to number of cpu cores (#52192) 17 November 2023, 02:09:09 UTC
b1c8e12 Use pkgimages for coverage & malloc tracking by ignoring native code in tracked packages (#52123) 16 November 2023, 19:51:25 UTC
40e56a5 add some instrumentation to measure page utilization per size class (#52164) One of the limitations is that it's only accurate right after the GC. Still might be helpful for observability purposes. 16 November 2023, 19:15:03 UTC
7f18f76 inference: enhance memoryop tfunc robustness (#52185) Make them able to handle potential `Vararg` argument. Also adds plenty of tests. 16 November 2023, 16:51:06 UTC
4689850 Compatible parent index when displaying dots in SubArrays (#52097) Fix #52095 by passing the `reindex`ed indices through `to_indices` to convert them to `Integer`s. This should strip `CartesianIndex`es in particular, which resolves the issue. Fixes: ```julia julia> view(1:2, [CartesianIndex(2)]) 1-element view(::UnitRange{Int64}, CartesianIndex{1}[CartesianIndex(2,)]) with eltype Int64: 2 ``` 16 November 2023, 16:14:45 UTC
2fb06a7 inference: streamline `builtin_effects` (#52177) Composed of the following two commits: --- > stop passing `arginfo` to `builtin_effects` (e758d079d7f1aa185f2e90273be0340d669dfa3e) `builtin_effects` no longer requires the `arginfo` parameter, as `getfield_effects` doesn't depend on analyzing `fargs` for `:boundscheck` information anymore. The equivalent analysis is now done as the post-opt analysis. Given that `:boundscheck` expressions are now lowered to an independent statement, even if we need to analyze `fargs` within `builtin_effects`, we would likely need to pass `sv::AbsIntState` too in order to allow it to use `ssa_def_slot`. For now, it's more efficient to just eliminate the passing of `arginfo` since it is not necessary. --- > exclude the first builtin function from `argtypes` of `builtin_effects` (90c7477223f72839a2927a1ef6b3d293fde6a945) Streamlined the `builtin_effects` function to accept `argtypes` without including the builtin function itself. The first argument in the previous implementation of `argtypes` was just redundant. This change might reduce unnecessary allocations. --- 16 November 2023, 07:19:22 UTC
574c5d1 exclude the first builtin function from `argtypes` of `builtin_effects` Streamlined the `builtin_effects` function to accept `argtypes` without including the builtin function itself. The first argument in the previous implementation of `argtypes` was just redundant. This change might reduce unnecessary allocations. 16 November 2023, 05:29:13 UTC
3c82403 stop passing `arginfo` to `builtin_effects` `builtin_effects` no longer requires the `arginfo` parameter, as `getfield_effects` doesn't depend on analyzing `fargs` for `:boundscheck` information anymore. The equivalent analysis is now done as the post-opt analysis. Given that `:boundscheck` expressions are now lowered to an independent statement, even if we need to analyze `fargs` within `builtin_effects`, we would likely need to pass `sv::AbsIntState` too in order to allow it to use `ssa_def_slot`. For now, it's more efficient to just eliminate the passing of `arginfo` since it is not necessary. 16 November 2023, 05:29:13 UTC
253cddc enhance maintainability of `jl_ir_` accessors (#52167) By allowing us to change data size at one place when we make a change to the layout of compressed IR. 16 November 2023, 05:27:32 UTC
aa00204 🤖 [master] Bump the SparseArrays stdlib from 7786a73 to f154de2 (#52183) Co-authored-by: Dilum Aluthge <dilum@aluthge.com> 16 November 2023, 00:54:28 UTC
221f074 🤖 [master] Bump the SparseArrays stdlib from 37fc321 to 7786a73 (#52181) Stdlib: SparseArrays URL: https://github.com/JuliaSparse/SparseArrays.jl.git Stdlib branch: main Julia branch: master Old commit: 37fc321 New commit: 7786a73 Julia version: 1.11.0-DEV SparseArrays version: 1.11.0 Bump invoked by: @IanButterworth Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: https://github.com/JuliaSparse/SparseArrays.jl/compare/37fc321e28a32f79a928c24e5739a83d92de5205...7786a73cefe4147fb423a5fa529aa583ca6c877c ``` $ git log --oneline 37fc321..7786a73 7786a73 Add Aqua compat. Create CompatHelper.yml (#470) ``` Co-authored-by: Dilum Aluthge <dilum@aluthge.com> 15 November 2023, 20:08:06 UTC
5edcdc5 [REPL] fix computation of startpos for path completions (#52009) Fixes https://github.com/JuliaLang/julia/issues/51985 Ensure that the REPL completions escape and unescape text correctly, using the correct functions, and accounting for exactly what the user has currently typed. The old broken method is left around for Pkg, since it has an over-reliance on it returning incorrect answers. Once Pkg is fixed, we can delete that code. Co-authored-by: Jameson Nash <vtjnash@gmail.com> 15 November 2023, 19:15:16 UTC
eaef647 Make c func `abspath` consistent on Windows. Fix tracking path conversion. (#52140) Explanation for the `GetFullPathName` behavior https://developercommunity.visualstudio.com/t/GetFullPath-fails-if-given-empty-string/483359#T-N486167 15 November 2023, 02:42:19 UTC
25bcc60 tidy up the inlining algorithm (#52158) 15 November 2023, 01:38:15 UTC
539ca89 atexit: move hook before precompile output (#51849) To show how this is used, this updates the profile_printing_listener background job to use this mechanism. 15 November 2023, 01:34:47 UTC
a26e23a make objectid effects total (#52119) Avoids the need to rehash most dictionaries on reload. System image data size increase is about 109MB -> 112MB, since there are about 130k Arrays, 75k CodeInstances, 30k Methods, 80k TypeMapEntries, 75k MethodInstance, and 36k Core.Bindings, and other mutable objects. 15 November 2023, 01:13:40 UTC
cd98632 test: disable bug-report=rr-local on aarch64 (#52172) This always fails on CI. Refs https://github.com/JuliaLang/julia/pull/51776 15 November 2023, 01:11:34 UTC
0cf2bf1 Reduce compile time for generic matmatmul (#52038) This is another attempt at improving the compile time issue with generic matmatmul, hopefully improving runtime performance also. @chriselrod @jishnub There seems to be a little typo/oversight somewhere, but it shows how it could work. Locally, this reduces benchmark times from https://github.com/JuliaLang/julia/pull/51812#issuecomment-1780394475 by more than 50%. --------- Co-authored-by: Chris Elrod <elrodc@gmail.com> 14 November 2023, 21:58:03 UTC
d8a410c improve "deadlock avoidance" of unexpectedly abrubt exits 14 November 2023, 21:09:18 UTC
67ec832 restore deprecated function for Pkg tests 14 November 2023, 21:09:18 UTC
b638381 atexit: move hook before precompile output To show how this is used, this updates the profile_printing_listener background job to use this mechanism. Also ensure mktemp and mktempdir cleanup even on unexpected exit: Previously this was relying on all Tasks running to completion, which is not a good assumption. Add the atexit hook, so that even if they do not run to completion, they still get cleaned up. 14 November 2023, 21:09:07 UTC
4fd9692 test: fix race in atexit test Exposed by the presence of any atexit hooks in the new process, such as added in this PR. 14 November 2023, 21:09:07 UTC
4bc45a7 Transpose elements in `copy_transpose!` (#52116) 14 November 2023, 16:49:44 UTC
1a885c4 AbsInt: thread lattice throughout `abstract_call_gf_by_type` (#52162) 14 November 2023, 15:55:00 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
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
back to top