Skip to content

feat(acir): 支持同一 Table firing 的混合字段 proposal - #145

Merged
zhoubot merged 8 commits into
mainfrom
feat/issue-129-static-field-writes
Sep 16, 2026
Merged

zhoubot merged 8 commits into
mainfrom
feat/issue-129-static-field-writes

Conversation

@hmljy2020

Copy link
Copy Markdown
Collaborator

摘要

  • 允许同一条 rule firing 对同一 Table 产生字段集合不同的多个有序 proposal。
  • QueueGraph 和 GFSim 为每条 proposal 保留精确的 index/value/present/mode/field_mask footprint。
  • 整个 firing 一次性预约、取消和发布;提交时先做 field merge、再做 replace,同类写入保持源码顺序。
  • 统一 system/module-local Table、局部别名、安全 select、普通 helper 和 @ac.inline helper 的字段 provenance 推导。
  • 补齐 native、frontend、MLIR、PYC、Verilator parity、文档和 decision 证据。

依赖关系

本 PR 堆叠在 #144 上,而 #144 又依赖 #142。合并顺序必须是:#142#144 → 本 PR;请勿在 #144 之前合并本 PR。

本 PR 当前有意以 #144 的 head commit cd3d3e16(临时 upstream base ref feat/explicit-table-state)为基线,以便 review diff 只包含本次 issue #129 的改动。#142#144 合并后,应把本分支 rebase 到最新 main,并将本 PR base 改回 main

本 PR 取代 #143,请勿单独合并 #143 #143 的 proven frontend field-write 切片已被完整吸收,并进一步覆盖 module-local Table、普通/inline helper 等价性、同 owner 不同 schema 的多 proposal,以及 GFSim 逐条 footprint 原子批次。

pyc6 Decision / Contract 影响

  • 相关 Decisions:0154、0236、0243、0261、0263。
  • 同一 firing 内的两条 Table proposal 在以下任一条件成立时可以共存:索引可静态证明不同、presence 可证明互斥,或两者均为 field mode 且规范字段集合不相交。
  • 可能发生的同字段重叠,以及 replace 与其他写入的潜在重叠,继续 fail closed。
  • 所有表达式读取同一 tick-start committed snapshot;Queue/output 背压或任一 prepare 失败会取消整个 firing。
  • 运行时 field mask 继续限制为最多 64 个顶层 Entry 字段。

验证

  • 必需 PR checks:
    • G0: Python Checks
    • G0: Agentic Python Checks
  • Python frontend:404 passed,2 skipped。
  • GFSim native:257/257 passed。
  • CodeGen native:172/172 passed,覆盖 flat/structured 生成 C++ 编译。
  • Table backend:8/8 passed。
  • Table PYC C++/Verilator parity:3/3 passed。
  • 本次修改涉及的 MLIR storage-selection/branch-lowering:3/3 passed。
  • 官方 AC G2 closure:passed;本次明确跳过 G0/G1。
  • strict decision status:263 rows,0 deferred。
  • changed-file pre-commit、API hygiene、Markdown 和 whitespace checks:passed。

证据:

  • docs/gates/logs/20260916-issue129-mixed-field-writes/summary.md
  • docs/gates/logs/20260916-issue129-mixed-field-writes/agentic_circuit_summary.json
  • docs/gates/logs/20260916-issue129-mixed-field-writes/decision_status_report.json

完整 check-acir 仍保留 docs/gates/logs/20260915-issue129-static-field-writes/summary.md 已记录的 9 个无关 checkout baseline failure;本次修改和新增的 lit 测试全部通过,没有新增失败。

文档

  • 更新中英文 ACIR 规范、语言参考、Decisions 0154/0236/0243/0263,以及 Decisions 0154/0236/0243/0261/0263 的 decision-status 证据。
  • 不增加新的 Python transaction API、兼容模式或用户可见的运行时反射机制。

风险与兼容性

  • 用户可见效果:一条 rule 可以原子修改同一逻辑 Table entry 的多个不相交字段,不再需要将 entry 拆成多个状态 bank。
  • with ac.assert_disjoint(...) 和动态同字段冲突 obligation 不在本次修改内;静态无法证明安全的同字段冲突继续 fail closed。
  • 本 PR 是 stacked PR,依赖合并后必须 rebase 并切换 base。

关联

@zhoubot zhoubot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge blocker: publishPreparedBatch stores exact writes in PendingProposal::footprints, but conflictsWithPending() and conflictsWithPendingEndpoint() inspect only PendingProposal::footprint (simulator/gfsim/include/gfsim/queue_blocks.h:1836-1852,2184-2193). A later single/legacy endpoint can therefore reserve an overlapping entry/field after a batch is pending, violating fail-closed conflict and atomicity semantics. Please check both singular and vector footprints symmetrically and add batch-first/single-first overlap regressions, including replace-vs-field, disjoint controls, and queue-consumption assertions. This PR also inherits the #142 Slot activation blocker until the stack is repaired.

@zhoubot
zhoubot force-pushed the feat/issue-129-static-field-writes branch from a7ae3c6 to 132f3d9 Compare September 16, 2026 03:56
@zhoubot
zhoubot changed the base branch from feat/explicit-table-state to main September 16, 2026 03:56

@zhoubot zhoubot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed after the mixed batch/single conflict repair and selective rebase onto #142/#144. Batch footprints now participate symmetrically in pending conflict checks; 109 QueueBlocks tests, focused frontend/unit/contracts/docs/API checks, and both required G0 checks pass.

@zhoubot
zhoubot merged commit 6a24876 into main Sep 16, 2026
2 checks passed
@zhoubot
zhoubot deleted the feat/issue-129-static-field-writes branch September 16, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants