From 9c452e71535e4185f0c8b633b69ba97f6b3d32a3 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Tue, 16 Mar 2021 07:01:48 -0400 Subject: [PATCH 1/6] add explanation about top-level compilation to timing macros [skip ci] (#39802) (cherry picked from commit dca0850ea7ca0c8734cd904d78e9f0832afaca58) --- base/timing.jl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/base/timing.jl b/base/timing.jl index 976bda7962676..7af6f038ba6ea 100644 --- a/base/timing.jl +++ b/base/timing.jl @@ -172,6 +172,10 @@ allocations, and the total number of bytes its execution caused to be allocated, returning the value of the expression. Any time spent garbage collecting (gc) or compiling is shown as a percentage. +In some cases the system will look inside the `@time` expression and compile some of the +called code before execution of the top-level expression begins. When that happens, some +compilation time will not be counted. To include this time you can run `@time @eval ...`. + See also [`@timev`](@ref), [`@timed`](@ref), [`@elapsed`](@ref), and [`@allocated`](@ref). @@ -264,6 +268,10 @@ end A macro to evaluate an expression, discarding the resulting value, instead returning the number of seconds it took to execute as a floating-point number. +In some cases the system will look inside the `@elapsed` expression and compile some of the +called code before execution of the top-level expression begins. When that happens, some +compilation time will not be counted. To include this time you can run `@elapsed @eval ...`. + See also [`@time`](@ref), [`@timev`](@ref), [`@timed`](@ref), and [`@allocated`](@ref). @@ -323,6 +331,10 @@ A macro to execute an expression, and return the value of the expression, elapse total bytes allocated, garbage collection time, and an object with various memory allocation counters. +In some cases the system will look inside the `@timed` expression and compile some of the +called code before execution of the top-level expression begins. When that happens, some +compilation time will not be counted. To include this time you can run `@timed @eval ...`. + See also [`@time`](@ref), [`@timev`](@ref), [`@elapsed`](@ref), and [`@allocated`](@ref). From 981d57362d002e1409ebbc0bb6817dfa46d6e32c Mon Sep 17 00:00:00 2001 From: "Steven G. Johnson" Date: Sun, 21 Mar 2021 08:56:45 -0400 Subject: [PATCH 2/6] document thread safety for RNGs (#40109) (cherry picked from commit 7d117dceb0f791e9ab9a7d5864e32809c3ce16c0) --- stdlib/Random/docs/src/index.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stdlib/Random/docs/src/index.md b/stdlib/Random/docs/src/index.md index 4e8ace596543a..ca86de44ecce4 100644 --- a/stdlib/Random/docs/src/index.md +++ b/stdlib/Random/docs/src/index.md @@ -13,7 +13,9 @@ type, which is a wrapper over the OS provided entropy. Most functions related to random generation accept an optional `AbstractRNG` object as first argument, which defaults to the global one if not provided. Moreover, some of them accept optionally dimension specifications `dims...` (which can be given as a tuple) to generate arrays of random -values. +values. In a multi-threaded program, you should generally use different RNG objects from different threads +in order to be thread-safe. However, the default global RNG is thread-safe as of Julia 1.3 (because +it internally corresponds to a per-thread RNG). A `MersenneTwister` or `RandomDevice` RNG can generate uniformly random numbers of the following types: [`Float16`](@ref), [`Float32`](@ref), [`Float64`](@ref), [`BigFloat`](@ref), [`Bool`](@ref), From 8448050c5d0362b1b06f34aac05fd4a913942a0d Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Wed, 17 Mar 2021 18:07:39 +0100 Subject: [PATCH 3/6] =?UTF-8?q?Revert=20"add=20'=E1=B5=80=20postfix=20oper?= =?UTF-8?q?ator=20for=20transpose=20(#38062)"=20(#40075)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 665279aedb18501938c934d46aa593a26a506b3e. (cherry picked from commit 7838e0973ba3183735cca6485a65ae9e708f0c1d) --- NEWS.md | 1 - base/exports.jl | 1 - base/operators.jl | 1 - stdlib/LinearAlgebra/src/adjtrans.jl | 12 ------------ test/operators.jl | 3 --- 5 files changed, 18 deletions(-) diff --git a/NEWS.md b/NEWS.md index ad41fb40a1876..0ce4a5cc458d5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -114,7 +114,6 @@ New library features inserting or consuming the first dimension depending on the ratio of `sizeof(T)` and `sizeof(S)`. * New `append!(vector, collections...)` and `prepend!(vector, collections...)` methods accept multiple collections to be appended or prepended ([#36227]). -* The postfix operator `'ᵀ` can now be used as an alias for `transpose` ([#38062]). * `keys(io::IO)` has been added, which returns all keys of `io` if `io` is an `IOContext` and an empty `Base.KeySet` otherwise ([#37753]). * `count` now accepts an optional `init` argument to control the accumulation type ([#37461]). diff --git a/base/exports.jl b/base/exports.jl index 0c157c45d2052..cedf0b1e48be2 100644 --- a/base/exports.jl +++ b/base/exports.jl @@ -467,7 +467,6 @@ export # linear algebra var"'", # to enable syntax a' for adjoint adjoint, - var"'ᵀ", transpose, kron, kron!, diff --git a/base/operators.jl b/base/operators.jl index d591b6254255a..8120e95913e3c 100644 --- a/base/operators.jl +++ b/base/operators.jl @@ -567,7 +567,6 @@ end function kron! end const var"'" = adjoint -const var"'ᵀ" = transpose """ \\(x, y) diff --git a/stdlib/LinearAlgebra/src/adjtrans.jl b/stdlib/LinearAlgebra/src/adjtrans.jl index c89da6d60141d..5710021f2772b 100644 --- a/stdlib/LinearAlgebra/src/adjtrans.jl +++ b/stdlib/LinearAlgebra/src/adjtrans.jl @@ -136,7 +136,6 @@ julia> x'x adjoint(A::AbstractVecOrMat) = Adjoint(A) """ - A'ᵀ transpose(A) Lazy transpose. Mutating the returned object should appropriately mutate `A`. Often, @@ -146,9 +145,6 @@ that this operation is recursive. This operation is intended for linear algebra usage - for general data manipulation see [`permutedims`](@ref Base.permutedims), which is non-recursive. -!!! compat "Julia 1.6" - The postfix operator `'ᵀ` requires Julia 1.6. - # Examples ```jldoctest julia> A = [3+2im 9+2im; 8+7im 4+6im] @@ -160,14 +156,6 @@ julia> transpose(A) 2×2 transpose(::Matrix{Complex{Int64}}) with eltype Complex{Int64}: 3+2im 8+7im 9+2im 4+6im - -julia> x = [3, 4im] -2-element Vector{Complex{Int64}}: - 3 + 0im - 0 + 4im - -julia> x'ᵀx --7 + 0im ``` """ transpose(A::AbstractVecOrMat) = Transpose(A) diff --git a/test/operators.jl b/test/operators.jl index fb884d52cbf98..1abfffaa09744 100644 --- a/test/operators.jl +++ b/test/operators.jl @@ -253,7 +253,4 @@ end @test ∋(0)(-2:2) end -a = rand(3, 3) -@test transpose(a) === a'ᵀ - @test [Base.afoldl(+, 1:i...) for i = 1:40] == [i * (i + 1) ÷ 2 for i = 1:40] From 2e9532bb99106cc59993bc5519d1c505c1e78980 Mon Sep 17 00:00:00 2001 From: Sacha Verweij Date: Tue, 16 Mar 2021 12:35:56 -0400 Subject: [PATCH 4/6] Prevent PCRE from needing a rebuild/reconf. This commit reorders a couple touches in deps/pcre.mkl. Those touches are intended to prevent patch application from triggering rebuild/reconf. The present ordering doesn't quite succeed in that objective; patch application triggers rebuild. On systems with compatible autotools, the rebuild succeeds and the build is nonetheless happy. On systems with incompatible versions of autotools, however, the build fails for need of a reconf. The reordering in this commit prevents the rebuild. Co-Authored-By: Rob Vermaas (cherry picked from commit 068420b86564d0729ef8762302f9eec4a264f853) --- deps/pcre.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/pcre.mk b/deps/pcre.mk index 70b9e9f96ff02..5294a81a1f1d1 100644 --- a/deps/pcre.mk +++ b/deps/pcre.mk @@ -14,9 +14,9 @@ $(SRCCACHE)/pcre2-$(PCRE_VER)/source-extracted: $(SRCCACHE)/pcre2-$(PCRE_VER).ta cp $(SRCDIR)/patches/config.sub $(SRCCACHE)/pcre2-$(PCRE_VER)/config.sub cd $(SRCCACHE)/pcre2-$(PCRE_VER) && patch -p1 -f < $(SRCDIR)/patches/pcre2-cet-flags.patch # Fix some old targets modified by the patching + touch -c $(SRCCACHE)/pcre2-$(PCRE_VER)/aclocal.m4 touch -c $(SRCCACHE)/pcre2-$(PCRE_VER)/Makefile.am touch -c $(SRCCACHE)/pcre2-$(PCRE_VER)/Makefile.in - touch -c $(SRCCACHE)/pcre2-$(PCRE_VER)/aclocal.m4 touch -c $(SRCCACHE)/pcre2-$(PCRE_VER)/configure echo $1 > $@ From 60e70d84fbadeea9d03af1d1552c27aa11d6204f Mon Sep 17 00:00:00 2001 From: Sacha Verweij Date: Fri, 12 Mar 2021 18:26:14 -0500 Subject: [PATCH 5/6] Fix a couple of likely typos in deps/p7zip.mk and deps/pcre.mk. (#40003) (cherry picked from commit ec78ac75bbb23b3d6242110afc5745c17c0cac54) --- deps/p7zip.mk | 2 +- deps/pcre.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deps/p7zip.mk b/deps/p7zip.mk index ced419396b2ff..20c85602f767a 100644 --- a/deps/p7zip.mk +++ b/deps/p7zip.mk @@ -9,7 +9,7 @@ $(BUILDDIR)/p7zip-$(P7ZIP_VER)/source-extracted: $(SRCCACHE)/p7zip-$(P7ZIP_VER). $(JLCHECKSUM) $< mkdir -p $(dir $@) cd $(dir $@) && $(TAR) --strip-components 1 -jxf $< - echo $1 > $@ + echo 1 > $@ checksum-p7zip: $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.bz2 $(JLCHECKSUM) $< diff --git a/deps/pcre.mk b/deps/pcre.mk index 5294a81a1f1d1..e2bed3502a333 100644 --- a/deps/pcre.mk +++ b/deps/pcre.mk @@ -18,7 +18,7 @@ $(SRCCACHE)/pcre2-$(PCRE_VER)/source-extracted: $(SRCCACHE)/pcre2-$(PCRE_VER).ta touch -c $(SRCCACHE)/pcre2-$(PCRE_VER)/Makefile.am touch -c $(SRCCACHE)/pcre2-$(PCRE_VER)/Makefile.in touch -c $(SRCCACHE)/pcre2-$(PCRE_VER)/configure - echo $1 > $@ + echo 1 > $@ checksum-pcre2: $(SRCCACHE)/pcre2-$(PCRE_VER).tar.bz2 $(JLCHECKSUM) $< From 45b1b152ffa94cf442531f9dae0e076e1009097f Mon Sep 17 00:00:00 2001 From: Jeffrey Lin Date: Tue, 23 Mar 2021 17:05:13 +0000 Subject: [PATCH 6/6] Markdown: prevent display() error with empty list item (#40122) (cherry picked from commit cc639ec7eadf3c8db1c6ae01ad0edbfdece1bc32) --- stdlib/Markdown/src/render/terminal/formatting.jl | 1 + stdlib/Markdown/test/runtests.jl | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/stdlib/Markdown/src/render/terminal/formatting.jl b/stdlib/Markdown/src/render/terminal/formatting.jl index 4fd1cccedf7fb..bacd82f7ed021 100644 --- a/stdlib/Markdown/src/render/terminal/formatting.jl +++ b/stdlib/Markdown/src/render/terminal/formatting.jl @@ -42,6 +42,7 @@ wrapped_lines(io::IO, f::Function, args...; width = 80, i = 0) = function print_wrapped(io::IO, s...; width = 80, pre = "", i = 0) lines = wrapped_lines(io, s..., width = width, i = i) + isempty(lines) && return 0, 0 print(io, lines[1]) for line in lines[2:end] print(io, '\n', pre, line) diff --git a/stdlib/Markdown/test/runtests.jl b/stdlib/Markdown/test/runtests.jl index 286004707b8bd..f9983d10089f9 100644 --- a/stdlib/Markdown/test/runtests.jl +++ b/stdlib/Markdown/test/runtests.jl @@ -1213,3 +1213,12 @@ end | $x | """) end + +@testset "issue 40080: empty list item breaks display()" begin + d = TextDisplay(devnull) + display(d, md""" + 1. hello + 2. + """) +end +