What problem does it solve?
Developers modifying LuisaCompute's AST layer need to understand how variable read/write usage is tracked and propagated through expressions, FunctionBuilder, and builtin CallOp calls, which is scattered across many headers and source files.
Core Features & Use Cases
- Usage Marker Reference: Explains the two-layer design of per-expression usage caches and FunctionBuilder's per-variable usage storage, including RefExpr forwarding rules.
- CallOp Marking Rules: Documents which builtin CallOps mark argument 0 as WRITE versus the default all-READ behavior, plus external and custom callable propagation.
- Extension Guides: Provides step-by-step checklists for adding new CallOps, expressions, and statements, including which backend codegen files must be updated (CUDA, Metal, HLSL, SPIR-V, LLVM CPU, XIR).
- Use Case: When adding a new write-style builtin operation, consult the skill to update the CallOp enum, CallExpr::_mark() switch, validation in op.cpp, and each backend's codegen switch.
Quick Start
Ask the assistant to explain how usage marking works for a specific CallOp or to walk through adding a new builtin operation to the LuisaCompute AST.