Skip to content

test(coverage): cluster B — the last 63 lines (92.3% → 99.45%) - #136

Merged
aarontrowbridge merged 7 commits into
mainfrom
test/coverage-cluster-b
Aug 20, 2026
Merged

test(coverage): cluster B — the last 63 lines (92.3% → 99.45%)#136
aarontrowbridge merged 7 commits into
mainfrom
test/coverage-cluster-b

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Closes #134 (cluster B — the final push; 86.45% → 92.31% was #135, this takes it to 99.45%).

Corrected the brief first: a fresh coverage baseline showed 5 of the 7 listed gap files were already at 0 uncovered after cluster A — the issue's numbers were stale. The real remaining gap was 63 lines across 13 files.

Closed 52 of them: the test_objective/test_integrator/test_constraint harness branches (verbose printers, atol/rtol paths), constrain.jl's Vector/tuple-bounds + the feasible-row continue (via MockOptimizer — Ipopt's wrapper lacks NumberOfConstraints for affine-in-set), the zero-order-hold spline_order=0 path through TimeDependentBilinearIntegrator end-to-end, callback freq-gating + a fidelity-dip scan, refine= kwarg re-sync, fix_global_variable! preservation, SolveStats fallbacks via a status-only mock, and 2 dead debug branches removed (4 unreachable error("Unsupported spline order") branches — the inner constructor already rejects; a Hessian-structure debug loop filtered by construction).

The 11 remaining are each documented-uncoverable: 3 failure-only diagnostic printers (fire iff the adjacent @test fails), 3 NT-dependency-gated guards (timestep::Symbol pin makes them unreachable — kept as defensive), 2 @threads branches (single-threaded test process), 2 Linux-only Pardiso dlopens, 1 attribution artifact (one-line struct inside a testitem).

Suite: 631 passed / 1 pre-existing broken (Aqua undefined_exports), 632 total. Bugs found (filed separately): GlobalEqualityConstraint is a function not a type — the name invites isa-misuse.

…ine-order rejection

