RSSAmplifier

Blog

not your average end user

Recent content on not your average end user

klatz.coRSS feed ↗102 posts

Latest posts

Notes: GPU IRs

from a conversation with Daniel after https://sflean.group/ 
 
 pytorch -> triton -> tritonIR -> ptx -> sass
 
 or eager-mode: pytorch -> prebuilt cuda kernels 
 
 
 jax -> jaxpr -> xla -> llvm ir -> ptx -> sass
 
 can’t have if statements in jax - branches are ?collapsed? at
compiletime 
 there is a keyword in jax that gets around this 
 it…

2026 Papers


 First-in-human quantum entanglement imaging 
 
 PET scan observing entanglement on a 68Ga - observed annihilation
photons 
 
 
 EML: All elementary functions from a single binary operator 
 
 eml(x, y) = e^x - ln(y) 
 gives you all the cos, sin, tan 
 cute. practical? who knows! 
 i sketched a bit what making circuits with this would look like.…

Proof System Notes


 Thaler: Proofs, Arguments, and Zero-Knowledge (Textbook) 
 Avigad, de Moura, Kong, Ullrich: Theorem Proving in Lean 4 


Proof System Timelines

Pulled from a model and not double-checked. “Proof system” used broadly: formal logic, mechanized theorem proving, and cryptographic proofs of knowledge. 
 
 ~500bce panini, ashtadhyayi (formal generative grammar of sanskrit) 
 ~350bce aristotle, syllogistic logic + organon 
 ~300bce euclid’s elements (axiomatic geometry) 
 ~250bce archimedes, method of…

Lean 4 vibe-port of Flypitch (continuum hypothesis independence)

I ported
 Flypitch 
from Lean 3 to Lean 4 over the course of approximately a week, mostly
unattended Claude. 
 The proof of the independence of the continuum hypothesis is a Gödel +
Cohen result that deals with the cardinality of the naturals vs. the reals. 
 That is to say, it states that ZFC (from set theory)
cannot prove or disprove the existence of a…

Confidential Computing Notes


 Repo: ~/learning/gpucc (local) 
 Hardware: AMD EPYC (SEV-SNP), Intel Xeon (TDX), NVIDIA H100/A100 
 
 What is Confidential Computing? 
 
 Running workloads in hardware-enforced trusted execution environments (TEEs) 
 The host/hypervisor cannot read or tamper with guest memory 
 Attestation: cryptographic proof that the workload is running in a genuine TEE with…

Computer Science Notes


 Book: Introduction to Algorithms – Cormen/Leiserson/Rivest/Stein (CLRS) 
 Book: Structure and Interpretation of Computer Programs – Abelson/Sussman (SICP) 
 Course: MIT 6.006 Introduction to Algorithms (YouTube) – Demaine 
 Course: MIT 6.824 Distributed Systems – Morris 
 Course: CMU 15-445 Database Systems – Pavlo 
 Exercises: Nand2Tetris…

Physics Notes


 double slit 
 stern-gerlach 
 delayed choice 
 cosmic scale delayed choice (wheeler’s) 


Why are passkeys better?

The login flows generally seem poorly-written, and we have now increased
the complexity of login flows. Are they worth it? 
 Benefits: 
 
 They ?require? secure elements. Websites can now know that a subsequent
