What problem does it solve? AscendC kernel developers frequently hit runtime UB out-of-bounds errors (errno 507035, VEC instruction error) because LocalTensor subview offsets computed at runtime are silently accepted by the compiler but rejected by vector intrinsics at execution. This Skill documents the compile-time offset invariant, legal subview sources, and safe rewrite patterns for multi-row batching and per-row processing. ## Core Features & Use Cases - Subview legality rules: Distinguishes compile-time constant offsets (constexpr, macros, unrolled loops) from illegal runtime offsets (tiling fields, block_idx, loop variables) for vector intrinsic operands. - Batched per-row rewrite patterns: Provides three legal alternatives for softmax/layernorm/RMSNorm batching: per-row Alloc/Free cycles, WholeReduceMax with mask/repeatTimes over flattened rows, and compile-time fixed batch sizes. - UB aliasing and failure diagnosis: Explains non-overlap requirements for intrinsic operands and maps symptoms (errno 507035, NaN corruption, flaky results) to root causes. - Use Case: When a batched softmax kernel crashes with 'ub address out of bounds' after introducing inLocal[r * paddedD], use this Skill to rewrite the loop with per-row queue cycles or a single WholeReduceMax call with repeatTimes. ## Quick Start Ask the assistant to review your AscendC kernel for illegal LocalTensor subviews and rewrite any runtime-offset slicing into the safe per-row or repeat-based patterns.