The spline_order = 0 (ZOH) branches of the constructor, evaluate!,
eval_jacobian, and eval_hessian_of_lagrangian had never been exercised —
every existing test used the default linear interpolation. Adds a
test_integrator run at spline_order = 0 and a rejection test for
spline_order = 2 (the constructor's live validation error).
…dentBilinearIntegrator

The constructor errors on spline_order ∉ {0, 1} before the struct can be
created (the custom inner constructor is the only one, and spline_order is
an immutable Int field), so the else-error branches in the u_template
setup, evaluate!, eval_jacobian, and eval_hessian_of_lagrangian were
unreachable — dead re-validations of an invariant established at
construction. Replaced with one-line conditionals.

Same category as cluster A's dead-path removals: code that cannot execute
given intra-file invariants. No behavior change.
…ow skip

BoundsConstraint application (the MOI functor) had never seen a
Vector{Float64} symmetric bound spec (global or trajectory variable) nor
a (lb, ub) tuple spec on a global variable — only scalar and
trajectory-tuple specs ran. Exercises all four combinations against fresh
optimizers and counts the emitted MOI constraints.

Also covers GlobalLinearConstraint's all-zero-row continue: a row of A
that is identically zero with 0 ∈ [lo, hi] is structurally feasible and
must be skipped without error (only the infeasible variant was tested
before). Counts via a MockOptimizer since Ipopt's wrapper does not
implement NumberOfConstraints for affine-in-set constraints.
…mposite scaling

Closes the remaining dark branches of the shared validation harnesses:

- test_objective (src/objectives/_objectives.jl): the num::Real *
  CompositeObjective weight-rescaling branch; the test_equality = false
  norm-based gradient checks for both atol > 0 and atol == 0 (relative
  tolerance); the show_gradient_diff / show_hessian_diff verbose
  branches, driven with a quartic loss whose finite-difference
  truncation error makes the element-wise printers fire while rtol keeps
  the still-run comparisons green.
- test_constraint (src/constraints/_constraints.jl): the
  test_equality = false norm-based Jacobian/Hessian branches for both
  atol > 0 and atol == 0.
- test_integrator (src/integrators/_integrators.jl): the atol == 0
  relative-tolerance norm branches for Jacobian and Hessian.

The verbose diff printlns that only fire when an adjacent comparison
FAILS (test_constraint's show_jacobian_diff/show_hessian_diff element
printers, test_integrator's gauss_newton printer) are deliberately left
uncovered: they are exactly complementary to the @test that would fail.
…ts fallbacks, constraint filter

- Ipopt _solve: a refine= kwarg reaching the solver must re-sync the
  derived adaptive_mu_globalization field (only the eval_hessian sync
  was exercised before). Asserts the mutation on a user-owned options
  struct.
- callback_best_rollout_fidelity_factory: freq = 2 covers the
  every-other-iteration early return, and a fidelity sequence with a dip
  forces the insertion scan to walk past an incumbent it does not beat
  (completing the loop body without a break).
- _solve_stats: an optimizer that supports only TerminationStatus covers
  the fallbacks (raw status from string(status), objective NaN,
  iterations -1).
- fix_global_variable!: unrelated constraints in the list must survive
  the filter (the return-true branch).
- show_problem_details comment: records why 'Constraints: (none)' is
  unreachable via construction (NamedTrajectories types timestep as a
  Symbol, so the Δt-bounds injection always fires).
…tor testitem

The debug loop scanned the evaluator's Hessian-of-the-Lagrangian
structure for entries with j < i and printed them — but the structure is
filtered to i ≤ j at construction (evaluator.jl, hessian_structure
assembly), so the branch could never fire. Provably dead test-side
diagnostic; removing it changes no assertion.

@github-actions github-actions Bot left a comment

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.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'DirectTrajOpt.jl convergence'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: d0b5860 Previous: 0cd7923 Ratio
xgate_convergence_ipopt_N51 [infidelity] 7.749301200732361e-11 infidelity 4.429490108037726e-11 infidelity 1.75
xgate_convergence_madnlp_N51 [infidelity] 2.4343860260955807e-12 infidelity 3.086420008457935e-14 infidelity 78.87

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions Bot left a comment

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.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'DirectTrajOpt.jl benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: d0b5860 Previous: 134c3ac Ratio
bilinear_N51_ipopt [wall] 1.390554001 s 0.564104588 s 2.47
bilinear_N51_ipopt [alloc] 4316741896 bytes 1432053240 bytes 3.01
bilinear_N51_madnlp [wall] 2.209829449 s 0.363166886 s 6.08
bilinear_N51_madnlp [alloc] 6696387344 bytes 980944936 bytes 6.83
scaling_N101_d4_ipopt [wall] 2.641427874 s 1.054411922 s 2.51
scaling_N101_d4_ipopt [alloc] 6982620672 bytes 2467082832 bytes 2.83
scaling_N25_d16_ipopt [wall] 9.579275237 s 3.044575574 s 3.15
scaling_N25_d16_ipopt [alloc] 32245838552 bytes 5664718144 bytes 5.69
scaling_N25_d4_madnlp [wall] 3.016324541 s 0.799365378 s 3.77

This comment was automatically generated by workflow using github-action-benchmark.

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.05882% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../integrators/time_dependent_bilinear_integrator.jl 83.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

The historical fixture g(a) = [norm(a) - 1.0] is kinky at zero; a
finite-difference Hessian across a kink is unstable, and the test
flaked on CI runners for exactly that reason (observed on main's own
baseline coverage run, pre-cluster-B; twice more on this PR's 1.12
jobs). The syntax-equivalence claim ([:u] behaves identically to :u)
needs no kink: g(a) = [sum(abs2, a) - 1.0] is smooth and the tight
atol=1e-6 now holds. Verified 3× consecutive clean runs.
@aarontrowbridge

Copy link
Copy Markdown
Member Author

The 1.12 failure de-flaked at the root. The NonlinearKnotPointConstraint - single variable with vector syntax failure is a pre-existing flake (it failed on main's own baseline coverage run before this branch existed) — the fixture g(a) = [norm(a) - 1.0] is kinky at zero, and finite-difference Hessians across a kink are unstable. The syntax-equivalence claim needs no kink: swapped to a smooth fixture with a tighter atol (1e-6), verified 3× consecutive clean runs locally. The Aqua persistent-tasks failure is the known runner flake (passes on rerun; failed main runs too).

@aarontrowbridge
aarontrowbridge marked this pull request as ready for review August 20, 2026 11:08
@aarontrowbridge
aarontrowbridge merged commit 2fc4198 into main Aug 20, 2026
11 of 13 checks passed
@aarontrowbridge
aarontrowbridge deleted the test/coverage-cluster-b branch August 20, 2026 11:08
aarontrowbridge referenced this pull request Aug 21, 2026
…137)

* release: v0.10.0

* test(aqua): persistent_tasks broken-with-evidence — the 1.12-runner flake

Fails intermittently on PR CI (twice consecutively on this release PR)
while passing locally everywhere and failing main runs too; the check is
sensitive to runner-level async timing. Stops gating releases on a coin
flip; revisit when the Aqua/1.12.7 interaction is understood.

* test(aqua): persistent_tasks broken on 1.12 only — live on 1.10/1.11

The unconditional broken=true made Aqua report 'Unexpected Pass' as an
error on the healthy versions (the flake is 1.12-runner-specific).
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.

Coverage campaign: 86.45% → 100% (baseline 2026-08-18)

1 participant