before_code stringlengths 30 149k | reviewer_comment stringlengths 16 20.6k | after_code stringlengths 30 163k | diff_context stringlengths 0 22.4k | file_path stringlengths 6 155 | comment_line int64 0 26 | language stringclasses 19
values | quality_score float64 0.07 1 | comment_type stringclasses 9
values | comment_length int64 16 20.6k | before_lines int64 2 4.61k | after_lines int64 2 4.4k | is_negative bool 2
classes | pr_title stringlengths 7 140 | pr_number int64 18 61.2k | repo_name stringclasses 29
values | repo_stars int64 321 56k | repo_language stringclasses 14
values | reviewer_username stringclasses 378
values | author_username stringclasses 739
values | user stringlengths 361 200k | assistant stringlengths 16 20.6k | system stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
# discover the piece of AST which should be returned.
ex = _find_SyntaxTree_macro(full_ex, __source__.line)
isnothing(ex) && error("_find_SyntaxTree_macro failed")
# 4. Do the first step of JuliaLowering's syntax lowering to get
# syntax interpolations to work
_, ex1 = expand_forms_1(__module__,... | This seems like this would flatten inside inert AST structures, which is illegal IIUC? | # discover the piece of AST which should be returned.
ex = _find_SyntaxTree_macro(full_ex, __source__.line)
isnothing(ex) && error("_find_SyntaxTree_macro failed")
# 4. Do the first step of JuliaLowering's syntax lowering to get
# syntax interpolations to work
_, ex1 = expand_forms_1(__module__,... | @@ -394,3 +394,29 @@ macro SyntaxTree(ex_old)
Expr(:call, :interpolate_ast, SyntaxTree, ex1[3][1],
map(e->_scope_layer_1_to_esc!(Expr(e)), ex1[4:end])...)
end
+
+function _flatten_blocks(st::SyntaxTree)
+ if kind(st) === K"block"
+ out = SyntaxList(st._graph)
+ for c in children(st)
+ ... | JuliaLowering/src/utils.jl | 26 | Julia | 0.214 | question | 86 | 37 | 41 | false | [JuliaLowering] Misc. cleanup: `symboliclabel`, `flatten_blocks` | 61,166 | JuliaLang/julia | 35,573 | Julia | topolarity | mlechu | Review this pull request change.
Language: Julia
File: JuliaLowering/src/utils.jl
PR Title: [JuliaLowering] Misc. cleanup: `symboliclabel`, `flatten_blocks`
BEFORE CODE: # discover the piece of AST which should be returned.
ex = _find_SyntaxTree_macro(full_ex, __source__.line)
isnothing(ex) && error("_f... | This seems like this would flatten inside inert AST structures, which is illegal IIUC? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
@test_throws "cycle detected" JuliaLowering.assert_syntaxtree(bad_st)
cyc_1 = JuliaSyntax.newnode(g, st, K"block", NodeId[])
cyc_2 = JuliaSyntax.newnode(g, st, K"block", NodeId[cyc_1._id])
JuliaSyntax.setchildren!(g, cyc_1._id, NodeId[cyc_2._id])
@test_throws "cycle detected" JuliaLowering.assert_s... | Another test case for you:
```julia
st = @ast_ [K"block" [K"inert" [K"block" 1::K"Value" [K"block" 1::K"Value"]]]]
@test JuliaLowering.flatten_blocks(st) ≈
@ast_ [K"block" [K"inert" [K"block" 1::K"Value" [K"block" 1::K"Value"]]]]
``` | @test_throws "cycle detected" JuliaLowering.assert_syntaxtree(bad_st)
cyc_1 = JuliaSyntax.newnode(g, st, K"block", NodeId[])
cyc_2 = JuliaSyntax.newnode(g, st, K"block", NodeId[cyc_1._id])
JuliaSyntax.setchildren!(g, cyc_1._id, NodeId[cyc_2._id])
@test_throws "cycle detected" JuliaLowering.assert_s... | @@ -22,3 +22,56 @@
@test_throws "cycle detected" JuliaLowering.assert_syntaxtree(cyc_1)
@test_throws "cycle detected" JuliaLowering.assert_syntaxtree(cyc_2)
end
+
+@testset "flatten_blocks" begin
+ let
+ st = @ast_ [K"block"]
+ @test JuliaLowering.flatten_blocks(st) ≈
+ @ast_ [K"b... | JuliaLowering/test/ast.jl | 26 | Julia | 0.786 | suggestion | 261 | 51 | 51 | false | [JuliaLowering] Misc. cleanup: `symboliclabel`, `flatten_blocks` | 61,166 | JuliaLang/julia | 35,573 | Julia | topolarity | mlechu | Review this pull request change.
Language: Julia
File: JuliaLowering/test/ast.jl
PR Title: [JuliaLowering] Misc. cleanup: `symboliclabel`, `flatten_blocks`
BEFORE CODE: @test_throws "cycle detected" JuliaLowering.assert_syntaxtree(bad_st)
cyc_1 = JuliaSyntax.newnode(g, st, K"block", NodeId[])
cyc_2 = J... | Another test case for you:
```julia
st = @ast_ [K"block" [K"inert" [K"block" 1::K"Value" [K"block" 1::K"Value"]]]]
@test JuliaLowering.flatten_blocks(st) ≈
@ast_ [K"block" [K"inert" [K"block" 1::K"Value" [K"block" 1::K"Value"]]]]
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
K"toplevel" AST. The solution implemented in JuliaLang/julia#53515 was to save
our place and expand later using `Expr(:hygienic-scope toplevel_child mod)`.
Of course, these hygienic-scopes are also necessary because existing user code
contains the corresponding escaping, which would otherwise cause errors. We
already... | This should probably check the kind of `ex[2]`, esp. since I believe it is occasionally `nothing::K"core"`? | K"toplevel" AST. The solution implemented in JuliaLang/julia#53515 was to save
our place and expand later using `Expr(:hygienic-scope toplevel_child mod)`.
Of course, these hygienic-scopes are also necessary because existing user code
contains the corresponding escaping, which would otherwise cause errors. We
already... | @@ -276,9 +276,12 @@ function expand_macro(ctx, ex)
mctx = MacroContext(ctx.graph, ex, current_layer(ctx), ctx.expr_compat_mode)
macfunc = eval_macro_name(ctx, mctx, macname)
raw_args = ex[3:end]
- macro_loc = let loc = source_location(LineNumberNode, ex)
+ macro_loc = if ex[2].value isa LineNumber... | JuliaLowering/src/macro_expansion.jl | 26 | Julia | 0.571 | question | 107 | 51 | 51 | false | [JuliaLowering] Take macro lno from argument, not provenance | 61,178 | JuliaLang/julia | 35,573 | Julia | topolarity | mlechu | Review this pull request change.
Language: Julia
File: JuliaLowering/src/macro_expansion.jl
PR Title: [JuliaLowering] Take macro lno from argument, not provenance
BEFORE CODE: K"toplevel" AST. The solution implemented in JuliaLang/julia#53515 was to save
our place and expand later using `Expr(:hygienic-scope tople... | This should probably check the kind of `ex[2]`, esp. since I believe it is occasionally `nothing::K"core"`? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
if kind(ex) === K"toplevel"
mapchildren(ctx, ex) do e
@ast ctx ex [K"hygienic-scope" e mod::K"Value" lnn::K"Value"]
end
else
mapchildren(e->fix_toplevel_expansion(ctx, e, mod, lnn), ctx, ex)
end
end
function expand_macro(ctx, ex)
@assert kind(ex) == K"macrocall"
... | ```suggestion
else
LineNumberNode(0, :none)
end
```
or an assertion failure, etc. | if kind(ex) === K"toplevel"
mapchildren(ctx, ex) do e
@ast ctx ex [K"hygienic-scope" e mod::K"Value" lnn::K"Value"]
end
else
mapchildren(e->fix_toplevel_expansion(ctx, e, mod, lnn), ctx, ex)
end
end
function expand_macro(ctx, ex)
@assert kind(ex) == K"macrocall"
... | @@ -276,9 +276,16 @@ function expand_macro(ctx, ex)
mctx = MacroContext(ctx.graph, ex, current_layer(ctx), ctx.expr_compat_mode)
macfunc = eval_macro_name(ctx, mctx, macname)
raw_args = ex[3:end]
- macro_loc = let loc = source_location(LineNumberNode, ex)
+ macro_loc = if kind(ex[2]) === K"Value"
+... | JuliaLowering/src/macro_expansion.jl | 26 | Julia | 0.714 | bug | 109 | 51 | 51 | false | [JuliaLowering] Take macro lno from argument, not provenance | 61,178 | JuliaLang/julia | 35,573 | Julia | topolarity | mlechu | Review this pull request change.
Language: Julia
File: JuliaLowering/src/macro_expansion.jl
PR Title: [JuliaLowering] Take macro lno from argument, not provenance
BEFORE CODE: if kind(ex) === K"toplevel"
mapchildren(ctx, ex) do e
@ast ctx ex [K"hygienic-scope" e mod::K"Value" lnn::K"Value"]
... | ```suggestion
else
LineNumberNode(0, :none)
end
```
or an assertion failure, etc. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// Finished scanning this one, finish up by checking the GC invariance
// and let the next item replacing the current one directly.
gc_mark_push_remset(ptls, objary->parent, objary->nptr);
}
return 1;
}
gc_mark_push_remset(ptls, objary->parent, objary->nptr);
... | No issues found. | // Finished scanning this one, finish up by checking the GC invariance
// and let the next item replacing the current one directly.
gc_mark_push_remset(ptls, objary->parent, objary->nptr);
}
return 1;
}
gc_mark_push_remset(ptls, objary->parent, objary->nptr);
... | @@ -2971,6 +2971,12 @@ void jl_gc_init(void)
gc_mark_loop(NULL, sp);
}
+// callback for passing OOM errors from gmp
+JL_DLLEXPORT void jl_throw_out_of_memory_error(void)
+{
+ jl_throw(jl_memory_exception);
+}
+
// allocation wrappers that track allocation and let collection run
JL_DLLEXPORT void *jl_gc_c... | src/gc.c | 0 | C | 1 | none | 16 | 51 | 51 | true | rebase: Throw OutOfMemoryError when gmp tries to allocate memory beyond the limit | 31,215 | JuliaLang/julia | 35,573 | Julia | musm | Review this pull request change.
Language: C
File: src/gc.c
PR Title: rebase: Throw OutOfMemoryError when gmp tries to allocate memory beyond the limit
BEFORE CODE: // Finished scanning this one, finish up by checking the GC invariance
// and let the next item replacing the current one direc... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
3-element Vector{Float64}:
0.7128099173553719
-0.051652892561983674
0.10020661157024757
julia> A\\X
3-element Vector{Float64}:
0.7128099173553719
-0.05165289256198333
0.10020661157024785
```
"""
ldiv!(Y, A, B)
"""
ldiv!(A, B)
Compute `A \\ B` in-place and overwriting `B` to store the result.
The argum... | No issues found. | 3-element Vector{Float64}:
0.7128099173553719
-0.051652892561983674
0.10020661157024757
julia> A\\X
3-element Vector{Float64}:
0.7128099173553719
-0.05165289256198333
0.10020661157024785
```
"""
ldiv!(Y, A, B)
"""
ldiv!(A, B)
Compute `A \\ B` in-place and overwriting `B` to store the result.
The argum... | @@ -94,6 +94,8 @@ export
eigvecs,
factorize,
givens,
+ hermitianpart,
+ hermitianpart!,
hessenberg,
hessenberg!,
isdiag, | stdlib/LinearAlgebra/src/LinearAlgebra.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Add matrix symmetrizing functions | 31,836 | JuliaLang/julia | 35,573 | Julia | ararslan | Review this pull request change.
Language: Julia
File: stdlib/LinearAlgebra/src/LinearAlgebra.jl
PR Title: Add matrix symmetrizing functions
BEFORE CODE: 3-element Vector{Float64}:
0.7128099173553719
-0.051652892561983674
0.10020661157024757
julia> A\\X
3-element Vector{Float64}:
0.7128099173553719
-0.0516... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
return astname(x.args[1].args[1].args[end], ismacro)
else
n = isexpr(x, (:module, :struct)) ? 2 : 1
astname(x.args[n], ismacro)
end
end
astname(q::QuoteNode, ismacro::Bool) = astname(q.value, ismacro)
astname(s::Symbol, ismacro::Bool) = ismacro ? macroname(s) : s
astname(@nospecialize... | No issues found. | return astname(x.args[1].args[1].args[end], ismacro)
else
n = isexpr(x, (:module, :struct)) ? 2 : 1
astname(x.args[n], ismacro)
end
end
astname(q::QuoteNode, ismacro::Bool) = astname(q.value, ismacro)
astname(s::Symbol, ismacro::Bool) = ismacro ? macroname(s) : s
astname(@nospecialize... | @@ -62,7 +62,7 @@ include("bindings.jl")
import .Base.Meta: quot, isexpr
import .Base: Callable, with_output_color
-using .Base: RefValue
+using .Base: RefValue, mapany
import ..CoreDocs: lazy_iterpolate
export doc
@@ -71,12 +71,13 @@ export doc
const modules = Module[]
const META = gensym(:meta)
+const ... | base/docs/Docs.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | More invalidation fixes | 35,928 | JuliaLang/julia | 35,573 | Julia | timholy | Review this pull request change.
Language: Julia
File: base/docs/Docs.jl
PR Title: More invalidation fixes
BEFORE CODE: return astname(x.args[1].args[1].args[end], ismacro)
else
n = isexpr(x, (:module, :struct)) ? 2 : 1
astname(x.args[n], ismacro)
end
end
astname(q::QuoteNode, ismacr... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
wlist = filter(filterfunc, PGRP.workers)
end
for wl in wlist
(wl.state === W_CREATED) && wait(wl.c_state)
push!(join_list, wl)
end
end
all_locs = map(x -> isa(x, Worker) ?
(something(x.config.connect_at, ()), x.id) :
... | No issues found. | wlist = filter(filterfunc, PGRP.workers)
end
for wl in wlist
(wl.state === W_CREATED) && wait(wl.c_state)
push!(join_list, wl)
end
end
all_locs = map(x -> isa(x, Worker) ?
(something(x.config.connect_at, ()), x.id) :
... | @@ -148,7 +148,7 @@ function set_worker_state(w, state)
end
function check_worker_state(w::Worker)
- if w.state == W_CREATED
+ if w.state === W_CREATED
if !isclusterlazy()
if PGRP.topology === :all_to_all
# Since higher pids connect with lower pids, the remote worker
@@ ... | stdlib/Distributed/src/cluster.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Fix more invalidations from overloading `==` | 36,282 | JuliaLang/julia | 35,573 | Julia | timholy | Review this pull request change.
Language: Julia
File: stdlib/Distributed/src/cluster.jl
PR Title: Fix more invalidations from overloading `==`
BEFORE CODE: wlist = filter(filterfunc, PGRP.workers)
end
for wl in wlist
(wl.state === W_CREATED) && wait(wl.c_state)
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
# Examples
```jldoctest
julia> rpad("March", 20)
"March "
```
"""
rpad(s, n::Integer, p::Union{AbstractChar,AbstractString}=' ') = rpad(string(s), n, string(p))
function rpad(
s::Union{AbstractChar,AbstractString},
n::Integer,
p::Union{AbstractChar,AbstractString}=' ',
) :: String
m = sig... | No issues found. | # Examples
```jldoctest
julia> rpad("March", 20)
"March "
```
"""
rpad(s, n::Integer, p::Union{AbstractChar,AbstractString}=' ') = rpad(string(s), n, string(p))
function rpad(
s::Union{AbstractChar,AbstractString},
n::Integer,
p::Union{AbstractChar,AbstractString}=' ',
) :: String
m = sig... | @@ -256,7 +256,7 @@ julia> rstrip(a)
"""
function rstrip(f, s::AbstractString)
for (i, c) in Iterators.reverse(pairs(s))
- f(c) || return @inbounds SubString(s, 1, i)
+ f(c::AbstractChar) || return @inbounds SubString(s, 1, i::Int)
end
SubString(s, 1, 0)
end
@@ -389,26 +389,26 @@ functio... | base/strings/util.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Fix invalidations from novel Integer conversions | 36,459 | JuliaLang/julia | 35,573 | Julia | timholy | Review this pull request change.
Language: Julia
File: base/strings/util.jl
PR Title: Fix invalidations from novel Integer conversions
BEFORE CODE: # Examples
```jldoctest
julia> rpad("March", 20)
"March "
```
"""
rpad(s, n::Integer, p::Union{AbstractChar,AbstractString}=' ') = rpad(string(s), n, stri... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
void jl_set_base_ctx(char *__stk);
extern JL_DLLEXPORT ssize_t jl_tls_offset;
extern JL_DLLEXPORT const int jl_tls_elf_support;
void jl_init_threading(void);
void jl_start_threads(void);
// Whether the GC is running
extern char *jl_safepoint_pages;
STATIC_INLINE int jl_addr_is_safepoint(uintptr_t addr)
{
uintptr_... | No issues found. | void jl_set_base_ctx(char *__stk);
extern JL_DLLEXPORT ssize_t jl_tls_offset;
extern JL_DLLEXPORT const int jl_tls_elf_support;
void jl_init_threading(void);
void jl_start_threads(void);
// Whether the GC is running
extern char *jl_safepoint_pages;
STATIC_INLINE int jl_addr_is_safepoint(uintptr_t addr)
{
uintptr_... | @@ -228,8 +228,8 @@ extern jl_array_t *jl_all_methods JL_GLOBALLY_ROOTED;
JL_DLLEXPORT extern int jl_lineno;
JL_DLLEXPORT extern const char *jl_filename;
-JL_DLLEXPORT jl_value_t *jl_gc_pool_alloc(jl_ptls_t ptls, int pool_offset,
- int osize);
+jl_value_t *jl_gc_pool_alloc_n... | src/julia_internal.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | allocation profiler: get stacks for pool allocs via wrapper function | 43,868 | JuliaLang/julia | 35,573 | Julia | vilterp | Review this pull request change.
Language: C/C++
File: src/julia_internal.h
PR Title: allocation profiler: get stacks for pool allocs via wrapper function
BEFORE CODE: void jl_set_base_ctx(char *__stk);
extern JL_DLLEXPORT ssize_t jl_tls_offset;
extern JL_DLLEXPORT const int jl_tls_elf_support;
void jl_init_thread... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@test reverse(()) === ()
@test reverse((1,2,3)) === (3,2,1)
end
# issue #21697
@test_throws ArgumentError ntuple(identity, -1)
@testset "specialized reduction" begin
@test sum((1,2,3)) === 6
@test prod(()) === 1
@test prod((1,2,3)) === 6
# issue 39182
@test sum((0xe1, 0x1f)) === sum([0x... | No issues found. |
@test reverse(()) === ()
@test reverse((1,2,3)) === (3,2,1)
end
# issue #21697
@test_throws ArgumentError ntuple(identity, -1)
@testset "specialized reduction" begin
@test sum((1,2,3)) === 6
@test prod(()) === 1
@test prod((1,2,3)) === 6
# issue 39182
@test sum((0xe1, 0x1f)) === sum([0x... | @@ -208,7 +208,7 @@ end
@test iterate(t, y3[2]) === nothing
@test eachindex((2,5,"foo")) === Base.OneTo(3)
- @test eachindex((2,5,"foo"), (1,2,5,7)) === Base.OneTo(4)
+ @test_throws DimensionMismatch eachindex((2,5,"foo"), (1,2,5,7))
@test Core.Compiler.is_nothrow(Base.infer_effects(iterate, (T... | test/tuple.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Require all tuples in eachindex to have the same length. | 48,125 | JuliaLang/julia | 35,573 | Julia | navdeeprana | Review this pull request change.
Language: Julia
File: test/tuple.jl
PR Title: Require all tuples in eachindex to have the same length.
BEFORE CODE:
@test reverse(()) === ()
@test reverse((1,2,3)) === (3,2,1)
end
# issue #21697
@test_throws ArgumentError ntuple(identity, -1)
@testset "specialized reducti... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
end
end
end
end
# test hour, minute, second
let h=0, mi=0, s=0, ms=0, us=0, ns=0
for h = (0, 23), mi = (0, 59), s = (0, 59),
ms in (0, 1, 500, 999), us in (0, 1, 500, 999), ns in (0, 1, 500, 999)
t = Dates.Time(h, mi, s, ms, us, ns)
... | No issues found. | end
end
end
end
# test hour, minute, second
let h=0, mi=0, s=0, ms=0, us=0, ns=0
for h = (0, 23), mi = (0, 59), s = (0, 59),
ms in (0, 1, 500, 999), us in (0, 1, 500, 999), ns in (0, 1, 500, 999)
t = Dates.Time(h, mi, s, ms, us, ns)
... | @@ -192,6 +192,69 @@ end
dt1 = dt1 + Dates.Day(1)
end
end
+@testset "ISO year utils" begin
+ # Tests from https://www.epochconverter.com/weeks
+ @test Dates.weeksinyear(Dates.Year(2023)) == 52
+ @test Dates.weeksinyear(Dates.Year(2022)) == 52
+ @test Dates.weeksinyear(Dates.Year(2021)) == 52
... | stdlib/Dates/test/accessors.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | add ISO year / ISO week utilities | 48,507 | JuliaLang/julia | 35,573 | Julia | isentropic | Review this pull request change.
Language: Julia
File: stdlib/Dates/test/accessors.jl
PR Title: add ISO year / ISO week utilities
BEFORE CODE: end
end
end
end
# test hour, minute, second
let h=0, mi=0, s=0, ms=0, us=0, ns=0
for h = (0, 23), mi = (0, 59), s = ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@test div(-x,UInt(y)) == div(-x,y)
@test fld(UInt(x),UInt(y)) == fld(x,y)
@test fld(UInt(x),y) == fld(x,y)
@test fld(x,UInt(y)) == fld(x,y)
@test fld(UInt(x),-y) == reinterpret(UInt,fld(x,-y))
@test fld(-x,UInt(y)) == fld(-x,y)
@test ... | No issues found. | @test div(-x,UInt(y)) == div(-x,y)
@test fld(UInt(x),UInt(y)) == fld(x,y)
@test fld(UInt(x),y) == fld(x,y)
@test fld(x,UInt(y)) == fld(x,y)
@test fld(UInt(x),-y) == reinterpret(UInt,fld(x,-y))
@test fld(-x,UInt(y)) == fld(-x,y)
@test ... | @@ -1770,6 +1770,27 @@ end
@test cld(-1.1, 0.1) == div(-1.1, 0.1, RoundUp) == ceil(big(-1.1)/big(0.1)) == -11.0
@test fld(-1.1, 0.1) == div(-1.1, 0.1, RoundDown) == floor(big(-1.1)/big(0.1)) == -12.0
end
+ @testset "issue #49450" begin
+ @test div(514, Float16(0.75)) === Float16(685... | test/numbers.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Improve floating-point Euclidean division for Float16 and Float32 | 49,637 | JuliaLang/julia | 35,573 | Julia | simonbyrne | Review this pull request change.
Language: Julia
File: test/numbers.jl
PR Title: Improve floating-point Euclidean division for Float16 and Float32
BEFORE CODE: @test div(-x,UInt(y)) == div(-x,y)
@test fld(UInt(x),UInt(y)) == fld(x,y)
@test fld(UInt(x),y) == fld(x,y)
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
// Annotates a function with attributes suitable for GC allocation
// functions. Specifically, the return value is marked noalias and nonnull.
static Function *addGCAllocAttributes(Function *target)
{
auto FnAttrs = AttrBuilder(target->getContext());
FnAttrs.addMemoryAttr(MemoryEffects::... | No issues found. | // Annotates a function with attributes suitable for GC allocation
// functions. Specifically, the return value is marked noalias and nonnull.
static Function *addGCAllocAttributes(Function *target)
{
auto FnAttrs = AttrBuilder(target->getContext());
FnAttrs.addMemoryAttr(MemoryEffects::... | @@ -88,6 +88,27 @@ llvm::CallInst *JuliaPassContext::getPGCstack(llvm::Function &F) const
return nullptr;
}
+llvm::CallInst *JuliaPassContext::getOrAddPGCstack(llvm::Function &F)
+{
+ if (pgcstack_getter || adoptthread_func)
+ for (auto &I : F.getEntryBlock()) {
+ if (CallInst *callInst = d... | src/llvm-pass-helpers.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Allow for :foreigncall to transition to GC safe automatically | 49,933 | JuliaLang/julia | 35,573 | Julia | vchuravy | Review this pull request change.
Language: C++
File: src/llvm-pass-helpers.cpp
PR Title: Allow for :foreigncall to transition to GC safe automatically
BEFORE CODE: // Annotates a function with attributes suitable for GC allocation
// functions. Specifically, the return value is marked noalias and nonnull.
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@test round(123.456, sigdigits=5) ≈ 123.46
@test round(123.456, sigdigits=8, base = 2) ≈ 123.5
@test round(123.456, sigdigits=2, base = 4) ≈ 128.0
@test round(0.0, sigdigits=1) === 0.0
@test round(-0.0, sigdigits=1) === -0.0
@test round(1.2, sigdigits=2) === 1.2
@test round(1.0, sigdigits=6)... | No issues found. | @test round(123.456, sigdigits=5) ≈ 123.46
@test round(123.456, sigdigits=8, base = 2) ≈ 123.5
@test round(123.456, sigdigits=2, base = 4) ≈ 128.0
@test round(0.0, sigdigits=1) === 0.0
@test round(-0.0, sigdigits=1) === -0.0
@test round(1.2, sigdigits=2) === 1.2
@test round(1.0, sigdigits=6)... | @@ -209,3 +209,47 @@ end
struct CustomNumber <: Number end
@test !isnan(CustomNumber())
end
+
+@testset "isapprox and integer overflow" begin
+ for T in (Int8, Int16, Int32)
+ T === Int && continue
+ @test !isapprox(typemin(T), T(0))
+ @test !isapprox(typemin(T), unsigned(T)(0))
+ ... | test/floatfuncs.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Fix integer overflow in `isapprox` | 50,730 | JuliaLang/julia | 35,573 | Julia | nalimilan | Review this pull request change.
Language: Julia
File: test/floatfuncs.jl
PR Title: Fix integer overflow in `isapprox`
BEFORE CODE: @test round(123.456, sigdigits=5) ≈ 123.46
@test round(123.456, sigdigits=8, base = 2) ≈ 123.5
@test round(123.456, sigdigits=2, base = 4) ≈ 128.0
@test round(0.0, sigd... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@test LinRange(0,3,4)/3 == LinRange(0,1,4)
@test broadcast(-, 2, LinRange(0,3,4)) == LinRange(2,-1,4)
@test broadcast(+, 2, LinRange(0,3,4)) == LinRange(2,5,4)
@test -LinRange{Int}(0,3,4) === LinRange{Int}(0,-3,4)
@test -LinRange{Float64}(0.,3.,4) === LinRange{Float64}(-0.,-3.,4)
@test reverse(L... | No issues found. | @test LinRange(0,3,4)/3 == LinRange(0,1,4)
@test broadcast(-, 2, LinRange(0,3,4)) == LinRange(2,-1,4)
@test broadcast(+, 2, LinRange(0,3,4)) == LinRange(2,5,4)
@test -LinRange{Int}(0,3,4) === LinRange{Int}(0,-3,4)
@test -LinRange{Float64}(0.,3.,4) === LinRange{Float64}(-0.,-3.,4)
@test reverse(L... | @@ -2528,3 +2528,10 @@ end
end
end
+
+@testset "unsigned index #44895" begin
+ x = range(-1,1,length=11)
+ @test x[UInt(1)] == -1.0
+ a = StepRangeLen(1,2,3,2)
+ @test a[UInt(1)] == -1
+end | test/ranges.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Make ranges more robust with unsigned indexes. | 50,823 | JuliaLang/julia | 35,573 | Julia | gbaraldi | Review this pull request change.
Language: Julia
File: test/ranges.jl
PR Title: Make ranges more robust with unsigned indexes.
BEFORE CODE: @test LinRange(0,3,4)/3 == LinRange(0,1,4)
@test broadcast(-, 2, LinRange(0,3,4)) == LinRange(2,-1,4)
@test broadcast(+, 2, LinRange(0,3,4)) == LinRange(2,5,4)
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
# This file is a part of Julia. License is MIT: https://julialang.org/license
using Test
using Base.Threads
@testset "Task threadpools" begin
c = Channel{Symbol}() do c; put!(c, threadpool(current_task())); end
@test take!(c) === threadpool(current_task())
c = Channel{Symbol}(spawn = true) do c; put!(c, t... | No issues found. | # This file is a part of Julia. License is MIT: https://julialang.org/license
using Test
using Base.Threads
@testset "Task threadpools" begin
c = Channel{Symbol}() do c; put!(c, threadpool(current_task())); end
@test take!(c) === threadpool(current_task())
c = Channel{Symbol}(spawn = true) do c; put!(c, t... | @@ -0,0 +1,14 @@
+# This file is a part of Julia. License is MIT: https://julialang.org/license
+
+using Test
+using Base.Threads
+
+@testset "Task threadpools" begin
+ c = Channel{Symbol}() do c; put!(c, threadpool(current_task())); end
+ @test take!(c) === threadpool(current_task())
+ c = Channel{Symbol}(spa... | test/channel_threadpool.jl | 0 | Julia | 1 | none | 16 | 15 | 15 | true | Add a `threadpool` parameter to `Channel` constructor | 50,858 | JuliaLang/julia | 35,573 | Julia | kpamnany | Review this pull request change.
Language: Julia
File: test/channel_threadpool.jl
PR Title: Add a `threadpool` parameter to `Channel` constructor
BEFORE CODE: # This file is a part of Julia. License is MIT: https://julialang.org/license
using Test
using Base.Threads
@testset "Task threadpools" begin
c = Chann... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
return heap_p
end
heap_p += heap_c * nt
newheaps = Vector{taskheap}(undef, heap_p)
copyto!(newheaps, tpheaps)
for i = (1 + length(tpheaps)):heap_p
newheaps[i] = taskheap()
end
heaps[tp] = newheaps
end
return heap_p
end
function ... | No issues found. | return heap_p
end
heap_p += heap_c * nt
newheaps = Vector{taskheap}(undef, heap_p)
copyto!(newheaps, tpheaps)
for i = (1 + length(tpheaps)):heap_p
newheaps[i] = taskheap()
end
heaps[tp] = newheaps
end
return heap_p
end
function ... | @@ -88,6 +88,7 @@ end
function multiq_insert(task::Task, priority::UInt16)
tpid = ccall(:jl_get_task_threadpoolid, Int8, (Any,), task)
+ @assert tpid > -1
heap_p = multiq_size(tpid)
tp = tpid + 1
@@ -124,6 +125,9 @@ function multiq_deletemin()
tid = Threads.threadid()
tp = ccall(:jl_t... | base/partr.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Separate foreign threads into a :foreign threadpool | 50,912 | JuliaLang/julia | 35,573 | Julia | vchuravy | Review this pull request change.
Language: Julia
File: base/partr.jl
PR Title: Separate foreign threads into a :foreign threadpool
BEFORE CODE: return heap_p
end
heap_p += heap_c * nt
newheaps = Vector{taskheap}(undef, heap_p)
copyto!(newheaps, tpheaps)
for i = (... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
REPL.history_reset_state(hp)
panel.hist = hp
panel.keymap_dict = LineEdit.keymap(Dict{Any,Any}[skeymap,
LineEdit.default_keymap, LineEdit.escape_defaults])
c = Condition()
panel.on_done = (s, buf, ok) -> begin
if !ok
LineEdit.transition(s, :abort)
end
li... | No issues found. | REPL.history_reset_state(hp)
panel.hist = hp
panel.keymap_dict = LineEdit.keymap(Dict{Any,Any}[skeymap,
LineEdit.default_keymap, LineEdit.escape_defaults])
c = Condition()
panel.on_done = (s, buf, ok) -> begin
if !ok
LineEdit.transition(s, :abort)
end
li... | @@ -1670,3 +1670,49 @@ fake_repl() do stdin_write, stdout_read, repl
wait(repltask)
@test contains(txt, "Some type information was truncated. Use `show(err)` to see complete types.")
end
+
+# Hints for tab completes
+
+fake_repl() do stdin_write, stdout_read, repl
+ repltask = @async begin
+ REPL.r... | stdlib/REPL/test/repl.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Add repl tab complete hints while typing | 51,229 | JuliaLang/julia | 35,573 | Julia | IanButterworth | Review this pull request change.
Language: Julia
File: stdlib/REPL/test/repl.jl
PR Title: Add repl tab complete hints while typing
BEFORE CODE: REPL.history_reset_state(hp)
panel.hist = hp
panel.keymap_dict = LineEdit.keymap(Dict{Any,Any}[skeymap,
LineEdit.default_keymap, LineEdit.escape_defaul... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
# P64 pools with 64 bit tags
@test popfirst!(got) == " 16 Base.invokelatest(g, 0)"
@test popfirst!(got) == " 32 Base.invokelatest(g, x)"
elseif 12 == (() -> @allocated ccall(:jl_gc_allocobj, Ptr{Cvoid}, (Csize_t,), 8))()
# See if we have a 12-b... | No issues found. | # P64 pools with 64 bit tags
@test popfirst!(got) == " 16 Base.invokelatest(g, 0)"
@test popfirst!(got) == " 32 Base.invokelatest(g, x)"
elseif 12 == (() -> @allocated ccall(:jl_gc_allocobj, Ptr{Cvoid}, (Csize_t,), 8))()
# See if we have a 12-b... | @@ -315,18 +315,21 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no`
# --quiet, --banner
let p = "print((Base.JLOptions().quiet, Base.JLOptions().banner))"
- @test read(`$exename -e $p`, String) == "(0, -1)"
- @test read(`$exename -q -e $p`, S... | test/cmdlineargs.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Make banner size depend on terminal size | 51,811 | JuliaLang/julia | 35,573 | Julia | tecosaur | Review this pull request change.
Language: Julia
File: test/cmdlineargs.jl
PR Title: Make banner size depend on terminal size
BEFORE CODE: # P64 pools with 64 bit tags
@test popfirst!(got) == " 16 Base.invokelatest(g, 0)"
@test popfirst!(got) == " 32 Base.invo... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
unsigned pool_id = select_pool(bufsz);
if (pool_sizes[pool_id] == bufsz) {
task->stkbuf = NULL;
#ifdef _COMPILER_ASAN_ENABLED_
__asan_unpoison_stack_memory((uintptr_t)stkbuf, bufsz);
#endif
small_arraylist_push(&ptls->heap.free_stacks[pool_id], stkbuf);
}
... | No issues found. | unsigned pool_id = select_pool(bufsz);
if (pool_sizes[pool_id] == bufsz) {
task->stkbuf = NULL;
#ifdef _COMPILER_ASAN_ENABLED_
__asan_unpoison_stack_memory((uintptr_t)stkbuf, bufsz);
#endif
small_arraylist_push(&ptls->heap.free_stacks[pool_id], stkbuf);
}
... | @@ -203,6 +203,8 @@ void sweep_stack_pools(void)
assert(gc_n_threads);
for (int i = 0; i < gc_n_threads; i++) {
jl_ptls_t ptls2 = gc_all_tls_states[i];
+ if (ptls2 == NULL)
+ continue;
// free half of stacks that remain unused since last sweep
for (int p = 0; p <... | src/gc-stacks.c | 0 | C | 1 | none | 16 | 51 | 51 | true | free more thread state in jl_delete_thread and GC | 52,198 | JuliaLang/julia | 35,573 | Julia | JeffBezanson | Review this pull request change.
Language: C
File: src/gc-stacks.c
PR Title: free more thread state in jl_delete_thread and GC
BEFORE CODE: unsigned pool_id = select_pool(bufsz);
if (pool_sizes[pool_id] == bufsz) {
task->stkbuf = NULL;
#ifdef _COMPILER_ASAN_ENABLED_
__asan_un... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
end
end
all_tests = [tests; node1_tests]
local stdin_monitor
all_tasks = Task[]
o_ts_duration = 0.0
try
# Monitor stdin and kill this task on ^C
# but don't do this on Windows, because it may deadlock in the kernel
running_tests = Dict{String, DateTime}()
... | No issues found. | end
end
all_tests = [tests; node1_tests]
local stdin_monitor
all_tasks = Task[]
o_ts_duration = 0.0
try
# Monitor stdin and kill this task on ^C
# but don't do this on Windows, because it may deadlock in the kernel
running_tests = Dict{String, DateTime}()
... | @@ -8,6 +8,7 @@ if !Sys.iswindows() && isa(stdin, Base.TTY)
end
using Printf: @sprintf
using Base: Experimental
+using Base.ScopedValues
include("choosetests.jl")
include("testenv.jl")
@@ -420,60 +421,61 @@ cd(@__DIR__) do
Errored, and execution continues until the summary at the end of the test
run, w... | test/runtests.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | use ScopedValues for TestSets | 53,462 | JuliaLang/julia | 35,573 | Julia | simonbyrne | Review this pull request change.
Language: Julia
File: test/runtests.jl
PR Title: use ScopedValues for TestSets
BEFORE CODE: end
end
all_tests = [tests; node1_tests]
local stdin_monitor
all_tasks = Task[]
o_ts_duration = 0.0
try
# Monitor stdin and kill this task on ^C
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
/* functions needed to implement the value interface (cvtable_t) */
value_t relocate_lispvalue(fl_context_t *fl_ctx, value_t v);
void print_traverse(fl_context_t *fl_ctx, value_t v);
void fl_print_chr(fl_context_t *fl_ctx, char c, ios_t *f);
void fl_print_str(fl_context_t *fl_ctx, const char *s, ios_t *f);
void fl_prin... | No issues found. | /* functions needed to implement the value interface (cvtable_t) */
value_t relocate_lispvalue(fl_context_t *fl_ctx, value_t v);
void print_traverse(fl_context_t *fl_ctx, value_t v);
void fl_print_chr(fl_context_t *fl_ctx, char c, ios_t *f);
void fl_print_str(fl_context_t *fl_ctx, const char *s, ios_t *f);
void fl_prin... | @@ -158,7 +158,7 @@ value_t fl_cons(fl_context_t *fl_ctx, value_t a, value_t b) JL_NOTSAFEPOINT;
value_t fl_list2(fl_context_t *fl_ctx, value_t a, value_t b) JL_NOTSAFEPOINT;
value_t fl_listn(fl_context_t *fl_ctx, size_t n, ...) JL_NOTSAFEPOINT;
value_t symbol(fl_context_t *fl_ctx, const char *str) JL_NOTSAFEPOINT;
... | src/flisp/flisp.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | Canonicalize names of nested functions by keeping a more fine grained counter -- per (module, method name) pair | 53,719 | JuliaLang/julia | 35,573 | Julia | d-netto | Review this pull request change.
Language: C/C++
File: src/flisp/flisp.h
PR Title: Canonicalize names of nested functions by keeping a more fine grained counter -- per (module, method name) pair
BEFORE CODE: /* functions needed to implement the value interface (cvtable_t) */
value_t relocate_lispvalue(fl_context_t ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
g33829() = @allocated Base.inferencebarrier(f33829)(1.1,)
g33829() # warm up
@test (@allocated g33829()) == 0
@test called33829 # make sure there was a global side effect so it's hard for this call to simply be removed
let src = get_llvm(f33829, Tuple{Float64}, true, true)
@test occursin(r"call [^(]*double @", src)... | No issues found. | g33829() = @allocated Base.inferencebarrier(f33829)(1.1,)
g33829() # warm up
@test (@allocated g33829()) == 0
@test called33829 # make sure there was a global side effect so it's hard for this call to simply be removed
let src = get_llvm(f33829, Tuple{Float64}, true, true)
@test occursin(r"call [^(]*double @", src)... | @@ -866,7 +866,7 @@ if Sys.ARCH === :x86_64
foo52079() = Core.Intrinsics.have_fma(Float64)
if foo52079() == true
let io = IOBuffer()
- code_native(io,^,(Float64,Float64), dump_module=false)
+ code_native(io,Base.Math.exp_impl,(Float64,Float64,Val{:ℯ}), dump_module=false)
... | test/compiler/codegen.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | power uses Float64 exponents for integers | 53,967 | JuliaLang/julia | 35,573 | Julia | KlausC | Review this pull request change.
Language: Julia
File: test/compiler/codegen.jl
PR Title: power uses Float64 exponents for integers
BEFORE CODE: g33829() = @allocated Base.inferencebarrier(f33829)(1.1,)
g33829() # warm up
@test (@allocated g33829()) == 0
@test called33829 # make sure there was a global side effect ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@test r != s
@test hash(r) != hash(s)
rand(s)
end
@test rand(r, len) == rand(s, len)
@test s == r
@test hash(s) == hash(r)
h = rand(UInt)
@test hash(s, h) == hash(r, h)
if RNG == Xoshiro
t = copy(TaskLocalRNG())
... | No issues found. | @test r != s
@test hash(r) != hash(s)
rand(s)
end
@test rand(r, len) == rand(s, len)
@test s == r
@test hash(s) == hash(r)
h = rand(UInt)
@test hash(s, h) == hash(r, h)
if RNG == Xoshiro
t = copy(TaskLocalRNG())
... | @@ -694,6 +694,12 @@ let b = ['0':'9';'A':'Z';'a':'z']
@test randstring(MersenneTwister(0)) == randstring(MersenneTwister(0), b)
end
+@testset "`randstring` with $T" for T in (UInt8, UInt16, UInt32, Int8, Int16, Int32, UInt, Int)
+ # clamp it to a small value so that we don't allocate too much unnecessarily
... | stdlib/Random/test/runtests.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Support types other than `Int` in `randstring`, but convert to `Int` prior to entering the "main" method | 54,402 | JuliaLang/julia | 35,573 | Julia | Seelengrab | Review this pull request change.
Language: Julia
File: stdlib/Random/test/runtests.jl
PR Title: Support types other than `Int` in `randstring`, but convert to `Int` prior to entering the "main" method
BEFORE CODE: @test r != s
@test hash(r) != hash(s)
rand(s)
end
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
static std::pair<std::string,llvm::SmallVector<std::string, 0>>
get_llvm_target_noext(const TargetData<1> &data)
{
return std::make_pair(data.name, llvm::SmallVector<std::string, 0>{});
}
static std::pair<std::string,llvm::SmallVector<std::string, 0>>
get_llvm_target_vec(const TargetData<1> &data)
{
auto re... | No issues found. | }
static std::pair<std::string,llvm::SmallVector<std::string, 0>>
get_llvm_target_noext(const TargetData<1> &data)
{
return std::make_pair(data.name, llvm::SmallVector<std::string, 0>{});
}
static std::pair<std::string,llvm::SmallVector<std::string, 0>>
get_llvm_target_vec(const TargetData<1> &data)
{
auto re... | @@ -144,13 +144,27 @@ const std::pair<std::string,std::string> &jl_get_llvm_disasm_target(void)
jl_get_cpu_features_llvm(), {{}, 0}, {{}, 0}, 0});
return res;
}
-
+#ifndef __clang_gcanalyzer__
llvm::SmallVector<jl_target_spec_t, 0> jl_get_llvm_clone_targets(void)
{
- if (jit_targets.empty())... | src/processor_fallback.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Actually setup jit targets when compiling packageimages instead of targeting only one | 54,471 | JuliaLang/julia | 35,573 | Julia | gbaraldi | Review this pull request change.
Language: C++
File: src/processor_fallback.cpp
PR Title: Actually setup jit targets when compiling packageimages instead of targeting only one
BEFORE CODE: }
static std::pair<std::string,llvm::SmallVector<std::string, 0>>
get_llvm_target_noext(const TargetData<1> &data)
{
retur... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
# PR #18888: code_typed shouldn't cache, return_types should
f18888() = nothing
let
world = Core.Compiler.get_world_counter()
m = first(methods(f18888, Tuple{}))
ft = typeof(f18888)
code_typed(f18888, Tuple{}; optimize=false)
@test m.specializations !== Core.svec() # uncached, but creates the spec... | No issues found. |
# PR #18888: code_typed shouldn't cache, return_types should
f18888() = nothing
let
world = Core.Compiler.get_world_counter()
m = first(methods(f18888, Tuple{}))
ft = typeof(f18888)
code_typed(f18888, Tuple{}; optimize=false)
@test m.specializations !== Core.svec() # uncached, but creates the spec... | @@ -125,11 +125,18 @@ not_const = 1
# For curmod_*
include("testenv.jl")
+module TestMod36529
+ x36529 = 0
+ y36529 = 1
+ export y36529
+end
+
module TestMod7648
using Test
import Base.convert
import ..curmod_name, ..curmod
-export a9475, foo9475, c7648, foo7648, foo7648_nomethods, Foo7648
+using ..Tes... | test/reflection.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | reflection: allow `names` to return `using`-ed names | 54,609 | JuliaLang/julia | 35,573 | Julia | aviatesk | Review this pull request change.
Language: Julia
File: test/reflection.jl
PR Title: reflection: allow `names` to return `using`-ed names
BEFORE CODE:
# PR #18888: code_typed shouldn't cache, return_types should
f18888() = nothing
let
world = Core.Compiler.get_world_counter()
m = first(methods(f18888, Tuple... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
{
if (func == NULL)
return "macro expansion";
if (jl_is_method_instance(func))
func = ((jl_method_instance_t*)func)->def.value;
if (jl_is_method(func))
func = (jl_value_t*)((jl_method_t*)func)->name;
if (jl_is_symbol(func))
return jl_symbol_name((jl_sym_t*)func);
if (... | No issues found. | {
if (func == NULL)
return "macro expansion";
if (jl_is_method_instance(func))
func = ((jl_method_instance_t*)func)->def.value;
if (jl_is_method(func))
func = (jl_value_t*)((jl_method_t*)func)->name;
if (jl_is_symbol(func))
return jl_symbol_name((jl_sym_t*)func);
if (... | @@ -641,22 +641,22 @@ JL_DLLEXPORT jl_value_t *jl_lookup_code_address(void *ip, int skipC)
return rs;
}
-static void jl_safe_print_codeloc(const char* func_name, const char* file_name,
- int line, int inlined) JL_NOTSAFEPOINT
+static void jl_safe_fprint_codeloc(ios_t *s, const c... | src/stackwalk.c | 0 | C | 1 | none | 16 | 51 | 51 | true | NFC: Add `fprint` variants of internal print functions | 54,835 | JuliaLang/julia | 35,573 | Julia | topolarity | Review this pull request change.
Language: C
File: src/stackwalk.c
PR Title: NFC: Add `fprint` variants of internal print functions
BEFORE CODE: {
if (func == NULL)
return "macro expansion";
if (jl_is_method_instance(func))
func = ((jl_method_instance_t*)func)->def.value;
if (jl_is_metho... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
jl_task_t *ct = jl_current_task;
jl_excstack_t *excstack = ct->excstack;
if (!excstack || excstack->top == 0)
jl_error("rethrow(exc) not allowed outside a catch block");
// overwrite exception on top of stack. see jl_excstack_exception
jl_excstack_raw(excstack)[excstack->top-1].jlvalue = e;
... | No issues found. | jl_task_t *ct = jl_current_task;
jl_excstack_t *excstack = ct->excstack;
if (!excstack || excstack->top == 0)
jl_error("rethrow(exc) not allowed outside a catch block");
// overwrite exception on top of stack. see jl_excstack_exception
jl_excstack_raw(excstack)[excstack->top-1].jlvalue = e;
... | @@ -732,11 +732,38 @@ JL_DLLEXPORT JL_NORETURN void jl_no_exc_handler(jl_value_t *e, jl_task_t *ct)
if (!e)
e = jl_current_exception(ct);
- jl_printf((JL_STREAM*)STDERR_FILENO, "fatal: error thrown and no exception handler available.\n");
- jl_static_show((JL_STREAM*)STDERR_FILENO, e);
- jl_pri... | src/task.c | 0 | C | 1 | none | 16 | 51 | 51 | true | Add error dialog for critical errors on Windows | 54,836 | JuliaLang/julia | 35,573 | Julia | topolarity | Review this pull request change.
Language: C
File: src/task.c
PR Title: Add error dialog for critical errors on Windows
BEFORE CODE: jl_task_t *ct = jl_current_task;
jl_excstack_t *excstack = ct->excstack;
if (!excstack || excstack->top == 0)
jl_error("rethrow(exc) not allowed outside a catch bl... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
array = [1, 2, 3] + ['a', 'b', 'c']
@test array == ['b', 'd', 'f']
@test eltype(array) == Char
array = ['a', 'b', 'c'] - [0, 1, 2]
@test array == ['a', 'a', 'a']
@test eltype(array) == Char
end
@testset "sprint, repr" begin
@test sprint(show, "text/plain", '$') == "'\$': ASCII/Unicode U+0... | No issues found. |
array = [1, 2, 3] + ['a', 'b', 'c']
@test array == ['b', 'd', 'f']
@test eltype(array) == Char
array = ['a', 'b', 'c'] - [0, 1, 2]
@test array == ['a', 'a', 'a']
@test eltype(array) == Char
end
@testset "sprint, repr" begin
@test sprint(show, "text/plain", '$') == "'\$': ASCII/Unicode U+0... | @@ -244,8 +244,8 @@ end
@testset "overlong codes" begin
function test_overlong(c::Char, n::Integer, rep::String)
- if isvalid(c)
- @test Int(c) == n
+ if !Base.ismalformed(c)
+ @test Int(c) == n == codepoint(c)
else
@test_throws Base.InvalidCharError UIn... | test/char.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | make codepoint(c) work for overlong chars | 55,152 | JuliaLang/julia | 35,573 | Julia | stevengj | Review this pull request change.
Language: Julia
File: test/char.jl
PR Title: make codepoint(c) work for overlong chars
BEFORE CODE:
array = [1, 2, 3] + ['a', 'b', 'c']
@test array == ['b', 'd', 'f']
@test eltype(array) == Char
array = ['a', 'b', 'c'] - [0, 1, 2]
@test array == ['a', 'a', 'a']... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
#else
#define REMARK(remark)
#endif
void jl_alloc::runEscapeAnalysis(llvm::CallInst *I, EscapeAnalysisRequiredArgs required, EscapeAnalysisOptionalArgs options) {
required.use_info.reset();
Attribute allockind = I->getFnAttr(Attribute::AllocKind);
if (allockind.isValid())
required.use_info.allockin... | No issues found. | #else
#define REMARK(remark)
#endif
void jl_alloc::runEscapeAnalysis(llvm::CallInst *I, EscapeAnalysisRequiredArgs required, EscapeAnalysisOptionalArgs options) {
required.use_info.reset();
Attribute allockind = I->getFnAttr(Attribute::AllocKind);
if (allockind.isValid())
required.use_info.allockin... | @@ -88,6 +88,8 @@ bool AllocUseInfo::addMemOp(Instruction *inst, unsigned opno, uint32_t offset,
memop.isaggr = isa<StructType>(elty) || isa<ArrayType>(elty) || isa<VectorType>(elty);
memop.isobjref = hasObjref(elty);
auto &field = getField(offset, size, elty);
+ field.second.hasunboxed |= !hasObjref(... | src/llvm-alloc-helpers.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | AllocOpt: Fix stack lowering where alloca continas boxed and unboxed data | 55,306 | JuliaLang/julia | 35,573 | Julia | wsmoses | Review this pull request change.
Language: C++
File: src/llvm-alloc-helpers.cpp
PR Title: AllocOpt: Fix stack lowering where alloca continas boxed and unboxed data
BEFORE CODE: #else
#define REMARK(remark)
#endif
void jl_alloc::runEscapeAnalysis(llvm::CallInst *I, EscapeAnalysisRequiredArgs required, EscapeAnalysi... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
types === Bottom && return Future(CallMeta(Bottom, Any, EFFECTS_THROWS, NoCallInfo()))
if !(unwrapped isa DataType && unwrapped.name === Tuple.name)
return Future(CallMeta(Bottom, TypeError, EFFECTS_THROWS, NoCallInfo()))
end
argtype = argtypes_to_type(argtype_tail(argtypes, ... | No issues found. | types === Bottom && return Future(CallMeta(Bottom, Any, EFFECTS_THROWS, NoCallInfo()))
if !(unwrapped isa DataType && unwrapped.name === Tuple.name)
return Future(CallMeta(Bottom, TypeError, EFFECTS_THROWS, NoCallInfo()))
end
argtype = argtypes_to_type(argtype_tail(argtypes, ... | @@ -30,12 +30,12 @@ function propagate_conditional(rt::InterConditional, cond::Conditional)
new_elsetype = rt.elsetype === Const(true) ? cond.thentype : cond.elsetype
if rt.thentype == Bottom
@assert rt.elsetype != Bottom
- return Conditional(cond.slot, Bottom, new_elsetype)
+ return Co... | Compiler/src/abstractinterpretation.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | inference: track reaching defs for slots | 55,601 | JuliaLang/julia | 35,573 | Julia | topolarity | Review this pull request change.
Language: Julia
File: Compiler/src/abstractinterpretation.jl
PR Title: inference: track reaching defs for slots
BEFORE CODE: types === Bottom && return Future(CallMeta(Bottom, Any, EFFECTS_THROWS, NoCallInfo()))
if !(unwrapped isa DataType && unwrapped.name === Tuple... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if dep isa Module
if PkgId(dep) == modkey && module_build_id(dep) === modbuild_id
break
else
@debug "Rejecting cache file $path_to_try because module $modkey got loaded at a different version than... | No issues found. | if dep isa Module
if PkgId(dep) == modkey && module_build_id(dep) === modbuild_id
break
else
@debug "Rejecting cache file $path_to_try because module $modkey got loaded at a different version than... | @@ -1254,22 +1254,9 @@ function _include_from_serialized(pkg::PkgId, path::String, ocachepath::Union{No
if parentmodule(M) === M && PkgId(M) == pkg
register && register_root_module(M)
if timing_imports
- elapsed = round((time_ns() - t_before) / 1e6, digits = 1)
+ ... | base/loading.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Avoid confounding compilation side effects of `@time_imports` | 55,729 | JuliaLang/julia | 35,573 | Julia | IanButterworth | Review this pull request change.
Language: Julia
File: base/loading.jl
PR Title: Avoid confounding compilation side effects of `@time_imports`
BEFORE CODE: if dep isa Module
if PkgId(dep) == modkey && module_build_id(dep) === modbuild_id
break
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if env == "@."
env = current_project()
env === nothing && continue
end
env = expanduser(env)
env in envs || push!(envs, env)
end
end
return envs
end
function init_load_path()
if haskey(ENV, "JULIA_LOAD_PATH")
pa... | No issues found. | if env == "@."
env = current_project()
env === nothing && continue
end
env = expanduser(env)
env in envs || push!(envs, env)
end
end
return envs
end
function init_load_path()
if haskey(ENV, "JULIA_LOAD_PATH")
pa... | @@ -284,22 +284,14 @@ function load_path_expand(env::AbstractString)::Union{String, Nothing}
env == "@temp" && return mktempdir()
env == "@stdlib" && return Sys.STDLIB
if startswith(env, "@script")
- if @isdefined(PROGRAM_FILE)
- dir = dirname(PROGRAM_FILE)
- ... | base/initdefs.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Fix `--project=@script` when outside script directory | 56,351 | JuliaLang/julia | 35,573 | Julia | awadell1 | Review this pull request change.
Language: Julia
File: base/initdefs.jl
PR Title: Fix `--project=@script` when outside script directory
BEFORE CODE: if env == "@."
env = current_project()
env === nothing && continue
end
env = expanduser(env)
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
The `transcode` function succeeds as long as the input data can be
reasonably represented in the target encoding; it always succeeds for
conversions between UTF-XX encodings, even for invalid Unicode data.
Only conversion to/from UTF-8 is currently supported.
# Examples
```jldoctest
julia> str = "αβγ"
"αβγ"
julia> t... | No issues found. | The `transcode` function succeeds as long as the input data can be
reasonably represented in the target encoding; it always succeeds for
conversions between UTF-XX encodings, even for invalid Unicode data.
Only conversion to/from UTF-8 is currently supported.
# Examples
```jldoctest
julia> str = "αβγ"
"αβγ"
julia> t... | @@ -301,14 +301,27 @@ function transcode(::Type{UInt8}, src::AbstractVector{UInt16})
return dst
end
+"""
+ unsafe_string(p::Ptr{T}, [length::Integer]) where {T<:Union{UInt16,UInt32,Cwchar_t}}
+ unsafe_string(p::Cwstring)
+
+Transcode a string from the address of a C-style (NUL-terminated) string encoded a... | base/strings/cstring.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | document that unsafe_string accepts Cstring | 56,907 | JuliaLang/julia | 35,573 | Julia | stevengj | Review this pull request change.
Language: Julia
File: base/strings/cstring.jl
PR Title: document that unsafe_string accepts Cstring
BEFORE CODE: The `transcode` function succeeds as long as the input data can be
reasonably represented in the target encoding; it always succeeds for
conversions between UTF-XX encodi... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
end
@test popfirst!(got) == " - end"
@test popfirst!(got) == " - f(1.23)"
@test isempty(got) || got
end
# --optimize
@test readchomp(`$exename -E "Base.JLOptions().opt_level"`) == "2"
@test readchomp(`$exename -E "Base.JLOptions().opt_level" -O`) == "3"
... | No issues found. | end
@test popfirst!(got) == " - end"
@test popfirst!(got) == " - f(1.23)"
@test isempty(got) || got
end
# --optimize
@test readchomp(`$exename -E "Base.JLOptions().opt_level"`) == "2"
@test readchomp(`$exename -E "Base.JLOptions().opt_level" -O`) == "3"
... | @@ -891,6 +891,64 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no`
@test occursin("precompile(Tuple{typeof(Main.foo), Int", _stderr)
end
+ # --trace-eval
+ let
+ # Test --trace-eval=loc (location only)
+ mktempdir() do dir
+ testfile = joinpath(dir, "tes... | test/cmdlineargs.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Add `--trace-eval` and `Base.TRACE_EVAL` for showing each top level eval | 57,137 | JuliaLang/julia | 35,573 | Julia | IanButterworth | Review this pull request change.
Language: Julia
File: test/cmdlineargs.jl
PR Title: Add `--trace-eval` and `Base.TRACE_EVAL` for showing each top level eval
BEFORE CODE: end
@test popfirst!(got) == " - end"
@test popfirst!(got) == " - f(1.23)"
@test isempty(got) || got... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
UT = unsigned(T)
# Algorithm from Hacker's Delight, section 10-4
ad = unsigned(abs(d))
t = signedmin + signbit(d)
anc = t - one(UT) - rem(t, ad) # absolute value of nc
p = sizeof(d)*8 - 1
q1, r1 = divrem(signedmin, anc)
q2, r2 = divrem(signedmin, ad)
... | No issues found. | UT = unsigned(T)
# Algorithm from Hacker's Delight, section 10-4
ad = unsigned(abs(d))
t = signedmin + signbit(d)
anc = t - one(UT) - rem(t, ad) # absolute value of nc
p = sizeof(d)*8 - 1
q1, r1 = divrem(signedmin, anc)
q2, r2 = divrem(signedmin, ad)
... | @@ -2,7 +2,7 @@
module MultiplicativeInverses
-import Base: div, divrem, rem, unsigned
+import Base: div, divrem, mul_hi, rem, unsigned
using Base: IndexLinear, IndexCartesian, tail
export multiplicativeinverse
@@ -134,33 +134,13 @@ struct UnsignedMultiplicativeInverse{T<:Unsigned} <: MultiplicativeInverse{T}... | base/multinverses.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Add mul_hi function for bit integers | 57,276 | JuliaLang/julia | 35,573 | Julia | sumiya11 | Review this pull request change.
Language: Julia
File: base/multinverses.jl
PR Title: Add mul_hi function for bit integers
BEFORE CODE: UT = unsigned(T)
# Algorithm from Hacker's Delight, section 10-4
ad = unsigned(abs(d))
t = signedmin + signbit(d)
anc = t - one(UT) - rem(t... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if !any(x -> isequal(x, -0.0), a)
@test hash(convert(Array{Int}, a)) == hash(b)
if all(x -> typemin(Int8) <= x <= typemax(Int8), a)
@test hash(convert(Array{Int8}, a)) == hash(b)
end
end
end
# Test that overflow does not give inconsistent hashes with heterogeneous arrays
@te... | No issues found. | if !any(x -> isequal(x, -0.0), a)
@test hash(convert(Array{Int}, a)) == hash(b)
if all(x -> typemin(Int8) <= x <= typemax(Int8), a)
@test hash(convert(Array{Int8}, a)) == hash(b)
end
end
end
# Test that overflow does not give inconsistent hashes with heterogeneous arrays
@te... | @@ -315,6 +315,15 @@ struct AUnionParam{T<:Union{Nothing,Float32,Float64}} end
@test hash(5//3) == hash(big(5)//3)
end
+@testset "`Pair`" begin
+ @test (@inferred hash(0 => 1)) === (@inferred hash(false => true))
+ @test hash(0 => 1, UInt(0)) != hash(0 => 1, UInt(1))
+ let (x, y, z) = (1, 3, 7)
+ ... | test/hashing.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | prevent unnecessary `hash` collisions for `Pair` | 57,285 | JuliaLang/julia | 35,573 | Julia | nsajko | Review this pull request change.
Language: Julia
File: test/hashing.jl
PR Title: prevent unnecessary `hash` collisions for `Pair`
BEFORE CODE: if !any(x -> isequal(x, -0.0), a)
@test hash(convert(Array{Int}, a)) == hash(b)
if all(x -> typemin(Int8) <= x <= typemax(Int8), a)
@test has... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
return true;
}
else if (f == jl_builtin_compilerbarrier && (nargs == 2)) {
emit_typecheck(ctx, argv[1], (jl_value_t*)jl_symbol_type, "compilerbarrier");
*ret = argv[2];
return true;
}
return false;
}
// Returns ctx.types().T_prjlvalue
static CallInst *emit_jlcall(jl_co... | No issues found. | return true;
}
else if (f == jl_builtin_compilerbarrier && (nargs == 2)) {
emit_typecheck(ctx, argv[1], (jl_value_t*)jl_symbol_type, "compilerbarrier");
*ret = argv[2];
return true;
}
return false;
}
// Returns ctx.types().T_prjlvalue
static CallInst *emit_jlcall(jl_co... | @@ -1005,7 +1005,7 @@ static const auto jlgenericfunction_func = new JuliaFunction<>{
auto T_jlvalue = JuliaType::get_jlvalue_ty(C);
auto T_pjlvalue = PointerType::get(T_jlvalue, 0);
auto T_prjlvalue = PointerType::get(T_jlvalue, AddressSpace::Tracked);
- return FunctionType::get(T_prj... | src/codegen.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Add a warning for auto-import of types | 57,311 | JuliaLang/julia | 35,573 | Julia | Keno | Review this pull request change.
Language: C++
File: src/codegen.cpp
PR Title: Add a warning for auto-import of types
BEFORE CODE: return true;
}
else if (f == jl_builtin_compilerbarrier && (nargs == 2)) {
emit_typecheck(ctx, argv[1], (jl_value_t*)jl_symbol_type, "compilerbarrier");
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
"""
[ PREFIX xxx SUFFIX
"""
@test genmsg("xxx\nxxx", width=20, right_justify=200) ==
"""
┌ PREFIX xxx
└ xxx SUFFIX
"""
# When adding the suffix would overflow the display width, add it on
# the next line:
@test genmsg("xxxx... | No issues found. | """
[ PREFIX xxx SUFFIX
"""
@test genmsg("xxx\nxxx", width=20, right_justify=200) ==
"""
┌ PREFIX xxx
└ xxx SUFFIX
"""
# When adding the suffix would overflow the display width, add it on
# the next line:
@test genmsg("xxxx... | @@ -306,4 +306,47 @@ end
@test isempty(undoc)
end
+@testset "Logging when multithreaded" begin
+ n = 10000
+ cmd = `$(Base.julia_cmd()) -t4 --color=no $(joinpath(@__DIR__, "threads_exec.jl")) $n`
+ fname = tempname()
+ @testset "Thread safety" begin
+ f = open(fname, "w")
+ @test succe... | stdlib/Logging/test/runtests.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Logging: Improve threadsafety | 57,591 | JuliaLang/julia | 35,573 | Julia | IanButterworth | Review this pull request change.
Language: Julia
File: stdlib/Logging/test/runtests.jl
PR Title: Logging: Improve threadsafety
BEFORE CODE: """
[ PREFIX xxx SUFFIX
"""
@test genmsg("xxx\nxxx", width=20, right_justify=200) ==
"""
┌ PREFIX xxx
└ xxx SUF... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
for t in results(ts)
if isa(t, Error) || isa(t, Fail)
println("Error in testset $(ts.description):")
show(t)
println()
elseif isa(t, AbstractTestSet)
print_test_errors(t)
end
end
end
"""
print_test_results(ts::AbstractTestSet, depth_pa... | No issues found. | for t in results(ts)
if isa(t, Error) || isa(t, Fail)
println("Error in testset $(ts.description):")
show(t)
println()
elseif isa(t, AbstractTestSet)
print_test_errors(t)
end
end
end
"""
print_test_results(ts::AbstractTestSet, depth_pa... | @@ -43,6 +43,10 @@ const DISPLAY_FAILED = (
const FAIL_FAST = Ref{Bool}(false)
+const record_passes = OncePerProcess{Bool}() do
+ return Base.get_bool_env("JULIA_TEST_RECORD_PASSES", false)
+end
+
#-----------------------------------------------------------------------
# Backtrace utility functions
@@ -1100... | stdlib/Test/src/Test.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | CI: Store Passes in results.json + various improvements. | 57,686 | JuliaLang/julia | 35,573 | Julia | IanButterworth | Review this pull request change.
Language: Julia
File: stdlib/Test/src/Test.jl
PR Title: CI: Store Passes in results.json + various improvements.
BEFORE CODE: for t in results(ts)
if isa(t, Error) || isa(t, Fail)
println("Error in testset $(ts.description):")
show(t)
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if length(target) == 1 || isdisjoint(target, source)
for (i, j) in zip(target, source)
v[i], v[j] = v[j], v[i]
end
else
@assert minimum(source) <= minimum(target)
reverse!(v, minimum(source), maximum(target))
reverse!(v, minimum(target), maximum(target))
e... | No issues found. | if length(target) == 1 || isdisjoint(target, source)
for (i, j) in zip(target, source)
v[i], v[j] = v[j], v[i]
end
else
@assert minimum(source) <= minimum(target)
reverse!(v, minimum(source), maximum(target))
reverse!(v, minimum(target), maximum(target))
e... | @@ -336,13 +336,13 @@ julia> searchsorted([1, 2, 4, 5, 5, 7], 5) # multiple matches
4:5
julia> searchsorted([1, 2, 4, 5, 5, 7], 3) # no match, insert in the middle
-3:2
+3:2 (empty range)
julia> searchsorted([1, 2, 4, 5, 5, 7], 9) # no match, insert at end
-7:6
+7:6 (empty range)
julia> searchsorted([1, 2, 4,... | base/sort.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | display "(empty range)" in case of empty ranges | 57,697 | JuliaLang/julia | 35,573 | Julia | prashantrahul141 | Review this pull request change.
Language: Julia
File: base/sort.jl
PR Title: display "(empty range)" in case of empty ranges
BEFORE CODE: if length(target) == 1 || isdisjoint(target, source)
for (i, j) in zip(target, source)
v[i], v[j] = v[j], v[i]
end
else
@assert minim... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
end
function _ccallable(name::Union{Nothing, String}, rt::Type, sigt::Type)
ccall(:jl_extern_c, Cvoid, (Any, Any, Any), name, rt, sigt)
end
function expand_ccallable(name, rt, def)
if isa(def,Expr) && (def.head === :(=) || def.head === :function)
sig = def.args[1]
if sig.head === :(::)
... | No issues found. | end
function _ccallable(name::Union{Nothing, String}, rt::Type, sigt::Type)
ccall(:jl_extern_c, Cvoid, (Any, Any, Any), name, rt, sigt)
end
function expand_ccallable(name, rt, def)
if isa(def,Expr) && (def.head === :(=) || def.head === :function)
sig = def.args[1]
if sig.head === :(::)
... | @@ -203,11 +203,11 @@ function exit_on_sigint(on::Bool)
ccall(:jl_exit_on_sigint, Cvoid, (Cint,), on)
end
-function _ccallable(rt::Type, sigt::Type)
- ccall(:jl_extern_c, Cvoid, (Any, Any), rt, sigt)
+function _ccallable(name::Union{Nothing, String}, rt::Type, sigt::Type)
+ ccall(:jl_extern_c, Cvoid, (Any... | base/c.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | add the ability to specify the external name of a ccallable | 57,763 | JuliaLang/julia | 35,573 | Julia | JeffBezanson | Review this pull request change.
Language: Julia
File: base/c.jl
PR Title: add the ability to specify the external name of a ccallable
BEFORE CODE: end
function _ccallable(name::Union{Nothing, String}, rt::Type, sigt::Type)
ccall(:jl_extern_c, Cvoid, (Any, Any, Any), name, rt, sigt)
end
function expand_ccalla... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
target->eraseFromParent();
}
static bool hasUse(const JuliaPassContext &ctx, const jl_intrinsics::IntrinsicDescription &v)
{
auto Intr = ctx.getOrNull(v);
return Intr && !Intr->use_empty();
}
bool FinalLowerGC::shouldRunFinalGC()
{
bool should_run = 0;
should_run |= hasUse(*this, jl_intrinsics::ne... | No issues found. | target->eraseFromParent();
}
static bool hasUse(const JuliaPassContext &ctx, const jl_intrinsics::IntrinsicDescription &v)
{
auto Intr = ctx.getOrNull(v);
return Intr && !Intr->use_empty();
}
bool FinalLowerGC::shouldRunFinalGC()
{
bool should_run = 0;
should_run |= hasUse(*this, jl_intrinsics::ne... | @@ -7,7 +7,6 @@ STATISTIC(NewGCFrameCount, "Number of lowered newGCFrameFunc intrinsics");
STATISTIC(PushGCFrameCount, "Number of lowered pushGCFrameFunc intrinsics");
STATISTIC(PopGCFrameCount, "Number of lowered popGCFrameFunc intrinsics");
STATISTIC(GetGCFrameSlotCount, "Number of lowered getGCFrameSlotFunc intri... | src/llvm-final-gc-lowering.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Refactoring codegen passes that lower write barrier and allocation | 57,769 | JuliaLang/julia | 35,573 | Julia | udesou | Review this pull request change.
Language: C++
File: src/llvm-final-gc-lowering.cpp
PR Title: Refactoring codegen passes that lower write barrier and allocation
BEFORE CODE: target->eraseFromParent();
}
static bool hasUse(const JuliaPassContext &ctx, const jl_intrinsics::IntrinsicDescription &v)
{
auto Int... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@test ends_with_semicolon("1;\r")
@test ends_with_semicolon("1;\r\n \t\f")
@test ends_with_semicolon("1;#äsdf\n")
@test ends_with_semicolon("""1;\n#äsdf\n""")
@test !ends_with_semicolon("\"\\\";\"#\"")
@test ends_with_semicolon("\"\\\\\";#\"")
@test !ends_with_semicolon("begin\na;\nb;\nend... | No issues found. | @test ends_with_semicolon("1;\r")
@test ends_with_semicolon("1;\r\n \t\f")
@test ends_with_semicolon("1;#äsdf\n")
@test ends_with_semicolon("""1;\n#äsdf\n""")
@test !ends_with_semicolon("\"\\\";\"#\"")
@test ends_with_semicolon("\"\\\\\";#\"")
@test !ends_with_semicolon("begin\na;\nb;\nend... | @@ -925,7 +925,7 @@ function test19864()
@eval Base.showerror(io::IO, e::Error19864) = print(io, "correct19864")
buf = IOBuffer()
fake_response = (Base.ExceptionStack([(exception=Error19864(),backtrace=Ptr{Cvoid}[])]),true)
- REPL.print_response(buf, fake_response, false, false, nothing)
+ REPL.pri... | stdlib/REPL/test/repl.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | REPL: call display on the backend | 57,773 | JuliaLang/julia | 35,573 | Julia | IanButterworth | Review this pull request change.
Language: Julia
File: stdlib/REPL/test/repl.jl
PR Title: REPL: call display on the backend
BEFORE CODE: @test ends_with_semicolon("1;\r")
@test ends_with_semicolon("1;\r\n \t\f")
@test ends_with_semicolon("1;#äsdf\n")
@test ends_with_semicolon("""1;\n#äsdf\n""")
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
_, modkey, _ = dep
else
_, modkey, _ = dep::Tuple{String, PkgId, UInt128, String, Vector{Any}, Union{Nothing, String}}
end
end_loading(modkey, nothing)
end
for modkey in newdeps
... | No issues found. | _, modkey, _ = dep
else
_, modkey, _ = dep::Tuple{String, PkgId, UInt128, String, Vector{Any}, Union{Nothing, String}}
end
end_loading(modkey, nothing)
end
for modkey in newdeps
... | @@ -885,6 +885,7 @@ function project_file_manifest_path(project_file::String)::Union{Nothing,String}
manifest_path === missing || return manifest_path
end
dir = abspath(dirname(project_file))
+ isfile_casesensitive(project_file) || return nothing
d = parsed_toml(project_file)
base_manife... | base/loading.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Add `Base.active_manifest()` | 57,937 | JuliaLang/julia | 35,573 | Julia | IanButterworth | Review this pull request change.
Language: Julia
File: base/loading.jl
PR Title: Add `Base.active_manifest()`
BEFORE CODE: _, modkey, _ = dep
else
_, modkey, _ = dep::Tuple{String, PkgId, UInt128, String, Vector{Any}, Union{Nothing, String}}
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
s = "cd(\"" * julia_esc(joinpath(path, space_folder, "space"))
c, r = test_complete(s)
@test s[r] == julia_esc(joinpath(path, space_folder, "space"))
@test julia_esc(joinpath(path, space_folder, "space .file")) * "\"" in c
# '$' is the only character which can appear in a window... | No issues found. | s = "cd(\"" * julia_esc(joinpath(path, space_folder, "space"))
c, r = test_complete(s)
@test s[r] == julia_esc(joinpath(path, space_folder, "space"))
@test julia_esc(joinpath(path, space_folder, "space .file")) * "\"" in c
# '$' is the only character which can appear in a window... | @@ -2632,6 +2632,35 @@ const issue57780_orig = copy(issue57780)
test_complete_context("empty!(issue57780).", Main)
@test issue57780 == issue57780_orig
+function g54131 end
+for i in 1:498
+ @eval g54131(::Val{$i}) = i
+end
+g54131(::Val{499}; kwarg=true) = 499*kwarg
+struct F54131; end
+Base.getproperty(::F54131... | stdlib/REPL/test/replcompletions.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Re-enable tab completion of kwargs for large method tables | 58,012 | JuliaLang/julia | 35,573 | Julia | mbauman | Review this pull request change.
Language: Julia
File: stdlib/REPL/test/replcompletions.jl
PR Title: Re-enable tab completion of kwargs for large method tables
BEFORE CODE: s = "cd(\"" * julia_esc(joinpath(path, space_folder, "space"))
c, r = test_complete(s)
@test s[r] == julia_esc(joinpath... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
end
# issue #19655
let st = stacktrace(empty!(backtrace()))
# not in a `catch`, so should return an empty StackTrace
@test isempty(st)
@test isa(st, StackTrace)
end
module StackTracesTestMod
unfiltered_stacktrace() = stacktrace()
filtered_stacktrace() = StackTraces.remove_frames!(stacktrace(), Sta... | No issues found. | end
# issue #19655
let st = stacktrace(empty!(backtrace()))
# not in a `catch`, so should return an empty StackTrace
@test isempty(st)
@test isa(st, StackTrace)
end
module StackTracesTestMod
unfiltered_stacktrace() = stacktrace()
filtered_stacktrace() = StackTraces.remove_frames!(stacktrace(), Sta... | @@ -262,3 +262,39 @@ end
@testset "Base.StackTraces docstrings" begin
@test isempty(Docs.undocumented_names(StackTraces))
end
+
+
+@testset "Dispatch backtraces" begin
+ # Check that it's possible to capture a backtrace upon entrance to inference
+ # This test ensures that SnoopCompile will continue workin... | test/stacktraces.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Log a backtrace on entrance to type inference | 58,124 | JuliaLang/julia | 35,573 | Julia | timholy | Review this pull request change.
Language: Julia
File: test/stacktraces.jl
PR Title: Log a backtrace on entrance to type inference
BEFORE CODE: end
# issue #19655
let st = stacktrace(empty!(backtrace()))
# not in a `catch`, so should return an empty StackTrace
@test isempty(st)
@test isa(st, StackTrace... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
jl_aliasinfo_t ai = jl_aliasinfo_t::fromTBAA(ctx, ctx.tbaa().tbaa_const);
TheCallee = ai.decorateInst(ctx.builder.CreateAlignedLoad(TheCallee->getType(), GV, Align(sizeof(void*))));
setName(ctx.emission_context, TheCallee, namep);
returninfo.decl = FunctionCallee(returninfo.dec... | No issues found. | }
jl_aliasinfo_t ai = jl_aliasinfo_t::fromTBAA(ctx, ctx.tbaa().tbaa_const);
TheCallee = ai.decorateInst(ctx.builder.CreateAlignedLoad(TheCallee->getType(), GV, Align(sizeof(void*))));
setName(ctx.emission_context, TheCallee, namep);
returninfo.decl = FunctionCallee(returninfo.dec... | @@ -881,15 +881,6 @@ static const auto jlcheckassignonce_func = new JuliaFunction<>{
{T_pjlvalue, T_pjlvalue, T_pjlvalue, PointerType::get(JuliaType::get_jlvalue_ty(C), AddressSpace::CalleeRooted)}, false); },
nullptr,
};
-static const auto jldeclareconstval_func = new JuliaFunction<>{
- XSTR(jl_d... | src/codegen.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Lower `const x = ...` to new builtin `Core.setconst!` | 58,187 | JuliaLang/julia | 35,573 | Julia | xal-0 | Review this pull request change.
Language: C++
File: src/codegen.cpp
PR Title: Lower `const x = ...` to new builtin `Core.setconst!`
BEFORE CODE: }
jl_aliasinfo_t ai = jl_aliasinfo_t::fromTBAA(ctx, ctx.tbaa().tbaa_const);
TheCallee = ai.decorateInst(ctx.builder.CreateAlignedLoad(TheCallee->g... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
5-element Vector{String}:
"j"
"ju"
"jul"
"juli"
"julia"
```
"""
cumprod(x::AbstractVector) = cumprod(x, dims=1)
cumprod(itr) = accumulate(mul_prod, itr)
"""
accumulate(op, A; dims::Integer, [init])
Cumulative operation `op` along the dimension `dims` of `A` (providing `dims` is optional
for vectors). An ini... | No issues found. | 5-element Vector{String}:
"j"
"ju"
"jul"
"juli"
"julia"
```
"""
cumprod(x::AbstractVector) = cumprod(x, dims=1)
cumprod(itr) = accumulate(mul_prod, itr)
"""
accumulate(op, A; dims::Integer, [init])
Cumulative operation `op` along the dimension `dims` of `A` (providing `dims` is optional
for vectors). An ini... | @@ -5,12 +5,14 @@
# it does double the number of operations compared to accumulate,
# though for cheap operations like + this does not have much impact (20%)
function _accumulate_pairwise!(op::Op, c::AbstractVector{T}, v::AbstractVector, s, i1, n)::T where {T,Op}
- @inbounds if n < 128
- s_ = v[i1]
- ... | base/accumulate.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Narrow `@inbounds` annotations in `accumulate.jl` to only indexing calls | 58,200 | JuliaLang/julia | 35,573 | Julia | adienes | Review this pull request change.
Language: Julia
File: base/accumulate.jl
PR Title: Narrow `@inbounds` annotations in `accumulate.jl` to only indexing calls
BEFORE CODE: 5-element Vector{String}:
"j"
"ju"
"jul"
"juli"
"julia"
```
"""
cumprod(x::AbstractVector) = cumprod(x, dims=1)
cumprod(itr) = accumulate(mul... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if (jl_gotoifnot_label(stmt) <= i)
*has_loops = 1;
}
}
expr_attributes(stmt, body, has_ccall, has_defs, has_opaque);
}
*forced_compile = jl_has_meta(body, jl_force_compile_sym);
}
int jl_is_toplevel_only_expr(jl_value_t *e) JL_NOTSAFEPOINT
{
r... | No issues found. | if (jl_gotoifnot_label(stmt) <= i)
*has_loops = 1;
}
}
expr_attributes(stmt, body, has_ccall, has_defs, has_opaque);
}
*forced_compile = jl_has_meta(body, jl_force_compile_sym);
}
int jl_is_toplevel_only_expr(jl_value_t *e) JL_NOTSAFEPOINT
{
r... | @@ -346,15 +346,6 @@ check_type: ;
JL_UNLOCK(&world_counter_lock);
}
-void jl_eval_global_expr(jl_module_t *m, jl_expr_t *ex, int set_type)
-{
- size_t i, l = jl_array_nrows(ex->args);
- for (i = 0; i < l; i++) {
- jl_value_t *arg = jl_exprarg(ex, i);
- jl_declare_global(m, arg, NULL, 0);
- ... | src/toplevel.c | 0 | C | 1 | none | 16 | 51 | 51 | true | Remove :globaldecl and :global lowered forms; add Core.declare_global | 58,279 | JuliaLang/julia | 35,573 | Julia | xal-0 | Review this pull request change.
Language: C
File: src/toplevel.c
PR Title: Remove :globaldecl and :global lowered forms; add Core.declare_global
BEFORE CODE: if (jl_gotoifnot_label(stmt) <= i)
*has_loops = 1;
}
}
expr_attributes(stmt, body, has_ccall,... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@test_throws BoundsError r[badinds...] = -3
end
for goodinds in (1, 30, (1,1), (10,3))
@test setindex!(r, -3, goodinds...) === r
@test r[goodinds...] == -3
end
r = reinterpret(Int64, view(a, 1:2:5, :))
@test @inferred(IndexStyle(r)) == IndexCartesian()
fill!(r, 4)
@te... | No issues found. | @test_throws BoundsError r[badinds...] = -3
end
for goodinds in (1, 30, (1,1), (10,3))
@test setindex!(r, -3, goodinds...) === r
@test r[goodinds...] == -3
end
r = reinterpret(Int64, view(a, 1:2:5, :))
@test @inferred(IndexStyle(r)) == IndexCartesian()
fill!(r, 4)
@te... | @@ -325,6 +325,23 @@ test_many_wrappers(fill(1.0, 5, 3), (identity, wrapper)) do a_
@test r[goodinds...] == -5
end
end
+
+let a = rand(ComplexF32, 5)
+ r = reinterpret(reshape, Float32, a)
+ ref = Array(r)
+
+ @test r[1, :, 1] == ref[1, :]
+ @test r[1, :, 1, 1, 1] == ref[1, :]
+ @t... | test/reinterpretarray.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | fix trailing indices stackoverflow in reinterpreted array | 58,293 | JuliaLang/julia | 35,573 | Julia | adienes | Review this pull request change.
Language: Julia
File: test/reinterpretarray.jl
PR Title: fix trailing indices stackoverflow in reinterpreted array
BEFORE CODE: @test_throws BoundsError r[badinds...] = -3
end
for goodinds in (1, 30, (1,1), (10,3))
@test setindex!(r, -3, goodinds...) === r
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if (!exclude_typeofbottom || (!typetype && jl_isa((jl_value_t*)jl_typeofbottom_type, ty))) {
// detect Type{Union{}}, Type{Type{Union{}}}, and Type{typeof(Union{}} and do those early here
// otherwise the possibility of encountering `Type{Union{}}` in this interse... | No issues found. | if (!exclude_typeofbottom || (!typetype && jl_isa((jl_value_t*)jl_typeofbottom_type, ty))) {
// detect Type{Union{}}, Type{Type{Union{}}}, and Type{typeof(Union{}} and do those early here
// otherwise the possibility of encountering `Type{Union{}}` in this interse... | @@ -1332,6 +1332,9 @@ static void jl_typemap_list_insert_(
jl_typemap_entry_t *newrec)
{
jl_typemap_entry_t *l = jl_atomic_load_relaxed(pml);
+
+ // Pick the first intersection point that guarantees that the list ordering
+ // will be (leaf sigs..., simple sigs..., other sigs...)
while ((jl_va... | src/typemap.c | 0 | C | 1 | none | 16 | 51 | 51 | true | gf.c: Add some comments to `ml_matches` (NFC) | 58,304 | JuliaLang/julia | 35,573 | Julia | topolarity | Review this pull request change.
Language: C
File: src/typemap.c
PR Title: gf.c: Add some comments to `ml_matches` (NFC)
BEFORE CODE: if (!exclude_typeofbottom || (!typetype && jl_isa((jl_value_t*)jl_typeofbottom_type, ty))) {
// detect Type{Union{}}, Type{Type{Union{}}}, and Typ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if (bt == jl_uint16_type) return jl_box_uint16(jl_atomic_load((_Atomic(uint16_t)*)data));
if (bt == jl_char_type) return jl_box_char(jl_atomic_load((_Atomic(uint32_t)*)data));
assert(!bt->smalltag);
jl_task_t *ct = jl_current_task;
jl_value_t *v = jl_gc_alloc(ct->ptls, nb, bt);
// data is a... | No issues found. | if (bt == jl_uint16_type) return jl_box_uint16(jl_atomic_load((_Atomic(uint16_t)*)data));
if (bt == jl_char_type) return jl_box_char(jl_atomic_load((_Atomic(uint32_t)*)data));
assert(!bt->smalltag);
jl_task_t *ct = jl_current_task;
jl_value_t *v = jl_gc_alloc(ct->ptls, nb, bt);
// data is a... | @@ -702,13 +702,19 @@ void jl_compute_field_offsets(jl_datatype_t *st)
// Should never happen
throw_ovf(should_malloc, desc, st, fsz);
desc[i].isptr = 0;
+
if (jl_is_uniontype(fld)) {
fsz += 1; // selector byte
... | src/datatype.c | 0 | C | 1 | none | 16 | 51 | 51 | true | Fix layout flags for types that have oddly sized primitive type fields | 58,435 | JuliaLang/julia | 35,573 | Julia | gbaraldi | Review this pull request change.
Language: C
File: src/datatype.c
PR Title: Fix layout flags for types that have oddly sized primitive type fields
BEFORE CODE: if (bt == jl_uint16_type) return jl_box_uint16(jl_atomic_load((_Atomic(uint16_t)*)data));
if (bt == jl_char_type) return jl_box_char(jl_atomic_l... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
# (LegacyString.)UTF16String and (LegacyString.)UTF32String, among others.
mutable struct CharStr <: AbstractString
chars::Vector{Char}
CharStr(x) = new(collect(x))
end
Base.iterate(x::CharStr) = iterate(x.chars)
Base.iterate(x::CharStr, i::Int) = iterate(x.chars, i)
Base.lastindex(x::CharStr) = lastindex(x.ch... | No issues found. | # (LegacyString.)UTF16String and (LegacyString.)UTF32String, among others.
mutable struct CharStr <: AbstractString
chars::Vector{Char}
CharStr(x) = new(collect(x))
end
Base.iterate(x::CharStr) = iterate(x.chars)
Base.iterate(x::CharStr, i::Int) = iterate(x.chars, i)
Base.lastindex(x::CharStr) = lastindex(x.ch... | @@ -8,6 +8,17 @@ using Random
@test String("abc!") == "abc!"
@test String(0x61:0x63) == "abc"
+ # reinterpret arrays
+ v = [0x61,0x62,0x63,0x21]
+ v32 = copy(reinterpret(UInt32, v))
+ @test String(reinterpret(UInt8, v32)) == "abc!" && !isempty(v32)
+ @test 1 == @allocations String(reinterpret... | test/strings/basic.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Add a more efficient implementation for String(::ReinterpretArray) | 58,438 | JuliaLang/julia | 35,573 | Julia | lntricate1 | Review this pull request change.
Language: Julia
File: test/strings/basic.jl
PR Title: Add a more efficient implementation for String(::ReinterpretArray)
BEFORE CODE: # (LegacyString.)UTF16String and (LegacyString.)UTF32String, among others.
mutable struct CharStr <: AbstractString
chars::Vector{Char}
Char... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
# issue #37671
let d = Dict((:a,) => 1, (:a, :b) => 2)
@test d[(:a,)] == 1
@test d[(:a, :b)] == 2
end
# issue #37880
primitive type Has256Bits 256 end
let x = reinterpret(Has256Bits, [0xfcdac822cac89d82de4f9b3326da8294, 0x6ebac4d5982880ca703c57e37657f1ee])[]
shifted = [0xeefcdac822cac89d82de4f9b3326da82, ... | No issues found. |
# issue #37671
let d = Dict((:a,) => 1, (:a, :b) => 2)
@test d[(:a,)] == 1
@test d[(:a, :b)] == 2
end
# issue #37880
primitive type Has256Bits 256 end
let x = reinterpret(Has256Bits, [0xfcdac822cac89d82de4f9b3326da8294, 0x6ebac4d5982880ca703c57e37657f1ee])[]
shifted = [0xeefcdac822cac89d82de4f9b3326da82, ... | @@ -1047,3 +1047,25 @@ f57872() = (Core.isdefinedglobal(@__MODULE__, Base.compilerbarrier(:const, :x578
@noinline f_mutateany(@nospecialize x) = x[] = 1
g_mutateany() = (y = Ref(0); f_mutateany(y); y[])
@test g_mutateany() === 1
+
+# 58470 tbaa for unionselbyte of heap allocated mutables
+mutable struct Wrapper58470... | Compiler/test/codegen.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Fix tbaa usage when storing into heap allocated immutable structs | 58,483 | JuliaLang/julia | 35,573 | Julia | gbaraldi | Review this pull request change.
Language: Julia
File: Compiler/test/codegen.jl
PR Title: Fix tbaa usage when storing into heap allocated immutable structs
BEFORE CODE:
# issue #37671
let d = Dict((:a,) => 1, (:a, :b) => 2)
@test d[(:a,)] == 1
@test d[(:a, :b)] == 2
end
# issue #37880
primitive type Has25... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
ccall(:jl_mi_cache_insert, Cvoid, (Any, Any), mi, ci)
return cache
end
struct WorldRange
min_world::UInt
max_world::UInt
end
WorldRange() = WorldRange(typemin(UInt), typemax(UInt))
WorldRange(w::UInt) = WorldRange(w, w)
WorldRange(r::UnitRange) = WorldRange(first(r), last(r))
first(wr::WorldRange) = wr... | No issues found. | ccall(:jl_mi_cache_insert, Cvoid, (Any, Any), mi, ci)
return cache
end
struct WorldRange
min_world::UInt
max_world::UInt
end
WorldRange() = WorldRange(typemin(UInt), typemax(UInt))
WorldRange(w::UInt) = WorldRange(w, w)
WorldRange(r::UnitRange) = WorldRange(first(r), last(r))
first(wr::WorldRange) = wr... | @@ -14,7 +14,7 @@ end
function setindex!(cache::InternalCodeCache, ci::CodeInstance, mi::MethodInstance)
@assert ci.owner === cache.owner
m = mi.def
- if isa(m, Method) && m.module != Core
+ if isa(m, Method)
ccall(:jl_push_newly_inferred, Cvoid, (Any,), ci)
end
ccall(:jl_mi_cache_in... | Compiler/src/cicache.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Don't filter `Core` methods from newly-inferred list | 58,510 | JuliaLang/julia | 35,573 | Julia | topolarity | Review this pull request change.
Language: Julia
File: Compiler/src/cicache.jl
PR Title: Don't filter `Core` methods from newly-inferred list
BEFORE CODE: ccall(:jl_mi_cache_insert, Cvoid, (Any, Any), mi, ci)
return cache
end
struct WorldRange
min_world::UInt
max_world::UInt
end
WorldRange() = Worl... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
end)", true)
test_repr("a.:(=)")
test_repr("a.:(:)")
test_repr("(:).a")
@test eval(eval(Meta.parse(repr(:`ls x y`)))) == `ls x y`
@test repr(Expr(:., :a, :b, :c)) == ":(\$(Expr(:., :a, :b, :c)))"
@test repr(Expr(:., :a, :b)) == ":(\$(Expr(:., :a, :b)))"
@test repr(Expr(:., :a)) == ":(\$(Expr(:., :a)))"
@test repr(E... | No issues found. | end)", true)
test_repr("a.:(=)")
test_repr("a.:(:)")
test_repr("(:).a")
@test eval(eval(Meta.parse(repr(:`ls x y`)))) == `ls x y`
@test repr(Expr(:., :a, :b, :c)) == ":(\$(Expr(:., :a, :b, :c)))"
@test repr(Expr(:., :a, :b)) == ":(\$(Expr(:., :a, :b)))"
@test repr(Expr(:., :a)) == ":(\$(Expr(:., :a)))"
@test repr(E... | @@ -703,7 +703,7 @@ let oldout = stdout, olderr = stderr
redirect_stderr(olderr)
close(wrout)
close(wrerr)
- @test fetch(out) == "primitive type Int64 <: Signed\nTESTA\nTESTB\nΑ1Β2\"A\"\nA\n123\"C\"\n"
+ @test fetch(out) == "primitive type Int64 <: Signed\nTESTA\nTESTB\nΑ1Β2\"A\... | test/show.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Make more types jl_static_show readably | 58,512 | JuliaLang/julia | 35,573 | Julia | xal-0 | Review this pull request change.
Language: Julia
File: test/show.jl
PR Title: Make more types jl_static_show readably
BEFORE CODE: end)", true)
test_repr("a.:(=)")
test_repr("a.:(:)")
test_repr("(:).a")
@test eval(eval(Meta.parse(repr(:`ls x y`)))) == `ls x y`
@test repr(Expr(:., :a, :b, :c)) == ":(\$(Expr(:., ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
end
# Anonymous Functions
main_ex = quote
using Serialization
$create_serialization_stream() do s
local g() = :magic_token_anon_fun_test
local gkw(; kw=:thekw) = kw
serialize(s, g)
serialize(s, g)
serialize(s, gkw)
seekstart(s)
ds = Serializer(s)
... | No issues found. | end
# Anonymous Functions
main_ex = quote
using Serialization
$create_serialization_stream() do s
local g() = :magic_token_anon_fun_test
local gkw(; kw=:thekw) = kw
serialize(s, g)
serialize(s, g)
serialize(s, gkw)
seekstart(s)
ds = Serializer(s)
... | @@ -1,6 +1,7 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license
using Test, Random, Serialization, Base64
+using Base.ScopedValues: with
# Check that serializer hasn't gone out-of-frame
@test Serialization.sertag(Symbol) == 1
@@ -661,3 +662,14 @@ end
@test_broken isempty(undoc... | stdlib/Serialization/test/runtests.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | fix serializer compat with CodeInfos from v1.11 | 58,650 | JuliaLang/julia | 35,573 | Julia | JeffBezanson | Review this pull request change.
Language: Julia
File: stdlib/Serialization/test/runtests.jl
PR Title: fix serializer compat with CodeInfos from v1.11
BEFORE CODE: end
# Anonymous Functions
main_ex = quote
using Serialization
$create_serialization_stream() do s
local g() = :magic_token_anon_fun_tes... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
function reshape(parent::AbstractArray, ndims::Val{N}) where N
reshape(parent, rdims(Val(N), axes(parent)))
end
# Move elements from inds to out until out reaches the desired
# dimensionality N, either filling with OneTo(1) or collapsing the
# product of trailing dims into the last element
rdims_trailing(l, inds..... | No issues found. | function reshape(parent::AbstractArray, ndims::Val{N}) where N
reshape(parent, rdims(Val(N), axes(parent)))
end
# Move elements from inds to out until out reaches the desired
# dimensionality N, either filling with OneTo(1) or collapsing the
# product of trailing dims into the last element
rdims_trailing(l, inds..... | @@ -36,7 +36,7 @@ length(R::ReshapedArrayIterator) = length(R.iter)
eltype(::Type{<:ReshapedArrayIterator{I}}) where {I} = @isdefined(I) ? ReshapedIndex{eltype(I)} : Any
@noinline throw_dmrsa(dims, len) =
- throw(DimensionMismatch("new dimensions $(dims) must be consistent with array length $len"))
+ throw(Di... | base/reshapedarray.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | improve inferred effects for `reshape` for `Array` | 58,672 | JuliaLang/julia | 35,573 | Julia | nsajko | Review this pull request change.
Language: Julia
File: base/reshapedarray.jl
PR Title: improve inferred effects for `reshape` for `Array`
BEFORE CODE: function reshape(parent::AbstractArray, ndims::Val{N}) where N
reshape(parent, rdims(Val(N), axes(parent)))
end
# Move elements from inds to out until out reach... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
a = @noinline rand(rand(0:10))
if isempty(a)
err = BoundsError(a)
throw(err)
return nothing
end
return a
end
code_typed(foo; optimize=true)
code_typed(Compiler.setindex!, (Compiler.UseRef,Compiler.Ne... | No issues found. | a = @noinline rand(rand(0:10))
if isempty(a)
err = BoundsError(a)
throw(err)
return nothing
end
return a
end
code_typed(foo; optimize=true)
code_typed(Compiler.setindex!, (Compiler.UseRef,Compiler.Ne... | @@ -825,3 +825,23 @@ end
@test_throws ErrorException Base.code_ircode(+, (Float64, Float64); optimize_until = "nonexisting pass name")
@test_throws ErrorException Base.code_ircode(+, (Float64, Float64); optimize_until = typemax(Int))
+
+#57153 check that the CFG has a #0 block predecessor and that we don't fail to ... | Compiler/test/ssair.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Add 0 predecessor to entry basic block and handle it in inlining | 58,683 | JuliaLang/julia | 35,573 | Julia | gbaraldi | Review this pull request change.
Language: Julia
File: Compiler/test/ssair.jl
PR Title: Add 0 predecessor to entry basic block and handle it in inlining
BEFORE CODE: a = @noinline rand(rand(0:10))
if isempty(a)
err = BoundsError(a)
throw(err)
r... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
#undef X
JL_TIMING_COUNTER_LAST
};
#define TIMING_XCONCAT(x1, x2) x1##x2
#define TIMING_CONCAT(x1, x2) TIMING_XCONCAT(x1, x2)
/**
* Timing Backend: Aggregated timing counts (implemented in timing.c)
**/
typedef struct jl_timing_counts_event_t {
const char *name;
_Atomic(uint64_t) self;
_Atomic(uint... | No issues found. | #undef X
JL_TIMING_COUNTER_LAST
};
#define TIMING_XCONCAT(x1, x2) x1##x2
#define TIMING_CONCAT(x1, x2) TIMING_XCONCAT(x1, x2)
/**
* Timing Backend: Aggregated timing counts (implemented in timing.c)
**/
typedef struct jl_timing_counts_event_t {
const char *name;
_Atomic(uint64_t) self;
_Atomic(uint... | @@ -68,7 +68,8 @@ JL_DLLEXPORT int jl_timing_enabled(void);
#define HAVE_TIMING_SUPPORT
#endif
-#if defined( USE_TRACY ) || defined( USE_ITTAPI ) || defined( USE_NVTX ) || defined( USE_TIMING_COUNTS )
+#if defined( USE_TRACY ) || defined( USE_ITTAPI ) || defined( USE_NVTX ) || \
+ defined( USE_TIMING_CO... | src/timing.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | Add option to use Apple os_signpost for instrumentation | 58,702 | JuliaLang/julia | 35,573 | Julia | gbaraldi | Review this pull request change.
Language: C/C++
File: src/timing.h
PR Title: Add option to use Apple os_signpost for instrumentation
BEFORE CODE: #undef X
JL_TIMING_COUNTER_LAST
};
#define TIMING_XCONCAT(x1, x2) x1##x2
#define TIMING_CONCAT(x1, x2) TIMING_XCONCAT(x1, x2)
/**
* Timing Backend: Aggregated tim... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
end
export libgit2
# These get calculated in __init__()
const PATH = Ref("")
const PATH_list = String[]
const LIBPATH = Ref("")
const LIBPATH_list = String[]
artifact_dir::String = ""
libgit2_path::String = ""
const libgit2 = LazyLibrary(
if Sys.iswindows()
BundledLazyLibraryPath("libgit2.dll")
elsei... | No issues found. | end
export libgit2
# These get calculated in __init__()
const PATH = Ref("")
const PATH_list = String[]
const LIBPATH = Ref("")
const LIBPATH_list = String[]
artifact_dir::String = ""
libgit2_path::String = ""
const libgit2 = LazyLibrary(
if Sys.iswindows()
BundledLazyLibraryPath("libgit2.dll")
elsei... | @@ -3,7 +3,7 @@
## dummy stub for https://github.com/JuliaBinaryWrappers/LibGit2_jll.jl
baremodule LibGit2_jll
-using Base, Libdl, LibSSH2_jll
+using Base, Libdl, LibSSH2_jll, PCRE2_jll, Zlib_jll
if !(Sys.iswindows() || Sys.isapple())
using OpenSSL_jll
end
@@ -33,14 +33,14 @@ const libgit2 = LazyLibrary(
... | stdlib/LibGit2_jll/src/LibGit2_jll.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | LibGit2: Update to 1.9.1 | 58,731 | JuliaLang/julia | 35,573 | Julia | eschnett | Review this pull request change.
Language: Julia
File: stdlib/LibGit2_jll/src/LibGit2_jll.jl
PR Title: LibGit2: Update to 1.9.1
BEFORE CODE: end
export libgit2
# These get calculated in __init__()
const PATH = Ref("")
const PATH_list = String[]
const LIBPATH = Ref("")
const LIBPATH_list = String[]
artifact_dir::S... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
n += va
end
end
end
return n
end
return length(t.name.names) - t.name.n_uninitialized
end
import Core: typename
_tuple_error(T::Type, x) = (@noinline; throw(MethodError(convert, (T, x))))
convert(::Type{T}, x::T) where {T<:Tuple} = x
function co... | No issues found. | n += va
end
end
end
return n
end
return length(t.name.names) - t.name.n_uninitialized
end
import Core: typename
_tuple_error(T::Type, x) = (@noinline; throw(MethodError(convert, (T, x))))
convert(::Type{T}, x::T) where {T<:Tuple} = x
function co... | @@ -377,13 +377,14 @@ macro _nospecializeinfer_meta()
return Expr(:meta, :nospecializeinfer)
end
-function _checkbounds_array(::Type{Bool}, A::Union{Array, GenericMemory}, i::Int)
+# These special checkbounds methods are defined early for bootstrapping
+function checkbounds(::Type{Bool}, A::Union{Array, Memory}... | base/essentials.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Unify `_checkbounds_array` into `checkbounds` and use it in more places | 58,785 | JuliaLang/julia | 35,573 | Julia | giordano | Review this pull request change.
Language: Julia
File: base/essentials.jl
PR Title: Unify `_checkbounds_array` into `checkbounds` and use it in more places
BEFORE CODE: n += va
end
end
end
return n
end
return length(t.name.names) - t.name.n_uni... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
jlbacktrace(); // written to STDERR_FILENO
}
}
ct->world_age = last_age;
}
return;
}
void post_boot_hooks(void);
void post_image_load_hooks(void);
JL_DLLEXPORT void *jl_libjulia_internal_handle;
JL_DLLEXPORT void *jl_libjulia_handle;
JL_DLLEXPORT void *jl_RTLD_DEFAU... | No issues found. | jlbacktrace(); // written to STDERR_FILENO
}
}
ct->world_age = last_age;
}
return;
}
void post_boot_hooks(void);
void post_image_load_hooks(void);
JL_DLLEXPORT void *jl_libjulia_internal_handle;
JL_DLLEXPORT void *jl_libjulia_handle;
JL_DLLEXPORT void *jl_RTLD_DEFAU... | @@ -21,6 +21,10 @@
#include <pthread_np.h>
#endif
+#if !defined(_OS_WINDOWS_)
+#include <dlfcn.h>
+#endif
+
#include "julia.h"
#include "julia_internal.h"
#include "builtin_proto.h"
@@ -723,26 +727,29 @@ JL_DLLEXPORT void jl_init_(jl_image_buf_t sysimage)
void *stack_lo, *stack_hi;
jl_init_stack_limits... | src/init.c | 0 | C | 1 | none | 16 | 51 | 51 | true | jl_dlfind: do not find symbols in library dependencies | 58,815 | JuliaLang/julia | 35,573 | Julia | xal-0 | Review this pull request change.
Language: C
File: src/init.c
PR Title: jl_dlfind: do not find symbols in library dependencies
BEFORE CODE: jlbacktrace(); // written to STDERR_FILENO
}
}
ct->world_age = last_age;
}
return;
}
void post_boot_hooks(void);
void post_... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
# next is to test a very large range, which should be fast because print_range
# only examines spacing of the left and right edges of the range, sufficient
# to cover the designated screen size.
@test replrepr(range(0, stop=100, length=10000)) == "0.0:0.010001000100010001:100.0"
@test replrepr(LinRa... | No issues found. | # next is to test a very large range, which should be fast because print_range
# only examines spacing of the left and right edges of the range, sufficient
# to cover the designated screen size.
@test replrepr(range(0, stop=100, length=10000)) == "0.0:0.010001000100010001:100.0"
@test replrepr(LinRa... | @@ -743,6 +743,8 @@ end
@test length(typemin(T):typemax(T)) == T(0)
@test length(zero(T):one(T):typemax(T)) == typemin(T)
@test length(typemin(T):one(T):typemax(T)) == T(0)
+ @test length(StepRange{T,BigInt}(zero(T), 1, typemax(T))) == typemin(T)
+ @test length(StepRange{T,BigIn... | test/ranges.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | optimize `length(::OrdinalRange)` for large bit-ints | 58,864 | JuliaLang/julia | 35,573 | Julia | mbauman | Review this pull request change.
Language: Julia
File: test/ranges.jl
PR Title: optimize `length(::OrdinalRange)` for large bit-ints
BEFORE CODE: # next is to test a very large range, which should be fast because print_range
# only examines spacing of the left and right edges of the range, sufficient
# ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@test b === c
if ismutable($v)
@test !(b === a)
end
end
a isa Complex && let cf = @cfunction($fname, Ref{Complex}, (Ref{Any},))
b = ccall(cf, Ref{Complex}, (Ref{Any},), $v)
@test b == $v
@test b === c
if ... | No issues found. | @test b === c
if ismutable($v)
@test !(b === a)
end
end
a isa Complex && let cf = @cfunction($fname, Ref{Complex}, (Ref{Any},))
b = ccall(cf, Ref{Complex}, (Ref{Any},), $v)
@test b == $v
@test b === c
if ... | @@ -1979,3 +1979,11 @@ let llvm = sprint(code_llvm, gc_safe_ccall, ())
# check for the gc_safe store
@test occursin("store atomic i8 2", llvm)
end
+
+module Test57749
+using Test, Zstd_jll
+const prefix = "Zstd version: "
+const sym = :ZSTD_versionString
+get_zstd_version() = prefix * unsafe_string(ccall((sy... | test/ccall.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | fix #57749, model ccall binding access in inference | 58,872 | JuliaLang/julia | 35,573 | Julia | JeffBezanson | Review this pull request change.
Language: Julia
File: test/ccall.jl
PR Title: fix #57749, model ccall binding access in inference
BEFORE CODE: @test b === c
if ismutable($v)
@test !(b === a)
end
end
a isa Complex && let cf = @cfunction($fname, Ref... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@boundscheck checkbounds(a, i1, tailinds...)
ind_start, sidx = divrem((i1-1)*sizeof(T), sizeof(S))
# Optimizations that avoid branches
if sizeof(T) % sizeof(S) == 0
# T is bigger than S and contains an integer number of them
n = sizeof(T) ÷ sizeof(S)
t... | No issues found. | @boundscheck checkbounds(a, i1, tailinds...)
ind_start, sidx = divrem((i1-1)*sizeof(T), sizeof(S))
# Optimizations that avoid branches
if sizeof(T) % sizeof(S) == 0
# T is bigger than S and contains an integer number of them
n = sizeof(T) ÷ sizeof(S)
t... | @@ -311,6 +311,7 @@ SimdLoop.simd_inner_length(::SCartesianIndices2{K}, ::Any) where K = K
SCartesianIndex2{K}(I1+1, Ilast)
end
+_maybe_reshape(::IndexSCartesian2, A::AbstractArray, I...) = _maybe_reshape(IndexCartesian(), A, I...)
_maybe_reshape(::IndexSCartesian2, A::ReshapedReinterpretArray, I...) = A
# ... | base/reinterpretarray.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | make ReinterpretArray more Offset-safe | 58,898 | JuliaLang/julia | 35,573 | Julia | adienes | Review this pull request change.
Language: Julia
File: base/reinterpretarray.jl
PR Title: make ReinterpretArray more Offset-safe
BEFORE CODE: @boundscheck checkbounds(a, i1, tailinds...)
ind_start, sidx = divrem((i1-1)*sizeof(T), sizeof(S))
# Optimizations that avoid branches
if size... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@which get_A18434()(1; y=2)
@test counter18434 == 1
@which get_A18434()(1, y=2)
@test counter18434 == 2
let _true = Ref(true), f, g, h
@noinline f() = ccall((:time, "error_library_doesnt_exist\0"), Cvoid, ()) # should throw error during runtime
@noinline g() = _true[] ? 0 : h()
@noinline h() = (g(); f())
... | No issues found. | @which get_A18434()(1; y=2)
@test counter18434 == 1
@which get_A18434()(1, y=2)
@test counter18434 == 2
let _true = Ref(true), f, g, h
@noinline f() = ccall((:time, "error_library_doesnt_exist\0"), Cvoid, ()) # should throw error during runtime
@noinline g() = _true[] ? 0 : h()
@noinline h() = (g(); f())
... | @@ -343,21 +343,41 @@ end
# PR 57909
@testset "Support for type annotations as arguments" begin
- @test (@which (::Vector{Int})[::Int]).name === :getindex
- @test (@which (::Vector{Int})[::Int] = ::Int).name === :setindex!
- @test (@which (::Base.RefValue{Int}).x).name === :getproperty
- @test (@which (... | stdlib/InteractiveUtils/test/runtests.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | InteractiveUtils: Support callable objects as functions in introspection macros | 58,905 | JuliaLang/julia | 35,573 | Julia | serenity4 | Review this pull request change.
Language: Julia
File: stdlib/InteractiveUtils/test/runtests.jl
PR Title: InteractiveUtils: Support callable objects as functions in introspection macros
BEFORE CODE: @which get_A18434()(1; y=2)
@test counter18434 == 1
@which get_A18434()(1, y=2)
@test counter18434 == 2
let _true = ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
julia> isdispatchtuple(Tuple{DataType})
false
julia> isdispatchtuple(Tuple{Type{Int}})
true
julia> isdispatchtuple(Tuple{Type})
false
```
"""
isdispatchtuple(@nospecialize(t)) = (@_total_meta; isa(t, DataType) && (t.flags & 0x0004) == 0x0004)
datatype_ismutationfree(dt::DataType) = (@_total_meta; (dt.flags & 0x0100... | No issues found. |
julia> isdispatchtuple(Tuple{DataType})
false
julia> isdispatchtuple(Tuple{Type{Int}})
true
julia> isdispatchtuple(Tuple{Type})
false
```
"""
isdispatchtuple(@nospecialize(t)) = (@_total_meta; isa(t, DataType) && (t.flags & 0x0004) == 0x0004)
datatype_ismutationfree(dt::DataType) = (@_total_meta; (dt.flags & 0x0100... | @@ -173,6 +173,43 @@ false
"""
ispublic(m::Module, s::Symbol) = ccall(:jl_module_public_p, Cint, (Any, Any), m, s) != 0
+"""
+ @__FUNCTION__
+
+Get the innermost enclosing function object.
+
+!!! note
+ `@__FUNCTION__` has the same scoping behavior as `return`: when used
+ inside a closure, it refers to th... | base/runtime_internals.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Create `@__FUNCTION__` and `Expr(:thisfunction)` as generic function self-reference | 58,940 | JuliaLang/julia | 35,573 | Julia | MilesCranmer | Review this pull request change.
Language: Julia
File: base/runtime_internals.jl
PR Title: Create `@__FUNCTION__` and `Expr(:thisfunction)` as generic function self-reference
BEFORE CODE:
julia> isdispatchtuple(Tuple{DataType})
false
julia> isdispatchtuple(Tuple{Type{Int}})
true
julia> isdispatchtuple(Tuple{Type... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
processed_option = std::string(jl_string_data(target_str), jl_string_len(target_str));
if (option[8] == ';') {
processed_option += option + 8; // append the rest after "sysimage"
}
option = processed_option.c_str();
}
}
llvm::SmallVector<... | No issues found. | processed_option = std::string(jl_string_data(target_str), jl_string_len(target_str));
if (option[8] == ';') {
processed_option += option + 8; // append the rest after "sysimage"
}
option = processed_option.c_str();
}
}
llvm::SmallVector<... | @@ -506,6 +506,20 @@ parse_cmdline(const char *option, F &&feature_cb)
if (!option)
abort();
+ // Preprocess the option string to expand "sysimage" keyword
+ std::string processed_option;
+ if (strncmp(option, "sysimage", 8) == 0 && (option[8] == '\0' || option[8] == ';')) {
+ // Replace... | src/processor.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Add 'sysimage' keyword for `JULIA_CPU_TARGET` to match (or extend) the sysimage target | 58,970 | JuliaLang/julia | 35,573 | Julia | IanButterworth | Review this pull request change.
Language: C++
File: src/processor.cpp
PR Title: Add 'sysimage' keyword for `JULIA_CPU_TARGET` to match (or extend) the sysimage target
BEFORE CODE: processed_option = std::string(jl_string_data(target_str), jl_string_len(target_str));
if (option[8] == ';') {
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
end
# NOTE make sure to prevent inference bail out
validate44732(::Component44732) = nothing
validate44732(::Any) = error("don't erase this error!")
function issue44732(c::Container44732)
validate44732(c.x)
return nothing
end
let src = code_typed1(issue44732, (Container44732,))
@test any(isinvoke(:valida... | No issues found. | end
# NOTE make sure to prevent inference bail out
validate44732(::Component44732) = nothing
validate44732(::Any) = error("don't erase this error!")
function issue44732(c::Container44732)
validate44732(c.x)
return nothing
end
let src = code_typed1(issue44732, (Container44732,))
@test any(isinvoke(:valida... | @@ -2310,3 +2310,32 @@ g_noinline_invoke(x) = f_noinline_invoke(x)
let src = code_typed1(g_noinline_invoke, (Union{Symbol,Nothing},))
@test !any(@nospecialize(x)->isa(x,GlobalRef), src.code)
end
+
+# https://github.com/JuliaLang/julia/issues/58915
+f58915(nt) = @inline Base.setindex(nt, 2, :next)
+# This functio... | Compiler/test/inline.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | [release-1.12] Workaround poor inlining behavior for `if @generated` functions | 58,996 | JuliaLang/julia | 35,573 | Julia | topolarity | Review this pull request change.
Language: Julia
File: Compiler/test/inline.jl
PR Title: [release-1.12] Workaround poor inlining behavior for `if @generated` functions
BEFORE CODE: end
# NOTE make sure to prevent inference bail out
validate44732(::Component44732) = nothing
validate44732(::Any) = error("don't erase... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if (nb == 0) return jl_new_struct_uninit(bt); // returns bt->instance
if (bt == jl_bool_type) return (1 & jl_atomic_load((_Atomic(int8_t)*)data)) ? jl_true : jl_false;
if (bt == jl_uint8_type) return jl_box_uint8(jl_atomic_load((_Atomic(uint8_t)*)data));
if (bt == jl_int64_type) ret... | No issues found. | if (nb == 0) return jl_new_struct_uninit(bt); // returns bt->instance
if (bt == jl_bool_type) return (1 & jl_atomic_load((_Atomic(int8_t)*)data)) ? jl_true : jl_false;
if (bt == jl_uint8_type) return jl_box_uint8(jl_atomic_load((_Atomic(uint8_t)*)data));
if (bt == jl_int64_type) ret... | @@ -239,8 +239,10 @@ static jl_datatype_layout_t *jl_get_layout(uint32_t sz,
flddesc->flags.haspadding = haspadding;
flddesc->flags.isbitsegal = isbitsegal;
flddesc->flags.fielddesc_type = fielddesc_type;
- flddesc->flags.arrayelem_isboxed = arrayelem == 1;
- flddesc->flags.arrayelem_isunion = arra... | src/datatype.c | 0 | C | 1 | none | 16 | 51 | 51 | true | add array element mutex offset in print and gc | 58,997 | JuliaLang/julia | 35,573 | Julia | vtjnash | Review this pull request change.
Language: C
File: src/datatype.c
PR Title: add array element mutex offset in print and gc
BEFORE CODE: if (nb == 0) return jl_new_struct_uninit(bt); // returns bt->instance
if (bt == jl_bool_type) return (1 & jl_atomic_load((_Atomic(int8_t)*)data)) ? jl_true... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
for l in dims
len, overflow = Base.Checked.mul_with_overflow(promote(len, l)...)
overflow && throw(ArgumentError("requested size prod($((len, dims...))) too large, would overflow typeof(size(T)) == $(typeof(len))"))
end
len >= 0 || throw(ArgumentError("requested size must be ≥ 0, got $len"))... | No issues found. | for l in dims
len, overflow = Base.Checked.mul_with_overflow(promote(len, l)...)
overflow && throw(ArgumentError("requested size prod($((len, dims...))) too large, would overflow typeof(size(T)) == $(typeof(len))"))
end
len >= 0 || throw(ArgumentError("requested size must be ≥ 0, got $len"))... | @@ -187,16 +187,16 @@ like HDF5 (which can be used with memory-mapping).
"""
function mmap(io::IO,
::Type{Array{T,N}}=Vector{UInt8},
- dims::NTuple{N,Integer}=(div(filesize(io)-position(io),sizeof(T)),),
+ dims::NTuple{N,Integer}=(div(filesize(io)-position(io),Base.aligned_siz... | stdlib/Mmap/src/Mmap.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Bugfix: Use Base.aligned_sizeof instead of sizeof in Mmap.mmap | 58,998 | JuliaLang/julia | 35,573 | Julia | JonasIsensee | Review this pull request change.
Language: Julia
File: stdlib/Mmap/src/Mmap.jl
PR Title: Bugfix: Use Base.aligned_sizeof instead of sizeof in Mmap.mmap
BEFORE CODE: for l in dims
len, overflow = Base.Checked.mul_with_overflow(promote(len, l)...)
overflow && throw(ArgumentError("requested size pr... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
validate44732(::Any) = error("don't erase this error!")
function issue44732(c::Container44732)
validate44732(c.x)
return nothing
end
let src = code_typed1(issue44732, (Container44732,))
@test any(isinvoke(:validate44732), src.code)
end
@test_throws ErrorException("don't erase this error!") issue44732(Cont... | No issues found. | validate44732(::Any) = error("don't erase this error!")
function issue44732(c::Container44732)
validate44732(c.x)
return nothing
end
let src = code_typed1(issue44732, (Container44732,))
@test any(isinvoke(:validate44732), src.code)
end
@test_throws ErrorException("don't erase this error!") issue44732(Cont... | @@ -2314,4 +2314,43 @@ let src = code_typed1(g_noinline_invoke, (Union{Symbol,Nothing},))
@test !any(@nospecialize(x)->isa(x,GlobalRef), src.code)
end
+path = Ref{Symbol}(:unknown)
+function f59018_generator(x)
+ if @generated
+ if x isa DataType && x.name === Type.body.name
+ path[] = :gen... | Compiler/test/inline.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Don't inline generated functions if we can't invoke their generator | 59,018 | JuliaLang/julia | 35,573 | Julia | serenity4 | Review this pull request change.
Language: Julia
File: Compiler/test/inline.jl
PR Title: Don't inline generated functions if we can't invoke their generator
BEFORE CODE: validate44732(::Any) = error("don't erase this error!")
function issue44732(c::Container44732)
validate44732(c.x)
return nothing
end
let... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
for n = 0:28
@test log(2,2^n) == n
end
setprecision(10_000) do
@test log(2,big(2)^100) == 100
@test log(2,big(2)^200) == 200
@test log(2,big(2)^300) == 300
@test log(2,big(2)^400) == 400
end
for T in (Float32,Float64)
@test log(zero(T)) == -Inf
... | No issues found. | for n = 0:28
@test log(2,2^n) == n
end
setprecision(10_000) do
@test log(2,big(2)^100) == 100
@test log(2,big(2)^200) == 200
@test log(2,big(2)^300) == 300
@test log(2,big(2)^400) == 400
end
for T in (Float32,Float64)
@test log(zero(T)) == -Inf
... | @@ -754,6 +754,14 @@ end
end
end
+@testset "accuracy of `sinpi`, `cospi` around the origin" begin
+ for f in (sinpi, cospi)
+ for t in (Float32, Float64)
+ @test ulp_error_maximum(f, range(start = t(-0.25), stop = t(0.25), length = 5000)) < (has_fma[t] ? 1.0 : 1.5)
+ end
+ end
+en... | test/math.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | redo `sinpi` and `cospi` kernel polynomial approximation | 59,031 | JuliaLang/julia | 35,573 | Julia | nsajko | Review this pull request change.
Language: Julia
File: test/math.jl
PR Title: redo `sinpi` and `cospi` kernel polynomial approximation
BEFORE CODE: for n = 0:28
@test log(2,2^n) == n
end
setprecision(10_000) do
@test log(2,big(2)^100) == 100
@test log(2,big(2)^200) == 200
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if (O.getSpeedupLevel() >= 2) {
JULIA_PASS(FPM.addPass(AllocOptPass()));
FPM.addPass(SROAPass(SROAOptions::ModifyCFG));
FPM.addPass(VectorCombinePass(/*TryEarlyFoldsOnly=*/true));
FPM.addPass(MergedLoadStoreMotionPass());
FPM.addPass(GVNPass());
... | No issues found. | if (O.getSpeedupLevel() >= 2) {
JULIA_PASS(FPM.addPass(AllocOptPass()));
FPM.addPass(SROAPass(SROAOptions::ModifyCFG));
FPM.addPass(VectorCombinePass(/*TryEarlyFoldsOnly=*/true));
FPM.addPass(MergedLoadStoreMotionPass());
FPM.addPass(GVNPass());
... | @@ -96,7 +96,7 @@ using namespace llvm;
namespace {
//Shamelessly stolen from Clang's approach to sanitizers
//TODO do we want to enable other sanitizers?
- static void addSanitizerPasses(ModulePassManager &MPM, OptimizationLevel O) JL_NOTSAFEPOINT {
+ static void addSanitizerPasses(ModulePassManager &... | src/pipeline.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Add --target-sanitize=(memory|thread|address) | 59,035 | JuliaLang/julia | 35,573 | Julia | xal-0 | Review this pull request change.
Language: C++
File: src/pipeline.cpp
PR Title: Add --target-sanitize=(memory|thread|address)
BEFORE CODE: if (O.getSpeedupLevel() >= 2) {
JULIA_PASS(FPM.addPass(AllocOptPass()));
FPM.addPass(SROAPass(SROAOptions::ModifyCFG));
FPM.addPass(V... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
# total ordering
@test isless(big(-0.0), big(0.0))
@test isless(big(1.0), big(NaN))
@test isless(big(Inf), big(NaN))
@test isless(big(Inf), -big(NaN))
@test !isless(big(NaN), big(NaN))
@test !isless(big(-NaN), big(NaN))
@test !isless(-big(NaN), big(NaN))
@test !isless(-big(NaN), big... | No issues found. |
# total ordering
@test isless(big(-0.0), big(0.0))
@test isless(big(1.0), big(NaN))
@test isless(big(Inf), big(NaN))
@test isless(big(Inf), -big(NaN))
@test !isless(big(NaN), big(NaN))
@test !isless(big(-NaN), big(NaN))
@test !isless(-big(NaN), big(NaN))
@test !isless(-big(NaN), big... | @@ -35,6 +35,9 @@ import Base.MPFR
@test typeof(BigFloat(1//1)) == BigFloat
@test typeof(BigFloat(one(Rational{BigInt}))) == BigFloat
+ rat = 1 // (big(2)^300 + 1)
+ @test BigFloat(rat, RoundDown) < rat < BigFloat(rat, RoundUp)
+ @test BigFloat(-rat, RoundUp) < -rat < BigFloat(-rat, RoundDown)
... | test/mpfr.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Fix rounding when converting Rational to BigFloat | 59,063 | JuliaLang/julia | 35,573 | Julia | OlivierHnt | Review this pull request change.
Language: Julia
File: test/mpfr.jl
PR Title: Fix rounding when converting Rational to BigFloat
BEFORE CODE:
# total ordering
@test isless(big(-0.0), big(0.0))
@test isless(big(1.0), big(NaN))
@test isless(big(Inf), big(NaN))
@test isless(big(Inf), -big(NaN))
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
elseif absx < T(1.0)/2 # see 1) above
# if |x| sufficiently small, acos(x) ≈ pi/2
absx < ACOS_X_MIN_THRESHOLD(T) && return T(pi)/2
# if |x| < 0.5 we have acos(x) = pi/2 - (x + x*x^2*R(x^2))
return PIO2_HI(T) - (x - (PIO2_LO(T) - x*arc_tRt(x*x)))
end
z = (T(1.0) - absx)*T(0.5)... | No issues found. | elseif absx < T(1.0)/2 # see 1) above
# if |x| sufficiently small, acos(x) ≈ pi/2
absx < ACOS_X_MIN_THRESHOLD(T) && return T(pi)/2
# if |x| < 0.5 we have acos(x) = pi/2 - (x + x*x^2*R(x^2))
return PIO2_HI(T) - (x - (PIO2_LO(T) - x*arc_tRt(x*x)))
end
z = (T(1.0) - absx)*T(0.5)... | @@ -1104,6 +1104,10 @@ Return a `T(NaN)` if `isnan(x)`.
See also [`sinc`](@ref).
"""
cosc(x::Number) = _cosc(float(x))
+function _cosc_generic(x)
+ pi_x = pi * x
+ (pi_x*cospi(x)-sinpi(x))/(pi_x*x)
+end
function _cosc(x::Number)
# naive cosc formula is susceptible to catastrophic
# cancellation erro... | base/special/trig.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | improve `cosc(::Float32)` and `cosc(::Float64)` accuracy | 59,087 | JuliaLang/julia | 35,573 | Julia | nsajko | Review this pull request change.
Language: Julia
File: base/special/trig.jl
PR Title: improve `cosc(::Float32)` and `cosc(::Float64)` accuracy
BEFORE CODE: elseif absx < T(1.0)/2 # see 1) above
# if |x| sufficiently small, acos(x) ≈ pi/2
absx < ACOS_X_MIN_THRESHOLD(T) && return T(pi)/2
#... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@test (-1) ^ -1 === (-1) ^ -3 == (-1) ^ p3 === -1
@test true ^ -2 == true ^ p2 === true
end
@testset "issue #13748" begin
let A = [1 2; 3 4]; B = [5 6; 7 8]; C = [9 10; 11 12]
@test muladd(A,B,C) == A*B + C
end
end
@testset "issue #19872" begin
f19872a(x) = x ^ 5
f19872b(x) = x ^ (-102... | No issues found. | @test (-1) ^ -1 === (-1) ^ -3 == (-1) ^ p3 === -1
@test true ^ -2 == true ^ p2 === true
end
@testset "issue #13748" begin
let A = [1 2; 3 4]; B = [5 6; 7 8]; C = [9 10; 11 12]
@test muladd(A,B,C) == A*B + C
end
end
@testset "issue #19872" begin
f19872a(x) = x ^ 5
f19872b(x) = x ^ (-102... | @@ -448,14 +448,24 @@ end
end
@testset "deg2rad/rad2deg" begin
- @testset "$T" for T in (Int, Float64, BigFloat)
+ @testset "$T" for T in (Int, Float16, Float32, Float64, BigFloat)
@test deg2rad(T(180)) ≈ 1pi
@test deg2rad.(T[45, 60]) ≈ [pi/T(4), pi/T(3)]
@test rad2deg.([pi/T(4), pi... | test/math.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | more accurate `rad2deg` and `deg2rad` for `Float16` and `Float32` | 59,097 | JuliaLang/julia | 35,573 | Julia | nsajko | Review this pull request change.
Language: Julia
File: test/math.jl
PR Title: more accurate `rad2deg` and `deg2rad` for `Float16` and `Float32`
BEFORE CODE: @test (-1) ^ -1 === (-1) ^ -3 == (-1) ^ p3 === -1
@test true ^ -2 == true ^ p2 === true
end
@testset "issue #13748" begin
let A = [1 2; 3 4]; B = ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
using Libdl
using Zstd_jll # Note this uses the vendored older non-LazyLibrary version of Zstd_jll
# JLL usage at build-time should function as expected
Zstd_jll.__init__()
const build_ver = unsafe_string(ccall((:ZSTD_versionString, libzstd), Cstring, ()))
function print_string(fptr::Ptr{Cvoid})
println(Core.stdo... | No issues found. | using Libdl
using Zstd_jll # Note this uses the vendored older non-LazyLibrary version of Zstd_jll
# JLL usage at build-time should function as expected
Zstd_jll.__init__()
const build_ver = unsafe_string(ccall((:ZSTD_versionString, libzstd), Cstring, ()))
function print_string(fptr::Ptr{Cvoid})
println(Core.stdo... | @@ -24,16 +24,5 @@ function @main(args::Vector{String})::Cint
cfunc = @cfunction(print_string, Cvoid, (Ptr{Cvoid},))
fptr = dlsym(Zstd_jll.libzstd_handle, :ZSTD_versionString)
ccall(cfunc, Cvoid, (Ptr{Cvoid},), fptr)
-
- # map/mapreduce should work but relies on inlining and other optimizations
- a... | test/trimming/basic_jll.jl | 0 | Julia | 1 | none | 16 | 29 | 29 | true | make more cases of mapreduce trimmable | 59,104 | JuliaLang/julia | 35,573 | Julia | JeffBezanson | Review this pull request change.
Language: Julia
File: test/trimming/basic_jll.jl
PR Title: make more cases of mapreduce trimmable
BEFORE CODE: using Libdl
using Zstd_jll # Note this uses the vendored older non-LazyLibrary version of Zstd_jll
# JLL usage at build-time should function as expected
Zstd_jll.__init__(... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@test readchomp(`$trimmability_exe arg1 arg2`) == "Hello, world!\n$trimmability_exe\narg1\narg2\n$(4.0+pi)"
basic_jll_exe = joinpath(bindir, "basic_jll" * exe_suffix)
lines = split(readchomp(`$basic_jll_exe`), "\n")
@test lines[1] == "Julia! Hello, world!"
@test lines[2] == lines[3]
@test Base.... | No issues found. | @test readchomp(`$trimmability_exe arg1 arg2`) == "Hello, world!\n$trimmability_exe\narg1\narg2\n$(4.0+pi)"
basic_jll_exe = joinpath(bindir, "basic_jll" * exe_suffix)
lines = split(readchomp(`$basic_jll_exe`), "\n")
@test lines[1] == "Julia! Hello, world!"
@test lines[2] == lines[3]
@test Base.... | @@ -1,4 +1,9 @@
+import Pkg
+
+Pkg.activate(".")
+
using Test
+using JSON
@test length(ARGS) == 1
bindir = dirname(ARGS[1])
@@ -18,4 +23,62 @@ let exe_suffix = splitext(Base.julia_exename())[2]
@test lines[2] == lines[3]
@test Base.VersionNumber(lines[2]) ≥ v"1.5.7"
@test filesize(basic_jll_exe) < f... | test/trimming/trimming.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | juliac: log entrypoints and nonstandard typedefs | 59,108 | JuliaLang/julia | 35,573 | Julia | timholy | Review this pull request change.
Language: Julia
File: test/trimming/trimming.jl
PR Title: juliac: log entrypoints and nonstandard typedefs
BEFORE CODE: @test readchomp(`$trimmability_exe arg1 arg2`) == "Hello, world!\n$trimmability_exe\narg1\narg2\n$(4.0+pi)"
basic_jll_exe = joinpath(bindir, "basic_jll" *... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
Animals \| 1 1 2 \s*\d*\.\ds
Felines \| 1 1 \s*\d*\.\ds
Canines \| 1 1 \s*\d*\.\ds
Arrays \| 1 1 2 \s*\d*\.\ds
""", msg)
end
# 20489
let msg = split(read(pipeline(ignorestatus(`$(Base.julia_cmd()) -... | No issues found. | Animals \| 1 1 2 \s*\d*\.\ds
Felines \| 1 1 \s*\d*\.\ds
Canines \| 1 1 \s*\d*\.\ds
Arrays \| 1 1 2 \s*\d*\.\ds
""", msg)
end
# 20489
let msg = split(read(pipeline(ignorestatus(`$(Base.julia_cmd()) -... | @@ -107,6 +107,25 @@ end
@test_throws "\"" throw("\"")
@test_throws Returns(false) throw(Returns(false))
end
+
+@testset "Pass - exception with pattern (3-arg form)" begin
+ # Test 3-argument form: @test_throws ExceptionType pattern expr
+ @test_throws ErrorException "error foo" error("error foo 1")
+ ... | stdlib/Test/test/runtests.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Test: `@test_throws` add 3-arg form for testing exception type and message | 59,117 | JuliaLang/julia | 35,573 | Julia | IanButterworth | Review this pull request change.
Language: Julia
File: stdlib/Test/test/runtests.jl
PR Title: Test: `@test_throws` add 3-arg form for testing exception type and message
BEFORE CODE: Animals \| 1 1 2 \s*\d*\.\ds
Felines \| 1 1 \s*\d*\.\ds
Canines ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
# involving external modules
callf(x) = f(x)
callg(x) = x < 5 ? g(x) : invoke(g, Tuple{Real}, x)
callh(x) = h(x)
callq(x) = q(x)
callqi(x) = invoke(q, Tuple{Integer}, x)
callfnc(x) = fnc(x)
callgnc(x) = x < ... | No issues found. |
# involving external modules
callf(x) = f(x)
callg(x) = x < 5 ? g(x) : invoke(g, Tuple{Real}, x)
callh(x) = h(x)
callq(x) = q(x)
callqi(x) = invoke(q, Tuple{Integer}, x)
callfnc(x) = fnc(x)
callgnc(x) = x < ... | @@ -686,16 +686,15 @@ precompile_test_harness(false) do dir
error("break me")
end
""")
- @test_warn r"LoadError: break me\nStacktrace:\n[ ]*\[1\] [\e01m\[]*error" try
- Base.require(Main, :FooBar2)
- error("the \"break me\" test failed")
- catch exc
- ... | test/precompile.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Precompile out of env deps in serial within precompilepkgs | 59,122 | JuliaLang/julia | 35,573 | Julia | IanButterworth | Review this pull request change.
Language: Julia
File: test/precompile.jl
PR Title: Precompile out of env deps in serial within precompilepkgs
BEFORE CODE:
# involving external modules
callf(x) = f(x)
callg(x) = x < 5 ? g(x) : invoke(g, Tuple{Real}, x)
callh(... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
# the usual rules for Julia strings.
s = "cd(\"" * julia_esc(joinpath(path, space_folder, "space"))
c, r = test_complete(s)
@test s[r] == julia_esc(joinpath(path, space_folder, "space"))
@test julia_esc(joinpath(path, space_folder, "space .file")) * "\"" in c
# '$' is th... | No issues found. | # the usual rules for Julia strings.
s = "cd(\"" * julia_esc(joinpath(path, space_folder, "space"))
c, r = test_complete(s)
@test s[r] == julia_esc(joinpath(path, space_folder, "space"))
@test julia_esc(joinpath(path, space_folder, "space .file")) * "\"" in c
# '$' is th... | @@ -139,6 +139,7 @@ let ex =
kwtest4(a::SubString; x23, _something) = pass
kwtest5(a::Int, b, x...; somekwarg, somekotherkwarg) = pass
kwtest5(a::Char, b; xyz) = pass
+ kwtest6(f::Function, arg1; somekwarg) = pass
const named = (; len2=3)
con... | stdlib/REPL/test/replcompletions.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | [REPL] Fix keyword arguments completions with do block | 59,123 | JuliaLang/julia | 35,573 | Julia | xal-0 | Review this pull request change.
Language: Julia
File: stdlib/REPL/test/replcompletions.jl
PR Title: [REPL] Fix keyword arguments completions with do block
BEFORE CODE: # the usual rules for Julia strings.
s = "cd(\"" * julia_esc(joinpath(path, space_folder, "space"))
c, r = test_complete(s)... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
callee_valid_range = WorldRange(method_or_ci.min_world, method_or_ci.max_world)
if !(our_world in callee_valid_range)
if our_world < first(callee_valid_range)
update_valid_age!(sv, WorldRange(first(sv.world.valid_worlds), first(callee_valid_range)-1))
... | No issues found. | callee_valid_range = WorldRange(method_or_ci.min_world, method_or_ci.max_world)
if !(our_world in callee_valid_range)
if our_world < first(callee_valid_range)
update_valid_age!(sv, WorldRange(first(sv.world.valid_worlds), first(callee_valid_range)-1))
... | @@ -3255,7 +3255,7 @@ function abstract_eval_copyast(interp::AbstractInterpreter, e::Expr, sstate::Sta
return RTEffects(rt, Any, effects)
end
-function abstract_eval_isdefined_expr(interp::AbstractInterpreter, e::Expr, sstate::StatementState,
+function abstract_eval_isdefined_expr(::AbstractInterpreter, e::Expr... | Compiler/src/abstractinterpretation.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | inference: avoid `LimitedAccuracy` within slot wrappers | 59,182 | JuliaLang/julia | 35,573 | Julia | aviatesk | Review this pull request change.
Language: Julia
File: Compiler/src/abstractinterpretation.jl
PR Title: inference: avoid `LimitedAccuracy` within slot wrappers
BEFORE CODE: callee_valid_range = WorldRange(method_or_ci.min_world, method_or_ci.max_world)
if !(our_world in callee_valid_range)
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
b = Array(a)
@test hash(convert(Array{Any}, a)) == hash(b)
@test hash(convert(Array{supertype(eltype(a))}, a)) == hash(b)
@test hash(convert(Array{Float64}, a)) == hash(b)
if !any(x -> isequal(x, -0.0), a)
@test hash(convert(Array{Int}, a)) == hash(b)
if all(x -> typemin(Int8) <= x <... | No issues found. | b = Array(a)
@test hash(convert(Array{Any}, a)) == hash(b)
@test hash(convert(Array{supertype(eltype(a))}, a)) == hash(b)
@test hash(convert(Array{Float64}, a)) == hash(b)
if !any(x -> isequal(x, -0.0), a)
@test hash(convert(Array{Int}, a)) == hash(b)
if all(x -> typemin(Int8) <= x <... | @@ -321,3 +321,22 @@ end
src = only(code_typed(f, Tuple{UInt}))[1]
@test count(stmt -> Meta.isexpr(stmt, :foreigncall), src.code) == 0
end
+
+@testset "hash_bytes consistency" begin
+ # Test that hash_bytes(::Array), hash_bytes(Generator(identity, Array)), and hash_bytes(pointer(Array)) return the same va... | test/hashing.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | add safer, more versatile version of rapidhash for any array and for any iterable | 59,185 | JuliaLang/julia | 35,573 | Julia | vtjnash | Review this pull request change.
Language: Julia
File: test/hashing.jl
PR Title: add safer, more versatile version of rapidhash for any array and for any iterable
BEFORE CODE: b = Array(a)
@test hash(convert(Array{Any}, a)) == hash(b)
@test hash(convert(Array{supertype(eltype(a))}, a)) == hash(b)
@t... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
else
ft = ftypes[fld]
end
if !isa(ft, Type) && !isa(ft, TypeVar)
return Const(ft)
end
exactft = exact || (!has_free_typevars(ft) && u.name !== Tuple.name)
ft = rewrap_unionall(ft, s)
if exactft
if hasuniquerep(ft)
return Const(ft) # ft unique via type cac... | No issues found. | else
ft = ftypes[fld]
end
if !isa(ft, Type) && !isa(ft, TypeVar)
return Const(ft)
end
exactft = exact || (!has_free_typevars(ft) && u.name !== Tuple.name)
ft = rewrap_unionall(ft, s)
if exactft
if hasuniquerep(ft)
return Const(ft) # ft unique via type cac... | @@ -2750,9 +2750,8 @@ function memoryop_noub(@nospecialize(f), argtypes::Vector{Any})
return false
end
-function current_scope_tfunc(interp::AbstractInterpreter, sv::InferenceState)
+function current_scope_tfunc(::AbstractInterpreter, sv::InferenceState)
pc = sv.currpc
- handler_info = sv.handler_info
... | Compiler/src/tfuncs.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | compiler: eliminate most of unused variables in the compiler | 59,202 | JuliaLang/julia | 35,573 | Julia | aviatesk | Review this pull request change.
Language: Julia
File: Compiler/src/tfuncs.jl
PR Title: compiler: eliminate most of unused variables in the compiler
BEFORE CODE: else
ft = ftypes[fld]
end
if !isa(ft, Type) && !isa(ft, TypeVar)
return Const(ft)
end
exactft = exact || (!has_free_t... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
bad = true;
dbgs() << "Global " << GV.getName() << " is a declaration but is in partition " << GVNames[GV.getName()] << "\n";
}
} else {
// Local global values are not partitioned
if (!GVNames.count(GV.getName())) {
bad = true;
... | No issues found. | bad = true;
dbgs() << "Global " << GV.getName() << " is a declaration but is in partition " << GVNames[GV.getName()] << "\n";
}
} else {
// Local global values are not partitioned
if (!GVNames.count(GV.getName())) {
bad = true;
... | @@ -42,9 +42,10 @@
#include <llvm/Support/FormatAdapters.h>
#include <llvm/Linker/Linker.h>
-
using namespace llvm;
+#include <zstd.h>
+
#include "jitlayers.h"
#include "serialize.h"
#include "julia_assert.h"
@@ -2147,27 +2148,53 @@ void jl_dump_native_impl(void *native_code,
sysimgM.setDataLayout(DL... | src/aotcompile.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | System image compression with zstd | 59,227 | JuliaLang/julia | 35,573 | Julia | xal-0 | Review this pull request change.
Language: C++
File: src/aotcompile.cpp
PR Title: System image compression with zstd
BEFORE CODE: bad = true;
dbgs() << "Global " << GV.getName() << " is a declaration but is in partition " << GVNames[GV.getName()] << "\n";
}
} else... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
end
tt = signature_type(f, types)
matches = invoke_interp_compiler(passed_interp, :_findall_matches, interp, tt)
matches === nothing && raise_match_failure(:infer_exception_types, tt)
excts = Any[]
for match in matches.matches
frame = invoke_interp_compiler(passed_interp, :typeinf_frame,... | No issues found. | end
tt = signature_type(f, types)
matches = invoke_interp_compiler(passed_interp, :_findall_matches, interp, tt)
matches === nothing && raise_match_failure(:infer_exception_types, tt)
excts = Any[]
for match in matches.matches
frame = invoke_interp_compiler(passed_interp, :typeinf_frame,... | @@ -1453,3 +1453,20 @@ function destructure_callex(topmod::Module, @nospecialize(ex))
end
return f, args, kwargs
end
+
+"""
+ Base.drop_all_caches()
+
+Internal function to drop all native code caches and increment world age.
+This invalidates all compiled code as if a method was added that intersects
+wi... | base/reflection.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Drop sysimage caches for --code-coverage=all | 59,234 | JuliaLang/julia | 35,573 | Julia | IanButterworth | Review this pull request change.
Language: Julia
File: base/reflection.jl
PR Title: Drop sysimage caches for --code-coverage=all
BEFORE CODE: end
tt = signature_type(f, types)
matches = invoke_interp_compiler(passed_interp, :_findall_matches, interp, tt)
matches === nothing && raise_match_failure(:i... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@async invokelatest(Main.remotecall_wait, include, p, Main, arg)
end
end
end
end
# load file
if arg_is_program
# program
if !is_interactive::Bool
exit_on_sigint(true)
end
try
if PROGRAM_FILE == "... | No issues found. | @async invokelatest(Main.remotecall_wait, include, p, Main, arg)
end
end
end
end
# load file
if arg_is_program
# program
if !is_interactive::Bool
exit_on_sigint(true)
end
try
if PROGRAM_FILE == "... | @@ -120,6 +120,10 @@ function display_error(io::IO, er, bt)
end
display_error(er, bt=nothing) = display_error(stderr, er, bt)
+# N.B.: Any functions starting with __repl_entry cut off backtraces when printing in the REPL.
+__repl_entry_client_lower(mod::Module, @nospecialize(ast)) = Meta.lower(mod, ast)
+__repl_ent... | base/client.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Restore stacktrace scrubing in fallback REPL. | 59,241 | JuliaLang/julia | 35,573 | Julia | BioTurboNick | Review this pull request change.
Language: Julia
File: base/client.jl
PR Title: Restore stacktrace scrubing in fallback REPL.
BEFORE CODE: @async invokelatest(Main.remotecall_wait, include, p, Main, arg)
end
end
end
end
# load file
if arg_is_progr... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
z = zero(T)
else #safe to do y/x
z = atan(abs(y/x))
end
if m == 0
return z # atan(+,+)
elseif m == 1
return -z # atan(-,+)
elseif m == 2
return T(pi)-(z-ATAN2_PI_LO(T)) # atan(+,-)
else # default case m == 3
return (z-ATAN2_PI_LO(T))-T(pi) # atan(... | No issues found. | z = zero(T)
else #safe to do y/x
z = atan(abs(y/x))
end
if m == 0
return z # atan(+,+)
elseif m == 1
return -z # atan(-,+)
elseif m == 2
return T(pi)-(z-ATAN2_PI_LO(T)) # atan(+,-)
else # default case m == 3
return (z-ATAN2_PI_LO(T))-T(pi) # atan(... | @@ -1112,6 +1112,7 @@ function _cosc(x::Number)
# generic Taylor series: π ∑ (-1)^n (πx)^{2n-1}/a(n) where
# a(n) = (1+2n)*(2n-1)! (= OEIS A174549)
s = (term = -(π*x))/3
+ iszero(s) && return s # preserve floating-point signed zero
π²x² = term^2
ε = eps(fastabs(term)... | base/special/trig.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | test: math: test floating-point behavior when mapping zero to zero | 59,265 | JuliaLang/julia | 35,573 | Julia | nsajko | Review this pull request change.
Language: Julia
File: base/special/trig.jl
PR Title: test: math: test floating-point behavior when mapping zero to zero
BEFORE CODE: z = zero(T)
else #safe to do y/x
z = atan(abs(y/x))
end
if m == 0
return z # atan(+,+)
elseif m == 1
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
# Make sure type inference doesn't incorrectly optimize out
# `Expr(:inbounds, false)`
# Simply `return a[1]` doesn't work due to inlining bug
@inline function f1(a)
# This has to be an arrayget / arrayset since these currently have a
# implicit `Expr(:boundscheck)` that's not visible to type inference
x =... | No issues found. |
# Make sure type inference doesn't incorrectly optimize out
# `Expr(:inbounds, false)`
# Simply `return a[1]` doesn't work due to inlining bug
@inline function f1(a)
# This has to be an arrayget / arrayset since these currently have a
# implicit `Expr(:boundscheck)` that's not visible to type inference
x =... | @@ -349,8 +349,9 @@ if bc_opt == bc_default
m2 = Memory{Int}(undef,n)
m1 === m2
end
- no_alias_prove(1)
- @test (@allocated no_alias_prove(5)) == 0
+ no_alias_prove5() = no_alias_prove(5)
+ no_alias_prove5()
+ @test (@allocated no_alias_prove5()) == 0
end
@testset "automatic bo... | test/boundscheck_exec.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | change `@allocated` again | 59,278 | JuliaLang/julia | 35,573 | Julia | JeffBezanson | Review this pull request change.
Language: Julia
File: test/boundscheck_exec.jl
PR Title: change `@allocated` again
BEFORE CODE:
# Make sure type inference doesn't incorrectly optimize out
# `Expr(:inbounds, false)`
# Simply `return a[1]` doesn't work due to inlining bug
@inline function f1(a)
# This has to be... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
else
failfast = global_fail_fast()
end
end
return DefaultTestSet(String(desc)::String,
verbose, showtiming, failfast, extract_file(source),
time(), rng, 0, 0., 0x00, ReentrantLock(), Any[])
end
extract_file(source::LineNumberNode) = extract_file(source.file)
extract_f... | No issues found. | else
failfast = global_fail_fast()
end
end
return DefaultTestSet(String(desc)::String,
verbose, showtiming, failfast, extract_file(source),
time(), rng, 0, 0., 0x00, ReentrantLock(), Any[])
end
extract_file(source::LineNumberNode) = extract_file(source.file)
extract_f... | @@ -10,6 +10,13 @@ All tests belong to a *test set*. There is a default, task-level
test set that throws on the first failure. Users can choose to wrap
their tests in (possibly nested) test sets that will store results
and summarize them at the end of the test set with `@testset`.
+
+Environment variables:
+
+* `JUL... | stdlib/Test/src/Test.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Add test verbose env var and show when starting/finishing testsets | 59,295 | JuliaLang/julia | 35,573 | Julia | IanButterworth | Review this pull request change.
Language: Julia
File: stdlib/Test/src/Test.jl
PR Title: Add test verbose env var and show when starting/finishing testsets
BEFORE CODE: else
failfast = global_fail_fast()
end
end
return DefaultTestSet(String(desc)::String,
verbose, showtim... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if Base.JLOptions().trim != 0
include(joinpath(@__DIR__, "juliac-trim-base.jl"))
end
# Load user code
import Base.Experimental.entrypoint
# for use as C main if needed
function _main(argc::Cint, argv::Ptr{Ptr{Cchar}})::Cint
args = ccall(:jl_set_ARGS, Any, (Cint, Ptr{Ptr{Cchar}}), argc, argv)::Vector{String}
... | No issues found. | if Base.JLOptions().trim != 0
include(joinpath(@__DIR__, "juliac-trim-base.jl"))
end
# Load user code
import Base.Experimental.entrypoint
# for use as C main if needed
function _main(argc::Cint, argv::Ptr{Ptr{Cchar}})::Cint
args = ccall(:jl_set_ARGS, Any, (Cint, Ptr{Ptr{Cchar}}), argc, argv)::Vector{String}
... | @@ -8,6 +8,7 @@ Core.Compiler._verify_trim_world_age[] = Base.get_world_counter()
# Initialize some things not usually initialized when output is requested
Sys.__init__()
+Base.reinit_stdio()
Base.init_depot_path()
Base.init_load_path()
Base.init_active_project() | contrib/juliac/juliac-buildscript.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Fix printing of errors in juliac + searchsorted functions for LinearAlgebra | 59,299 | JuliaLang/julia | 35,573 | Julia | gbaraldi | Review this pull request change.
Language: Julia
File: contrib/juliac/juliac-buildscript.jl
PR Title: Fix printing of errors in juliac + searchsorted functions for LinearAlgebra
BEFORE CODE: if Base.JLOptions().trim != 0
include(joinpath(@__DIR__, "juliac-trim-base.jl"))
end
# Load user code
import Base.Exper... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
T24Linear( X::AbstractArray{T,N}) where {T,N } = T24Linear{T,N}(X)
T24Linear{T }(X::AbstractArray{_,N}) where {T,N,_} = T24Linear{T,N}(X)
T24Linear{T,N}(X::AbstractArray ) where {T,N } = T24Linear{T,N,size(X)}(X...)
Base.size(::T24Linear{T,N,dims}) where {T,N,dims} = dims
import Base: IndexLinear
Base.Index... | No issues found. | T24Linear( X::AbstractArray{T,N}) where {T,N } = T24Linear{T,N}(X)
T24Linear{T }(X::AbstractArray{_,N}) where {T,N,_} = T24Linear{T,N}(X)
T24Linear{T,N}(X::AbstractArray ) where {T,N } = T24Linear{T,N,size(X)}(X...)
Base.size(::T24Linear{T,N,dims}) where {T,N,dims} = dims
import Base: IndexLinear
Base.Index... | @@ -71,3 +71,23 @@ Base.similar(A::WrapperArray, ::Type{T}, dims::Dims) where T = similar(A.parent,
Base.cconvert(::Type{Ptr{T}}, A::WrapperArray{T}) where {T} = Base.cconvert(Ptr{T}, A.parent)
Base.strides(A::WrapperArray) = strides(A.parent)
Base.elsize(::Type{WrapperArray{T,N,A}}) where {T,N,A<:AbstractArray{T,N}... | test/testhelpers/arrayindexingtypes.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | don't assume homogenous axes types in `dropdims` | 59,302 | JuliaLang/julia | 35,573 | Julia | adienes | Review this pull request change.
Language: Julia
File: test/testhelpers/arrayindexingtypes.jl
PR Title: don't assume homogenous axes types in `dropdims`
BEFORE CODE: T24Linear( X::AbstractArray{T,N}) where {T,N } = T24Linear{T,N}(X)
T24Linear{T }(X::AbstractArray{_,N}) where {T,N,_} = T24Linear{T,N}(X)
T24Lin... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
JL_UNLOCK(&method->writelock);
return 1;
}
static int erase_all_backedges(jl_methtable_t *mt, void *env)
{
return jl_typemap_visitor(jl_atomic_load_relaxed(&mt->defs), erase_method_backedges, env);
}
JL_DLLEXPORT void jl_disable_new_worlds(void)
{
if (jl_generating_output())
jl_error("Di... | No issues found. | }
JL_UNLOCK(&method->writelock);
return 1;
}
static int erase_all_backedges(jl_methtable_t *mt, void *env)
{
return jl_typemap_visitor(jl_atomic_load_relaxed(&mt->defs), erase_method_backedges, env);
}
JL_DLLEXPORT void jl_disable_new_worlds(void)
{
if (jl_generating_output())
jl_error("Di... | @@ -1217,14 +1217,9 @@ static void jl_compilation_sig(
int notcalled_func = (i_arg > 0 && i_arg <= 8 && !(definition->called & (1 << (i_arg - 1))) &&
!jl_has_free_typevars(decl_i) &&
jl_subtype(elt, (jl_value_t*)jl_function_type));
- if (notc... | src/gf.c | 0 | C | 1 | none | 16 | 51 | 51 | true | Fix nospecializing Functions in `Union{Nothing,Function}` params | 59,327 | JuliaLang/julia | 35,573 | Julia | NHDaly | Review this pull request change.
Language: C
File: src/gf.c
PR Title: Fix nospecializing Functions in `Union{Nothing,Function}` params
BEFORE CODE: }
JL_UNLOCK(&method->writelock);
return 1;
}
static int erase_all_backedges(jl_methtable_t *mt, void *env)
{
return jl_typemap_visitor(jl_atomic_load_r... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@atomic n_passed::Int
@atomic time_end::Float64
# Memoized test result state over `results` - Computed only once the test set is finished
# 0x0: Unknown
# 0x1: All passed
# 0x2: Some failed
@atomic anynonpass::UInt8
results_lock::ReentrantLock
results::Vector{Any}
end
function Def... | No issues found. |
@atomic n_passed::Int
@atomic time_end::Float64
# Memoized test result state over `results` - Computed only once the test set is finished
# 0x0: Unknown
# 0x1: All passed
# 0x2: Some failed
@atomic anynonpass::UInt8
results_lock::ReentrantLock
results::Vector{Any}
end
function Def... | @@ -29,11 +29,7 @@ using Random: AbstractRNG, default_rng
using InteractiveUtils: gen_call_with_extracted_types
using Base: typesplit, remove_linenums!
using Serialization: Serialization
-using Base.ScopedValues: ScopedValue, @with
-
-const record_passes = OncePerProcess{Bool}() do
- return Base.get_bool_env("JUL... | stdlib/Test/src/Test.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | Allow ScopedValue defaults to be lazily computed | 59,372 | JuliaLang/julia | 35,573 | Julia | Keno | Review this pull request change.
Language: Julia
File: stdlib/Test/src/Test.jl
PR Title: Allow ScopedValue defaults to be lazily computed
BEFORE CODE:
@atomic n_passed::Int
@atomic time_end::Float64
# Memoized test result state over `results` - Computed only once the test set is finished
# 0x0: Un... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
end
err = ccall(:uv_pipe_open, Int32, (Ptr{Cvoid}, OS_HANDLE), p.handle, handle)
uv_error("pipe_open", err)
p.status = StatusOpen
iolock_end()
return p
end
## server functions ##
accept(server::PipeServer) = accept(server, PipeEndpoint())
function accept_nonblock(server::PipeServer, client::P... | No issues found. | end
err = ccall(:uv_pipe_open, Int32, (Ptr{Cvoid}, OS_HANDLE), p.handle, handle)
uv_error("pipe_open", err)
p.status = StatusOpen
iolock_end()
return p
end
## server functions ##
accept(server::PipeServer) = accept(server, PipeEndpoint())
function accept_nonblock(server::PipeServer, client::P... | @@ -24,6 +24,23 @@ function PipeServer()
return pipe
end
+function PipeServer(handle::OS_HANDLE)
+ pipe = PipeServer()
+ return Base.open_pipe!(pipe, handle)
+end
+
+function Base.open_pipe!(p::PipeServer, handle::OS_HANDLE)
+ iolock_begin()
+ if p.status != StatusInit
+ error("pipe is alread... | stdlib/Sockets/src/PipeServer.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | spawn: Allow libuv IOServers to be passed as extra FDs | 59,373 | JuliaLang/julia | 35,573 | Julia | Keno | Review this pull request change.
Language: Julia
File: stdlib/Sockets/src/PipeServer.jl
PR Title: spawn: Allow libuv IOServers to be passed as extra FDs
BEFORE CODE: end
err = ccall(:uv_pipe_open, Int32, (Ptr{Cvoid}, OS_HANDLE), p.handle, handle)
uv_error("pipe_open", err)
p.status = StatusOpen
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@testset "map on Dicts/Sets is forbidden" begin
@test_throws ErrorException map(identity, Set([1,2,3]))
@test_throws ErrorException map(identity, Dict("a"=>"b"))
end
@testset "Issue 30145" begin
X = [1,2,3]
@test isempty(X[Union{}[]])
end
@testset "Issue 30259" begin
A = randn(1,2,3)
@test get... | No issues found. | @testset "map on Dicts/Sets is forbidden" begin
@test_throws ErrorException map(identity, Set([1,2,3]))
@test_throws ErrorException map(identity, Dict("a"=>"b"))
end
@testset "Issue 30145" begin
X = [1,2,3]
@test isempty(X[Union{}[]])
end
@testset "Issue 30259" begin
A = randn(1,2,3)
@test get... | @@ -2293,6 +2293,21 @@ end
end
end
+@testset "AbstractOneTo" begin
+ s = SizedArrays.SizedArray{(2,2)}(ones(2,2))
+ v = view(s, :, 1)
+ @test axes(v,1) isa SizedArrays.SOneTo{2}
+ @test eachindex(v) isa SizedArrays.SOneTo{2}
+
+ ax = axes(v,1)
+ @test ax[Base.IdentityUnitRange(ax)] == ax
+ ... | test/abstractarray.jl | 0 | Julia | 1 | none | 16 | 51 | 51 | true | `axes` for a `Slice` of an `AbstractOneTo` axis | 59,384 | JuliaLang/julia | 35,573 | Julia | jishnub | Review this pull request change.
Language: Julia
File: test/abstractarray.jl
PR Title: `axes` for a `Slice` of an `AbstractOneTo` axis
BEFORE CODE: @testset "map on Dicts/Sets is forbidden" begin
@test_throws ErrorException map(identity, Set([1,2,3]))
@test_throws ErrorException map(identity, Dict("a"=>"b")... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.