Skip to content

refactor(pyc): unify zero-count primitive family - #38

Merged
zhoubot merged 1 commit into
codex/pyc-count-leading-zeros-primitivefrom
codex/pyc-zero-count-family
Sep 5, 2026
Merged

refactor(pyc): unify zero-count primitive family#38
zhoubot merged 1 commit into
codex/pyc-count-leading-zeros-primitivefrom
codex/pyc-zero-count-family

Conversation

@zhoubot

@zhoubot zhoubot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep simple public count_leading_zeros and count_trailing_zeros helpers
  • unify canonical ACIR and PYC into one count_zeros operation with verified static leading|trailing direction
  • freeze direction in QueueGraph plans and select the corresponding gfsim helper during C++ generation
  • replace the leading-only gfsim block with one CountZeros<Width, Direction> SimQueue template plus readable aliases
  • replace the leading-only RTL with one repository-owned BSD-3-Clause balanced tree parameterized by DIRECTION_LOW
  • emit two manifest bindings of one implementation identity; width and source selection remain fail closed

Decision

Decision 0166 records that direction is a semantic compile-time parameter, not a second implementation-specific API or runtime value.

Validation

  • pre-commit run
  • pytest tests/unit -m unit — 23 passed
  • pytest tests/system/test_primitive_selection.py -q — 16 passed
  • Agentic Python frontend/JIT/tool lane — 144 passed, 2 environment skips
  • exact Agentic CI unittest lane — 37 contracts tests plus 141 frontend tests passed (3 environment skips)
  • check-acir — 141/141
  • ACIROpsTests — 1845/1845
  • CodeGenTests — 98/98
  • GfsimTests — 252/252
  • repository contracts, IR coverage, API hygiene, and MkDocs strict — passed
  • decision-status validation — 166 rows, 0 deferred
  • independent review — APPROVE

Evidence: docs/gates/logs/20260905-pyc-zero-count-family-r1/summary.md

Stack

This PR is intentionally based on #37 and should be reviewed/merged after the earlier stacked PRs.

@zhoubot
zhoubot requested a review from xiekunpeng as a code owner September 5, 2026 02:24
@zhoubot
zhoubot merged commit c2024aa into codex/pyc-count-leading-zeros-primitive Sep 5, 2026
2 checks passed
@zhoubot
zhoubot deleted the codex/pyc-zero-count-family branch September 5, 2026 02:28
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.

1 participant