Skip to content

Instantly share code, notes, and snippets.

View KristofferC's full-sized avatar
🇸🇪

Kristoffer Carlsson KristofferC

🇸🇪
View GitHub Profile

PR 780 P1 reproductions

These standalone scripts reproduce the three P1 findings from the review. Run them from the Ferrite.jl repository root. Each script currently fails at the documented invariant; after a fix, it should complete without error.

julia --project=. review_mwes/p1_balanceforest_3d_corner.jl
julia --project=. review_mwes/p1_q2_conformity.jl
julia --project=. review_mwes/p1_subdomain_conformity.jl
#!/usr/bin/env python3
"""Sort a precompile_*.jl file by the `#= NNN.N ms =#` timing comment.
Lines look like:
#= 465.4 ms =# precompile(Tuple{...})
Some lines are wrapped in ANSI color escapes (e.g. \\033[33m ... \\033[0m) and
end with `# recompile`; those escapes are stripped from all output.

verify_method logs phantom insert_backedges_callee invalidations for CodeInstances that are then promoted (wrong sentinel in the emit guard)

cc @topolarity @Keno — load-time backedge verification / invalidation logging on 1.12 and 1.14-DEV.

TL;DR

During package load, verify_method pushes an insert_backedges_callee entry to the invalidation log for any edge whose per-edge max_valid2 ≠ typemax. But the neutral (unconstrained) value inside verify_method is validation_world, not typemax. So an edge that constrains nothing — e.g. a Core.Binding edge to a

Why Julia's atomic modify doesn't fold to atomicrmw (and when it actually does)

Investigation notes for mwe.jl. Versions tested: 1.12.6, 1.13.0-rc1, 1.14.0-DEV.2212 (062a90bc8c). Source references are to julia master (6e40a4a448, 2026-06-08).

TL;DR

The MWE's code_llvm-based counting is partly misled by a reflection artifact. The real situation, measured on **native code of the actual JIT

#!/usr/bin/env julia
#
#===- git-runic - Runic Git Integration ----------------------*- julia -*--===#
#
# Based on `git-clang-format`, which is part of the LLVM Project, under the
# Apache License v2.0 with LLVM Exceptions (see https://llvm.org/LICENSE.txt).
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===------------------------------------------------------------------------===#
using SnoopCompileCore
# First load OhMyREPL so its methods are compiled
using OhMyREPL
# Now track invalidations caused by loading SymbolicUtils
invs = @snoop_invalidations using SymbolicUtils;
using SnoopCompile
using SnoopCompile: countchildren

=== SnoopCompile Invalidations Report ===

rebinding Core.Binding(:(Base.HashArrayMappedTries.iterate), #undef, #undef, Any[CodeInstance for MethodInstance for getproperty(::Module, ::Symbol)], 0x00) invalidated:
   mt_backedges: 1: signature Base.HashArrayMappedTries.iterate triggered MethodInstance for getproperty(::Module, ::Symbol) (0 children)


inserting readline(io::VSCodeServer.IJuliaCore.IJuliaStdio) @ VSCodeServer.IJuliaCore ~/dyad1.12/julia-vscode/scripts/packages/IJuliaCore/src/stdio.jl:230 invalidated:
   backedges: 1: superseding readline(s::IO; keep) @ Base io.jl:619 with MethodInstance for readline(::IO) (2 children)
# use with Julia 1.11
using Cassette
Cassette.@context TraceCtx
mutable struct CallTrace
depth::Int
pending_newline::Bool
CallTrace() = new(0, false)

Plots.jl precompile issue

  • Create LocalPreferences.toml with
    [PrecompileTools]
    precompile_workloads = false
  • Install Plots + HTTP.
  • Run julia +1.10 --project --trace-compile=plots_compile.jl
  • Run the following:
colptr = [1, 20, 53, 107, 138, 139, 158, 191, 224, 278, 332, 333, 364, 383, 402, 435, 468, 499, 530, 531, 550, 569, 588, 621, 675, 708, 741, 795, 849, 871, 893, 926, 959, 995, 1031, 1053, 1075, 1094, 1125, 1126, 1145, 1146, 1177, 1196, 1215, 1216, 1235, 1266, 1297, 1316, 1335, 1389, 1420, 1474, 1528, 1529, 1560, 1593, 1626, 1657, 1688, 1689, 1708, 1727, 1746, 1799, 1852, 1905, 1938, 1971, 2007, 2043, 2065, 2087, 2117, 2118, 2148, 2149, 2168, 2198, 2228, 2247, 2266, 2320, 2351, 2405, 2459, 2460, 2491, 2524, 2557, 2588, 2619, 2620, 2639, 2658, 2677, 2732, 2787, 2842, 2874, 2906, 2942, 2978, 3000, 3022, 3066, 3067, 3068, 3069, 3087, 3119, 3151, 3169, 3187, 3241, 3272, 3326, 3380, 3381, 3412, 3445, 3478, 3509, 3540, 3541, 3560, 3579, 3598, 3655, 3712, 3769, 3803, 3837, 3873, 3909, 3931, 3953, 4008, 4063, 4118, 4150, 4182, 4216, 4250, 4270, 4290, 4320, 4373, 4403, 4404, 4457, 4510, 4528, 4529, 4559, 4589, 4621, 4653, 4671, 4689, 4717, 4766, 4794, 4795, 4844, 4893, 4912, 4913, 4941, 4969, 5002, 5035, 5054, 5073, 50