Instruction file imported from shifulegend/project-zero (
.github/instructions/core.instructions.md). Copyright stays with the author.
Copilot scoped rules: core engine (adapter for docs/ai/engineering-rules.md)
- Small single-responsibility TUs;
src/<area>/x.c⇄include/<area>/x.h. Reusesimd_dispatch, GGUF reader,tn_aligned_*,tn_size_mul*,tn_get_free_ram. - No hardcoding: shape/tokens/quant/RoPE/MoE from GGUF metadata (
hdr->archprefix). - Memory safety:
memsetstructs before partial init; overflow-checked size math; 64-byte aligned SIMD buffers; trap absurd allocations deterministically (not via malloc-NULL). - Cross-platform: AVX2..VNNI / NEON+dotprod / scalar all compile;
TN_HAS_*gates; portableTN_PREFETCH_T1. - No new
-Wall -Wextra -Wpedanticwarnings; keep ASan/UBSan green. - Any bug found gets fixed in the same pass, even if pre-existing/unrelated to the task — log it
in
mistakes.mdtoo, but that's not a substitute for fixing. Only defer for genuinely large architectural fixes, and flag those to the user explicitly. Seeengineering-rules.md§ Bug-fix policy.