repo-test-develop

Guides test framework setup and test case development for Ascend C operator repositories.

Updated Sep 15, 2026
One-click install
npx skills add https://github.com/WangWindow/CANN-BatchMatMulMaxsum --skill repo-test-develop-wangwindow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: repo-test-develop
Source: https://github.com/WangWindow/CANN-BatchMatMulMaxsum/tree/main/.agents/skills/repo-test-develop
Command: npx skills add https://github.com/WangWindow/CANN-BatchMatMulMaxsum --skill repo-test-develop-wangwindow

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Developing tests for Ascend C NPU operators requires deciding how to build golden references, design graded functional cases, complete white-box coverage, and run precision and performance evaluation, with different procedures depending on whether an external evaluation suite exists. ## Core Features & Use Cases - Dual-mode test engineering: Routes work into Mode A (align with an existing evaluation suite's golden/cases/prototype contract) or Mode B (self-build golden, cases, and run.sh harness). - Black-box and white-box case design: Provides factor decomposition, L0/L1/L2 grading, boundary and special-value coverage, plus source-code-driven branch enumeration for tail blocks, non-aligned DataCopyPad, and tilingkey paths. - Precision and performance standards: Defines authoritative precision assertions per dtype, golden homologous-truncation discipline, msprof-based profiling, and HAP scoring interpretation. - Use Case: When implementing a BatchMatmulMaxSum operator on Ascend NPU, load this Skill to verify evaluation-suite case coverage, add white-box cases for unaligned tails, and run precision checks against the FP64 golden. ## Quick Start Load the repo-test-develop skill to design graded test cases and set up the precision test harness for my Ascend C operator.

Frequently Asked Questions about repo-test-develop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design test cases for an Ascend C operator?

Decompose each input and attribute into orthogonal factors like dtype, shape, format, and value range, then apply single-factor coverage for L0, pairwise combination for L1, and one case per anomaly scenario for L2. Include boundary shapes, non-aligned tails, and special values like inf and nan.

What is the difference between Mode A and Mode B test development?

Mode B means no evaluation suite exists, so you self-build the golden, cases, and run.sh harness. Mode A means an evaluation suite provides golden, cases, and operator prototypes, so your job is aligning to its contract, checking case coverage, and adding white-box cases only.

How do I write white-box test cases for operator kernels?

Enumerate all live branches from the kernel Process control flow and host tiling code, such as tail blocks, non-aligned DataCopyPad, multi-core boundaries, and tilingkey dispatches. Then reverse-solve shapes and dtypes that trigger each branch, and record a branch coverage report.

What precision tolerances apply to FP16 and BF16 operator tests?

Default standards are rtol/atol of 1e-5 for FP32, 1e-3 for FP16, and 1e-2 for BF16, with authoritative values taken from the ops-precision-standard skill. In Mode A, the evaluation framework's own judgment criteria are the final arbiter and override self-built tolerances.

Why must the golden reference apply the same truncation as the device kernel?

Because the device quantizes or truncates inputs, the golden must apply identical processing to the same data, such as rounding then clamping integers or rounding each operand to fp16/bf16 before computing. Otherwise precision comparisons produce false mismatches.

When should I reuse the ascendc-st-design engine instead of manual case design?

Use it when the operator has many parameters, complex dependencies or broadcasting, and you need an auditable coverage report. For simple elementwise operators, manual factor-based design following the documented steps is lighter and sufficient.