add-reference-tests

Generate and validate pytest-based reference tests for flashinfer_trace definitions against FlashInfer or SGLang ground truth.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Rockyeast/flashinfer-trace-dev --skill add-reference-tests-rockyeast
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-reference-tests
Source: https://github.com/Rockyeast/flashinfer-trace-dev/tree/main/.claude/skills/add-reference-tests
Command: npx skills add https://github.com/Rockyeast/flashinfer-trace-dev --skill add-reference-tests-rockyeast

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates the creation and validation of reference tests for flashinfer_trace definitions, ensuring reference implementations align with ground-truth kernels from FlashInfer or SGLang.

Core Features & Use Cases

  • Generates pytest-based test scaffolds under flashinfer_trace/tests/references/
  • Discovers definitions by op_type or name, and supports testing all relevant definitions
  • Validates reference implementations against ground-truth kernels with configurable tolerances, shapes, and dtypes
  • Integrates with existing tooling to verify correctness and consistency when adding new kernels

Quick Start

Run /add-reference-tests --op-type mla_paged to generate tests for MLA paged definitions and execute them with pytest.

Frequently Asked Questions about add-reference-tests

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

FAQPage Schema
How do I automate pytest test generation for flashinfer_trace reference implementations?

Generate pytest scaffolds for flashinfer_trace by targeting a specific op_type or all definitions under flashinfer_trace/definitions, placing new tests in flashinfer_trace/tests/references/ while skipping existing ones.

What is reference testing for FlashInfer or SGLang kernel definitions?

Reference testing validates flashinfer_trace definitions against FlashInfer or SGLang ground-truth kernels by verifying constants, input shapes, and numerical correctness across multiple sources using configurable tolerances and dtypes.

Do I need to clone repos before generating reference tests for flashinfer_trace?

Yes, you must complete the clone-repos step before generating reference tests, because the validation process requires accessing ground-truth kernels from FlashInfer or SGLang to compare against your local definitions.

Can I test all flashinfer_trace definitions at once instead of targeting a single op_type?

Yes, you can test all relevant definitions at once by running the command without a specific op_type filter, which discovers all definitions under flashinfer_trace/definitions and generates corresponding pytest files for each.

Does generating new reference tests overwrite existing pytest files in flashinfer_trace?

No, generating new reference tests skips existing files in flashinfer_trace/tests/references/ and only creates scaffolds for definitions that lack a corresponding test file, preserving your previously written or modified tests.

What is the best way to validate numerical correctness of flashinfer_trace definitions against ground truth?

The best way to validate numerical correctness is using pytest-based reference tests that compare your definitions against FlashInfer or SGLang ground truth with configurable tolerances, shapes, and dtypes to ensure kernel implementation alignment.