Skip to content

refactor(build): drop SIMPLER_PTO_ISA_COMMIT override channels#1218

Merged
ChaoZheng109 merged 1 commit into
hw-native-sys:mainfrom
yanghaoran29:down_spic
Jul 1, 2026
Merged

refactor(build): drop SIMPLER_PTO_ISA_COMMIT override channels#1218
ChaoZheng109 merged 1 commit into
hw-native-sys:mainfrom
yanghaoran29:down_spic

Conversation

@yanghaoran29

@yanghaoran29 yanghaoran29 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Follow up #1196: now that managed pto-isa defaults to pto_isa.pin, the CMake define and Python env override channel SIMPLER_PTO_ISA_COMMIT is redundant with the pin-as-single-source-of-truth model. This PR drops only that channel.

Scope clarification: the CI's PTO_ISA_COMMIT mechanism is kept. The read-pto-isa action still reads pto_isa.pin and exports it as PTO_ISA_COMMIT, and the scene/UT steps still pass --pto-isa-commit ${{ env.PTO_ISA_COMMIT }} so host_runtime.so and the test-time kernels stay on one pto-isa revision (issue #1067). Only the SIMPLER_PTO_ISA_COMMIT half of the resolution tier is removed.

  • pto_isa.py: resolve_pto_isa_commit no longer falls back to the SIMPLER_PTO_ISA_COMMIT env var; CLI > pin only.
  • CMakeLists.txt: drop the SIMPLER_PTO_ISA_COMMIT cache variable and the --pto-isa-commit forwarding to build_runtimes.py.
  • ci.yml: the four onboard install steps lose the cmake.define.SIMPLER_PTO_ISA_COMMIT override and fall through to the pin default (which read-pto-isa exports as PTO_ISA_COMMIT); the --pto-isa-commit pytest passes are retained.
  • getting-started.md / developer-guide.md: document PTO_ISA_ROOT and manual build_runtimes.py --pto-isa-commit as the install-time override path (the CMake define is gone).
  • test_pto_isa.py: rewrite env-priority cases to CLI + pin.

Install/run override still available via --pto-isa-commit CLI (run-time), PTO_ISA_ROOT, or manual build_runtimes.py --pto-isa-commit (install-time).

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 40838e29-4089-4dc0-8883-4e79c0f0c56d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Removes SIMPLER_PTO_ISA_COMMIT environment variable and explicit --pto-isa-commit argument wiring from CI workflows, CMakeLists.txt, and resolve_pto_isa_commit(). All components now default to pto_isa.pin for PTO-ISA commit selection; CI jobs add --clone-protocol https/ssh flags instead. Tests and docs updated accordingly.

Changes

Remove SIMPLER_PTO_ISA_COMMIT, rely on pto_isa.pin

Layer / File(s) Summary
resolve_pto_isa_commit: remove env fallback
simpler_setup/pto_isa.py
Removes SIMPLER_PTO_ISA_COMMIT env fallback from resolve_pto_isa_commit(); requested is now set directly from the commit argument. Updates ensure_pto_isa_root() resolution order comment to list --pto-isa-commit as step 2.
CMakeLists.txt: remove SIMPLER_PTO_ISA_COMMIT cache option
CMakeLists.txt
Removes the SIMPLER_PTO_ISA_COMMIT cache option and the conditional _pto_isa_commit_arg from the build_runtimes custom target; only SIMPLER_PTO_CLONE_PROTOCOL and SIMPLER_SANITIZER remain.
CI/sanitizer workflows: drop --pto-isa-commit, add --clone-protocol
.github/workflows/ci.yml, .github/workflows/sanitizers.yml
Removes SIMPLER_PTO_ISA_COMMIT pip pinning and --pto-isa-commit ${{ env.PTO_ISA_COMMIT }} from all sim, onboard, and hardware test jobs. Adds --clone-protocol https/ssh and --enable-* DFX flags.
Unit tests: replace env-based assertions with pin mocks
tests/ut/py/test_pto_isa.py
Removes monkeypatch.delenv("SIMPLER_PTO_ISA_COMMIT") from multiple tests; rewrites resolve_pto_isa_commit tests for pin-based precedence; replaces env-based runtime compatibility tests with read_pto_isa_pin mock and a new missing-pin rejection test.
Docs: update PTO-ISA resolution and build instructions
docs/getting-started.md, docs/developer-guide.md
Updates checkout selection order, removes CMake define approach, and documents build_runtimes.py --pto-isa-commit / PTO_ISA_ROOT as alternatives; clarifies compatibility-check fallback uses pto_isa.pin.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related issues

Possibly related PRs

Poem

🐇 Hoppity-hop, no more commit to pin by hand,
The pto_isa.pin file takes command!
No env vars lurking in the CI queue,
Just --clone-protocol to see us through.
The rabbit cheers: less flags, more peace —
Let pinned defaults bring sweet release! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: removing the SIMPLER_PTO_ISA_COMMIT override channels.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description is clearly about the PTO-ISA override refactor and names the same affected files and tests as the changeset.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request removes the SIMPLER_PTO_ISA_COMMIT environment and CMake variables, simplifying the resolution order for the pto-isa repository checkout and updating the documentation and tests accordingly. The review feedback highlights opportunities to clean up the unit tests by removing unused monkeypatch fixtures and mocks, as well as deleting a redundant test case that is already covered by a parametrized test.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread tests/ut/py/test_pto_isa.py Outdated
Comment thread tests/ut/py/test_pto_isa.py Outdated
Comment thread tests/ut/py/test_pto_isa.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/getting-started.md (1)

