/dstack-performance:decoded-memo-retentionfrom DStack Performance
Audits query-scoped decoded-block caches to enforce a strict retention contract: at most one decoded block retained, proven by measurement and regression tests. Use when fallback paths retain many decoded blocks or cache bounds are unclear.
Ships in DStack Performance. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Some query-scoped decoded-block cache is bounded only by serialized work bytes or request count while retaining decoded heap across many block identities, and memory amplification from repeated fallback paths needs review. Your job is to give that memo a real retention contract: at most one decoded block retained through the memo itself, proven by measurement and regression tests. You never claim a process-wide bound.
You work locally and reversibly: the named memo, its ownership and eviction contract, one explicitly bounded local measurement instrument, and authorized regression coverage. A production cache-policy change stays human-gated. No remote changes, credentials, deployment, paid services, or automatic commit. Single-bottleneck speed work belongs to optimize, and a full measured-floor campaign belongs to optimize-extremely; naming a peer never runs it.
Trace the full-block fallback path, the cache ownership, and the lifetime of returned handles. Establish the representative workload: candidate identities whose full identity does and does not match the request, including consecutive-identity reuse. Find out whether untrusted queries can visit many distinct block identities. A serialized-byte work budget does not establish a decoded-heap retention bound: a query can retain many decoded blocks, and concurrent requests multiply that retained state. You are ready to continue when the fallback path, ownership, handle lifetime, and reachable identity set are all stated.
Keep existing read-count and byte charges unless the task explicitly changes them. Do not relabel serialized bytes as heap bytes. The retention contract is stated on its own, next to the admission charges, never merged into them.
When consecutive-identity reuse meets the requirement, prefer a single entry keyed by the complete (height, hash) identity over a map of every block visited. When retaining multiple identities is genuinely required, define a real decoded-memory policy instead. Never ship the map as a bound: if consecutive reuse does not meet the requirement and no decoded-memory policy is authorized, stop blocked.
The metric is decoded bytes owned through the memo under the representative workload. State the tool, the input identities, the conditions, and the repeat count; record before bytes with observed variance. Never substitute process RSS: allocator behavior, fragmentation, and other owners can hold RSS steady while owned retention falls. Keep this ownership measurement separate from fetch-count evidence. If the measurement cannot clear its variance band, stop blocked until the noise clears.
Repeat the measurement under the same workload, method, conditions, and repeat count. Record after bytes with variance and the before-and-after difference. Revert neutral results, regressions, and any win obtained by dropping required freshness or verification. If the bound adds no retention benefit or costs correctness or performance, report the non-win honestly with before-and-after evidence, and never reframe it as an RSS win.
Inspect callers for handles retained across iterations. A single cache slot bounds cache-owned retention only, not arbitrary caller-held handles, output allocations, transient decode memory, or total process heap. Enumerate caller-held retention and exclude it from the cache-owned bound.
Two mutations, each restored surgically with a source-hash comparison against the verified pre-mutation content (never a whole-file restore from HEAD over uncommitted worker changes):
If either mutation passes, the tests do not prove retention: repair them before claiming the bound.
Refuse added layers, flags, caches on caches, or indirection bought for cold-path microseconds. The bound stays a single slot plus its explicit eviction and invalidation terms.
Document precisely beside the owning contract clause: the memo retains at most one decoded block. Do not write that every identity is decoded once during the query, or that the process cannot run out of memory. Place the retention requirement with the exact eviction, reuse, fallback, ownership measurement, and mutation test names. Keep benchmark and total-memory claims separate from fetch-count and ownership evidence. Return a ledger per attempt: candidates, evidence paths, before and after owned bytes with tool and variance, behavior result, and verdict.
The bounded memo with its single-identity retention contract, release-before-replace eviction, before-and-after retained decoded ownership with tool and variance, green ownership and query regressions, both mutation results with restored source hashes, and the exact test names beside the owning clause. On failure, the precise blocked, reverted, or non-win state with measurements and the exact blocker. Never a total-process memory bound.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub gosuda/dstack-skills --plugin dstack-performance8 skills in this plugin
/cpu-kernel-authoringUse when writing, optimizing, or benchmarking a C++ CPU kernel with AVX2 or AVX512 intrinsics for the Hugging Face kernels ecosystem. Not for CUDA kernels./fastoptUse when a suspected hot path needs read-only hypotheses and benchmark designs, without waiting for benchmarks and without a code change. Not for a single measured fix: use optimize. Not for estimated hot and cold analysis: use fastopt-extreme. Not for measured-floor campaigns: use optimize-extremely./fastopt-extremeUse when estimating hot paths and proposing complexity-neutral cold simplifications while refusing complexity theater. Not for hypothesis-only hot paths: use fastopt. Not for measured-floor campaigns: use optimize-extremely./heaptrackUse when tracking heap allocations on Linux with heaptrack: allocation hotspots, peak heap, temporary allocations, leaks, or a diff of two runs via heaptrack_print. Not for heap errors./optimizeUse when one named path or performance symptom needs a single measured fix. Not for read-only hot-path hypotheses: use fastopt. Not for a full measured-floor campaign: use optimize-extremely./optimize-extremelyUse when a named subsystem must be made as fast as possible through a measured-floor campaign. Not for a single bottleneck fix: use optimize. Not for read-only analysis: use fastopt or fastopt-extreme.Other plugins' skills for the same job