Repository navigation
[IR] 建立规范化资源接口与事务阶段契约 - #363
Conversation
zhoubot
left a comment
There was a problem hiding this comment.
Reviewed PR #363 head b69202a with its full diff and all review/comment/thread surfaces. Independent resource review and independent core-boundary tests found no remaining actionable defect.
Fixed an integration regression in prerequisite #366 (merged as c220222): the new normal instance printer caused three void-module tests from #364 to count zero children. Only two text filters changed; exact callee, instance-count, result and execution checks remain.
Fresh verification of the combined candidate 19fcf70b3a00e32ac47dbb7e723dfd438cdb0aac, tree 55cbb4999cdd2bd5aad5df99a34b08969e61d6e2, built and installed from its own checkout with LLVM/MLIR 22.1.8 and lit 18.1.8:
- bash tools/run_api_tests.sh --tier gate: PASS 25/25.
- bash tools/run_examples.sh --tier gate: PASS 13/13.
- python -m pytest -q tests/system/test_void_module_results.py: PASS 30/30 (previously three reproduced failures).
- New transactional lit: PASS 5/5; anchor tests PASS.
- Independent checks: forwarded bound/export aliases, distinct allocations under CSE, reload stability, ownerless alias cycle and bound replacement rejection, both emitter boundary rejections PASS.
- Changed-file pre-commit (CI hook selection), mkdocs build --strict, git diff --check: PASS.
No transaction execution/lowering capability is claimed. Nightly/long mutation matrices were not run. Implementation/integration, independent resource testing and independent review used separate instances; children inherited session model/effort without override. Raw receipts remain locally under docs/gates/logs/20261027-review-pr363/; this review supplies the remotely readable outcome summary.
Summary
为 issue #361 建立正式 ACIR v2 资源与阶段基础。后续 Rule/Method 和 link 需要一致地回答:资源由谁分配、输出由谁提供、导出是否复制,以及实例是否已闭合。本 PR 将这些规则放入正式 Dialect,复用实验分支的结构验证模式;不增加另一条 frontend。
linked仅表示资源/实例结构闭合,不代表事务可执行。Python 默认入口、Runtime 和后端生成未切换。Change type
Related issues
Related to #361。PR-01,无前置实现 PR,不关闭整个 issue。
feat/transactional-acir-gfsim是复用来源,不是语义权威。Changes
primitive<T>、state<T>、queue<T>和module_ref<@M>。State/Queue 显式分配并保留身份;Queue 深度属于分配配置;实例引用不创建实例。output_kinds区分外部提供的bound和导出已有资源的export,打印明确显示inputs(...) bound(...)。主要修改所有者为 IR/Dialect、旧路径接纳边界、测试适配器和文档。编译器逻辑在本轮精简中未改变。PR 总新增行数从 2022 减至 1019;保留契约文档
docs/development/transactional-resource-ir.md。Validation
当前提交:
b69202aa8f63a89d81f23f0839e317009850d852;基线:b986bb0ad721bc0834a71fc710dddca4bde339f4。使用本 checkout 构建的 Clang/LLVM/MLIR 22.1.8 工具链,通过pyc6/scripts/run.sh执行:mkdocs build --strictgit diff --cached --check本轮运行:
ctest --test-dir .pycircuit_out/local-clang22/build -R '^(ACIRLitGateTests|ACIRAnchorArtifactTests)$' --output-on-failure --no-tests=error;SKIP=pyc-api-hygiene pre-commit run --files <PR changed files>。精简前同一编译器实现已通过完整 API gate 25/25 和新消费者目录 example gate 13/13,包括既有 C++/RTL/四态回归;本轮未重复整个硬件矩阵。旧版本远端 Python Checks 的 Black 失败已修复,当前远端 CI 以 checks 为准。
NOT RUN:新事务契约执行仿真(本批无执行 lowering)、nightly/长 oracle/变异矩阵、非 gate 历史 helper 执行。原始日志与两个版本的审查记录保留在本地忽略目录
docs/gates/logs/20261027-pr01-resources/;上表是远端可读摘要,不将本地路径冒充公开 artifact。Review checklist
Reviewer notes
本地独立审查已完成,最后一项等待当前远端 CI。实现与测试由不同实例负责;独立架构/审查使用
gpt-6-astra,其余实例继承会话模型/effort,未显式 override。本轮独立审查确认核心意图保留,并按用户最新要求移除边缘矩阵,未以减少覆盖宣称额外能力。后续:PR-02 Rule/Method;PR-07 primitive 具体化、实际绑定和默认 Queue;PR-09 泛型 Module 要求与跨文件 link。无自动 merge。