Command Palette

Search for a command to run...

Назад к скиллам
скилл № 98295

tvm-fift-hypothesis-proving

Prove or reject TON TVM opcode, crash, gas-accounting, memory, CPU, debug, and RUNVM/RUNVMX resource hypotheses with Fift/Asm.fif probes. Use when testing…

БесплатноБез исполняемых скриптов
jiayaoqijiaот jiayaoqijia★ 81 звезда на GitHub

Установить tvm-fift-hypothesis-proving в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

TVM Fift Hypothesis Proving

Use this skill when the job is to turn a suspected TVM resource, crash, or gas-accounting issue into a minimal executable Fift probe and classify the result.

Typical triggers:

  • "this opcode crashes TVM"
  • "this opcode allocates memory without gas"
  • "this instruction is exponential"
  • "this gas charge is too low"
  • "RUNVM or RUNVMX can reset accounting"
  • "debug output, stack dumps, or Fift tooling can be abused"

If the hypothesis needs validator networking, block production, account state, or transaction replay, use a local-network triage skill instead or combine both workflows.

Entry Model

Fift is a stack language. Values are pushed first, words consume values from the top of the stack, and .s prints the current Fift stack. The top of the printed stack is the last item.

TVM assembler syntax is also stack-shaped:

  • Start assembler probes with "Asm.fif" include.
  • Put TVM code inside <{ ... }>s when you want a code slice suitable for runvmcode or gasrunvmcode.
  • Arguments already on the Fift stack become the initial TVM stack.
  • gasrunvmcode takes a code slice and a gas limit, then returns TVM result values, the exit code, and gas consumed.

Useful public references:

  • Fift introduction: https://ton.org/fiftbase.pdf
  • TVM description: https://ton.org/tvm.pdf
  • In the TON repo, inspect doc/fiftbase.tex, crypto/fift/lib/Fift.fif, crypto/fift/lib/Asm.fif, crypto/fift/words.cpp, crypto/vm/contops.cpp, and the opcode implementation under crypto/vm/.

Quick Start

Create probe.fif in a TON checkout:

"Asm.fif" include

2 3 <{ ADD DUP MUL }>s 1000000 gasrunvmcode .s cr

Run it:

build/crypto/fift -Icrypto/fift/lib -s probe.fif

The TVM program is three opcodes:

  1. ADD turns 2 3 into 5.
  2. DUP duplicates 5.
  3. MUL returns 25.

The stack line has this shape:

25 0 <gas>

25 is the TVM result, 0 is the TVM exit code, and <gas> is the gas consumed by this build and global version. With a too-small gas limit, expect an out-of-gas exit such as:

<exception-parameter> -14 <gas>

Do not hard-code one gas number across versions. Record the build, global version, exact probe, exit code, and measured gas.

Workflow

  1. Ground the hypothesis in current code. Locate the assembler mnemonic and C++ executor with rg. Identify where gas is charged, where cells or stack entries are allocated, whether the operation is version-gated, and whether the surface is consensus execution, get-method/liteserver, Fift tooling, debug-only code, or host-library code outside TVM.

  2. Build the smallest executable probe. Start with one opcode or a tiny opcode sequence. Keep the first run small enough to finish quickly. Scale one parameter at a time. Prefer gasrunvmcode or explicit runvmx modes when the returned gas matters.

  3. Measure host resources separately from TVM gas. Use /usr/bin/time -v for RSS and CPU. Use timeout for suspected hangs. Redirect huge debug output to a file or /dev/null. Record stack output, exit code, gas, max RSS, user/system time, elapsed time, and the scale parameter.

  4. Compare against a charged baseline. For cells, compare BTOS or HASHBU paths against ENDC, ENDC CTOS, or ENDC HASHCU. For debug/output claims, compare gas at construction time against host output bytes or RSS. For RUNVM, distinguish a stack supplied by Fift from a stack built inside TVM and paid by TVM gas.

  5. Classify the result. Confirm only when a bounded PoC demonstrates a production-reachable path where TVM gas stays flat or much lower than host memory, CPU, output, or crypto work, and the code path explains why. Downrank findings that require Fift debug flags, DUMP*, stack trace, .s, .dump, or (dump) unless a production host enables the same sink on untrusted contract output. Reject hypotheses with durable negative facts: bounded tuple length, bounded dictionary key depth, memoized cell DAG traversal, explicit linear gas, paid stack movement, or version-gated historical fixes.

  6. Preserve reusable conclusions in the requested public artifact. Keep private provenance, local report filenames, absolute local paths, and raw huge outputs out of public skill content and public reports. Write down exact rejection reasons so future triage can skip known false positives quickly.

Command Patterns

Run a one-off probe:

build/crypto/fift -Icrypto/fift/lib -s probe.fif

Measure RSS and CPU:

/usr/bin/time -v build/crypto/fift -Icrypto/fift/lib -s probe.fif >/tmp/probe.out 2>/tmp/probe.time

Bound a suspected hang or crash:

timeout 10s /usr/bin/time -v build/crypto/fift -Icrypto/fift/lib -s probe.fif >/tmp/probe.out 2>/tmp/probe.time
echo "status=$?"

Scale a parameter cautiously:

for n in 8 12 16 20; do
  sed "s/@N@/$n/" probe.template.fif >/tmp/probe.fif
  /usr/bin/time -f "N=$
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • SOURCE.md
  • TRUST.auto.yaml
  • agents/openai.yaml

FAQ

Что делает скилл tvm-fift-hypothesis-proving?

Prove or reject TON TVM opcode, crash, gas-accounting, memory, CPU, debug, and RUNVM/RUNVMX resource hypotheses with Fift/Asm.fif probes. Use when testing suspected TVM instruction underpricing, native crashes, exponential resource growth, or runvm behavior in a local TON checkout.

Как установить скилл tvm-fift-hypothesis-proving?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл tvm-fift-hypothesis-proving запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить tvm-fift-hypothesis-proving с