Skip to main content

add-invariant

Add a new trace invariant (INV-XXX) to the LPDDR5 validation suite — documents it in INVARIANTS.md, implements the check in trace_validator.py, and wires it into validate(). Use when a new trace bug class is discovered and needs a permanent guard.

ソース情報

リポジトリ
stillwater-sc/kpu-sim
ソースの最終更新活動
2026年9月20日 01:09
検出された SKILL.md の言語
英語
スター
2
フォーク
3

インストール方法

デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。

ソースファイルを確認

インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。

SKILL.md を表示中

SKILL.md
ソースの指示 · 読み取り専用プレビュー
name
add-invariant
description
Add a new trace invariant (INV-XXX) to the LPDDR5 validation suite — documents it in INVARIANTS.md, implements the check in trace_validator.py, and wires it into validate(). Use when a new trace bug class is discovered and needs a permanent guard.
# Adding a New Invariant Migrated out of CLAUDE.md so it loads only when an invariant is actually being added. ## Existing invariants **Do not keep a copy of the list here.** `patterns/memory/lpddr5/INVARIANTS.md` is authoritative for definitions, and `trace_validator.py`'s `validate()` is authoritative for what is actually enforced. The two already differ — the validator registers 8 IDs while INVARIANTS.md documents 13 — so a third copy in this skill would only add a way to pick a duplicate ID. Before choosing an ID, read both: ```bash grep -oE 'INV-[0-9]+' patterns/memory/lpddr5/INVARIANTS.md | sort -u # documented grep -oE "invariant='INV-[0-9]+'" patterns/memory/lpddr5/common/trace_validator.py | sort -u # enforced ``` Ranges in use, per INVARIANTS.md's own sections: `INV-0xx` trace structure, `INV-1xx` timing constraints, `INV-2xx` visualization. Pick the next unused number in the right range. ## Steps 1. Document in `patterns/memory/lpddr5/INVARIANTS.md` with: - Unique ID (INV-XXX) - Description - Rationale - Validation logic - Failure example - Fix hint 2. Implement in `patterns/memory/lpddr5/common/trace_validator.py`: ```python def _check_inv_xxx_name(self): """INV-XXX: Description.""" # Validation logic if violation_detected: self.violations.append(Violation( invariant='INV-XXX', severity=Severity.ERROR, message="...", fix_hint="..." )) ``` 3. Add the new check to the validator's `validate()` method. 4. Re-run the validator over every existing trace (`/trace-check`) to confirm the new invariant doesn't false-positive on known-good traces.
GitHubで見る