Skip to content

Personal/l00800392/get 1119#977

Open
z00520135 wants to merge 2 commits intotile-ai:ascendc_ptofrom
LYMAXPUP:personal/l00800392/get_1119
Open

Personal/l00800392/get 1119#977
z00520135 wants to merge 2 commits intotile-ai:ascendc_ptofrom
LYMAXPUP:personal/l00800392/get_1119

Conversation

@z00520135
Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

👋 Hi! Thank you for contributing to the TileLang project.

Please remember to run bash format.sh in the root directory of the project to ensure your changes are properly linted and formatted. This will help ensure your contribution passes the format check.

We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work!

🚀

Copy link
Copy Markdown
Contributor

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

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 implements a code coverage tracking system for both Python and C++ source code, adding configuration files, documentation, and orchestration scripts. The review feedback focuses on best practices such as excluding generated reports from version control, improving the reliability of the coverage parsing script, ensuring proper error handling in shell scripts, and using explicit Python module execution for the coverage tool.

Comment thread coverage_report.md
@@ -0,0 +1,268 @@
# TileLang Coverage Report
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.

medium

This file appears to be a generated coverage report. Checking generated artifacts into the repository is generally discouraged as it leads to unnecessary repository bloat and merge conflicts. Consider adding this file to .gitignore and using a CI/CD pipeline or a dedicated coverage service to host these reports.

Comment on lines +23 to +28
match = re.match(r"^(\S+)\s+\|(\S+)\s+(\d+)\|(\S+)\s+(\d+)", line.strip())
if match:
filename = match.group(1)
lines_rate = match.group(2)
funcs_rate = match.group(4)
print(f"| {filename} | {lines_rate} | {funcs_rate} |")
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.

medium

The current regex is fragile and may fail to parse standard lcov --list output, which typically includes parentheses for hit/total counts (e.g., 80.0% (4/5)). Using split('|') is a more robust approach to extract the filename and percentage rates.

Suggested change
match = re.match(r"^(\S+)\s+\|(\S+)\s+(\d+)\|(\S+)\s+(\d+)", line.strip())
if match:
filename = match.group(1)
lines_rate = match.group(2)
funcs_rate = match.group(4)
print(f"| {filename} | {lines_rate} | {funcs_rate} |")
parts = [p.strip() for p in line.split('|')]
if len(parts) >= 3:
filename = parts[0]
lines_rate = parts[1].split()[0] if parts[1].split() else "-"
funcs_rate = parts[2].split()[0] if parts[2].split() else "-"
print(f"| {filename} | {lines_rate} | {funcs_rate} |")

Comment thread scripts/run_coverage.sh
# 捕获覆盖率数据
if find build -name "*.gcda" | grep -q .; then
echo "Found .gcda files, generating coverage report..."
lcov --capture --directory build --output-file coverage_cpp.info --no-external --quiet 2>/dev/null || true
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.

medium

Removing || true ensures that the script fails immediately if coverage capture fails, preventing the generation of misleading or empty reports. Since set -e is active, it's better to let the script exit on critical failures.

Suggested change
lcov --capture --directory build --output-file coverage_cpp.info --no-external --quiet 2>/dev/null || true
lcov --capture --directory build --output-file coverage_cpp.info --no-external --quiet 2>/dev/null

Comment thread scripts/run_coverage.sh
if [ -f "$PROJECT_ROOT/examples/.coverage_combined" ]; then
cd "$PROJECT_ROOT"
cp examples/.coverage_combined . 2>/dev/null || true
coverage report --rcfile=.coveragerc --data-file=.coverage_combined --sort=Cover | tail -30
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.

medium

Use python3 -m coverage instead of coverage to ensure the command is executed using the intended Python environment, as recommended in your own guild.md documentation. This also applies to line 159.

Suggested change
coverage report --rcfile=.coveragerc --data-file=.coverage_combined --sort=Cover | tail -30
python3 -m coverage report --rcfile=.coveragerc --data-file=.coverage_combined --sort=Cover | tail -30

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