Prompt
Maintain consistency with established naming patterns and conventions throughout the codebase. This includes matching enum names with their value prefixes, following existing API naming patterns, using consistent variable naming within similar contexts, and applying appropriate prefixes to avoid naming conflicts.
Key principles:
- Enum consistency: Match enum names with their value prefixes (e.g.,
diffusion_algforDIFFUSION_ALG_*values) - API pattern adherence: Maintain established function naming patterns (e.g.,
llama_sampler_init_*family) - Variable consistency: Use consistent naming within similar contexts (e.g.,
api_prefixinstead ofserver_prefixwhen other variables useapi_*) - Appropriate specificity: Prefer generic names when functionality isn’t specific to one implementation (
LLM_KV_MAMBA_RMS_NORMinstead ofLLM_KV_FALCON_H1_MAMBA_RMS_NORM) - Conflict avoidance: Add appropriate prefixes to prevent naming collisions (e.g.,
GGML_CPU_prefix for CPU-specific macros)
Example:
// Good: Enum name matches value prefix
enum diffusion_alg {
DIFFUSION_ALG_ORIGIN = 0,
DIFFUSION_ALG_MASKGIT_PLUS = 1,
};
// Bad: Enum name doesn't match value prefix
enum diffusion_algorithm {
DIFFUSION_ALG_ORIGIN = 0,
DIFFUSION_ALG_MASKGIT_PLUS = 1,
};