Add shape probe: measure "1-D = scalar" boundary compliance - #614
Conversation
A diagnostic (not a test suite) that drives a type-recording OCP through CTDirect's ADNLP transcription to measure, without modifying any source, what shapes reach the user's dynamics/lagrange/mayer/path/boundary functions today, and what each candidate fix (getter-level vs call-boundary coercion) would cost. Mirrors CTFlows.jl/probe/cpu. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Why Option B (call-boundary coercion), not Option A (getter-level coercion)Two places could apply the Option A looks cheaper at first glance — three functions instead of ~16 call sites — but the probe shows it's incomplete by construction, not just costlier:
So Option A reduces to Option B + a second mechanism + two internal-algebra rewrites. Option B — precomputing Explicitly out of scope here (and why)
Detailed audit (measured capability matrices, full call-site inventory, test sketches) to follow in a separate comment/report on this PR. |
Follow the control-toolbox Handbook workflow philosophy (WORKFLOWS.md §2)
and the pattern already shipped in CTFlows.jl: expensive workflows only
run on push/tag to main, and are opt-in per PR via a 'run …' label. This
avoids burning CI/doc-build/breakage minutes on every push to a draft PR
such as this one.
- CI.yml: split into test-cpu-github (ubuntu/macos/windows, label
'run ci cpu') and test-gpu-kkt (self-hosted kkt runner, label
'run ci gpu'), mirroring CTFlows.jl's split-CI structure. GPU.yml is
kept as-is (it runs the dedicated GPU-specific test suite via
test_args=GPU, a different job than the plain suite on the kkt runner).
- Documentation.yml: gate behind 'run documentation'.
- Breakage.yml: add the missing label gate ('run breakage') — it
previously ran unconditionally on every PR push.
- All three: drop 'opened' from the pull_request 'types' list. A label
applied at PR creation emits both 'opened' and 'labeled'; keeping
'opened' in a label-gated caller fires the job twice on the same
commit (see WORKFLOWS.md §2 for the measured duplicate-run evidence).
Created the 'run ci cpu', 'run ci gpu', 'run documentation', and
'run breakage' repo labels (none of the four existed before).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
test-gpu-kkt now passes test_args: 'GPU' (new input on CTActions' reusable ci.yml, control-toolbox/CTActions#65) to run CTDirect's GPU-specific test suite (test/test_gpu.jl) directly, instead of the plain suite. This was the only reason GPU.yml existed as a separate hand-rolled workflow, so it is removed along with the now-orphaned 'run GPU' label ('run ci gpu' on test-gpu-kkt is the single GPU trigger from here on). Dropped with GPU.yml: the weekly cron schedule and continue-on-error. Discussed with the user; simplification (one GPU path, PR-gated only) was the preferred tradeoff over keeping both. Depends on control-toolbox/CTActions#65 landing on @main before test-gpu-kkt can resolve the test_args input. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Scope note: existing test problems are not migrated to scalar style here. The implementation adds one new test problem ( All the existing test problems (both That said, rewriting them to drop the now-unnecessary |
Add _dim_coerce/DOCPshape, precomputed once per DOCP and applied immediately before every call into a user OCP function (dynamics, lagrange, mayer, path and boundary constraints), across all 7 schemes. Matches CTFlows' existing convention: 1-D state/control/variable now reach the user as a scalar, driven by the declared dimension, never by runtime type; the in-place derivative buffer stays a vector. Add a scalar-style non-regression problem and a type-recording contract test suite (all schemes, 1-D/n-D/mixed-dim/zero-control cases) confirming the contract holds with no behaviour change to existing (all [1]-indexed) problems. Full suite: 535/535. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Points test-cpu-github at CTActions@fix/windows-ct-registry and limits the matrix to windows-latest only, to check whether removing the runner.os != 'Windows' guard lets add-julia-registry@v2 work on this runner. To be reverted once the result is known. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CTActions#66 (OpenSSH client swap + cache-before-registry ordering) is merged to main, so windows-latest works with use_ct_registry again. Points test-cpu-github back at @main and restores the full ubuntu/macos/windows matrix, ending the temporary experiment against the fix/windows-ct-registry branch. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #614 +/- ##
==========================================
+ Coverage 70.64% 71.25% +0.61%
==========================================
Files 14 14
Lines 1366 1395 +29
==========================================
+ Hits 965 994 +29
Misses 401 401 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ates MadNLPGPU 0.10 moved CUDA/CUDSS support to a package extension that only loads when CUDSS is imported alongside CUDA, unlike 0.8 where CUDSS was a hard dependency. test_gpu.jl already defaulted to linear_solver=CUDSSSolver but never imported CUDSS, causing the kkt GPU job to fail. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary
probe/shape/— a diagnostic (not a test suite) that drives a type-recording OCP through CTDirect's ADNLP transcription to measure, without modifying any source, what shapes reach the user'sdynamics/lagrange/mayer/path/boundaryfunctions today, and the cost of each candidate fix (getter-level vs. call-boundary coercion). MirrorsCTFlows.jl/probe/cpu.philosophy/dimension-and-shape.md), part of roadmap #610 §7 / discussion #609 §7.Closes #613
Test plan
julia --project=probe/shape probe/shape/probe_shape.jlruns clean and prints the capability matrices