Skip to content

Instantly share code, notes, and snippets.

View staticfloat's full-sized avatar

Elliot Saba staticfloat

View GitHub Profile
@staticfloat
staticfloat / cache_scope.jl
Last active June 20, 2023 19:44
Cache Scope - inspector for .ji cache rejections
using Pkg
using Base: PkgId, find_all_in_cache_path, parse_cache_header, isvalid_cache_header
using AbstractTrees
# build_id is composed of:
# - jl_module_build_id() in `src/module.c`, which is a 128-bit value
# split into two 64-bit chunks (`hi`, `lo`) which are initialized to (`0xffffffffffffffff`, `jl_hrtime()`)
# - The hi chunk gets the checksum written out to it in `src/staticdata.c`, it is itself split
# into two pieces, (`0xfafbfcfd`, `jl_crc32c(cache_data)`)
struct JICacheBuildId
using DepotCompactor, Pkg
# Calculate the depot path for one of our agents
function agent_depot_path(agent_idx)
"/data/agent-cache/yggy-amdci7.$(agent_idx)/julia-buildkite-plugin/depots/e2fd9734-29d8-45cd-b0eb-59f7104f3131"
end
all_agent_depot_paths = [agent_depot_path(idx) for idx in 0:11]
# Our "shared" depot that we compact into
shared_depot_path = "/data/agent-cache/yggy-shared/depot"
This file has been truncated, but you can view the full file.
Process: julia [92097]
Path: /Users/USER/*/julia
Load Address: 0x102940000
Identifier: julia
Version: ???
Code Type: ARM64
Platform: macOS
Parent Process: julia [92089]
Date/Time: 2023-04-11 12:17:08.759 -0700
@staticfloat
staticfloat / Makefile
Created April 5, 2023 15:12
Accelerate NEWLAPCK dpstrf bug
all: run
dpstrf_newlapack: dpstrf_test.c
$(CC) -o $@ -Ddpstrf='dpstrf$$NEWLAPACK' dpstrf_test.c -framework Accelerate
dpstrf_newlapack_ilp64: dpstrf_test.c
$(CC) -o $@ -Ddpstrf='dpstrf$$NEWLAPACK$$ILP64' -DILP64 dpstrf_test.c -framework Accelerate
dpstrf_oldlapack: dpstrf_test.c
$(CC) -o $@ -Ddpstrf='dpstrf_' dpstrf_test.c -framework Accelerate
@staticfloat
staticfloat / Manifest.toml
Last active February 27, 2023 23:55
Diffractor Performance Comparison
# This file is machine-generated - editing it directly is not advised
julia_version = "1.10.0-DEV"
manifest_format = "2.0"
project_hash = "6985a7b33b28c6ef7f7c6220f3b93174d59aec37"
[[deps.AbstractFFTs]]
deps = ["ChainRulesCore", "LinearAlgebra"]
git-tree-sha1 = "69f7020bd72f069c219b5e8c236c1fa90d2cb409"
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c"
#!/bin/bash
# Git rebase entire branch
grb()
{
if git show-ref --verify --quiet refs/remotes/origin/main; then
BASE=${1:-origin/main}
else
BASE=${1:-origin/master}
fi
using REPL
# Helper function to determine if something is "struct"-like
is_struct_like(x) = Base.nfields(x) > 0
function is_array_like(x)
return typeof(x) <: AbstractArray
end
# We sadly can't use `∉` because `missing ∉ haystack` is `missing`, not `false` :(
function missing_resistant_contains(needle, haystack)
@staticfloat
staticfloat / README.md
Last active January 4, 2023 21:28
UDP latency loopback test

With no sleep enabled, I consistently get extremely low send/recv times:

$ gcc -o udp_loopback_test_c udp_loopback_test.c && ./udp_loopback_test_c 
[1.0] send: 4.93us      recv: 7.41us
[2.0] send: 4.68us      recv: 7.04us
[3.0] send: 4.86us      recv: 7.58us
[4.0] send: 4.79us      recv: 7.60us
[5.0] send: 4.88us      recv: 7.03us
[6.0] send: 4.70us recv: 7.57us
@staticfloat
staticfloat / openwrt.dts
Created December 9, 2022 19:43
Ubiquiti device tree vs. OpenWRT device tree
/dts-v1/;
/ {
#address-cells = <0x02>;
model = "Ubiquiti UniFi 6 LR v2";
#size-cells = <0x02>;
interrupt-parent = <0x01>;
compatible = "ubnt,unifi-6-lr-v2\0mediatek,mt7622";
i2c@11009000 {
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 5.10.146 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 11.2.0 r19803-9a599fee93) 11.2.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=110200
CONFIG_LD_VERSION=237000000
CONFIG_CLANG_VERSION=0
CONFIG_LLD_VERSION=0