Skip to content

Instantly share code, notes, and snippets.

View praveenperera's full-sized avatar

Praveen Perera praveenperera

View GitHub Profile
@praveenperera
praveenperera / 0-README.md
Created October 19, 2026 21:46
NVIDIA/cuda-rust#1465: reduced repro, typed ld/st.shared simulation, and benchmarks

NVIDIA/cuda-rust#1465: reduced repro and benchmarks

Measures whether typed ld.shared / st.shared on u32 shared addresses would keep the reg + imm addressing that the speakrs workaround (an opaque mov.b32 on the shared base) recovers. Everything is built from cuda-rust a25a5857692d399bf079cce7399b2724f60c9059 (main on 2026-10-19) with nightly-2026-10-11.

Layout

Gists are flat: a file named dir__file belongs at dir/file. Run bash unflatten.sh in a

@praveenperera
praveenperera / rebuild_undo.py
Created October 15, 2026 16:25
Rebuild corrupted Bitcoin undo records (rev*.dat) from -txindex without a full reindex
#!/usr/bin/env python3
"""Rebuild block undo records from -txindex and compare them with a blocks/revNNNNN.dat file
Undo data for a block is the list of outputs its inputs spent, so a node with -txindex can
rebuild it exactly. Use this when a few blocks fail with "Can't read undo data from disk" or
"ReadBlockUndo: Checksum mismatch" and the rest of the node is healthy
Report mode (read-only) rebuilds each height and shows whether the record on disk matches:
rebuild_undo.py --datadir ~/.bitcoin --rev 5123 --from-height 913130 --to-height 913140 --out ./out
@praveenperera
praveenperera / 0-README.md
Created October 10, 2026 17:57
NVIDIA/cuda-rust#1465: spk_segdense_embed_b32_tf32_k2 with and without the opaque shared base (PTX, SASS, source, counting scripts)

NVIDIA/cuda-rust#1465: comparison artifacts

Kernel: spk_segdense_embed_b32_tf32_k2 from speakrs crates/speakrs-cuda-kernels/src/segdense.rs (branch cuda-fp16, c98d2d6), copied unchanged except for a no-opaque feature that turns the opaque helper (an inline mov.b32 with options(register_only)) into an identity.

Build

  • cuda-oxide a73ec6ef7fe2922c93f5d1e1f2e3de67c891a760, cargo-oxide 0.2.1
  • nightly-2026-08-28 (rustc 1.100.0-nightly e457a7b0d, LLVM 23.1.0)
  • llc: the toolchain default (LLVM 23.1.0), or Ubuntu llc-21 (21.1.8) through CUDA_OXIDE_LLC=/usr/bin/llc-21
  • ptxas: CUDA 13.0 V13.0.88 and CUDA 13.4 V13.4.92, -arch=sm_120
@praveenperera
praveenperera / CLAUDE.md
Created December 10, 2025 15:56
claude code for research

Research Repository

Purpose

This repository is for research purposes only. No code should be added here.

Structure

Each research topic should have its own directory at the root level.

@praveenperera
praveenperera / Dockerfile
Created June 25, 2020 21:07
Dockerfile for my phoenix + tailwindcss + purge css template repo
# STEP 1 - DEPS GETTER
FROM hexpm/elixir:1.10.2-erlang-22.2.7-alpine-3.11.3 AS deps-getter
# setup up variables
ARG APP_NAME
ARG APP_VSN
ARG PHOENIX_SUBDIR=.
ENV APP_NAME=${APP_NAME} \
APP_VSN=${APP_VSN}
@praveenperera
praveenperera / utils.rs
Last active May 27, 2020 18:55
build a path list in parallel
use crossbeam_channel as channel;
use ignore::WalkBuilder;
use std::path::{Path, PathBuf};
#[derive(Debug)]
enum Message {
FoundPath(Result<ignore::DirEntry, ignore::Error>),
DoneScanning,
}
#!/bin/bash
# Options
#
# -V, --verbose
# Enable verbose output for the installer
#
# -f, -y, --force, --yes
# Skip the confirmation prompt during installation
#
@praveenperera
praveenperera / brew_permissions.sh
Last active December 24, 2019 04:49
brew permissions
sudo chown -R $(whoami) /usr/local
sudo chown -R $(whoami) $(brew --prefix)/*
sudo chown -R "$USER":admin /usr/local
sudo chown -R "$USER":admin /Library/Caches/Homebrew
@praveenperera
praveenperera / webpack.config.js
Created December 17, 2019 14:38
webpack.config.js (2019)
const path = require("path");
const glob = require("glob");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const WebpackNotifierPlugin = require("webpack-notifier");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const isProduction = process.env.NODE_ENV === "production";
const ImageminPlugin = require("imagemin-webpack-plugin").default;
@praveenperera
praveenperera / crate-gh-install.sh
Last active November 27, 2019 20:27 — forked from sjparkinson/crate-gh-install.sh
Install binaries from a GitHub release.
#!/bin/sh
# Heavily modified from https://github.com/japaric/trust/blob/gh-pages/install.sh.
help() {
cat <<'EOF'
Install a binary release of a Rust crate hosted on GitHub.
Usage:
install.sh [options]