Skip to content

Instantly share code, notes, and snippets.

View vtjnash's full-sized avatar

Jameson Nash vtjnash

View GitHub Profile
@vtjnash
vtjnash / issue53075.txt
Created January 27, 2024 00:10
issue53075 backedges
This file has been truncated, but you can view the full file.
backedges=Array{Any, 1}(dims=(15410,), mem=Memory{Any}(17310, 0x55f4d407bb40)[
Tuple{typeof(LinearAlgebra._generic_matmatmul!), Array{Base.Complex{Float32}, 2}, Any, Any, LinearAlgebra.MulAddMul{ais1, bis0, Bool, Bool} where bis0 where ais1},
generic_matmatmul!(Array{Base.Complex{Float32}, 2}, Char, Char, LinearAlgebra.UpperTriangular{Base.Complex{Float32}, Array{Base.Complex{Float32}, 2}}, LinearAlgebra.UpperTriangular{Base.Complex{Float32}, Array{Base.Complex{Float32}, 2}}, LinearAlgebra.MulAddMul{ais1, bis0, Bool, Bool} where bis0 where ais1) from generic_matmatmul!(Union{AbstractArray{T, 1}, AbstractArray{T, 2}} where T, Any, Any, Union{AbstractArray{T, 1}, AbstractArray{T, 2}} where T, Union{AbstractArray{T, 1}, AbstractArray{T, 2}} where T, LinearAlgebra.MulAddMul{ais1, bis0, TA, TB} where TB where TA where bis0 where ais1),
Tuple{typeof(LinearAlgebra._generic_matmatmul!), LinearAlgebra.UpperTriangular{Base.Complex{Float32}, Array{Base.Complex{Float32}, 2}}, Any, Any, LinearAlgebra.MulAddMul{ais1,
@vtjnash
vtjnash / Profile-Allocs-print.jl
Created September 20, 2022 21:14
Mix-in file for adding Profile.print-like functionality to Profile.Allocs
# This file is a part of Julia. License is MIT: https://julialang.org/license
# Mix-in functionality to Profile.Allocs to give it a similar print output as Profile
# Activate with:
# Base.include(Profile.Allocs, "/Users/jameson/julia/zipyard/profile_alloc_tools.jl")
# or
# using Revise; Revise.includet(Profile.Allocs, "/Users/jameson/julia/zipyard/profile_alloc_tools.jl")
# Refs: https://github.com/JuliaLang/julia/pull/42768
global print
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGIi5QABEAC8iWK3GRMBqX5r3w2OmGexT/RnFhjblO7zka+Y32LEq8Lp6QA9
iT79fyO8vWgGZRC6qvIiNYzeOMb4IuYMlwSnSYg631cnij3nFqGU4vy8bmFMakPA
uS3PF4/uqwdrQ+SUY8bWM7K2ymhvg6v04tilcSOzTw2S0OetHl0Js7McYcoiCBCl
AB2B3QM714VWeTEYllbelLiFCoN6m9KBqPmektTfmZpNUWHmw308KQkn0TzuIyTt
B6iJ0qc6+Z9+6HutRRpfz3Ly3DtS6K8Z9YbmqL8EmESjlYgFQUNu98oEcsrFbIXC
d6WtlvSqrvr5tCtpG7kg+dR4rcONiosvNKb77l21QU0NbIvuLndMAKsHuJRSQkI0
/ktWvIIq5MVhDoYBs633V9S3TMPzCCZ07KQthM8juzcL9Z78AvSHOttmqHvfvEnj
rMfz+sZfYPZIwcwBYVrv/RSH0cOg2FJ7HvEHL3paAMufYS+zOXk1pykBG1UGuj6Q
@vtjnash
vtjnash / mach-sigchld-bug.c
Created August 17, 2021 22:03
SIGCHLD bug with macOS mach xnu posix_spawn
/* Copyright libuv contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGDlNbwBEACcP4bRV2VZjt0gjTl5g9Eild/e9MAemDGd63U2570f+3bJJo3I
ysbIUeIikWtYvmnZPXCQz2rn7skXX2v1bHRpaP8eEyeCxtuzIJ8IFk6cS253abZw
dWuy3fEYFlW0qez9BkLuYF25nbEBi964GBpsivmnGmzlN3hctJT1n+eJgukt/NQw
twp/5aiEfZ6ACW9hrzegOefVjd5ahs+rNViME5COk+a1fkRV8FDcSz6i5nEFxKEs
wDgziOoWhK9jzVCq+5p45uNKcZnp80zdyjerFF9oVpvqwwF6lM2H+FvYx+yT/x7C
zd7iwWB4ERDtOiyqbl+MEu2ES0I/inwYve14/mEiq2CBCvEh6b3kijcahU+ND9/N
1XCMJYUp0tORGEWKAi2xPWB5u8toL2qg/Y9wG2QJ+W81qxyXw1IHAO2N35jUI+Hr
GmyFRuCxdj/T1nBTJT8CfeXEPGbAud2JU2Lb3jLoy86F+BQhLVttJiDvV/y6gJOk
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQINBFcQfaEBEACsFVOK9z9DQTbBAh0fWIilqgeT6B1MM5fKSJOjT/UreHEicdQG
yAws+C7/1HqotqAStLbpO2bLHBWhtMZyiINPkRJ8Wa4Pl/57TgJoN6B1peGnyH2a
QBtyje+Ikp+9ZcdSBSXM5ozOXjuW9bEn65esg6uBXossN6cblkWBCWGvWFD5SoHf
e0EyHGS2Lnj2mPM+eBttxcK8q2RTFTPp4JbKGmv7B3z8ML2VrtDZRP5KwTq3Kf9N
rKU7tK0tJOqMHPltcBmIm+pvbJGFlAWSkF+opcufoRNRy+V/dSlREywh+ywhrQnB
k7nsAN49qt84wz3zyLez+0B+nvzVJPGx40ZsIxLUhuSMxNFmo4kOOGhfy0m7tn0V
S0Evyei1YV7wg8pvkyvszaT7kCBs3GzaoWbndNG2DZebObcUg2dmMeo8rjdEZyQ9

Introduction

This proposal aims to define the memory model of Julia and to provide certain guarantees in the presence of data races, both by default and through providing intrinsics to allow the user to specify the level of guarantees required. This should allow native implementation in Julia of simple system primitives (like mutexes), interoperate with native system code, and aim to give generally explainable behaviors without incurring significant performance cost. Additionally, it strives to be general-purpose and yet clear about the user's intent—particularly with respect to ensuring that an atomic-type field is accessed with proper care for synchronization.

The last two points deserve particular attention, as Julia has always provided strong reflection and generic programming capabilities that has not been seen—in this synergy combination—in any other language. Therefore, we want to be careful to observe a distinction between the asymmetries of reading vs. writing that we have felt is often not given

@vtjnash
vtjnash / alloc32035.jl
Created April 13, 2021 06:34
memory allocation policy comparison
let a = 2; global y2 = Int[]
while a < 2^42
a += a < .1*2^34 ? a : round(Int, .1*2^34)
push!(y2, a)
end
y2
end;
let a = 2; global y3 = Int[]
while a < 2^46
@vtjnash
vtjnash / MHO-C303.txt
Last active January 18, 2023 05:08
Updating time on MHO-C303 manually (example)
Getting current time:
julia> string(bswap(round(UInt32, datetime2unix(Dates.now()))), base=16) * "00"
"5f3f1f60"
The "00" is the timezone offset (in hours). Here we just use localtime (with offset zero).
With Bluetility.app (from Github) or any other similar tool for bt gatt, look for:
Service: EBE0CCB0-7A0A-4B0C-8A1A-6FF2997DA3A6
Characteristic: EBE0CCB7-7A0A-4B0C-8A1A-6FF2997DA3A6
Read: Hex: 973F1F60_00
@vtjnash
vtjnash / ambig.jl
Created May 19, 2020 02:27
method-ambiguities on f12cde0e8c7f4268838d3201dd9e13b90ea44633 (Version 1.6.0-DEV.29)
julia> Test.detect_ambiguities(Base)
35-element Array{Tuple{Method,Method},1}:
(\(F::LinearAlgebra.Factorization{T}, B::Union{Array{Complex{T},1}, Array{Complex{T},2}}) where T<:Union{Float32, Float64} in LinearAlgebra at /data/vtjnash/julia/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/factorization.jl:84, \(A::LinearAlgebra.LQ{TA,S} where S<:AbstractArray{TA,2}, B::StridedVecOrMat{TB}) where {TA, TB} in LinearAlgebra at /data/vtjnash/julia/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/lq.jl:310)
(convert(::Type{T}, x::T) where T in Base at essentials.jl:171, convert(::Type{T}, x) where T>:Missing in Base at missing.jl:69)
(convert(::Type{T}, x) where T>:Missing in Base at missing.jl:69, convert(::Type{T}, x::T) where T>:Nothing in Base at some.jl:33)