Skip to content

Instantly share code, notes, and snippets.

View ryogrid's full-sized avatar

Ryo Kanbayashi ryogrid

View GitHub Profile
@mizchi
mizchi / formal-methods-playbook.md
Created July 2, 2026 14:29
実装コードから仕様を吸い出して Z3 / TLA+ でバグを払い出す — 実践プレイブック

実装コードから仕様を吸い出して Z3 / TLA+ でバグを払い出す — 実践プレイブック

既存システムの実装を「事実上の仕様」とみなし、それを形式化することで 「テストでは踏めないバグ」と「実装が暗黙に決めている仕様」を炙り出すための手順書。 仕様書が無い / あてにならない / 仕様と実装がずれている、という現場を前提にする。


0. 基本姿勢: コードが de-facto 仕様である

@ryogrid
ryogrid / article.md
Last active December 30, 2025 22:28
PGの(ほぼ)全部のシンボルのドキュメントを生成してみた

どうも、ryo_grid です。

これは、PostgreSQL Advent Calender 2025 (シリーズ1) の23日分が空いていたので28日に書いた記事です。

はじめに

「PostgreSQLの内部実装を読みたいけど、100万行超のCコードはちょっと...」

そんなあなたに朗報です。 AIエージェントがPostgreSQLのソースコードを解析して生成した、関数や構造体ごとのドキュメントがあります!

@ryogrid
ryogrid / brin_bloom_add_value.md
Created September 7, 2025 13:20
PGのシンボル全てLLMに解説させる計画の成果物の例

brin_bloom_add_value

Overview

Examines an index tuple and updates its bloom filter by adding a new value from a heap tuple, returning whether the bloom filter was modified.

Definition

Datum brin_bloom_add_value(PG_FUNCTION_ARGS)
@ryogrid
ryogrid / chat-log-pre-process-funcs.py
Created May 17, 2025 22:50
Slackログの前処理(ボリューム削減)に使った関数抜粋
def basic_filter_message(username, message_text):
if not message_text or len(message_text) < 8: return False
patterns = [r"^(はい|ええ|うん|OK|了解|承知しました|わかりました|なるほど)$", r"^(ありがとうございます|ありがとう|どうも)$",
r"^(お疲れ様です|おつかれさまです)$", r"^(お願いします|よろしくお願いいたします|よろしくです)$",
r"^(笑|w+|草)$", r"^\s*(スタンプ)\s*$", r"^そうですね$|^ですねー$|^たしかに$"]
for p in patterns:
if re.fullmatch(p, message_text, re.IGNORECASE): return False
return True
# --- プロンプト作成関数 ---
@ryogrid
ryogrid / block.html
Created May 4, 2025 06:08
ブロック崩しゲームもどき by Qwen3 8B 3bit量子化 アンド コンテキスト長くした版
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<title>ブロック崩しゲーム</title>
<style>
body {
margin: 0;
overflow: hidden;
@ryogrid
ryogrid / pg18_dev_250405_io_uring_pgbench_results.txt
Last active April 6, 2025 23:58
postgresのio_uringを有効にした時のパフォーマンスを見てみる
注意:まだベータにもなっていない段階のコードベースで、設定も精査せず、ベンチマーククライアントも同一マシンに置いて、とりあえず測定をしてみた、というだけのものなので、その程度のものであり、結果であるというところは、ご承知おき下さい。
●前提情報
■実施日
2025/4/5
■測定環境(自作デスクトップ)
AMD Ryzen 7 5700X 8-Core Processor 4.50 GHz
Memory 64GB
WD_Black SN770 NVMe WDS100T3X0E 1TB M.2 PCI-Express Gen4
@ryogrid
ryogrid / Ollama_deepseek-r1_14b_hybrid_RAG_for_web_url.ipynb
Created February 13, 2025 14:14
LLM with deepseek-r1:14b on Ollama
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fumiya-kume
fumiya-kume / .cursorrules
Created January 11, 2025 14:26
.cursorrules in 2025/01/11
# .cursorrules
# Development Steps for CLI Application in Go
## 1. Overall Design
- Define the purpose and scope of the CLI application.
- Identify the target audience and their needs.
- Outline the main features and functionalities.
- Create a high-level architecture diagram.
- **Improve Specifications/Features:**
@mizchi
mizchi / あなたのパフォーマンスを倍にする Frontend Ops はいかがですか.md
Last active November 13, 2026 13:37
あなたのパフォーマンスを倍にする Frontend Ops の傭兵はいかがですか

WIP

@ryogrid
ryogrid / nostr_event.pb.go
Last active April 28, 2024 03:40
NostrのイベントデータをMessagePackとProtobufでシリアライズした時のデータサイズ
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.32.0
// protoc v3.19.1
// source: np2p_event.proto
package schema
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"