Rule Schema【免费下载链接】cannbot-skillsCANNBot 是面向 CANN 开发的用于提升开发效率的系列智能体本仓库为其提供可复用的 Skills 模块。项目地址: https://gitcode.com/cann/cannbot-skillsgrammar_rules.yamlandconstraint_rules.yamlare the source of truth for syntax-rewrite rules and migration constraint rules.The Markdown files remain human-readable browse views:grammar.mdconstraints.mdUpdate the YAML files first. Keep the Markdown views aligned afterward.grammar_rules.yamlUsegrammar_rules.yamlto record syntax-level rewrite rules for CUDA source code that must be adjusted for Ascend C SIMT.Record Structure- rule_id: assert-header pattern: assert category: debug status: required action: include_header cuda_form: assert(...) ascend_form: #include utils/debug/asc_assert.h note: Add the Ascend SIMT assert header when assert is used. source: - reference/grammar.md reviewed_by: human reviewed_at: 2026-04-06Field Definitionsrule_idRequired.Unique identifier for the rule.Use lowercase letters, digits, and hyphens.patternRequired.The CUDA syntax pattern or construct this rule applies to.categoryRequired.Suggested values:debugmemory-spaceheadersyntaxstatusRequired.One of:required: a fixed rule that must be appliedrewrite-required: syntax must be transformedconditional: only applies in specific situationsunknown: rule not fully confirmed yetactionRequired.One of:include_headersyntax_replacecheck_docsmanual_reviewcuda_formRequired, may be empty.Short representation of the CUDA-side form.ascend_formRequired, may be empty.Short representation of the Ascend-side form.noteRequired, may be empty.Brief explanation of the rule or its scope.sourceRequired.List of references that justify the rule.reviewed_byRequired, may be empty.human,agent, or a more specific reviewer label.reviewed_atRequired, may be empty.ISO date string.Maintenance RulesAdd a new rule when the syntax transformation is reusable across operators.Do not encode one-off operator-specific hacks as global syntax rules.If the rewrite rule is uncertain, keepstatus: unknownorstatus: conditional.Prefer shortcuda_formandascend_formexamples over long code blocks.constraint_rules.yamlUseconstraint_rules.yamlto record unsupported or restricted features in the current migration model.Record Structure- rule_id: cooperative-groups feature: Cooperative Groups category: execution-model status: unsupported action: stop_and_report workaround: note: No workaround in the current migration model. source: - reference/constraints.md reviewed_by: human reviewed_at: 2026-04-06Field Definitionsrule_idRequired.Unique identifier for the constraint rule.Use lowercase letters, digits, and hyphens.featureRequired.Human-readable name of the constrained feature.categoryRequired.Suggested values:graphicsexecution-modelmemory-modelperformance-modelcompilationdata-typebuildstatusRequired.One of:unsupported: the feature has no direct migration support in the current model; useactionto distinguish blocking features from removable unsupported subpathsrestricted: only usable with a workaround or limitationconditional: support depends on context or extra confirmationunknown: not fully investigated yetactionRequired.One of:stop_and_report: the selected migration path cannot continueremove_and_record: remove or exclude the unsupported source subpath, record the exclusion, and continue only if supported behavior remainsmanual_implementationcheck_docsmanual_reviewworkaroundRequired, may be empty.The accepted workaround when one exists.noteRequired, may be empty.Brief explanation of the constraint.sourceRequired.List of references that justify the rule.reviewed_byRequired, may be empty.human,agent, or a more specific reviewer label.reviewed_atRequired, may be empty.ISO date string.Maintenance RulesUseunsupportedonly when the feature itself has no direct migration support in the current migration model.Useaction: stop_and_reportfor blocking unsupported features that prevent the selected migration path from continuing.Useaction: remove_and_recordfor unsupported subpaths that may be removed or excluded while preserving supported source-visible behavior.Userestrictedwhen a workaround exists but carries limits or extra migration work.If the rule still needs confirmation, useconditionalorunknown; do not overstate support.Keep workarounds short in YAML and move long explanations to Markdown if needed.General Update WorkflowWhen a human or agent updates rule references:Update the relevant YAML file first.Keeprule_idstable once introduced.Add or revisesource,note, andreviewed_at.Sync the Markdown browse view if the rule meaning changed.【免费下载链接】cannbot-skillsCANNBot 是面向 CANN 开发的用于提升开发效率的系列智能体本仓库为其提供可复用的 Skills 模块。项目地址: https://gitcode.com/cann/cannbot-skills创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考