188-188: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Remove stale PTO_ISA_COMMIT reference.

The parenthetical "(CI PTO_ISA_COMMIT)" is outdated—CI no longer uses that variable since this PR removes SIMPLER_PTO_ISA_COMMIT wiring from workflows. The trigger is now the pto_isa.pin file itself. Consider rephrasing to "Pinned pto-isa commit changes" or similar.

Also, "set PTO_ISA_ROOT at a pre-checked-out clone" should be "set PTO_ISA_ROOT to a pre-checked-out clone".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/getting-started.md` at line 188, The getting-started docs still refer to
the obsolete CI `PTO_ISA_COMMIT` variable, so update the wording around the
`pto_isa.pin` change trigger to remove that reference and describe it as pinned
pto-isa commit changes instead; also fix the `PTO_ISA_ROOT` guidance in the same
section to say it should be set to a pre-checked-out clone, using the existing
documentation text near the ASCEND_HOME_PATH example as the location cue.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 232-247: Add --require-pto-isa to each DFX smoke pytest invocation
in the CI workflow so these jobs fail immediately when PTO-ISA cannot be
resolved or cloned; update the affected smoke steps (for example the
l2_swimlane, PMU, and args_dump commands) to pass this flag alongside the
existing pytest options, matching the behavior used by the main scene-test jobs.

In `@docs/developer-guide.md`:
- Line 188: Update the pto-isa rebuild guidance in the developer guide to remove
the stale CI environment variable reference in the “Pinned pto-isa commit” note,
since the source of truth is now the pto_isa.pin default rather than a CI
override; also reword the PTO_ISA_ROOT guidance in that same entry to use “to”
or “point ... to” instead of “at” for the pre-checked-out clone. Keep the change
localized to the table row that mentions pto_isa.pin, PTO_ISA_ROOT, and
build_runtimes.py.

---

Outside diff comments:
In `@docs/getting-started.md`:
- Line 188: The getting-started docs still refer to the obsolete CI
`PTO_ISA_COMMIT` variable, so update the wording around the `pto_isa.pin` change
trigger to remove that reference and describe it as pinned pto-isa commit
changes instead; also fix the `PTO_ISA_ROOT` guidance in the same section to say
it should be set to a pre-checked-out clone, using the existing documentation
text near the ASCEND_HOME_PATH example as the location cue.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e849e8b9-4aba-4c93-9c6a-263445470ed8

📥 Commits

Reviewing files that changed from the base of the PR and between 9e0140c and bdcce30.

📒 Files selected for processing (7)
  • .github/workflows/ci.yml
  • .github/workflows/sanitizers.yml
  • CMakeLists.txt
  • docs/developer-guide.md
  • docs/getting-started.md
  • simpler_setup/pto_isa.py
  • tests/ut/py/test_pto_isa.py
💤 Files with no reviewable changes (1)
  • CMakeLists.txt

Comment thread .github/workflows/ci.yml Outdated
Comment thread docs/developer-guide.md
@yanghaoran29 yanghaoran29 force-pushed the down_spic branch 2 times, most recently from 9cfe82e to f12a51f Compare June 30, 2026 13:13
Follow up hw-native-sys#1196: now that managed pto-isa defaults to pto_isa.pin, the
CMake define and Python env override channel (SIMPLER_PTO_ISA_COMMIT)
is redundant with the pin-as-single-source-of-truth model. Drop only
that channel; keep the CI's PTO_ISA_COMMIT pinning (read-pto-isa exports
pto_isa.pin as PTO_ISA_COMMIT, which the scene/UT steps still pass via
--pto-isa-commit to keep host_runtime.so and test kernels on one
revision, issue hw-native-sys#1067).

- pto_isa.py: resolve_pto_isa_commit no longer falls back to the
  SIMPLER_PTO_ISA_COMMIT env var; CLI > pin only.
- CMakeLists.txt: drop the SIMPLER_PTO_ISA_COMMIT cache variable and
  the --pto-isa-commit forwarding to build_runtimes.py.
- ci.yml: the four onboard install steps lose the
  cmake.define.SIMPLER_PTO_ISA_COMMIT override and fall through to the
  pin default (== PTO_ISA_COMMIT); the --pto-isa-commit pytest passes
  are retained.
- getting-started.md / developer-guide.md: document PTO_ISA_ROOT and
  manual build_runtimes.py --pto-isa-commit as the install-time override
  path (the CMake define is gone).
- test_pto_isa.py: rewrite env-priority cases to CLI + pin.

Install/run override still available via --pto-isa-commit CLI (run-time),
PTO_ISA_ROOT, or manual build_runtimes.py --pto-isa-commit (install-time).
@ChaoZheng109 ChaoZheng109 merged commit 9239a11 into hw-native-sys:main Jul 1, 2026
16 checks passed
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