Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7a28ad5
Actually setup jit targets when compiling packageimages instead of ta…
gbaraldi Jul 3, 2025
c96d507
`[backports-release-1.10]`: Distributed: Worker: Bind to the first no…
DilumAluthge Jul 8, 2025
2a53722
Fixes for bitcast bugs with LLVM 17 / opaque pointers (#54548)
maleadt May 22, 2024
54e1119
Add boundscheck in speccache_eq to avoid OOB access due to data race …
kpamnany Jun 18, 2024
1998364
fix special function `::Real` fallback stack overflow (#57790)
nsajko Mar 17, 2025
9c892c6
Logging: Improve threadsafety (#57591)
IanButterworth Apr 4, 2025
7ac9a80
Switch from segfault to `zip` behavior for mismatched indices in `map…
adienes Apr 19, 2025
029abad
Fix removal of globals with addrspaces in removeAddrspaces (#58322)
gbaraldi May 6, 2025
f507ecb
Update install link in warning (#58638)
IanButterworth Jun 5, 2025
623884c
Unicode: Force-inline isgraphemebreak! (#58674)
Keno Jun 10, 2025
6f3d23e
Test: Fix failfast for for loops (#58695)
IanButterworth Jun 11, 2025
8cf6158
Test: Hide REPL internals in backtraces (#58732)
IanButterworth Jun 20, 2025
3104bec
Add a `similar` method for `Type{<:CodeUnits}` (#57826)
ararslan Jul 2, 2025
ed63f5a
Fix nthreadpools size in JLOptions (#58937)
IanButterworth Jul 9, 2025
03b53d3
Clarify and enhance confusing precompile test (#59170)
IanButterworth Jul 31, 2025
951d565
Update the developer docs to reflect the use of JuliaSyntax.jl (#59300)
ajwheeler Aug 19, 2025
3fffb59
[backports-release-1.10] Remove bfloat16 condition accidentally backp…
imciner2 Aug 22, 2025
1a3c229
[OpenBLAS_jll] Include patches to fix CASUM in 1.10 (#59346)
imciner2 Sep 12, 2025
37d1127
remove workaround for controlling terminal behavior in repl_cmd (#58554)
vtjnash May 29, 2025
0269d45
`@nospecialize` for `string_index_err` (#57604)
nsajko Aug 21, 2025
ed38aed
Enable getting non-boxed LLVM type from Julia Type (#56890)
wsmoses Sep 5, 2025
d269b23
[backports-release-1.11] Don't forget to decay value on struct initia…
gbaraldi Sep 9, 2025
0741bfe
Fix intrinsics test on 1.10 backports branch
DilumAluthge Sep 14, 2025
05ee0aa
Remove bad test
gbaraldi Sep 15, 2025
6901dde
CI 1.10: Use the 1.10-specific Buildkite branch (#59761)
DilumAluthge Oct 6, 2025
7bf0208
Remove bitrotten debug-only code in 1.10 (#59917)
vchuravy Oct 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite-external-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
main
release-julia-1.10
15 changes: 4 additions & 11 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ stackframe_lineinfo_color() = repl_color("JULIA_STACKFRAME_LINEINFO_COLOR", :bol
stackframe_function_color() = repl_color("JULIA_STACKFRAME_FUNCTION_COLOR", :bold)

function repl_cmd(cmd, out)
shell = shell_split(get(ENV, "JULIA_SHELL", get(ENV, "SHELL", "/bin/sh")))
shell_name = Base.basename(shell[1])

# Immediately expand all arguments, so that typing e.g. ~/bin/foo works.
cmd.exec .= expanduser.(cmd.exec)

Expand Down Expand Up @@ -63,19 +60,15 @@ function repl_cmd(cmd, out)
cd(dir)
println(out, pwd())
else
@static if !Sys.iswindows()
if shell_name == "fish"
shell_escape_cmd = "begin; $(shell_escape_posixly(cmd)); and true; end"
else
shell_escape_cmd = "($(shell_escape_posixly(cmd))) && true"
end
if !Sys.iswindows()
shell = shell_split(get(ENV, "JULIA_SHELL", get(ENV, "SHELL", "/bin/sh")))
shell_escape_cmd = shell_escape_posixly(cmd)
cmd = `$shell -c $shell_escape_cmd`
end
try
run(ignorestatus(cmd))
catch
# Windows doesn't shell out right now (complex issue), so Julia tries to run the program itself
# Julia throws an exception if it can't find the program, but the stack trace isn't useful
# Julia throws an exception if it can't find the cmd (which may be the shell itself), but the stack trace isn't useful
lasterr = current_exceptions()
lasterr = ExceptionStack([(exception = e[1], backtrace = [] ) for e in lasterr])
invokelatest(display_error, lasterr)
Expand Down
2 changes: 1 addition & 1 deletion base/options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct JLOptions
commands::Ptr{Ptr{UInt8}} # (e)eval, (E)print, (L)load
image_file::Ptr{UInt8}
cpu_target::Ptr{UInt8}
nthreadpools::Int16
nthreadpools::Int8
nthreads::Int16
nmarkthreads::Int16
nsweepthreads::Int8
Expand Down
2 changes: 2 additions & 0 deletions base/strings/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,8 @@ write(io::IO, s::CodeUnits) = write(io, s.s)
unsafe_convert(::Type{Ptr{T}}, s::CodeUnits{T}) where {T} = unsafe_convert(Ptr{T}, s.s)
unsafe_convert(::Type{Ptr{Int8}}, s::CodeUnits{UInt8}) = unsafe_convert(Ptr{Int8}, s.s)

similar(::Type{<:CodeUnits{T}}, dims::Dims) where {T} = similar(Array{T}, dims)

"""
codeunits(s::AbstractString)

Expand Down
4 changes: 2 additions & 2 deletions base/strings/string.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ An error occurred when trying to access `str` at index `i` that is not valid.
"""
struct StringIndexError <: Exception
string::AbstractString
index::Integer
index::Int
end
@noinline string_index_err(s::AbstractString, i::Integer) =
@noinline string_index_err((@nospecialize s::AbstractString), i::Integer) =
throw(StringIndexError(s, Int(i)))
function Base.showerror(io::IO, exc::StringIndexError)
s = exc.string
Expand Down
2 changes: 1 addition & 1 deletion base/strings/unicode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ isgraphemebreak(c1::AbstractChar, c2::AbstractChar) =
# Stateful grapheme break required by Unicode-9 rules: the string
# must be processed in sequence, with state initialized to Ref{Int32}(0).
# Requires utf8proc v2.0 or later.
function isgraphemebreak!(state::Ref{Int32}, c1::AbstractChar, c2::AbstractChar)
@inline function isgraphemebreak!(state::Ref{Int32}, c1::AbstractChar, c2::AbstractChar)
if ismalformed(c1) || ismalformed(c2)
state[] = 0
return true
Expand Down
186 changes: 93 additions & 93 deletions deps/checksums/openblas

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion deps/openblas.mk
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,17 @@ $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-m1-4003.patch-applied: $(BUILDDIR)/$(OP
patch -p1 -f < $(SRCDIR)/patches/openblas-m1-4003.patch
echo 1 > $@

$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-configured: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-m1-4003.patch-applied
$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-asum-avx512.patch-applied: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-m1-4003.patch-applied
cd $(BUILDDIR)/$(OPENBLAS_SRC_DIR) && \
patch -p1 -f < $(SRCDIR)/patches/openblas-asum-avx512.patch
echo 1 > $@

$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-casum-fallback-fix.patch-applied: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-asum-avx512.patch-applied
cd $(BUILDDIR)/$(OPENBLAS_SRC_DIR) && \
patch -p1 -f < $(SRCDIR)/patches/openblas-casum-fallback-fix.patch
echo 1 > $@

$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-configured: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-casum-fallback-fix.patch-applied
echo 1 > $@

$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-compiled: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-configured
Expand Down
68 changes: 68 additions & 0 deletions deps/patches/openblas-asum-avx512.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
From 9019bc494514a74c2042152cdca0a36adea7b42f Mon Sep 17 00:00:00 2001
From: Martin Kroeker <[email protected]>
Date: Sat, 4 Nov 2023 22:10:06 +0100
Subject: [PATCH] Use SkylakeX ?ASUM microkernel for Cooperlake/Sapphirerapids
as well

---
kernel/x86_64/casum.c | 2 +-
kernel/x86_64/dasum.c | 2 +-
kernel/x86_64/sasum.c | 2 +-
kernel/x86_64/zasum.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/x86_64/casum.c b/kernel/x86_64/casum.c
index 60feec0ce..e4d054311 100644
--- a/kernel/x86_64/casum.c
+++ b/kernel/x86_64/casum.c
@@ -4,7 +4,7 @@
#define ABS_K(a) ((a) > 0 ? (a) : (-(a)))
#endif

-#if defined(SKYLAKEX)
+#if defined(SKYLAKEX) || defined(COOPERLAKE) || defined(SAPPHIRERAPIDS)
#include "casum_microk_skylakex-2.c"
#endif

diff --git a/kernel/x86_64/dasum.c b/kernel/x86_64/dasum.c
index a9c40f38f..0147c6978 100644
--- a/kernel/x86_64/dasum.c
+++ b/kernel/x86_64/dasum.c
@@ -4,7 +4,7 @@
#define ABS_K(a) ((a) > 0 ? (a) : (-(a)))
#endif

-#if defined(SKYLAKEX)
+#if defined(SKYLAKEX) || defined(COOPERLAKE) || defined(SAPPHIRERAPIDS)
#include "dasum_microk_skylakex-2.c"
#elif defined(HASWELL) || defined(ZEN)
#include "dasum_microk_haswell-2.c"
diff --git a/kernel/x86_64/sasum.c b/kernel/x86_64/sasum.c
index 37a92468f..3f22cb97a 100644
--- a/kernel/x86_64/sasum.c
+++ b/kernel/x86_64/sasum.c
@@ -9,7 +9,7 @@

#endif

-#if defined(SKYLAKEX)
+#if defined(SKYLAKEX) || defined(COOPERLAKE) || defined(SAPPHIRERAPIDS)
#include "sasum_microk_skylakex-2.c"
#elif defined(HASWELL) || defined(ZEN)
#include "sasum_microk_haswell-2.c"
diff --git a/kernel/x86_64/zasum.c b/kernel/x86_64/zasum.c
index 80e95a2c8..3f17ab1cf 100644
--- a/kernel/x86_64/zasum.c
+++ b/kernel/x86_64/zasum.c
@@ -4,7 +4,7 @@
#define ABS_K(a) ((a) > 0 ? (a) : (-(a)))
#endif

-#if defined(SKYLAKEX)
+#if defined(SKYLAKEX) || defined(COOPERLAKE) || defined(SAPPHIRERAPIDS)
#include "zasum_microk_skylakex-2.c"
#endif

--
2.50.1

79 changes: 79 additions & 0 deletions deps/patches/openblas-casum-fallback-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
From f8ad5344c210960fc399ca5b0ad8559ab5ca253e Mon Sep 17 00:00:00 2001
From: Bart Oldeman <[email protected]>
Date: Fri, 17 Nov 2023 23:49:34 +0000
Subject: [PATCH] Fix casum fallback kernel.

This kernel is only used on Skylake+ if the kernel with AVX512
intrinsics can't be used, but used the variable x1 incorrectly
in the tail end of the loop, as it is still at the initial
value instead of where x points to.

This caused 55 "other error"s in the LAPACK tests
(https://github.com/OpenMathLib/OpenBLAS/issues/4282)

This change makes casum.c as similar as possible as zasum.c,
because zasum.c does this correctly.
---
kernel/x86_64/casum.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/kernel/x86_64/casum.c b/kernel/x86_64/casum.c
index e4d054311..28d78d279 100644
--- a/kernel/x86_64/casum.c
+++ b/kernel/x86_64/casum.c
@@ -9,12 +9,12 @@
#endif

#ifndef HAVE_CASUM_KERNEL
-static FLOAT casum_kernel(BLASLONG n, FLOAT *x1)
+static FLOAT casum_kernel(BLASLONG n, FLOAT *x)
{

BLASLONG i=0;
BLASLONG n_8 = n & -8;
- FLOAT *x = x1;
+ FLOAT *x1 = x;
FLOAT temp0, temp1, temp2, temp3;
FLOAT temp4, temp5, temp6, temp7;
FLOAT sum0 = 0.0;
@@ -24,14 +24,14 @@ static FLOAT casum_kernel(BLASLONG n, FLOAT *x1)
FLOAT sum4 = 0.0;

while (i < n_8) {
- temp0 = ABS_K(x[0]);
- temp1 = ABS_K(x[1]);
- temp2 = ABS_K(x[2]);
- temp3 = ABS_K(x[3]);
- temp4 = ABS_K(x[4]);
- temp5 = ABS_K(x[5]);
- temp6 = ABS_K(x[6]);
- temp7 = ABS_K(x[7]);
+ temp0 = ABS_K(x1[0]);
+ temp1 = ABS_K(x1[1]);
+ temp2 = ABS_K(x1[2]);
+ temp3 = ABS_K(x1[3]);
+ temp4 = ABS_K(x1[4]);
+ temp5 = ABS_K(x1[5]);
+ temp6 = ABS_K(x1[6]);
+ temp7 = ABS_K(x1[7]);

sum0 += temp0;
sum1 += temp1;
@@ -43,12 +43,12 @@ static FLOAT casum_kernel(BLASLONG n, FLOAT *x1)
sum2 += temp6;
sum3 += temp7;

- x+=8;
+ x1+=8;
i+=4;
}

while (i < n) {
- sum4 += (ABS_K(x1[0]) + ABS_K(x1[1]));
+ sum4 += ABS_K(x1[0]) + ABS_K(x1[1]);
x1 += 2;
i++;
}
--
2.50.1

24 changes: 5 additions & 19 deletions doc/src/devdocs/eval.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,11 @@ The 10,000 foot view of the whole process is as follows:

## [Parsing](@id dev-parsing)

The Julia parser is a small lisp program written in femtolisp, the source-code for which is distributed
inside Julia in [src/flisp](https://github.com/JuliaLang/julia/tree/master/src/flisp).

The interface functions for this are primarily defined in [`jlfrontend.scm`](https://github.com/JuliaLang/julia/blob/master/src/jlfrontend.scm).
The code in [`ast.c`](https://github.com/JuliaLang/julia/blob/master/src/ast.c) handles this handoff
on the Julia side.

The other relevant files at this stage are [`julia-parser.scm`](https://github.com/JuliaLang/julia/blob/master/src/julia-parser.scm),
which handles tokenizing Julia code and turning it into an AST, and [`julia-syntax.scm`](https://github.com/JuliaLang/julia/blob/master/src/julia-syntax.scm),
which handles transforming complex AST representations into simpler, "lowered" AST representations
which are more suitable for analysis and execution.

If you want to test the parser without re-building Julia in its entirety, you can run the frontend
on its own as follows:

$ cd src
$ flisp/flisp
> (load "jlfrontend.scm")
> (jl-parse-file "<filename>")
By default, Julia uses [JuliaSyntax.jl](https://github.com/JuliaLang/JuliaSyntax.jl) to produce the
AST. Historically, it used a small lisp program written in femtolisp, the source-code for which is
distributed inside Julia in [src/flisp](https://github.com/JuliaLang/julia/tree/master/src/flisp).
If the `JULIA_USE_FLISP_PARSER` environment variable is set to `1`, the old parser will be used
instead.

## [Macro Expansion](@id dev-macro-expansion)

Expand Down
16 changes: 12 additions & 4 deletions src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,13 +638,13 @@ static Value *emit_struct_gep(jl_codectx_t &ctx, Type *lty, Value *base, unsigne

static Type *_julia_struct_to_llvm(jl_codegen_params_t *ctx, LLVMContext &ctxt, jl_value_t *jt, bool *isboxed, bool llvmcall=false);

static Type *_julia_type_to_llvm(jl_codegen_params_t *ctx, LLVMContext &ctxt, jl_value_t *jt, bool *isboxed)
static Type *_julia_type_to_llvm(jl_codegen_params_t *ctx, LLVMContext &ctxt, jl_value_t *jt, bool *isboxed, bool no_boxing)
{
// this function converts a Julia Type into the equivalent LLVM type
if (isboxed) *isboxed = false;
if (jt == (jl_value_t*)jl_bottom_type)
return getVoidTy(ctxt);
if (jl_is_concrete_immutable(jt)) {
if (jl_is_concrete_immutable(jt) || no_boxing) {
if (jl_datatype_nbits(jt) == 0)
return getVoidTy(ctxt);
Type *t = _julia_struct_to_llvm(ctx, ctxt, jt, isboxed);
Expand All @@ -657,13 +657,20 @@ static Type *_julia_type_to_llvm(jl_codegen_params_t *ctx, LLVMContext &ctxt, jl

static Type *julia_type_to_llvm(jl_codectx_t &ctx, jl_value_t *jt, bool *isboxed)
{
return _julia_type_to_llvm(&ctx.emission_context, ctx.builder.getContext(), jt, isboxed);
return _julia_type_to_llvm(&ctx.emission_context, ctx.builder.getContext(), jt, isboxed, false);
}

extern "C" JL_DLLEXPORT_CODEGEN
Type *jl_type_to_llvm_impl(jl_value_t *jt, LLVMContextRef ctxt, bool *isboxed)
{
return _julia_type_to_llvm(NULL, *unwrap(ctxt), jt, isboxed);
return _julia_type_to_llvm(NULL, *unwrap(ctxt), jt, isboxed, false);
}


extern "C" JL_DLLEXPORT_CODEGEN
Type *jl_struct_to_llvm_impl(jl_value_t *jt, LLVMContextRef ctxt, bool *isboxed)
{
return _julia_type_to_llvm(NULL, *unwrap(ctxt), jt, isboxed, true);
}


Expand Down Expand Up @@ -3086,6 +3093,7 @@ static void init_bits_value(jl_codectx_t &ctx, Value *newv, Value *v, MDNode *tb
static void init_bits_cgval(jl_codectx_t &ctx, Value *newv, const jl_cgval_t& v, MDNode *tbaa)
{
// newv should already be tagged
newv = maybe_decay_tracked(ctx, newv);
if (v.ispointer()) {
emit_memcpy(ctx, newv, jl_aliasinfo_t::fromTBAA(ctx, tbaa), v, jl_datatype_size(v.typ), sizeof(void*));
}
Expand Down
2 changes: 2 additions & 0 deletions src/codegen-stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ JL_DLLEXPORT LLVMOrcThreadSafeModuleRef jl_get_llvm_module_fallback(void *native

JL_DLLEXPORT void *jl_type_to_llvm_fallback(jl_value_t *jt, LLVMContextRef llvmctxt, bool_t *isboxed) UNAVAILABLE

JL_DLLEXPORT void *jl_struct_to_llvm_fallback(jl_value_t *jt, LLVMContextRef llvmctxt, bool_t *isboxed) UNAVAILABLE

JL_DLLEXPORT jl_value_t *jl_get_libllvm_fallback(void) JL_NOTSAFEPOINT
{
return jl_nothing;
Expand Down
5 changes: 4 additions & 1 deletion src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6553,8 +6553,11 @@ static Function* gen_cfun_wrapper(
ctx.builder.ClearInsertionPoint();

if (aliasname) {
GlobalAlias::create(cw->getValueType(), cw->getType()->getAddressSpace(),
auto alias = GlobalAlias::create(cw->getValueType(), cw->getType()->getAddressSpace(),
GlobalValue::ExternalLinkage, aliasname, cw, M);
if(ctx.emission_context.TargetTriple.isOSBinFormatCOFF()) {
alias->setDLLStorageClass(GlobalValue::DLLStorageClassTypes::DLLExportStorageClass);
}
}

if (nest) {
Expand Down
4 changes: 3 additions & 1 deletion src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static int8_t jl_cachearg_offset(jl_methtable_t *mt)

static uint_t speccache_hash(size_t idx, jl_svec_t *data)
{
jl_method_instance_t *ml = (jl_method_instance_t*)jl_svecref(data, idx);
jl_method_instance_t *ml = (jl_method_instance_t*)jl_svecref(data, idx); // This must always happen inside the lock
jl_value_t *sig = ml->specTypes;
if (jl_is_unionall(sig))
sig = jl_unwrap_unionall(sig);
Expand All @@ -121,6 +121,8 @@ static uint_t speccache_hash(size_t idx, jl_svec_t *data)

static int speccache_eq(size_t idx, const void *ty, jl_svec_t *data, uint_t hv)
{
if (idx >= jl_svec_len(data))
return 0; // We got a OOB access, probably due to a data race
jl_method_instance_t *ml = (jl_method_instance_t*)jl_svecref(data, idx);
jl_value_t *sig = ml->specTypes;
if (ty == sig)
Expand Down
1 change: 1 addition & 0 deletions src/jl_exported_funcs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@
YY(jl_dump_llvm_opt) \
YY(jl_dump_fptr_asm) \
YY(jl_get_function_id) \
YY(jl_struct_to_llvm) \
YY(jl_type_to_llvm) \
YY(jl_getUnwindInfo) \
YY(jl_get_libllvm) \
Expand Down
1 change: 1 addition & 0 deletions src/llvm-multiversioning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,7 @@ void CloneCtx::rewrite_alias(GlobalAlias *alias, Function *F)
trampoline->removeFnAttr("julia.mv.reloc");
trampoline->removeFnAttr("julia.mv.clones");
trampoline->addFnAttr("julia.mv.alias");
trampoline->setDLLStorageClass(alias->getDLLStorageClass());
alias->eraseFromParent();

uint32_t id;
Expand Down
Loading