Skip to content

Instantly share code, notes, and snippets.

@qpwo
qpwo / Uniform-Pluricanonical-Iitaka-Fibrations-complete-standalone-equivalent-explainer-for-16-year-olds-with-nothing-missing-ascii.txt
Created October 29, 2026 03:45
Uniform-Pluricanonical-Iitaka-Fibrations-complete-standalone-equivalent-explainer-for-16-year-olds-with-nothing-missing-ascii.txt
Exercise: Canonical divisor. Let X be a smooth projective variety. Name the divisor that records the zeros and poles of a rational volume form on X.
Solution. That divisor is the canonical divisor K_X. For each positive integer m the nonzero sections of O_X(mK_X) are the m-pluricanonical forms. Their images in projective space have a maximum dimension, the Kodaira dimension kappa(X). The uniform pluricanonical degree theorem states: for each integer d>=1 there is an integer m(d)>0 such that, over every algebraically closed field of characteristic zero, the complete system |m(d)K_X| defines the Iitaka fibration of every smooth integral projective d-fold X with kappa(X)>=0.
Iitaka 1971, On D-dimensions of algebraic varieties: ./Iitaka1971.pdf
> The D-dimension of an algebraic variety is defined and studied.
Kodaira 1963, On compact complex analytic surfaces I: https://www.jstor.org/stable/pdf/2373157.pdf
> Elliptic surfaces and their canonical bundles organize the fibre structure.
Exercise: Log discrep
@qpwo
qpwo / caveman_db.txt
Last active September 17, 2026 07:21
caveman_db.txt
Big Bucket Rock Sorter
Short Answer
Big cloud bucket is very far away.
Put flat sorted rocks in bucket.
Keep map in fast camp.
Smash small rocks into big rocks often.
Send many hunters at once.
Math is good but only if you smash.
@qpwo
qpwo / flash_attn3.py
Created September 10, 2026 17:52
flash_attn3
# ==============================================================================
# flash_attn3 combined implementation
#
# Source URLs:
# - https://huggingface.co/kernels-community/flash-attn3/resolve/v1/build/torch-stable-abi210-cu128-x86_64-linux/flash_attn_interface.py
# - https://huggingface.co/kernels-community/flash-attn3/resolve/v1/build/torch-stable-abi210-cu128-x86_64-linux/_ops.py
# ==============================================================================
# ==============================================================================
# flash_attn3_ops.py (inlined)
@qpwo
qpwo / mirrorcode.txt
Created September 3, 2026 22:48
backup of mirrorcode.txt
Epoch AI logo
Latest
Our work
Navigate by topic
About
Contact
MirrorCode: Evidence that AI can already do some weeks-long coding tasks
Report
Apr. 10, 2026
@qpwo
qpwo / pr691-gist-placeholder.txt
Created August 24, 2026 19:33
pr691-real-headful-chromeshots
x
@qpwo
qpwo / PERFECTREACT.tsx
Created August 22, 2026 21:17
PERFECT REACT
/** Search and Lookup pages. */
import React from 'react';
import type { Case } from './db';
import type { ApiResponse } from './api';
import { store } from './store.ts';
function onSearchChange(e: React.ChangeEvent<HTMLInputElement>) {
store.set('search_query', e.target.value);
}
@qpwo
qpwo / how-to-split-ts-tsx-mjs.c
Created August 20, 2026 13:24
how-to-split-ts-tsx-mjs.c
//bin/sh -c 'sum=$(cksum < "$0" | tr " " -); o=${TMPDIR:-/tmp}/how-to-split-ts-tsx-mjs-$sum; [ -x "$o" ] || ${CC:-cc} -O3 -Wall -Wextra $(pkg-config --cflags libgit2) "$0" -o "$o" $(pkg-config --libs libgit2) || exit; exec "$o" "$@"' "$0" "$@"; exit
#include <git2.h>
#include <ctype.h>
#include <errno.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
@qpwo
qpwo / fill_in_the_gaps.py
Created August 12, 2026 06:07
not a bad mask filler
import pathlib as _pl; print(_pl.Path(__file__).read_text()); print("END_OF_SOURCE")
import sys, pathlib, time, math, pickle
import numpy as np
import jax
import jax.numpy as jnp
import optax
VOCAB = 256
CTX = 1024
BATCH = 96
//bin/sh -c 'o=${0%.c}; [ "$o" -nt "$0" ] || ${CC:-clang} -O3 -march=native -o "$o" "$0"; exec "$o" "$@"' "$0" "$@"; exit
// source: http://smalldatum.blogspot.com/2016/01/summary-of-advantages-of-lsm-vs-b-tree.html
#define _GNU_SOURCE
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <fcntl.h>
#include <unistd.h>
@qpwo
qpwo / safe.asm
Last active July 28, 2026 11:03
safe assembly thingy
; WOWNEAT/3. Intel AMD64 plus bnd. No language runtime operations.
; Full-width pointer moves preserve hidden authority. Integer writes clear it.
; Every imported entry is verifier-described in section .wowneat.abi.
; Linux x86-64 SysV register order is used for direct calls.
; Verifier must track allocation identity per bnd-tagged pointer through all
; full-width moves and memory loads. When rt.free is called on a pointer, the
; verifier marks that allocation as freed. Any subsequent load or store through
; any pointer whose provenance traces to a freed allocation is a compile-time
; error. This closes use-after-free: stale bnd bounds cannot match a live
; allocation because the verifier rejects the dereference before code emission.