op-test

op-test is a skill for Claude Code, OpenCode from mindspore-ai/akg. It costs 113 tokens per session (4,860 once invoked), scanned A, original, Apache-2.0.

A robustness-testing tool for computational operators, which are small pieces of code that perform tensor calculations.

In plain words
What is it for?
It builds and runs varied test cases, compares results for correctness, measures performance, supports multiple devices, and produces JSON data and a Markdown report.
Why use it?
It checks whether an operator remains accurate and performs well when input shapes and data types change, including boundary and unusually shaped cases.

Skill for Claude CodeOpenCode

Written for Claude Code and OpenCode: argument-hint in frontmatter, but also installed under .opencode/.

Good fit It builds and runs varied test cases, compares results for correctness, measures performance, supports multiple devices, and produces JSON data and a Markdown report.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mindspore-ai/akg/op-test
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mindspore-ai/akg --skill op-test
Clone the repo
git clone --depth 1 https://github.com/mindspore-ai/akg

Made for: Claude Code, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for op-test

README.md
[![agentmods](https://agentmods.dev/badge/skills/mindspore-ai/akg/op-test/github.svg)](https://agentmods.dev/skills/mindspore-ai/akg/op-test)
Your own site
<a href="https://agentmods.dev/skills/mindspore-ai/akg/op-test"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/op-test/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for op-test

Your own site · 80×15
<a href="https://agentmods.dev/skills/mindspore-ai/akg/op-test"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/op-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 113 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,860 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00113 $0.04860
Opus 5 $0.00056 $0.02430
Sonnet 5 $0.00023 $0.00972
Haiku 4.5 $0.00011 $0.00486

Measured 9d ago against content hash 33e50a16c978, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

op-test scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (references/batch-robustness-test-example.py, references/robustness_test_runner.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

akg_agents/workspace/.opencode/skills/op-test/SKILL.md · 437 lines

How it starts

The opening of the file, as written. The whole thing — 437 lines — stays where its author put it; the contents beside it link to each section on GitHub.

算子鲁棒性测试


流程概览

  1. 信息收集 — 读取 task_code / kernel_code,提取 tensor 签名、维度语义、kernel 分块参数
  2. 准备环境与测试目录 — 根据用户提供的 akg_agents 路径和环境名激活环境,创建独立测试目录
  3. 编写测试脚本并运行 — 复制通用运行器 (robustness_test_runner.py),编写算子特定脚本(CONFIG + TEST_CASES + make_inputs),导入 Model / ModelNew,构造变异 shape/dtype 输入,精度验证(子进程 + 超时保护)+ 性能测试(方法与 akg_agents 仓库一致),DevicePool 支持多设备并行
  4. 分析结果与生成报告 — 输出 JSON 原始数据 + Markdown 洞察分析(失败模式聚类、性能剖面、修复建议)

Shape 变异策略

总元素数分级

根据单个 tensor flatten 后的元素数分为三级:

级别 元素数 说明
小 shape ≤ 1e3 边界和极端情况
中等 shape 1e4 ~ 1e7 常见业务场景
大 shape ≥ 1e8 大规模计算,精度累积(按显存/内存量力而行)

同一级别内 1 个代表值即可。

选值原则

  1. 每级 1 个代表:小、中、大各一个 shape
  2. 对齐边界:根据 kernel 的 BLOCK_SIZE / VECTOR_SIZE 取 BLOCK-1 和 BLOCK+1
  3. 最小边界:所有维度为 1
  4. 极端纵横比:某个维度为 1,其他维度大(如单 batch)
  5. 非 2 的幂:至少 1 个含素数或非对齐维度的 shape

典型 case 组成(8-12 个)

# 类型 说明
1 原始 shape 基准
2 小 shape ≤ 1e3 元素
3 中等 shape 1e4 ~ 1e7 元素
4 大 shape ≥ 1e8 元素(按显存/内存调整)
5 最小边界 所有维度 = 1
6 极端纵横比 某维度 = 1
7 对齐边界 BLOCK_SIZE ± 1
8 非 2 的幂 含素数维度
9+ dtype 变异 原始 shape + 不同 dtype

维度约束

  • 自由维度(如 batch_size):直接变异输入 shape
  • 参数绑定维度(如 Linear 的 in_features):需重新创建模型实例

dtype 变异策略

原始 dtype 建议测试
float32 float16, bfloat16
bfloat16 float16, float32
float16 bfloat16, float32

精度容忍度:

dtype 容忍度
float32 0.02
float16 0.004
bfloat16 0.03

执行流程

阶段 0:信息收集

读取 task_code 和 kernel_code,提取:

  1. tensor 签名:从 get_inputs()Model.forward() 确定每个输入的 shape 和 dtype
  2. 维度语义:标注每个维度(batch、reduction_axis、spatial 等)
  3. 参数约束:从 get_init_inputs() 确定哪些维度受模型参数绑定
  4. kernel 分块参数:查看 kernel 中的 BLOCK_SIZE、VECTOR_SIZE 等常量
  5. 当前验证通过的配置:shape、dtype、backend、dsl、arch

Read the full file on GitHub · 437 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 437 lines · 113 tokens per session scan A 33e50a16c978

Subscribe to this mod's changes

op-test is a skill published in the GitHub repository mindspore-ai/akg (259 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 113 tokens to every session and 4,860 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.