Skip to content

feat(pyc): add semantic popcount primitive - #36

Merged
zhoubot merged 3 commits into
codex/ac-stateful-rulefrom
codex/pyc-popcount-primitive
Sep 5, 2026
Merged

feat(pyc): add semantic popcount primitive#36
zhoubot merged 3 commits into
codex/ac-stateful-rulefrom
codex/pyc-popcount-primitive

Conversation

@zhoubot

@zhoubot zhoubot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add vendor-neutral pyc.popcount with exact max(1, ceil(log2(N+1))) result width
  • expose the same semantic operation through structural pyCircuit, Cycle-Aware Signal, and Agentic Circuit
  • lower Agentic ACIR to one PYC operation and provide typed gfsim helper/SimQueue behavior
  • select a digest-verified repository-owned BSD-3-Clause RTL candidate only in the Verilog backend
  • use a padded balanced adder tree so implementation depth matches the logarithmic MLIR cost model
  • remove the legacy Agentic hard-coded popcount Verilog path; no Solderpad source from PR feat(runtime): integrate Verilog crawler and catalog #29 is imported or relicensed

Decisions

  • Decision 0161: qualified RTL selection remains backend-owned and fail closed
  • Decision 0164: population count is a semantic PYC primitive

Validation

  • pre-commit run
  • pytest tests/unit -m unit — 20 passed
  • pytest tests/system/test_primitive_selection.py -q — 11 passed
  • Agentic Python focused lane — 142 passed, 2 skipped
  • check-acir — 140/140
  • ACIROpsTests — 1845/1845
  • CodeGenTests — 97/97
  • GfsimTests — 251/251
  • repository contracts and API hygiene — passed
  • mkdocs build --strict — passed
  • decision-status validation — 164 rows, 0 deferred

Evidence: docs/gates/logs/20260905-pyc-popcount-rtl-r1/summary.md

Stack

This PR is intentionally based on #35 (codex/ac-stateful-rule) and should be reviewed/merged after the earlier stacked PRs.

@zhoubot
zhoubot merged commit c377d18 into codex/ac-stateful-rule Sep 5, 2026
2 checks passed
@zhoubot
zhoubot deleted the codex/pyc-popcount-primitive branch September 5, 2026 02:31
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