refactor(agentic): decompose queue frontend foundations and lowering - #148
Conversation
|
已推送 Queue parser 第一轮内部拆分,PR head 已从 本轮新增三个可独立审阅和回退的提交:
完成内容:
最终验证:
完整 CLI lane 仍报告本机环境/已有构建库存问题:48 passed、6 failed、2 errors、1 skipped。失败集中于 linux-aarch64 SDK planning 未支持、staged runtime fixture 仍含 LLVM header,以及本地 native extension 的 module inventory/order 与当前源码不一致;没有失败指向本轮 parser/handler 文件。 本轮保持纯结构重构,不改变 Python 语法、QueueProgram、诊断文本、ACIR 或 GFSim C++ 语义,也未触及 dialect/pass/verifier/backend,因此未扩大到 G1/G2/Verilator。 |
zhoubot
left a comment
There was a problem hiding this comment.
Re-reviewed at 7f8cd41. Independent code review: APPROVE; architectural status: CLEAR. The legacy facade compatibility blocker, package-wide type-rendering boundary, and dead extraction aliases are fixed. Frontend 410/410 (5 skipped), contracts 57/57, unit 147/147, import-order 21/21, differential lowering 217/217, and both required G0 checks pass.
Summary
_queue_compilerpackage: source/provenance helpers, AST normalization, immutable model definitions, static type analysis, ACIR text rendering, expression emission,QueueProgram -> raw ACIRlowering, parser state/context, module specialization, and ordered Queue/Memory/Table/Slot/endpoint statement handlers_queue_frontend.pyas the compatibility and source-lowering facade_queue_frontend.pyfrom about 19,700 lines to under 200 lines without redesigning parsing or semanticsIssue #147 Progress
This PR completes the mechanical extraction through source/normalization, model/static types, expression/lowering, explicit parser state/context, resource statement handlers, and module orchestration.
Still intentionally deferred:
Lowering consumes the captured
QueueProgramand its stored expression ASTs; it does not reparse Python source or recompute parser effects.pyc6 Decision / Contract Impact
Review Fixes
_queue_compiler/type_rendering.py.mlir()is called only through_render_typesource_framecompatibility re-exportValidation
The one native JIT frontend case also passed when pointed at the current
acir-optandacir-queue-cxxgentools. Release-only AC G1/G2, Verilator, and release closure remain outside this Python-only refactor PR.Risk / Compatibility
_queue_compilerimplementation modules through__module__; wrapper copies are not createdRelated Issues