Skip to content

Test the (q,) NeuralNetworkIntegrator iterate method - #309

Merged
michakraus merged 3 commits into
mainfrom
fix/unbound-args-nightly
Sep 24, 2026
Merged

michakraus merged 3 commits into
mainfrom
fix/unbound-args-nightly

Conversation

@michakraus

Copy link
Copy Markdown
Member

Summary

#308 rewrote the signature of the iterate method for a NeuralNetworkIntegrator on (q,) initial conditions, but no test called that method, so codecov/patch on #308 reported 0% of the diff covered. This PR adds one assertion to the "Layer and architecture docstring examples" testset: the docstring's ResNet, run from (q = [1, 1, 1],) for four points, must return (q = [1 2 4 8; 1 3 9 27; 1 3 7 15],).

The expected trajectory is the closed form of x ↦ x + Wx + b with W = diag(1, 2, 1), b = (0, 0, 1), not a recomputation. A CHANGELOG entry is under [Unreleased] → Added.

The branch name is the one #308 used: its commits are already in main, and against main this PR is the test and its CHANGELOG line only.

Pre-PR verification

Fixed: the missing CHANGELOG entry for the new test.

Unresolved: none.

Pre-existing, not in this diff (nits):

  • The iterate docstring in src/architectures/neural_network_integrator.jl gives the example ResNet as x ↦ Wx + b. The network computes x + Wx + b, which the doctest output and both tests show: nn([1, 1, 1]) == [2, 3, 3], not [1, 2, 2].
  • The same docstring describes ics as "a NamedTuple of two vectors", but its example passes a vector.

Checked and clean:

  • Correctness: which(iterate, …) for a (q = Vector,) argument resolves to the (q,) method. The testset passes 5/5 on Julia 1.13.0 and 1.14.0-DEV.3309.
  • Type piracy: the diff adds no method. Aqua.test_piracies reports the 3 known methods in src/layers/resnet.jl that test/aqua.jl asserts.
  • Type stability: the covered call infers @NamedTuple{q::Matrix{Int64}}.
  • Allocations: fatou lint is clean on the changed file, and the hunk has no allocating construct.
  • Comments and history: the hunk adds no comment and no historical prose.
  • Formatting: JuliaFormatter (sciml) passes on the changed file.

Not checked: the 1.10 LTS floor (CI's min job covers it), a docs build (no docs or docstring change), and the full suite (left to CI).

🤖 Generated with Claude Code

michakraus and others added 2 commits September 24, 2026 17:48
No test called it, so codecov/patch reported 0% of the diff covered.
The assertion reuses the docstring's ResNet example with a (q = ics,)
initial condition; the expected trajectory is the closed form of
x -> 2x, 3x, 2x + 1 per row, not a recomputation.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 24, 2026 15:53

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@michakraus
michakraus merged commit a3ecab2 into main Sep 24, 2026
13 checks passed
@michakraus
michakraus deleted the fix/unbound-args-nightly branch September 24, 2026 17:11
@codecov

codecov Bot commented Sep 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.14%. Comparing base (4a9b4c4) to head (f192483).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #309      +/-   ##
==========================================
+ Coverage   86.07%   86.14%   +0.06%     
==========================================
  Files          76       76              
  Lines        3016     3016              
==========================================
+ Hits         2596     2598       +2     
+ Misses        420      418       -2     

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants