Skip to content

Guard the ReducedTensor allocation readings on coverage - #62

Merged
michakraus merged 2 commits into
mainfrom
test/coverage-guard-reduced-tensor
Nov 1, 2026
Merged

michakraus merged 2 commits into
mainfrom
test/coverage-guard-reduced-tensor

Conversation

@michakraus

@michakraus michakraus commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

The == 0 allocation readings of ReducedTensor and their > 0 control in test/reduced_tensor.jl now sit behind Base.JLOptions().code_coverage == 0, with the same comment as test/algorithms/symplectic_deim.jl. Coverage instrumentation allocates on its own account, and every other == 0 reading of the suite is already guarded this way. An allocation sweep of the reduced-basis packages found this testset to be the one exception.

Tests and CHANGELOG.md only ([Unreleased] — targeting 0.4.1); nothing in src/ changes, and no release is needed for it.

Evidence

  • test/reduced_tensor.jl passes 74/74 with coverage off (Julia 1.13.3), and 62/62 under --code-coverage=user: the 12 guarded readings (3 readings × 2 element types × 2 widths) are skipped.
  • In a fresh process, with coverage on and off, getindex and copyto! read 0 B; the guard is preventive and does not hide a present failure.

Pre-PR verification

  • Fixed: the first pass found the CHANGELOG sentence too wide ("as the other allocation tests of the suite are"; test/projection.jl has unguarded ceiling, size-difference and > 0 checks). It now reads "as the other == 0 readings of the suite are".
  • Unresolved: none.
  • Pre-existing: none.
  • Checked and clean:
    • Every == 0 allocation reading under test/ is behind the coverage guard: test/algorithms/symplectic_deim.jl, test/reduced_equations.jl (three blocks) and test/reduced_tensor.jl.
    • JuliaFormatter, fatou lint, the test-layout check and NFC are clean.
    • No stale comment, and no history outside CHANGELOG.md.
  • Not checked: piracy, type stability and allocations of src/: the branch does not change it.
  • Release: no bump needed.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Allocation checks for indexed access, copying, and collection now run only when code-coverage instrumentation is disabled. The expected allocation results are unchanged.
  • Documentation
    • Updated the unreleased changelog entry to describe the coverage-related behavior of these checks.

michakraus and others added 2 commits November 1, 2026 13:36
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d74f035c-98ee-428d-9139-664e59c9dfe1
Commits

Reviewing files that changed from the base of the PR and between 215c52e and 130556a.

Files selected for processing: 2
  • CHANGELOG.md
  • test/reduced_tensor.jl

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

The ReducedTensor allocation assertions for getindex, copyto!, and collect now run only when Julia code-coverage instrumentation is disabled. The changelog records this test-only change.

Changes: Allocation test coverage

Layer / File(s) Summary
Gate allocation assertions
test/reduced_tensor.jl, CHANGELOG.md
The allocation assertions run only when code coverage is disabled. Their expected results are unchanged. The changelog documents the test change.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Merge Risk: Minimal · up to 13055

No actionable merge-blocking risk remains in this test-only change.

Architecture risk: Low · up to 13055

The change affects 2 systems.

Changed systems: CHANGELOG.md, test

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — CHANGELOG.md (service) was modified; 1 changed file maps to changed impact.
  • observed — test (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in CHANGELOG.md: Adds an unreleased 0.4.1 “Changed” entry documenting that ReducedTensor allocation checks for getindex and copyto! are gated on Base.JLOptions().code_coverage == 0; it identifies this as a test-only change.
  • observed — Modified behavior in test/reduced_tensor.jl: The three allocation assertions now run only when Base.JLOptions().code_coverage == 0; the expected results remain zero allocations for indexed access and copyto!, and positive allocations for collect.
Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding a coverage guard for ReducedTensor allocation readings.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@codecov

codecov Bot commented Nov 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.56%. Comparing base (215c52e) to head (130556a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #62   +/-   ##
=======================================
  Coverage   96.56%   96.56%           
=======================================
  Files          10       10           
  Lines         320      320           
=======================================
  Hits          309      309           
  Misses         11       11           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@michakraus
michakraus merged commit 25c5da9 into main Nov 1, 2026
13 of 14 checks passed
@michakraus
michakraus deleted the test/coverage-guard-reduced-tensor branch November 1, 2026 13:04
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