Skip to content

Instantly share code, notes, and snippets.

View fzyzcjy's full-sized avatar
😄
Hello, world!\n

fzyzcjy fzyzcjy

😄
Hello, world!\n
  • +=1 (seriously this is the name)
  • Solar system
View GitHub Profile
@fzyzcjy
fzyzcjy / README.md
Last active July 9, 2026 10:45
ch3.1 op40/op42 mechanical-move proofs (4 certified relocations + verify_all)

Mechanical-move proofs — ch3.1 op40 / op42

Each script regenerates one commit from its base with faithful relocation primitives and byte-diffs the result against the commit in a throwaway git worktree. PASS = the commit is exactly those relocations, nothing else.

script commit PR kind
op40_extract_allocation.py 9992594a extract allocation logic from common.py #29431 generator-inferred (extract_symbols_to_new_module)
op42_relocate_assign.py 897ec989 relocate assign_req_to_token_pool helpers #29432 generator-inferred
@fzyzcjy
fzyzcjy / 42c9b47152.py
Last active July 9, 2026 06:34
Mechanical extract-function proof for PR #29432 (op42 spec decode: alloc_for_spec_decode)
#!/usr/bin/env python3
"""op42 mechanical move (spec decode): extract the canonical de-batched alloc block from
eagle_prepare_for_decode into a module-level alloc_for_spec_decode in mem_cache/allocation.py.
The body is cut verbatim by extract_function; only signature / call are authored."""
import subprocess
import sys
sys.path.insert(
0,
str(__import__("pathlib").Path(__file__).resolve().parent),
@fzyzcjy
fzyzcjy / 302bc58f3f.py
Last active July 9, 2026 06:34
Mechanical extract-function proof for PR #29432 (op42 decode prealloc: alloc_for_decode_prealloc[_hisparse])
#!/usr/bin/env python3
"""op42 mechanical move (decode prealloc): extract the two prealloc alloc blocks in
DecodePreallocQueue into module-level free functions alloc_for_decode_prealloc_hisparse
and alloc_for_decode_prealloc. Bodies are cut verbatim by extract_function; only the
signature / return / call interface is authored."""
import subprocess
import sys
sys.path.insert(
0,
@fzyzcjy
fzyzcjy / d9e21ed5b.py
Last active July 9, 2026 06:34
Mechanical-move proof for PR #29432 (op42: relocate assign_req_to_token_pool helpers)
"""Auto-generated reproduce script. Audit each call, then run.
commit: d9e21ed5bb90650c8497c874c59f6eb7ad20c5ba
subject: Relocate assign_req_to_token_pool triton helpers into mem_cache/allocation.py
Each call is a faithful relocation primitive. Running this reproduces the commit
in a throwaway worktree and diffs it byte-for-byte; PASS means the commit is
exactly these relocations.
"""
import sys
@fzyzcjy
fzyzcjy / 65cfba81f.py
Created July 9, 2026 03:25
Mechanical-move proof for PR #29431 (op40: extract allocation logic from common.py)
"""Auto-generated reproduce script. Audit each call, then run.
commit: 65cfba81f5c69178e743100ff0a5b55b402b4dc8
subject: Lightweight extract allocation logic from mem_cache/common.py to more clearly show nearly parallel variants
Each call is a faithful relocation primitive. Running this reproduces the commit
in a throwaway worktree and diffs it byte-for-byte; PASS means the commit is
exactly these relocations.
"""
import sys
@fzyzcjy
fzyzcjy / cdp-result.json
Last active June 6, 2026 08:42
flutter_rust_bridge online demo gallery manual test execution 2026-06-06
{
"page": {
"url": "https://cjycode.com/flutter_rust_bridge/demo/",
"title": "",
"text": "Skip to main content\nFlutter Rust Bridge\nv2\nGitHub\nSearch\n⌘\nK\nIntroduction\nQuickstart\nDemo\nGuides\nOverview\nTypes\nTwo-way Road\nFunctions\nTraits (base classes)\nTranslate third-party packages\nLifetimes / Return references\nConcurrency and async\nCustomization\nCross-platform utils\nMisc Features\nMiscellaneous\nHow-to\nWho is using it\nPerformance\nContributor guide & Implementations\nManual (76 entries)\nDemo\nDemo\n\nSome scenarios when using Rust and Dart include:\n\nUse arbitrary Rust libraries, in Dart: When there is a library only existing in Rust but not in Dart.\nHigh-performance code in Rust, others in Dart: Rust makes it easy to write multi-thread code, algorithms, data-intensive operations, etc.\nLogic in Rust, UI in Dart: When you want a UI framework (Flutter) for your Rust system.\nIntroduction​\n\nWe demonstrate a simple example here. In this demo, let us draw a Mandelbrot set (a
@fzyzcjy
fzyzcjy / transform_release_req_free_func.py
Created May 28, 2026 06:56
Mechanical refactor transform: extract release_req / retract_all as module-level free functions
#!/usr/bin/env python3
"""Reproducible transform for: extract release_req / retract_all as module-level free functions.
Run from the sglang repo root:
python3 /tmp/transform_release_req_free_func.py
"""
import sys
from pathlib import Path
sys.path.append(".claude/skills/mechanical-refactor-verify")
@fzyzcjy
fzyzcjy / verify-scheduler-init-style-mechanical.py
Created May 25, 2026 08:07
Byte-equality audit for sgl-project/sglang PR #26271 (Scheduler.__init__ extraction)
#!/usr/bin/env python3
"""Programmatic byte-equality audit for PR #26271
(sgl-project/sglang `tom/scheduler_init_style`).
The PR claims to be a purely mechanical refactor of
``python/sglang/srt/managers/scheduler.py``: 13 inline component
constructions inside ``Scheduler.__init__`` are extracted into
per-component ``init_<name>()`` methods, with no behavior change.
This script proves the claim by *programmatic* comparison instead of
@fzyzcjy
fzyzcjy / backend_request_func.py
Last active April 26, 2026 13:01
InferenceX bench backend_request_func.py with per-request status print (5 sites patched)
# SPDX-License-Identifier: Apache-2.0
import json
import os
import sys
import time
import traceback
from dataclasses import dataclass, field
from typing import List, Optional, Union
@fzyzcjy
fzyzcjy / transform_reorder_rollout_manager.py
Last active April 6, 2026 03:58
Mechanical refactor transform: reorder RolloutManager
#!/usr/bin/env python3
"""Reproducible transform for: reorder RolloutManager methods and privatize some names.
Run from the repo root: python3 /tmp/transform_reorder_rollout_manager.py
"""
import sys
from pathlib import Path
sys.path.append(".claude/skills/mechanical-refactor-verify")
from mechanical_refactor_verify_utils import verify_mechanical_refactor, git_add_and_commit