request is coming from the same private key in a secure element (we have
a cryptographic ?root of trust? / ?chain of attribution? that connects a
given request…

List: Internet Pianists

Figured I should start keeping one: 
 
 Animenz - Anime arrangements 
 Cateen カティン - 
 lara6683 - videogame covers 
 Caliko - games 


Cool blogs


 https://www.seangoedecke.com/good-system-design/ 
 https://www.stephendiehl.com/posts/ 
 https://leni.sh/ 


Linear Algebra Notes


 Hefferon: Linear Algebra (Textbook, 4th ed) 


Prompting Tips


 Reflect on 5-7 different possible sources of the problem, distill those down to 1-2 most likely sources, and then add logs to validate your assumptions before we move onto implementing the actual code fix 
 source 
 
 
 
 Title: Senior Engineer Task Execution Rule 
 Applies to: All Tasks 
 Rule:
You are a senior engineer with deep experience building…

Transformer Notes

Transformer visualizations: 
 
 
 https://bbycroft.net/llm 
 
 
 https://poloclub.github.io/transformer-explainer/ 
 
 
 Autograd / miniGPT by hand (blog roadmap) 
 
 
 CS336 @ Stanford 
 
 
 Transformers from scratch - sensibly written, broken down by topic 
 
 
 Provable optimal transport with transformers - optimal…

Technology Timelines

Pulled from a model and not double-checked: 
 
 100,000-50,000bce spoken language 
 ~10000bce agriculture, animal domestication 
 ~65000bce la pasiega cave paintings 
 ~3500bce bronze 
 ~3300bce early swords 
 ~3200bce written language 
 ~3000bce wheel 
 ~1500bce iron 
 ~1500bce hinduism 
 ~1300bce judaism 
 ~600bce buddhism / confucianism / daoism…

LessOnline 2025

Rationalism has certainly been present in my high school and college
friend groups: initially with HPMOR and then later with LessWrong posts in
the DMs. When my roommates suggested we go to the conference, I was
enthusiastic for a shared group activity. 
 “Being” very intellectual - in the head - is perhaps not a recipe for
centeredness and embodiment, which seem…

Reading List 2024


 https://gallium.inria.fr/blog/intel-skylake-bug/ 
 
 Skylake series of Intel processors had a hardware bug when using
certain registers in tight loops, with hyperthreading enabled. 
 Manifested as crashes in OCaml programs. 
 
 


Some Stable Diffusion Research

I got curious how Stable Diffusion works. 
 Diffusion models, in short: 
 
 PNG -> Some “latest space” 
 Compressed with a “variational encoder / decoder” 
 Add noise according to a gaussian 
 Pass (prompt,noise,latent_img, timestep) into a U-Net 
 U-Net predicts noise that was added at that timestep 
 A scheduler/sampler (e.g. DDPM, Euler)…

2024 Plans

Curious, once again, what voice to use where. 
 Wanting to know precisely the correct time, socially, for a drink,
and precisely what the adverse health effects are. 
 Thanksgiving in Chicago November. Gym with Jose. 
 CCC at end of 2023. 
 SF for two weeks in January. 
 Colorado at the end of February, for Eric’s birthday. 
 
 Working in novel fields means…

Properties of various blockchains


 Bitcoin
 
 The First One 
 Proof of Work 
 Has a scripting language called Script 
 Lightning 
 
 
 Ethereum
 
 Proof of Stake 
 EVM opcodes see my notes 
 zksync 
 Optimism 
 
 
 Monero
 
 Privacy-preserving. High volume. 
 Had some traceability issues early on
( paper )
 
 i.e., you could defeat the…

Cryptography Notes


 
 Book: Understanding Cryptography – Paar/Pelzl 
 
 
 Course: Introduction to Cryptography (YouTube) – Paar 
 
 
 Website: zkhack.dev 
 
 
 Course: Cryptography 1 - Boneh 
 
 
 Exercises: Cryptopals 
 
 
 Course: Applied Cryptography tweet 
 
 
 Quantum computers break the hardness assumption of discrete…

Multisig vs Threshold Secret Sharing


 threshold secret sharing:
 
 you have multiple shards of a secret 
 given enough of them, you can reconstruct the whole secret 
 sample implementation: github/hashicorp/vault/shamir.go 
 
 
 multisig:
 
 you need multiple transactions from valid parties to execute
something 
 sample implementation: solidity-by-example/multisig 
…

Ethereum execution model

Execution model 
 source: https://www.evm.codes/about 
 
 stack based computer 
 all instructions take args from stack except PUSHx 
 sequential execution
 
 JUMP / JUMPI 
 REVERT 
 
 
 execution context:
 
 data regions 
 variables (program counter) 
 current caller (sender) 
 callee 
 
 
 code region:
 
 sort of…

ZKP Rust Libraries


 Arkworks has pretty unergonomic API but is the most used.
 
 Example code to prove a merkle tree inclusion 
 
 
 Bellman looks a little nicer but a little less production-ready.
 
 exposes a bunch of low-level primitives (you have to implement a bit! and xor!) for example 
 very mathy blog posts e.g.…

VR Fishtank

In January 2022, I moved to Berlin and led a team of 5 to build: 
 
	 A VR puzzle competition connected to a real-life fishtank via
	submersible webcam video stream designed to teach binary reverse engineering
		 
			 
				 
			 
			 
			 	 
				…

bluesky

i’m excited about it! 
 https://staging.bsky.social/profile/klatz.co 
 why? 
 it solves a lot of twitter and mastodon’s problems. the devs are cool
people. i’ve used twitter ~every day for eight years, and have many times
not written useful code for myself because i knew it risked getting killed
by twitter. 
 what’s cool about it? 
 domain…

Git Notes

From contributing to Stepmania: 
 git pull --rebase upstream main
git push origin main
 # delete local branch
git branch -d foo/bar
# delete remote branch
git push origin --delete foo/bar
 # updating personal fork
git pull --rebase upstream main # pull most recent changes from project.
 # --rebase avoids merge commit.
 # only drop in case of merge…

Protecting

… is hard, because it’s parenting. 
 And with parenting, you have to clean up after your kids, even when they
make large messes, and you’re tired, and you’re at your wit’s end. 
 The impulse to protect can be dangerous when misdirected. Or even wielded
by adversaries. 
 Think misapplications – those prepared to protect everything are bound…

What is security research?

(target audience: students) 
 Depends on context, but roughly sortable into 3 categories: 
 
 Independent (you, by yourself) 
 Industry (you, with a company) 
 Academic (you, with a professor) 
 
 These different sectors have different incentives. It is worth considering
whether these incentives align with your goals. Once affiliated with an
institution, it…

pwnies-please: Adversarially Attacking an Image Classifier


 For UIUCTF 2021 , I led a small group of colleagues to design and
deploy a CTF challenge wherein competitors had to fool an image classifier
based on resnet18 . 
 The challenge asks you to upload an image to the “pwny bouncer”, who will
then classify “pwny” or “not a pwny” using a naive classifier model, and a
robust classifier model.…

radare2 install

git clone https://github.com/radareorg/radare2 && cd radare2 && sys/install.sh


how to use venv, simple

# tl;dr it lets you make a clean disposable python environment 
 
 # while in a project directory 
 python3 -m venv env
 
 ls ./env/bin
 # Activate.ps1 activate activate.csh activate.fish easy_install easy_install-3.8 pip pip3 pip3.8 pygmentize python python3 
 
 source ./env/bin/activate
 
 # now we can install packages in this folder 
 
 which…

Top N Most Valuable Metaskills for Technical People

(continuing the theme of “me writing posts for friends I’m teaching to
code”) 
 
 How to ask technical questions artfully: https://www.google.com/search?q=how+to+ask+technical+questions 
 
 Get faster, better, more accurate responses 
 People like you for asking questions interestingly and respectfully 
 Feel the fear, and do it anyway 
 
…

How to make a Discord Bot

Audience: friends I’m teaching to code. 
 Warning, these are likely to change as WSL and discord.py do. 
 If you get stuck anywhere or want to know more, DM me! 
 Goal 
 A Discord bot on your local computer that runs when your computer is on. 
 Prerequisites 
 
 Know how to read 
 
 You will learn 
 
 How to read long instructions, ignoring…

RSI/Keyboard Overuse Resources

A friend recently developed tendonitis from typing/piano/Overwatch 12-14 hrs/day and I sent them my list of resources, collected over many years of me worrying about long-term effects of computer usage. Here they are. 
 
 “ Voice Driven Development ” - Talk by Emily Shea on fighting RSI using Talon, an OSS software project 
 g Heavy Industries : Stenography keyboards made…

WASM Reversing (b01lerctf 2020 alientech web 300)

Files 
 This challenge had 0 solves, probably because it was for a smaller CTF and had a difficult logical jump. I got about halfway through this challenge before getting stuck. I ended up
asking the organizers for the intended solve after the competition ended,
at which point I quickly solved it. 
 We’re given a WASM binary and a webserver asking for a username…

2019 Year in Review: Finishing School, SIGPwny, Japan

this post was started 6 February, finished 9 July, and is backdated 
 Been a while since the last post! I’ve been busy I guess. Haven’t had too
much of an itch to blog until I got to Seattle and had a little
downtime caffeine at 10pm by accident. Writing late at night remains one of my favorite hobbies. 
 I still really like the idea of blogging and hosting your own…

Writing a crappy DBI harness for ASISCTF 2019: Silkroad

I spent a disproportionately large amount of time solving the first portion
of this binary, because I was having fun learning things via it. I
did not solve anything past the first function, but hoo boy, there’s a great
pleasure in diving really deeply into a small problem and learning a lot. 
 We are given a pwn binary that asks for a magic value and runs through…

CypherCon 4 Talk: Building a Cohesive Undergraduate Security Club

Ian Klatzco 
 tl;dr: How to make a successful security club 
 
 Create an easy-to-access chatroom (Discord) 
 Set up a CTF framework like CTFd 
 Make extremely easy challenges 
 Make slides, hand them out at the beginning 
 Present on them for 15m, walk around and help people solve for 45m 
 
 Abstract 
 Building good teams (either in the “elite”…

GDB Catchpoints

gdb-peda$ help catch
Set catchpoints to catch events.

List of catch subcommands:

catch assert -- Catch failed Ada assertions
catch catch -- Catch an exception
catch exception -- Catch Ada exceptions
catch exec -- Catch calls to exec
catch fork -- Catch calls to fork
catch handlers -- Catch Ada exceptions
catch load -- Catch loads of shared…

Compiling SM5 on Windows: 2019


 Installed a bunch of dependencies from
 https://github.com/stepmania/stepmania/wiki/Compiling-StepMania .
 
 Dl’d directx 
 had 2015 redistrib on system 
 installed windows 10 sdk 
 installed latest nsis (release 15 dec 2018) 
 
 
 installed visual studio community 
 git clone git@github.com:stepmania/stepmania.git 
 cd stepmania && git…

IO Functions

Manners of getting input. From memory, maybe more later. 
 x86, 32 & 64b. 
 read from stdin to a buffer : Will read any character (incl. nulls). 
 fgets : reads up to n-1. terminates on nulls. adds a newline. 
 scanf : varargs. takes a format string specifier, eg scanf("%9s", mem_loc); . 
 getc in a while() loop : probably my least favorite. 
 mmap() 
 port mapped io :…

UW printf chals: leakme

audience: sigpwny members after the meeting where we ran it. very tutorial-y 
 would probably be very useful for students trying to do CS461/ECE422’s printf activity, though that’s 32-bit 
 sigpwny meets 7pm thursday eceb 3013; we can’t help you with your security MPs but we’ll teach you the skills necessary to do them 
 This is very long and favors going…

peda.py reference

A few PEDA commands are undocumented (on the first page of the GitHub repo,
there’s more useful help in help ). Here are my notes. 
 There are a bunch of useful aliases at the bottom of the file . 
 stack n 
 Prints n words off the stack. 
 context 
 Type context to re-print what usually prints at a breakpoint (registers, code, stack). 
 Built-in exploit code…

CSAW2018: tablez

Warning: very stream-of-thought-y. &#xA; &#xA; It&rsquo;s PIE, and ASLR is already off on my machine which makes restarting in GDB easier. &#xA; Set a breakpoint on main , and the strncmp in main that looks useful. &#xA; main checks to make sure the input string is 37 bytes. &#xA; r <<< $(python -c 'print 'a'*37')&#xA; x64 calling convention is rdi, rsi, rdx, rcx, r8, r9, and then they start going…

x64 Argument Passing

According to the ABI, the first 6 integer or pointer arguments to a&#xA;function are passed in registers. The first is placed in rdi, the second in&#xA;rsi, the third in rdx, and then rcx, r8 and r9. Only the 7th argument and&#xA;onwards are passed on the stack.&#xA; via

RISC-V Opcodes and Register Names

I needed this a few times during ECE411 — Computer Organization and Design at&#xA;UIUC. &#xA; Opcodes are stored in the lowest 6 bits of the instructions (for 32 bit mode at least)&#xA;&#xA;LUI 0110111&#xA;AUIPC 0010111&#xA;JAL 1101111&#xA;JALR 1100111&#xA;BEQ 1100011&#xA;BNE 1100011&#xA;BLT 1100011&#xA;BGE 1100011&#xA;BLTU 1100011&#xA;BGEU 1100011&#xA;LB 0000011&#xA;LH 0000011&#xA;LW…

Python LC3 Emulator

I wanted to learn how to write a CPU emulator, because it seemed like fun!&#xA;I ended up writing a disassembler too. GitHub . &#xA; I came across this &ldquo; literate program &rdquo; on how to write one in C++. I wanted to&#xA;do it in Python, because it seemed like it would be more educational if I needed&#xA;to transform the presented C++ into Python, and I was in the mood to learn…

Digging into pwntools

I&rsquo;m digging around into how pwntools is packaged. It looks really nicely organized and commented. &#xA; Get the path of a python modules &#xA; import pwn&#xA; print(pwn . __file__)&#xA; The pwn module is just a top-level with nice naming — pwnlib actually contains all the functionality. &#xA; dynelf.py is really interesting — it lets you resolve any symbol in a binary given a function…

How to learn about computers

I have this conversation with a lot of friends so I figured I&rsquo;d collect my&#xA;favorite resources somewhere so that I can just pass around a list. This is&#xA;targeted at people who did not/do not intend to do a CS major in undergrad,&#xA;and who are interested in learning more as a hobby or to get a job. &#xA; &#xA; The hardest problem in computer science is learning how to enjoy it.