https://github.com/JuliaLang/julia

sort by:
Revision Author Date Message Commit Date
7f8635f refactor `abstract_eval_statement_expr` (#54111) This commit divides the various expr handlings into `abstract_eval_xxx` subroutines in order to make the logic clearer and easier to follow. 19 April 2024, 04:05:35 UTC
f8b4b79 inference: handle `LimitedAccuracy` in `handle_global_assignment!` (#54130) `abstract_eval_statement` may return `LimitedAccuracy` so we need to handle it before applying `widenconst`. - fixes #54125 18 April 2024, 23:50:06 UTC
a67661e add function to query GC page size (#54115) 18 April 2024, 23:17:59 UTC
148330e Fix typo in docs for `partialsortperm` (#54137) 18 April 2024, 22:55:39 UTC
42b3134 Fix writing of AnnotatedChars to AnnotatedIOBuffer (#53941) The AnnotatedString(::AnnotatedChar) constructor actually does not exist. Considering that String(::Char) is not defined, and we don't try this anywhere else, the obvious fix is to just construct the appropriate AnnotatedString here. We can think about more properly Char-optimised writes in the future if it comes up. 18 April 2024, 15:59:44 UTC
38a9725 Support case-changes to Annotated{String,Char}s (#54013) Previously, any case changes to Annotated{String,Char} types triggered "fall back to non-annotated type" non-specialised methods. It would be nice to keep the annotations though, and that can be done so long as we keep track of any potential changes to the number of bytes taken by each character on case changes. This is unusual, but can happen with some letters (e.g. the upper case of 'ΕΏ' is 'S'). To handle this, a helper function annotated_chartransform is introduced. This allows for efficient uppercase/lowercase methods (about 50% overhead in managing the annotation ranges, compared to just transforming a String). The {upper,lower}casefirst and titlecase transformations are much more inefficient with this style of implementation, but not prohibitively so. If somebody has a bright idea, or they emerge as an area deserving of more attention, the performance characteristics can be improved. As a bonus, a specialised textwidth method is implemented to avoid the generic fallback, providing a ~12x performance improvement. To check that annotated_chartransform is accurate, as are the specialised case-transformations, a few million random collections of strings were pre- and post-annotated and checked to be the same in a fuzzing check performed with Supposition.jl. const short_str = Data.Text(Data.Characters(), max_len=20) const short_strs = Data.Vectors(short_str, max_size=10) const case_transform_fn = Data.SampledFrom((uppercase, lowercase)) function annot_caseinvariant(f::Function, strs::Vector{String}) annot_strs = map(((i, s),) -> AnnotatedString(s, [(1:ncodeunits(s), :i => i)]), enumerate(strs)) f_annot_strs = map(((i, s),) -> AnnotatedString(s, [(1:ncodeunits(s), :i => i)]), enumerate(map(f, strs))) pre_join = Base.annotated_chartransform(join(annot_strs), f) post_join = join(f_annot_strs) pre_join == post_join end @check max_examples=1_000_000 annot_caseinvariant(case_transform_fn, short_strs) This helped me determine that in annotated_chartransform the "- 1" was needed with offset position calculation, and that in the "findlast" calls that less than *or equal* was the correct equality test. 18 April 2024, 15:58:47 UTC
c741bd3 stdlib: faster kronecker product between hermitian and symmetric matrices (#53186) The kronecker product between complex hermitian matrices is again hermitian, so it can be computed much faster by only doing the upper (or lower) triangular. As @andreasnoack will surely notice, this only true for types where `conj(a*b) == conj(a)*conj(b)`, so I'm restricting the function to act only on real and complex numbers. In the symmetric case, however, no additional assumption is needed, so I'm letting it act on anything. Benchmarking showed that the code is roughly 2 times as fast as the vanilla kronecker product, as expected. The fastest case was always the UU case, and the slowest the LU case. The code I used is below ```julia using LinearAlgebra using BenchmarkTools using Quaternions randrmatrix(d, uplo = :U) = Hermitian(randn(Float64, d, d), uplo) randcmatrix(d, uplo = :U) = Hermitian(randn(ComplexF64, d, d), uplo) randsmatrix(d, uplo = :U) = Symmetric(randn(ComplexF64, d, d), uplo) randqmatrix(d, uplo = :U) = Symmetric(randn(QuaternionF64, d, d), uplo) dima = 69 dimb = 71 for randmatrix in [randrmatrix, randcmatrix, randsmatrix, randqmatrix] for auplo in [:U, :L] for buplo in [:U, :L] a = randmatrix(dima, auplo) b = randmatrix(dimb, buplo) c = kron(a,b) therm = @belapsed kron!($c, $a, $b) C = Matrix(c) A = Matrix(a) B = Matrix(b) told = @belapsed kron!($C, $A, $B) @show told/therm end end end ``` Weirdly enough, I got this expected speedup in one of my machines, but when running the benchmark in another I got roughly the same time. I guess that's a bug with `BechmarkTools`, because that's not consistent with the times I get running the functions individually, out of the loop. Another issue is that although I added a couple of tests, I couldn't get them to run. Perhaps someone here can tell me what's going on? I could run the tests from LinearAlgebra, it's just that editing the files made no difference to what was being run. I did get hundreds of errors from `triangular.jl`, but that's untouched by my code. --------- Co-authored-by: Oscar Smith <oscardssmith@gmail.com> 18 April 2024, 06:13:49 UTC
0f7674e Fix libasan runpath behaviour. (#54104) This is necessary with LLVM 17 but was extracted to a separate patch xref https://github.com/JuliaLang/julia/pull/53070 17 April 2024, 14:44:55 UTC
f30aae5 inference: remove staled `:method` handling (#54110) Within `abstract_eval_statement_expr` 17 April 2024, 10:51:54 UTC
306124c Fix integer overflow in `skip(s::IOBuffer, typemax(Int64))` (#54070) Fixes #53908 by clamping before doing addition. This also fixes an issue with negative skips if `io.offset` isn't zero. I am assuming that `io.size+1` cannot overflow. 17 April 2024, 09:03:58 UTC
159f4d7 Explicitly compute stride in unaliascopy for SubArray (#54102) Fix https://github.com/JuliaLang/julia/issues/54100 by computing the stride and offset explicitly. This is unlikely to be a performance concern, so we don't need to hard-code this. 16 April 2024, 23:35:27 UTC
c557636 Profile: fix heap snapshot is valid char check (#53984) Followup to https://github.com/JuliaLang/julia/pull/53833 Fixes a failure seen in https://github.com/JuliaLang/julia/pull/53974 (below) I believe this is the more correct check to make? The heapsnapshot generated from this PR is viewable in vscode. ``` 2024-04-06 09:33:58 EDT From worker 7: ERROR: Base.InvalidCharError{Char}('\xc1\xae') 2024-04-06 09:33:58 EDT From worker 7: Stacktrace: 2024-04-06 09:33:58 EDT From worker 7: [1] throw_invalid_char(c::Char) 2024-04-06 09:33:58 EDT From worker 7: @ Base ./char.jl:86 2024-04-06 09:33:58 EDT From worker 7: [2] UInt32 2024-04-06 09:33:58 EDT From worker 7: @ ./char.jl:133 [inlined] 2024-04-06 09:33:58 EDT From worker 7: [3] category_code 2024-04-06 09:33:58 EDT From worker 7: @ ./strings/unicode.jl:339 [inlined] 2024-04-06 09:33:58 EDT From worker 7: [4] isassigned 2024-04-06 09:33:58 EDT From worker 7: @ ./strings/unicode.jl:355 [inlined] 2024-04-06 09:33:58 EDT From worker 7: [5] isassigned 2024-04-06 09:33:58 EDT From worker 7: @ /cache/build/tester-amdci5-14/julialang/julia-master/julia-41d026beaf/share/julia/stdlib/v1.12/Unicode/src/Unicode.jl:138 [inlined] 2024-04-06 09:33:58 EDT From worker 7: [6] print_str_escape_json(stream::IOStream, s::String) 2024-04-06 09:33:58 EDT From worker 7: @ Profile.HeapSnapshot /cache/build/tester-amdci5-14/julialang/julia-master/julia-41d026beaf/share/julia/stdlib/v1.12/Profile/src/heapsnapshot_reassemble.jl:239 2024-04-06 09:33:59 EDT From worker 7: [7] (::Profile.HeapSnapshot.var"#5#6"{IOStream})(strings_io::IOStream) 2024-04-06 09:33:59 EDT From worker 7: @ Profile.HeapSnapshot /cache/build/tester-amdci5-14/julialang/julia-master/julia-41d026beaf/share/julia/stdlib/v1.12/Profile/src/heapsnapshot_reassemble.jl:192 ``` 16 April 2024, 20:00:23 UTC
d7a354a Throw `ConcurrencyViolationError` on `yield` with `current_task` (#53974) Previously, this errored with a nasty type assert *somewhere* in the runtime. Throwing a proper `ConcurrencyViolationError` allows this to be debugged, and makes the error condition better known. 16 April 2024, 19:56:42 UTC
824ceef Clarify `wait(::Task)` documentation (#53722) Small follow-up to https://github.com/JuliaLang/julia/pull/53685, since having critical documentation for a specific method be only mentioned in a catch-all docstring isn't quite as helpful as it could be (e.g. when looking at inline documentation with LSP, where it happens to know that the variable being passed is a `Task`). In addition, this also documents that `wait` on a `Task` will throw if given `current_task`. I've also split the function into a prototype and the actual implementation, so that the same "more specific docs at the method definition" transform can be applied for `GenericCondition` too. 16 April 2024, 19:42:43 UTC
f259eba Ignore inlining costs for precompilation with `--compile=all` (#53798) This helps to minimize the amount of missed precompiles that occur by eliding the inlining cost check when julia is run under `--compile=all`. This will lead to slightly larger sysimage sizes. However, in practice it leads to more extensive and successful precompilation, which can minimize the number of JIT events in call sites with dynamic dispatch. This is an alternative to #53547, where removing the inlining cost check was made universal. However, that lead to ~15% larger sysimage sizes by default. This implements Jeff's suggestion that this mode be enabled under `--compile=all`. 16 April 2024, 19:40:08 UTC
fb3ae01 inference correctness: fields and globals can revert to undef (#53750) Particularly under precompilation, fields and globals can revert to being undef, which is heavily relied upon by many `__init__` methods in the ecosystem (because JLL emits this pattern, so we cannot simply disallow it). While here, also fix and improve several places where we compute or use the isdefined check poorly. 16 April 2024, 19:23:19 UTC
13d4f0e remove hand-coded methods for (U)Int128 on 32 bit systems (#53867) I believe this code existed to work around bugs that LLVM used to have with 128 bit numbers on 32 bit systems, but I'm not entirely sure. 16 April 2024, 18:24:54 UTC
a82a28f newinterp: add external cache mode (#54074) When working on debugging inference behavior or performance tuning, having direct access to inspect the global cache can be really handy. Right now, `@newinterp` utilizes the `Core.Compiler.InternalCodeCache` for its global caching, which doesn’t allow for such inspections. This commit introduces the `@newinterp NewInterp cache_externally=true` option. This enhancement allows `NewInterp` to store `CodeInstance` in an external cache whose type is `IdDict{MethodInstance, CodeInstance}`. 16 April 2024, 14:27:37 UTC
e5821b3 LinearAlgebra: replace internal broadcast indexing method by getindex (#54071) Within the `@inbounds` annotation, these two should be equivalent, so we may call the public method instead of the internal one. Performance remains unchanged by this. 16 April 2024, 12:57:45 UTC
7ee15d1 LinearAlgebra: fix copyto! with aliased arrays (#54044) Fixes https://github.com/JuliaLang/julia/issues/39460 by ensuring that the matrices are `unalias`ed before copying. Also added `dataids` and `unaliascopy` for some of the wrapper types, which makes more such `copyto!` operations with aliased matrices return correct results. 16 April 2024, 12:56:59 UTC
d8b9810 set `@max_methods 2` for `error` (#54086) 16 April 2024, 00:07:54 UTC
c0611e8 Allow PrecompileTools to see MI's inferred by foreign abstract interpreters (#54069) Partially reverts https://github.com/JuliaLang/julia/pull/49391 PrecompileTools uses the timing infrastructure to snoop on the inference process. The reason for #49391 was that this could lead to accidental pollution of the caches with foreign results (https://github.com/timholy/SnoopCompile.jl/issues/338) After #52233 and especially #53336 we now filter results by cache owner and don't try to cache foreign code using the native pipeline. Motivated by https://github.com/JuliaGPU/GPUCompiler.jl/pull/567 which demonstrated that a foreign code instance would not be cached without PrecompileTools. 15 April 2024, 17:22:32 UTC
9de150c fix cumsum ignoring first element returned in call to promote_op (#53461) Include an option to have `promote_op` throw an error rather than return `Union{}`. We're not changing the default behaviour, but in some cases returning `Union{}` will result in less clear error messages. Closes #53438 @LilithHafner may have comments 15 April 2024, 13:22:04 UTC
3dd07fd document that print(x) and repr(x) call 2-arg show (#53927) As mentioned [here](https://discourse.julialang.org/t/improving-doc-for-display-print-show-repr/69124/4), the `print(x)` and `repr(x)` docstrings say that they default to calling `show`, but don't specifically say that they call the 2-argument `show`. (Probably because they pre-date the 3-argument `show`). 15 April 2024, 13:21:32 UTC
7ba1b33 Don't use `do` as variable name in doc strings. (#53924) 15 April 2024, 07:40:47 UTC
98f4747 optimizer: do not delete statements that may not `:terminate` (#52999) Fixes #52991. Currently this commit marks the test case added in #52954 as `broken` since it has relied on the behavior of #52991. I'm planning to add followup changes in a separate commit. 15 April 2024, 04:40:47 UTC
7e7e280 reachability: Ignore virtual catch predecessor (#54077) For catch blocks, we add a virtual `0` predecessor in addition to the predecessor from the enter block. However, for reachability purposes, only real predecessors count, so ignore that here. 14 April 2024, 19:40:36 UTC
c91edf3 irinterp: Move irinterp va processing (#54076) Currently we perform the va transform inside the innermost construct of IRInterpretationState. However, I think it makes more sense to lift this processing one level, so that the `argtypes` for the constructor that takes `ir` matches `ir.argtypes`, while the one for the constructor that takes `mi` is the full expanded out argtypes. NFC for base, but the `ir` constructor is used in downstream external absints. However, I think this way around is better for them also, since it's not always clear what format the argtypes they have are in and the va direction is easy and well supported, so it's better to have the option. 14 April 2024, 19:40:16 UTC
8d577ab `zeros`/`ones`/`fill` may accept arbitrary axes that are supported by `similar` (#53965) The idea is that functions like `zeros` are essentially constructing a container and filling it with a value. `similar` seems perfectly placed to construct such a container, so we may accept arbitrary axes in `zeros` as long as there's a corresponding `similar` method that is defined for the axes. Packages therefore would only need to define `similar`, and would get `zeros`/`ones` and `fill` for free. For example, the following will work after this: ```julia julia> using StaticArrays julia> zeros(SOneTo(2), 2) 2Γ—2 Matrix{Float64}: 0.0 0.0 0.0 0.0 julia> zeros(SOneTo(2), Base.OneTo(2)) 2Γ—2 Matrix{Float64}: 0.0 0.0 0.0 0.0 ``` Neither of these work on the current master, as `StaticArrays` doesn't define `zeros` for these combinations, even though it does define `similar`. One may argue for these methods to be added to `StaticArrays`, but this seems to be adding redundancy. The flip side is that `OffsetArrays` defines exactly these methods, so adding them to `Base` would break precompilation for the package. However, `OffsetArrays` really shouldn't be defining these methods, as this is type-piracy. The methods may be version-limited in `OffsetArrays` if this PR is merged. On the face of it, `trues` and `falses` should also work similarly, but currently these seem to be bypassing `similar` and constructing a `BitArray` explicitly. I have not added the corresponding methods for these functions, but they may be added as well. 14 April 2024, 14:51:22 UTC
b9aeafa Overload `Base.literal_pow` for `AbstractQ` (#54010) 13 April 2024, 20:07:01 UTC
a721658 clamp: Turn `ifelse` into ternary (#54038) Fixes #54022 Co-authored-by: Klaus Crusius <KlausC@users.noreply.github.com> 13 April 2024, 13:12:27 UTC
396abe4 ir: Set refined when narrowing PhiNode in IncrementalCompact (#54061) This is a bit of a tricky one. What happens here is that IncrementalCompact finds that one branch of an if/else is dead, so one of the incoming values of the PhiNode goes away. This may have the effect of narrowing the type of the PhiNode (if the branches have different types). In the latest iteration of our compiler, such situations need to be annotated with IR_FLAG_REFINED or `Refined()`, otherwise irinterp will skip them on revisit. In theory, the fix is quite simple: Check whether the type is being refined and if so, set the flag. However, this code sits inside IncrementalCompcat, which currently neither performs lattice operations nor sets any Refined flags by itself. The three possible options here are: 1. Thread lattice through IncrementalCompact. 2. Use an egal check inside IncrementalCompact rather than the proper lattice query. This is legal, but may overapproximate the need for `Refined`, thus causing unnecessary work later. 3. Move the phi node narrowing outside of IncrementalCompact. This PR takes a hybrid approach of 2 and 3. Approach 1 is undesirable, because we do not want to recompile all of IncrementalCompact for every lattice, just for this one query. I almost took approach 2, but it is unsatisfying, because of the imprecision, which could cuase a lot of extra work in pathological cases. The primary downside of approach 3 is that now every pass that performs IncrementalCompact with CFG manipulation enabled will need to call the `reprocess_phi_node!` helper. We have two of these in base (adce_pass! and `compact!(..., true)` although only the former as access to a lattice. The compromise I came up with here is to do the egality check, except leaving the PhiNode in place when it fails rather than setting `Refined` internally. I think this is ok. There's a bit of an issue with duplicate work, because the first thing that the lattice check will do is check for equality, but that only happens in the case where a refinement actually is required, which is both rarer and profitable. Finally, I'm pretty sure I've found this issue before, but I cannot find any writeup on it, so if somebody remembers me writing it up somewhere, please let me know so I can add appropriate cross references. --------- Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> 13 April 2024, 03:16:52 UTC
d47cbf6 Allow for querying of build_id from objects (#53943) For GPUCompiler we would like to support a native on disk cache of LLVM IR. One of the longstanding issues has been the cache invalidation of such an on disk cache. With #52233 we now have an integrated cache for the inference results and we can rely on `CodeInstance` to be stable across sessions. Due to #52119 we can also rely on the `objectid` to be stable. My inital thought was to key the native disk cache in GPUCompiler on the objectid of the corresponding CodeInstance (+ some compilation parameters). While discussing this with @rayegun yesterday we noted that having a CodeInstance with the same objectid might not be enough provenance. E.g we are not gurantueed that the CodeInstance is from the same build artifact and the same precise source code. For the package images we are tracking this during loading and validate all contents at once, and we keep explicitly track of the provenance chain. This PR adds a lookup up table where we map from "external_blobs" e.g. loaded images, to the corresponding top module of each image, and uses this to determine the build_id of the package image. 13 April 2024, 01:22:51 UTC
be3bc9a Only run Test.jl precompilation workload when outputting (#54045) These types of workloads are usually only run when generating output. 12 April 2024, 15:08:10 UTC
1ae41a2 Fix typos in docs (#54059) 12 April 2024, 03:14:37 UTC
db247ce LinearAlgebra: Remove unnecessary adjoint/transpose for bidiag/tridiag (#54024) These should be unnecessary, as the fallback methods do the same. 11 April 2024, 19:22:45 UTC
f085913 constprop: Add facility for widening arguments before constprop (#54036) There are various situations where we may want to constprop with something other than the most precise concrete arguments in order to make the resulting cache more useful to other call sites. One particular example of this might be a method where non-concrete inference already discovered that one argument is unused: ``` function foo(a, b::DispatchOnly) expensive_to_compile(a) end ``` Right now, we will generally perform constprop for every different value of `b`, even though we already have the information that `b` is unused. Another example is external absints that may want to treat certain types fully symbolically. They may want to substitute concrete values for an abstract domain. This adds the facility to do both of these things by 1. Adding an appropriate interp hook in the constprop path 2. Adding a WidendedSimpleArgtypes wrapper that's like SimpleArgtypes but works around an issue where we would override cache information using values from concrete eval, which is not legal if the argtypes were widened. 11 April 2024, 14:11:55 UTC
a7fd6a7 Allow mutable-for-identity-only types to be inlined into IR (#54034) This extends the value-inability predicate to allow mutable structs that do not have any mutable fields. The motivating example for this is ScopedValue, which is mutable only for identity. By allowing it in this predicate, more of the ScopedValue support code becomes concrete-eval eligible, rather than attempting to constprop for every single ScopedValue, saving compilation time. --------- Co-authored-by: Shuhei Kadowaki <aviatesk@gmail.com> 11 April 2024, 12:05:43 UTC
dc8857a ir: Add version of compute_trycatch for IRCode (#54035) For ir transform passes that need to be aware of current_scope. Currently no users in Base, but available for external absint. --------- Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> 11 April 2024, 12:05:30 UTC
630f754 Fix comparison base for line table compression (#54032) I'm not entirely sure what the original intent of this statement was, but the effect ends up being that some codeloc entries end up negative in the compressed representation, but the code always assumes unsigned integers, so things roundtripped badly, leading to badly corrupted stack traces. I guess this might have been a rebase mistake, since the same line exists (correctly) a few lines prior. Fixes #54031. 11 April 2024, 03:54:41 UTC
45fb084 inlining: remove unused `allow_abstract::Bool` keyword argument (#53601) 10 April 2024, 23:55:08 UTC
3357d1b revert moving "creating packages" from Pkg.jl (#53509) As mentioned in https://github.com/JuliaLang/julia/pull/52102#issuecomment-1845523326, having this information be moved from Pkg to Base creates a quite uncomfortable split between information about the package manager between the Pkg docs and Base. Pkg PR: https://github.com/JuliaLang/Pkg.jl/pull/3818 10 April 2024, 21:02:45 UTC
f46cb4c allow extensions to trigger from packages in [deps] (#54009) There is a use case where you have a weak dependency (for one of your extensions) that is misbehaving and you quickly want to try debug that issue. A workflow that feels reasonable for this could be: ``` pkg> dev WeakDependency # do some fixes in this dependency julia> using Package, WeakDependency # this loads the extension of Package triggered by loading WeakDependency # check that things work ok now ``` This doesn't work right now for two reasons: 1. Doing the `dev WeakDependency` will add the dependency to `[deps]` but not remove it from `[weakdeps]` which means you all of a sudden are in the scenario described in https://pkgdocs.julialang.org/v1/creating-packages/#Transition-from-normal-dependency-to-extension which is not what is desired. 2. The extension will not actually load because you can right now only trigger extensions from weak deps getting loaded, not from deps getting loaded. Point 1. is fixed by https://github.com/JuliaLang/Pkg.jl/pull/3865 Point 2. is fixed by this PR. 10 April 2024, 18:08:10 UTC
e9a24d4 πŸ€– [master] Bump the Pkg stdlib from 162634c56 to 8f772ffa7 (#54018) Stdlib: Pkg URL: https://github.com/JuliaLang/Pkg.jl.git Stdlib branch: master Julia branch: master Old commit: 162634c56 New commit: 8f772ffa7 Julia version: 1.12.0-DEV Pkg version: 1.12.0 Bump invoked by: @KristofferC Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: https://github.com/JuliaLang/Pkg.jl/compare/162634c5615d12b889e4b64f3cff95d1c377f189...8f772ffa72d86c81f03cddce2e779d6b330414e3 ``` $ git log --oneline 162634c56..8f772ffa7 8f772ffa7 prune manifest after the set of some deps have been "demoted" to weakdeps (#3864) 88c38b2cd make `add` and `dev` on a package remove it from the set of weak dependencies (#3865) 9210a1da5 fix how entry point to package is computed with `path` provided in project file (#3850) 77620a945 extensions: fixup entire manifest (#3720) 8cc835c7d Report failures to download artifacts as failures (#3860) 2f318cf66 remove unused PkgPrecompileError type (#3858) ``` Co-authored-by: Dilum Aluthge <dilum@aluthge.com> 10 April 2024, 13:11:43 UTC
d183ee1 Improve performance of `ncodeunits(::Char)` (#54001) This improves performance of `ncodeunits(::Char)` by simply counting the number of non-zero bytes (except for `\0`, which is encoded as all zero bytes). For a performance comparison, see [this gist]( https://gist.github.com/Seelengrab/ebb02d4b8d754700c2869de8daf88cad); there's an up to 10x improvement here for collections of `Char`, with a minor improvement for single `Char` (with much smaller spread). The version in this PR is called `nbytesencoded` in the benchmarks. Correctness has been verified with Supposition.jl, using the existing implementation as an oracle: ```julia julia> using Supposition julia> const chars = Data.Characters() julia> @check max_examples=1_000_000 function bytesenc(i=Data.Integers{UInt32}()) c = reinterpret(Char, i) ncodeunits(c) == nbytesdiv(c) end; Test Summary: | Pass Total Time bytesenc | 1 1 1.0s julia> ncodeunits('\0') == nbytesencoded('\0') true ``` Let's see if CI agrees! Notably, neither the existing nor the new implementation check whether the given `Char` is valid or not, since the only thing that matters is how many bytes are written out. --------- Co-authored-by: Sukera <Seelengrab@users.noreply.github.com> 09 April 2024, 21:06:49 UTC
f870ea0 Correct return types in docstrings of sincos* (#54006) Just a tiny correction to the return types noted in the docstrings, and include a phrase in `sincosd` that's present in the other two. 09 April 2024, 20:09:41 UTC
97ac3ec make `view(::Memory, ::Colon)` produce a Vector (#54005) 09 April 2024, 16:44:50 UTC
7099bdd LinearAlgebra: LazyString in interpolated error messages (#53976) 09 April 2024, 15:55:26 UTC
26070ca irinterp: Don't try to access mi.def if it's not a Method (#54003) I don't believe this is reachable from the base compiler pipeline, since we don't run irinterp on toplevel things, but I am seeing this in downstream packages. 09 April 2024, 14:32:00 UTC
3988860 Bump the StyledStrings stdlib from e0ca0f8 to bfdb4c3 (#53993) Overall, a large pile of polish with some fixes too. Git log of commits involved: bfdb4c3 Modify tests to also pass when run as stdlib c084718 Fix return type of AnnotatedString write 180ab6c Try fixing the non-stdlib tests via refactor 528f245 Docs: minor index copyedits, and americanizations 9c015e2 Docs: create an examples page a9772d4 Markup annot keys cannot contain null character 243d959 Allow interpolation of underline properties fd2adcc Docs: tweak face description for clarity 4b06b79 Docs: clarify that AbstractString is wrapped 7f07b1b Docs: second paragraph reads better as not a note a3d15cb Docs: forgot to mention font attribute 9c10614 Show colour and styling in docs 59fd944 Add docs previews to PR CI 9709612 Mark styled and withfaces functions as public API a4c7678 Make withfaces behave more consistently 50d4198 Add speculative consideration of future face keys 04b5031 Add fuzzing to the tests set 7dc3c26 Allow color strings as in Face constructor c419317 Don't annotate interpolated empty strings dfef96d Adjust prioritisation of composed styling in parse 9a23e9e Test the display of parsing errors 1d7f42a Test parsing of each and every inline face attr 84ba211 No need to escape a string when parsing e3c0453 Add missing is-macro check to face value interp db006ed Mistyped font attribute as "face" in the parser 230fa8e Test errors emitted with various malformed stystrs 31f4c1d Overly aggressive color names check in styled strs bec9216 Expand on faces tests 093385e Improve showing of RGB SimpleColors without MIME d60d545 Test the show methods of SimpleColor and Face cb05225 Test the AnnotatedIOBuffer printstyled method c36911c Test the (legacy) loading of colors from envvars 14b4c6e Reduce test code verbosity by importing more names 3db948f Add a battery of HTML encoding tests 316bdd5 Remove extranious spaces from HTML underline style 62a7d25 Adjust named HTML colours to be not-garish 81e031e Add a battery of ANSI encoding tests a14c3b1 Check the Smulx termcap instead of Su b9d4aea Use the redmean colour distance in 8-bit approx f9976ad More careful comma handling with inline face specs 24e10e4 Accept a style symbol as the sole underline value 2ba234a Use the hardcoded bold ANSI code ab4f681 Refactro termcolor8bit to be less magic a8b8aaf Fix off-by-one errors in termcolor8bit 21e127a Introduce fuzzer for styled markup a3b40b7 Mention the loading of faces.toml in the docs 16c0e4f Fix functional parsing of inline face weight 7da631f Consolidate use of "ws" and "whitespace" in EBNF b76c1ce Introduce ismacro convenience func to parser b1cb60c Fix handling of space around inline face attrs e22d058 Clarification in styled markup grammar docs 701d29f Introduce isnextchar convenience func to parser 6efb352 Fix edge-case parsing of empty face construct 10f6839 Implement new functional styled markup interpreter e2d2d5f Refactor stylemacro into a submodule 11c5bd9 Introduce specialised write for AnnotatedIOBuffer 09 April 2024, 14:21:58 UTC
0e28cf6 inference: fixes cache lookup with extended lattice elements (#53953) The previous local cache lookup system wasn't working well for caches with extended lattice elements that are transformed from the caller context to the callee context by `matching_cache_argtypes`. To address this, the current commit moves the call to `matching_cache_argtypes` right before `cache_lookup`, instead of within the `InferenceResult` constructor. Note that this adjustment leads to `given_argtypes` being allocated even when there's a cache hit, potentially affecting performance negatively. I'm looking to further optimize `matching_cache_argtypes` in an upcoming commit. 08 April 2024, 10:46:14 UTC
a5356a4 optimize construction of `InferenceResult` for constant inference 08 April 2024, 08:25:09 UTC
41347f5 πŸ€– [master] Bump the StyledStrings stdlib from e0ca0f8 to bfdb4c3 08 April 2024, 08:17:03 UTC
62df400 inference: fixes cache lookup with extended lattice elements The previous local cache lookup system wasn't working well for caches with extended lattice elements that are transformed from the caller context to the callee context by `matching_cache_argtypes`. To address this, the current commit moves the call to `matching_cache_argtypes` right before `cache_lookup`, instead of within the `InferenceResult` constructor. Note that this adjustment leads to `given_argtypes` being allocated even when there's a cache hit, potentially affecting performance negatively. I'm looking to further optimize `matching_cache_argtypes` in an upcoming commit. 08 April 2024, 07:09:27 UTC
e4f2124 Test and fix non-int-length bug in `view(::Memory, ::Union{UnitRange, Base.OneTo})` (#53991) We assumed, falsely, that `length(inds) isa Int`. The length must be convertible to an `Int` or we throw, but that conversion may need to be explicitly performed. Fixes #53990 CC @oscardssmith @vtjnash @odow 08 April 2024, 03:46:14 UTC
c5a3b65 Remove trailing slash in "Official https://julialang.org/ release" (#53978) 07 April 2024, 16:36:34 UTC
243ebc3 Support broadcasting over structured block matrices (#53909) Fix https://github.com/JuliaLang/julia/issues/48664 After this, broadcasting over structured block matrices with matrix-valued elements works: ```julia julia> D = Diagonal([[1 2; 3 4], [5 6; 7 8]]) 2Γ—2 Diagonal{Matrix{Int64}, Vector{Matrix{Int64}}}: [1 2; 3 4] β‹… β‹… [5 6; 7 8] julia> D .+ D 2Γ—2 Diagonal{Matrix{Int64}, Vector{Matrix{Int64}}}: [2 4; 6 8] β‹… β‹… [10 12; 14 16] julia> cos.(D) 2Γ—2 Matrix{Matrix{Float64}}: [0.855423 -0.110876; -0.166315 0.689109] [1.0 0.0; 0.0 1.0] [1.0 0.0; 0.0 1.0] [0.928384 -0.069963; -0.0816235 0.893403] ``` Such operations show up when using `BlockArrays`. The implementation is a bit hacky as it uses `0I` as the zero element in `fzero`, which isn't really the correct zero if the blocks are rectangular. Nonetheless, this works, as `fzero` is only used to determine if the structure is preserved. 07 April 2024, 14:22:09 UTC
1febcd6 Fix typos in docstrings (#53986) 07 April 2024, 07:37:27 UTC
821c608 Fix #52989: DateTime parser would return an error when parsing a year string (#53954) Issue #52989. Originally checked on version 1.10.0 but still relevant in the current version in master Bug: When executing the method DateTime to create a DateTime value with a string input only containing a year (ex: "2000") the method returns an 'ArgumentError: Invalid DateTime string' when it should, from what I understood, return a DateTime like 2000-01-01T00:00:00 seeing as if you call the same method with a number indicating a year (ex: 2000) the method returns correctly. Fix: The fix was simple, on the first tryparsenext_base10 block (line 207-211) where a year is parsed from the string the exit condition i > end_pos should jump into 'done' so it returns a correct value instead of 'error' 06 April 2024, 17:24:11 UTC
4e5bd66 fix minor typo in mktempdir docs (#53977) This is a minor change, just adding a missing word to a docstring for `Base.Filesystem.mktempdir` 06 April 2024, 17:20:21 UTC
f7c7410 `LazyString` in `DimensionMismatch` error messages in broadcasting (#53975) This reduces dynamic dispatch, and makes JET happier. Something similar is already used in line 523. 06 April 2024, 14:20:47 UTC
273d91e Make reshape and view on Memory produce Arrays and delete wrap (#53896) - Make reshape and view with one based indexing on Memory produce Arrays - delete wrap Implements https://github.com/JuliaLang/julia/issues/53552#issuecomment-2024288283 --------- Co-authored-by: Jameson Nash <vtjnash@gmail.com> 06 April 2024, 13:12:39 UTC
c707a53 Explicit namespaces in sort-related docstrings (#53968) This represents the unexported names by the fully qualified namespace, which makes it simpler to interpret the keyword arguments. Otherwise, for example, it's not obvious where `Forward` comes from in the `sort` docstring. Also, replaces some occurrences of `instance <: Algorithm` by `instance isa Algorithm`, which is the correct relation. This is also closer to English, which helps with readability. --------- Co-authored-by: Lilith Orion Hafner <lilithhafner@gmail.com> 06 April 2024, 12:03:33 UTC
d963a34 profile: doc: update the `Allocs.@profile` doc string (#53825) 05 April 2024, 19:02:33 UTC
59c3c71 TOML: Improve type-stability of BigInt/UInt support (#53955) From a type-stability perspective, this restores a lot of our behavior before #47903. As it turns out, 10 of the 11 uses of `parse_int` (now called `parse_integer`) introduced in that PR are unnecessary since the TOML format already requires the parsed value to be within a very limited range. Note that this change does not actually revert any functionality (in contrast to #49576) 05 April 2024, 18:50:20 UTC
0e59c9e Use StringMemory instead of StringVector where possible (#53962) On `1.11.0-alpha2` Old: ```julia @benchmark Base.dec($0x1, $0, $false) BenchmarkTools.Trial: 10000 samples with 994 evaluations. Range (min … max): 33.702 ns … 4.242 ΞΌs β”Š GC (min … max): 0.00% … 97.61% Time (median): 37.626 ns β”Š GC (median): 0.00% Time (mean Β± Οƒ): 45.787 ns Β± 147.794 ns β”Š GC (mean Β± Οƒ): 14.53% Β± 4.47% β–„β–…β–†β–‡β–ˆβ–‡β–‡β–…β–ƒβ–ƒβ–‚β–‚β–‚β– ▁▂▁▁▁ ▁▁ ▁ β–‚ β–„β–‡β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‡β–‡β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‡β–ˆβ–†β–†β–„β–„β–ƒβ–„β–…β–„β–†β–‡β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–†β–…β–…β–‡β–†β–…β–†β–„β–„β–…β–„β–„β–„β–β–… β–ˆ 33.7 ns Histogram: log(frequency) by time 67.5 ns < Memory estimate: 88 bytes, allocs estimate: 3. ``` New: ```julia BenchmarkTools.Trial: 10000 samples with 995 evaluations. Range (min … max): 27.538 ns … 3.397 ΞΌs β”Š GC (min … max): 0.00% … 97.86% Time (median): 30.151 ns β”Š GC (median): 0.00% Time (mean Β± Οƒ): 34.547 ns Β± 105.101 ns β”Š GC (mean Β± Οƒ): 10.37% Β± 3.39% ▁ β–ˆβ–†β–ƒ ▁ β–‚β–‚β–ƒβ–ƒβ–…β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–†β–ˆβ–ˆβ–ˆβ–ˆβ–†β–„β–„β–ƒβ–ƒβ–ƒβ–ƒβ–ƒβ–ƒβ–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–β–‚β–‚β–‚β–‚β–‚β–β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚ β–ƒ 27.5 ns Histogram: frequency by time 43.8 ns < Memory estimate: 56 bytes, allocs estimate: 2. ``` Fixes #53950, actually now even faster than `1.10.2`. It doesn't look like the length is ever changed and we don't return these `StringMemory`s so this change should be fine. 05 April 2024, 18:12:48 UTC
d505c8c `LazyString` in `LinearAlgebra.checksquare` error message (#53961) This reduces dynamic dispatch and makes JET happier. Testing on v1.11: ```julia julia> import LinearAlgebra: checksquare julia> using JET julia> @report_opt checksquare(rand(2,2), rand(2,2)) ═════ 4 possible errors found ═════ β”Œ checksquare(::Matrix{Float64}, ::Matrix{Float64}) @ LinearAlgebra /cache/build/builder-amdci4-1/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/LinearAlgebra/src/LinearAlgebra.jl:307 β”‚β”Œ string(::String, ::Tuple{Int64, Int64}) @ Base ./strings/io.jl:189 β”‚β”‚β”Œ print_to_string(::String, ::Tuple{Int64, Int64}) @ Base ./strings/io.jl:150 β”‚β”‚β”‚β”Œ _unsafe_take!(io::IOBuffer) @ Base ./iobuffer.jl:494 β”‚β”‚β”‚β”‚β”Œ wrap(::Type{Array}, m::MemoryRef{UInt8}, l::Int64) @ Base ./array.jl:3101 β”‚β”‚β”‚β”‚β”‚ failed to optimize due to recursion: wrap(::Type{Array}, ::MemoryRef{UInt8}, ::Int64) ││││└──────────────────── β”‚β”‚β”‚β”Œ print_to_string(::String, ::Vararg{Any}) @ Base ./strings/io.jl:143 β”‚β”‚β”‚β”‚ runtime dispatch detected: Base._str_sizehint(%17::Any)::Int64 │││└──────────────────── β”‚β”‚β”‚β”Œ print_to_string(::String, ::Vararg{Any}) @ Base ./strings/io.jl:148 β”‚β”‚β”‚β”‚ runtime dispatch detected: print(%59::IOBuffer, %97::Any)::Any │││└──────────────────── β”‚β”‚β”‚β”Œ string(::String, ::Int64, ::String, ::Tuple{Int64}, ::String, ::Int64, ::String, ::Int64, ::String) @ Base ./strings/io.jl:189 β”‚β”‚β”‚β”‚ failed to optimize due to recursion: string(::String, ::Int64, ::String, ::Tuple{Int64}, ::String, ::Int64, ::String, ::Int64, ::String) │││└──────────────────── julia> function checksquare(A...) # This PR sizes = Int[] for a in A size(a,1)==size(a,2) || throw(DimensionMismatch(lazy"matrix is not square: dimensions are $(size(a))")) push!(sizes, size(a,1)) end return sizes end checksquare (generic function with 2 methods) julia> @report_opt checksquare(rand(2,2), rand(2,2)) No errors detected ``` 05 April 2024, 17:48:05 UTC
5f4dec1 make loading work with a `entryfile` entry in the manifest file (#53939) also soft deprecate the `path` entry in project file in favour of using `entryfile` instead Fixes the Julia Base part of #53937 05 April 2024, 08:44:53 UTC
6ea67a9 change the variable name `linfo::MethodInstance` to `mi::MethodInstance` (#53952) 05 April 2024, 02:12:46 UTC
57bbff6 Profile: make heap snapshots viewable in vscode viewer (#53833) 05 April 2024, 02:00:13 UTC
e64fa86 Add missing methods for UniformScaling (#53949) The methods `float`, `cis`, `sincos` and `sincosd` are defined for matrices, so it makes sense for these to be defined for a `UniformScaling` as well. E.g.: ```julia julia> float(2I) UniformScaling{Float64} 2.0*I julia> sincos(2I) (UniformScaling{Float64}(0.9092974268256817), UniformScaling{Float64}(-0.4161468365471424)) ``` 05 April 2024, 01:47:06 UTC
a931fbe Make all command-line options documented in all related files (#53826) I checked and updated the three related files to make sure command-line documentations are the same in all of them. Previously mentioned in https://github.com/JuliaLang/julia/pull/52645#issuecomment-1870571454 --------- Co-authored-by: Matt Bauman <mbauman@gmail.com> 04 April 2024, 18:35:52 UTC
66a4fa7 Buildkite Test Analytics: fix `failure_expanded` (#53706) This pull request changes `failure_expanded` from `Dict{String, Any}` to `Vector{Dict{String, Any}}` to fix a JSON schema issue in the [Bootleg JSON writer](https://github.com/JuliaLang/julia/blob/7eb5cb89fb938a1dc67efa3861b25562767a7bbe/test/buildkitetestjson.jl#L13) πŸ΄β€β˜ οΈ which is responsible for producing JSON test results for [Buildkite Test Analytics](https://buildkite.com/test-analytics). The [`failure_expanded` attribute of a test result](https://buildkite.com/docs/test-analytics/importing-json#json-test-results-data-reference-test-result-objects) is a JSON array of objects, rather than a single object. I believe this is to support the possibility of multiple failure reasons in a single test case, although I'm not sure if that's used anywhere. I believe the associated uploads (batches of up to 5,000 results) are currently getting a successful HTTP 202 Accepted response, but the response body will contain an error for each test case that had a non-array `failure_expanded`, meaning those test cases will be dropped: ```http HTTP/1.1 202 Accepted Content-Type: application/json; charset=utf-8 Date: Tue, 12 Mar 2024 13:11:46 GMT X-Request-Id: a35322f6-9990-4b8e-8895-d62bd6e10935 { "id": "55ac3b92-…", "run_id": "bfa6de98-…", "queued": 4998, "skipped": 2, "errors": [ "Validation failed: Failure expanded must be an Array", "Validation failed: Failure expanded must be an Array" ], "run_url": "http://buildkite.com/…" } ``` Rather than make the Buildkite API more permissive, I figured I'd come and fix it upstream, and write my first few tiny lines of Julia while I'm at it 😁 I've verified that the adjusted JSON output it accepted by our ingestion system. --- For verification, I added an error to an arbitrarily selected test (because [workers don't return information about passing/broken tests, only errors or failure](https://github.com/JuliaLang/julia/blob/7eb5cb89fb938a1dc67efa3861b25562767a7bbe/test/runtests.jl#L363-L365)): ```patch diff --git a/test/char.jl b/test/char.jl index 1d3579013a..582423e8a3 100644 --- a/test/char.jl +++ b/test/char.jl @@ -1,6 +1,7 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license @testset "basic properties" begin + @test throw(ErrorException("testing Buildkite JSON")) @test typemax(Char) == reinterpret(Char, typemax(UInt32)) @test typemin(Char) == Char(0) @test typemax(Char) == reinterpret(Char, 0xffffffff) ``` … and then `CI=true ./julia test/runtests.jl char` which produces `test/results_1.json`. Before: ```json [ { "file_name": "/Users/pda/code/julia/test/char.jl", "history": { "duration": 2.123565912246704, "start_at": 1.710245465232599e9, "end_at": 1.710245467356165e9 }, "name": "test_error: throw(ErrorException(\"testing Buildkite JSON\"))", "location": "/Users/pda/code/julia/test/char.jl:4", "failure_reason": "Exception (unexpectedly) thrown during test", "scope": "/Overall/char", "failure_expanded": { "backtrace": [ " [1] top-level scope", " @ ~/code/julia/test/char.jl:4", " [2] macro expansion", " @ ~/code/julia/usr/share/julia/stdlib/v1.12/Test/src/Test.jl:164 [inlined]", " [3] macro expansion", " @ ~/code/julia/test/char.jl:4 [inlined]", " [4] macro expansion", " @ ~/code/julia/usr/share/julia/stdlib/v1.12/Test/src/Test.jl:164 [inlined]", " [5] macro expansion", " @ ~/code/julia/test/char.jl:4 [inlined]" ], "expanded": [ "testing Buildkite JSON" ] }, "id": "e9272117-d5f5-f542-039b-cfd3d2e8f33a", "result": "failed" } ] ``` After: ```json [ { "file_name": "/Users/pda/code/julia/test/char.jl", "history": { "duration": 2.123565912246704, "start_at": 1.710245465232599e9, "end_at": 1.710245467356165e9 }, "name": "test_error: throw(ErrorException(\"testing Buildkite JSON\"))", "location": "/Users/pda/code/julia/test/char.jl:4", "failure_reason": "Exception (unexpectedly) thrown during test", "scope": "/Overall/char", "failure_expanded": [ { "backtrace": [ " [1] top-level scope", " @ ~/code/julia/test/char.jl:4", " [2] macro expansion", " @ ~/code/julia/usr/share/julia/stdlib/v1.12/Test/src/Test.jl:164 [inlined]", " [3] macro expansion", " @ ~/code/julia/test/char.jl:4 [inlined]", " [4] macro expansion", " @ ~/code/julia/usr/share/julia/stdlib/v1.12/Test/src/Test.jl:164 [inlined]", " [5] macro expansion", " @ ~/code/julia/test/char.jl:4 [inlined]" ], "expanded": [ "testing Buildkite JSON" ] } ], "id": "e9272117-d5f5-f542-039b-cfd3d2e8f33a", "result": "failed" } ] ``` Diff: ```patch --- buildkite-before.json 2024-03-12 23:08:26 +++ buildkite-after.json 2024-03-12 23:07:58 @@ -10,23 +10,25 @@ "location": "/Users/pda/code/julia/test/char.jl:4", "failure_reason": "Exception (unexpectedly) thrown during test", "scope": "/Overall/char", - "failure_expanded": { - "backtrace": [ - " [1] top-level scope", - " @ ~/code/julia/test/char.jl:4", - " [2] macro expansion", - " @ ~/code/julia/usr/share/julia/stdlib/v1.12/Test/src/Test.jl:164 [inlined]", - " [3] macro expansion", - " @ ~/code/julia/test/char.jl:4 [inlined]", - " [4] macro expansion", - " @ ~/code/julia/usr/share/julia/stdlib/v1.12/Test/src/Test.jl:164 [inlined]", - " [5] macro expansion", - " @ ~/code/julia/test/char.jl:4 [inlined]" - ], - "expanded": [ - "testing Buildkite JSON" - ] - }, + "failure_expanded": [ + { + "backtrace": [ + " [1] top-level scope", + " @ ~/code/julia/test/char.jl:4", + " [2] macro expansion", + " @ ~/code/julia/usr/share/julia/stdlib/v1.12/Test/src/Test.jl:164 [inlined]", + " [3] macro expansion", + " @ ~/code/julia/test/char.jl:4 [inlined]", + " [4] macro expansion", + " @ ~/code/julia/usr/share/julia/stdlib/v1.12/Test/src/Test.jl:164 [inlined]", + " [5] macro expansion", + " @ ~/code/julia/test/char.jl:4 [inlined]" + ], + "expanded": [ + "testing Buildkite JSON" + ] + } + ], "id": "e9272117-d5f5-f542-039b-cfd3d2e8f33a", "result": "failed" } ``` 04 April 2024, 15:47:27 UTC
c371e4c Fix negative tolerance documentation issue in cholesky.jl (#53918) 04 April 2024, 14:21:31 UTC
19fffe1 Fixes for allowing `:throw_undef_if_not` on the frontend (#53944) https://github.com/JuliaLang/julia/pull/53875 allowed `:throw_undef_if_not` as a frontend form. However, the `UndefVarError` being tested is thrown because the first argument is resolved to a global ref: ```julia julia> @eval function has_tuin() $(Expr(:throw_undef_if_not, :x, false)) end has_tuin (generic function with 1 method) julia> @code_lowered has_tuin() # master CodeInfo( 1 ─ %1 = $(Expr(:throw_undef_if_not, :(Main.x), false)) └── return %1 ) julia> @code_lowered has_tuin() # this pr CodeInfo( 1 ─ %1 = $(Expr(:throw_undef_if_not, :x, false)) └── return %1 ) ``` This change skips this global ref resolution for the first argument and fixes a typo which would throw an error in case of non-const second argument. 04 April 2024, 08:54:55 UTC
0cd3164 Update stable version in README.md (#53947) [skip ci] 04 April 2024, 03:40:57 UTC
cb4e107 Add `zero` for `Base.TwicePrecision` (#53787) Since `zero` exists for a `TwicePrecision` type, it makes sense for a method to exist for an instance as well. Fixes #52713, which was a regression from v1.9.1. After this, the following may be displayed without errors: ```julia julia> r = 1.0*(1:5) .+ im 1.0 + 1.0im:Base.TwicePrecision{Float64}(1.0, 0.0):5.0 + 1.0im ``` However, in this case, the step is a `Base.TwicePrecision`, which seems to be an implementation detail that's leaking out, although addressing this may be a separate PR. 04 April 2024, 03:02:36 UTC
19919b7 Use `copyto!` in converting `Diagonal`/`Bidiagonal`/`Tridiagonal` to `Matrix` (#53912) With this, we may convert a structured matrix to `Matrix` even if its `eltype` doesn't support `zero(T)`, as long as we may index into the matrix and the elements have `zero` defined for themselves. This makes the following work: ```julia julia> D = Diagonal(fill(Diagonal([1,3]), 2)) 2Γ—2 Diagonal{Diagonal{Int64, Vector{Int64}}, Vector{Diagonal{Int64, Vector{Int64}}}}: [1 0; 0 3] β‹… β‹… [1 0; 0 3] julia> Matrix{eltype(D)}(D) 2Γ—2 Matrix{Diagonal{Int64, Vector{Int64}}}: [1 0; 0 3] [0 0; 0 0] [0 0; 0 0] [1 0; 0 3] ``` We also may materialize partly initialized matrices: ```julia julia> D = Diagonal(Vector{BigInt}(undef, 2)) 2Γ—2 Diagonal{BigInt, Vector{BigInt}}: #undef β‹… β‹… #undef julia> Matrix{eltype(D)}(D) 2Γ—2 Matrix{BigInt}: #undef 0 0 #undef ``` The performance seems identical for numeric matrices. 04 April 2024, 02:56:24 UTC
286e339 fix macros `@which`, `@edit`, `@functionloc`, `@less` for `literal_pow` case. (#53713) The macros `@which`, `@edit`, `@functionloc`, `@less` from `InteractiveUtils`, if applied to the case of literal powers, like `a^12` or `2^-1` used to direct the user to function `^`, while the compiler generates code for `Base.literal_pow`. Now the user is shown the code the compiler generates. Fixes #53691 Fixes #43337 Fixes #21014 Co-authored-by: Matt Bauman <mbauman@juliahub.com> 03 April 2024, 21:14:17 UTC
12c9391 β€œFix” #53451 -- allow zero-row QR factorization bypassing LAPACK (#53578) 03 April 2024, 19:51:04 UTC
d7dc9a8 make @fastmath mirror how lowering applies literal_pow (#53819) The expressions `a^x` and `@fastmath a^x` are now producing equivalent results (apart from floating point accuracy) in the case of literal integer `x`. The logic in the `fastmath` macro, trying to mimic the behaviour of the compiler is fixed. Fixes #53817 --------- Co-authored-by: Oscar Smith <oscardssmith@gmail.com> 03 April 2024, 15:06:13 UTC
c749147 fix typo in comment (#53936) Signed-off-by: crazehang <zhangrenzhong@outlook.com> 03 April 2024, 14:51:59 UTC
a69aa30 oc: code_typed support for optimized opaque closures (#53929) Reflection version of #53878. --------- Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Co-authored-by: Shuhei Kadowaki <aviatesk@gmail.com> 03 April 2024, 09:24:45 UTC
854170a minor followups on the linetable changes (#53921) - remove unnecessary `Core.` accessors to `DebugInfo` within `Core.Compiler` - improve the type of `DebugInfoStream`'s `edges` field 03 April 2024, 04:16:03 UTC
94f887b note that REPL doesn't show "nothing" values (#53930) It seemed worth documenting that display of `nothing` is suppressed by the REPL (and similar environments, e.g. IJulia). 03 April 2024, 02:00:42 UTC
1256e3e Buildkite Test Analytics: fix failure_expanded The `failure_expanded` attribute of a test result is an _array_ of objects, not a single object. I believe this is to support the possibility of multiple failure reasons in a single test case, although I'm not sure if that's used anywhere. https://buildkite.com/docs/test-analytics/importing-json#json-test-results-data-reference-test-result-objects 02 April 2024, 23:51:18 UTC
b70e1ae Buildkite typos in tests/buildkitetestjson.jl etc fixed 02 April 2024, 23:45:04 UTC
e99627f Explicitly call out reverse ranges in `:` and `range` docstring (#53626) 02 April 2024, 22:04:14 UTC
d8d3842 Avoid repeated precompilation when loading from non-relocatable cachefiles (#53905) Fixes https://github.com/JuliaLang/julia/issues/53859#issuecomment-2027352004, which was actually fixed before in https://github.com/JuliaLang/julia/pull/52346, but https://github.com/JuliaLang/julia/pull/52750 undid that fix. This PR does not directly address #53859, because I can not reproduce it atm. --- The `@depot` resolution logic for `include()` files is adjusted as follows: 1. (new behavior) If the cache is not relocatable because of an absolute path, we ignore that path for the depot search. Recompilation will be triggered by `stale_cachefile()` if that absolute path does not exist. Previously this caused any `@depot` tags to be not resolved and so trigger recompilation. 2. (new behavior) If we can't find a depot for a relocatable path, we still replace it with the depot we found from other files. Recompilation will be triggered by `stale_cachefile()` because the resolved path does not exist. 3. (this behavior is kept) We require that relocatable paths all resolve to the same depot. 4. (new behavior) We no longer use the first matching depot for replacement, but instead we explicitly check that all resolve to the same depot. This has two reasons: - We want to scan all source files anyways in order to provide logs for 1. and 2. above, so the check is free. - It is possible that a depot might be missing source files. Assume that we have two depots on `DEPOT_PATH`, `depot_complete` and `depot_incomplete`. If `DEPOT_PATH=["depot_complete","depot_incomplete"]` then no recompilation shall happen, because `depot_complete` will be picked. If `DEPOT_PATH=["depot_incomplete","depot_complete"]` we trigger recompilation and hopefully a meaningful error about missing files is thrown. If we were to just select the first depot we find, then whether recompilation happens would depend on whether the first relocatable file resolves to `depot_complete` or `depot_incomplete`. 02 April 2024, 10:25:09 UTC
718b988 documentation followup for "invert linetable representation (#52415)" (#53781) - fix up added documents: eb05b4f2acec6ac0ecbc34547716cc77f6cff719 - ~~set up a specific type to capture the 3-set data of `codelocs`: 6afde4b740960f39f49afbd8a8d138e7df3a4fdf~~ (moved to a separate PR) 02 April 2024, 02:31:42 UTC
0ac60b7 More emoji completions! 🫠 (#53913) Happy April fools day! πŸͺΏ Let's celebrate with a very important PR 🩡 This PR updates the REPL completion list with all the fun new emoji from unicode 15.1! This makes Julia ready for the up-and-coming programmzers who want the latest trends in emoji coding! 🫢🫢 Fresh new emoji for fresh new ideas! 🫢🫢 Some of the new emoji include: - `\:biting_lip:` 🫦 for when the IO code gets *spicy* - `\:beans:` 🫘 beanssss - `\:mirror_ball:` πŸͺ© for parties! - `\:playground_slide:` πŸ› for really fun code :) Thanks to @oxinabox for the future-proof script! Enjoy!! 01 April 2024, 21:06:16 UTC
1fedcab optimizer: allow multiple inlining again (#53911) Before JuliaLang/julia#52415 we could do multiple rounds of inlining on IR that had already been inlined, but this was no longer possible. By removing the assertion that was introduced in JuliaLang/julia#52415, this commit makes it possible to do multi-inlining once more. Note that to fully solve this, though, we need to enhance `ir_inline_linetable!` so it can add new linetables to an inner linetable that's already been inlined. This commit notes that enhancement as something we need to do later, leaving it with a TODO comment. 01 April 2024, 18:29:32 UTC
657ce04 Fix calling LLVM_SIZE on windows (#53902) Per https://github.com/JuliaCI/julia-buildkite/pull/224#issuecomment-1474914609, the path needs to be updated so that `llvm-size` can find `libLLVM.dll`. 01 April 2024, 18:13:18 UTC
e9d25ca Add `Base.isrelocatable(pkg)` (#53906) This PR adds a utility function `isrelocatable(pkg)` that can be used to check if `pkg` is already precompiled and if the associated cachefile is relocatable. The reason to implicitly perform the `isprecompiled` check is that the exact same computation needs to be done to find the right `.ji`. A `pkg` is said to be relocatable if 1. all `include()` paths are relocatable (they start with `@depot`), 2. all `include_dependency()` paths are relocatable (they start with `@depot` and `track_content=true` was used to include them). 01 April 2024, 05:34:51 UTC
a3f710e Copy for `CartesianIndices`/`LinearIndices` need not materialize (#53901) Currently, ```julia julia> C = CartesianIndices((1:2, 1:2)) CartesianIndices((1:2, 1:2)) julia> copy(C) 2Γ—2 Matrix{CartesianIndex{2}}: CartesianIndex(1, 1) CartesianIndex(1, 2) CartesianIndex(2, 1) CartesianIndex(2, 2) ``` However, seeing that a `CartesianIndices` is equivalent to an n-D range, there doesn't seem to be a need to materialize the result. This PR also ensures that `copy(C)` returns the same type as `C`. After this PR: ```julia julia> C = CartesianIndices((1:2, 1:2)) CartesianIndices((1:2, 1:2)) julia> copy(C) CartesianIndices((1:2, 1:2)) ``` Also, a similar change for `LinearIndices` is added. 31 March 2024, 01:56:46 UTC
313f933 curl: remove patch (#53892) This upstream patch needs to be removed because in latest curl, it's already applied. This currently prevents a build from source. (And I am wondering why that was not caught?) 30 March 2024, 14:04:42 UTC
24ff6f4 no need to check whether mq_master is nil in the GC work-stealing loop (#53899) This is not needed after https://github.com/JuliaLang/julia/pull/53355. 30 March 2024, 04:18:49 UTC
d10a0fb curl: fix RPATH to find nghttp2 and libssh2 (#53894) Fixes https://github.com/JuliaLang/julia/issues/48820 I think this is the proper fix, and there might be a configure option to curl or nghttp2 to set it, but I haven't been found it. So we'll do it that way. 29 March 2024, 16:51:02 UTC
e26d140 add initial support for OpenBSD (#53633) These commits add initial support of OpenBSD in julia. It isn't strictly enough to make julia runable on OpenBSD (see #53632), but it covers the larger part. --------- Co-authored-by: Max Horn <max@quendi.de> Co-authored-by: Oscar Smith <oscardssmith@gmail.com> 29 March 2024, 16:47:07 UTC
09b356f fix relocatable upgrades test (#53889) Fixes https://github.com/JuliaLang/julia/issues/53885 Not the first time MacOS serving tempdir via a symlink has caused obscure issues.. 29 March 2024, 13:27:51 UTC
back to top