Skip to content

refactor: remediate Python codecheck findings in PTODSL and TileOps - #1469

Closed
Zhendong404 wants to merge 2 commits into
hw-native-sys:mainfrom
Zhendong404:codex/codecheck-gc-master
Closed

refactor: remediate Python codecheck findings in PTODSL and TileOps#1469
Zhendong404 wants to merge 2 commits into
hw-native-sys:mainfrom
Zhendong404:codex/codecheck-gc-master

Conversation

@Zhendong404

@Zhendong404 Zhendong404 commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR carries two commits:

  1. refactor: remediate Python codecheck findings in PTODSL and TileOps

    • split oversized functions/methods in lib/TileOps/a5, lib/SoftOps, ptodsl and packaging below the method-size/complexity gates
    • split ptodsl/_ast_rewrite.py into a facade plus _ast_rewrite_errors/_analysis/_normalizers/_lowering so each file stays below the file-size gate
    • bundle long argument/return lists into plan/state objects, order private class methods, and inline redundant helpers
    • restore the straight-line tload burst for contiguous dim0 loads so emitted IR stays byte-identical to the mainline
    • all changes are semantically equivalent code reorganization; DSL/TileOps/PTODSL behavior is unchanged (24 files, +5412/-4166)
  2. ci: repair GitHub mirror build checks

    • refresh the ptoas-vmi pyproject.toml.patch for the current requires-python >= 3.10 floor
    • set legacy CMake policies before include(cmake/fetch_cann_cmake.cmake) and default the CANN third-party directory into the writable CMake binary tree when unset (3 files, +22/-10)

Validation

  • python3 -m py_compile: pass
  • git diff --check: pass
  • ctest -L PTODSL -j 4: 43/43 pass (incl. ptodsl_tilelib_catalog, ptodsl_tilelib_elementwise, jit_compile, scf_while_ast, section)
  • MLIR byte-identical comparisons against the mainline for tload straight-line/loop/rank2 rendering
  • GitHub mirror build checks run on this PR

Squash of a88c7f908..d3adacdef (8 commits) into one semantically equivalent change:
- split oversized functions/methods in lib/TileOps/a5, lib/SoftOps, ptodsl and packaging below the method-size/complexity gates
- split ptodsl/_ast_rewrite.py into a facade plus _ast_rewrite_errors/_analysis/_normalizers/_lowering so every file stays below the file-size gate
- bundle long argument/return lists into plan/state objects, order private class methods, and inline redundant helpers
- restore the straight-line tload burst for contiguous dim0 loads so emitted IR matches gc/master byte-for-byte

Pure refactor; DSL/TileOps/PTODSL behavior is unchanged. Verified by ctest -L PTODSL (43/43), py_compile, git diff --check, and byte-identical MLIR comparisons against gc/master.
- Refresh the ptoas-vmi pyproject patch for the current requires-python floor.
- Set legacy CMake policies before fetching cann-cmake and default the
  third-party directory into the writable CMake binary tree when unset.
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