Fix missing critical regions caused by DAQPBase 0.4.1 early-exit optimization bug#34
Draft
Copilot wants to merge 2 commits into
Draft
Fix missing critical regions caused by DAQPBase 0.4.1 early-exit optimization bug#34Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
The early-exit optimization added in DAQPBase 0.4.1 (daqp commit 49bc1408) contains a bug: when H and f are empty (NULL), uninitialized xold memory is incorrectly used as x_unc after a pointer swap, while the code assumes it is already zeroed. This causes wrong feasibility results in get_ignore_masks and compute_AS0, leading to some valid critical regions being incorrectly pruned and producing holes in the solution. The fix adds a helper function ldp_quadprog() that solves the LDP min ||x||^2/2 s.t. Ax <= b using an explicit identity Hessian H=I(n). This is mathematically equivalent but forces the correct code path in daqp_update_ldp where x_unc is computed explicitly (as 0 when f=0), rather than being assumed zero from potentially garbage memory. Co-authored-by: darnstrom <55484604+darnstrom@users.noreply.github.com> Agent-Logs-Url: https://github.com/darnstrom/ParametricDAQP.jl/sessions/5c8838e7-3862-4f21-8333-723fa4523b6b
Copilot
AI
changed the title
[WIP] Investigate test failures in ParametricDAQP.jl due to DAQPBase update
Fix missing critical regions caused by DAQPBase 0.4.1 early-exit optimization bug
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DAQPBase 0.4.1 (daqp commit 49bc1408) introduced an early-exit in
daqp_update_ldpthat is triggered whenHandfare NULL (pure LDP calls). After a pointer swap,work->xpoints to uninitializedmalloc'd memory (xold), but the code assumes it is zeroed. This corrupts the feasibility check and thed(slack) values used by the subsequentdaqp_ldpsolve, producing wrong exitflags.In ParametricDAQP,
get_ignore_masksandcompute_AS0callDAQPBase.quadprog(zeros(0,0), zeros(0), ...)which triggers this path. The result: 5 valid constraint pairs are incorrectly marked infeasible, pruning valid active-set combinations from the combinatorial search and leaving 116 missing critical regions (holes in the partition).Changes
src/utils.jl— Addedldp_quadprog()helper that replacesquadprog(zeros(0,0), zeros(0), A, b, ...)with an explicit identity Hessian:H = I(n), f = zeros(n)is mathematically equivalent to the LDP (identical KKT conditions, solutions, and dual variables), but forcesdaqp_update_ldpto computex_uncexplicitly as 0 rather than reading from garbage memory. Applied to all 5 affectedquadprogcalls incompute_AS0(MPLDP and MPQP/MPVI paths) andget_ignore_masks.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/FluxML/MacroTools.jl/tarball/1e0228a030642014fe5cfe68c2c0a818f9e3f522/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaBinaryWrappers/DAQP_jll.jl/tarball/e9cfcc76474c4a3afdaaa582ec3f862120d93224/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaCI/BenchmarkTools.jl/tarball/7fecfb1123b8d0232218e2da0c213004ff15358d/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaCollections/OrderedCollections.jl/tarball/05868e21324cede2207c6f0f466b4bfef6d5e7ee/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaData/DataAPI.jl/tarball/abe83f3a2f1b857aac70ef8b269080af17764bbe/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaData/Parsers.jl/tarball/7d2f8f21da5db6a806faf7b9b292296da42b2810/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaData/Tables.jl/tarball/f2c1efbc8f3a609aadf318094f8fc5204bdaf344/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaDocs/DocStringExtensions.jl/tarball/7442a5dfe1ebb773c29cc2962a8980f47221d76c/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaIO/JSON.jl/tarball/b3ad4a0255688dcb895a52fafbaae3023b588a90/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaLang/Compat.jl/tarball/9d8a54ce4b17aa5bdce0ea5c34bc5e7c340d16ad/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaLang/PrecompileTools.jl/tarball/07a921781cab75691315adc645096ed5e370cb77/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaPackaging/JLLWrappers.jl/tarball/0533e564aae234aff59ab625543145446d8b6ec2/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaPackaging/Preferences.jl/tarball/8b770b60760d4451834fe79dd483e318eee709c4/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaPackaging/Requires.jl/tarball/62389eeff14780bfe55195b7204c0d8738436d64/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaPlots/Plots.jl/tarball/5c3d09cc4f31f5fc6af001c250bf1278733100ff/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaServices/StructUtils.jl/tarball/fa95b3b097bcef5845c142ea2e085f1b2591e92c/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaStats/Statistics.jl/tarball/ae3bb1eb3bba077cd276bc5cfc337cc65c3075c0/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/KristofferC/PGFPlotsX.jl/tarball/e5df51ffc01f8771d94c8db2d164be1f6927849c/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/darnstrom/PolyDAQP.jl/tarball/b44aa329d124e2098a27be78ba008eca596ae4c6/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/darnstrom/daqp/tarball/52046f50338206658e3c082ab7f9dfff108525a2/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/jw3126/ArgCheck.jl/tarball/f9e9a66c9b7be1ad7372bbd9b062d9230c30c5ce/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/mauro3/Parameters.jl/tarball/34c0e9ad262e5f7fc75b10a9952ca7692cfc5fbe/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/mauro3/UnPack.jl/tarball/387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/queryverse/DataValueInterfaces.jl/tarball/bfc1187b79289637fa0ef6d4436ebdfe6905cbd6/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/queryverse/IteratorInterfaceExtensions.jl/tarball/a3f24677c21f5bbe9d2a714f95dcd58337fb2856/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/queryverse/TableTraits.jl/tarball/c06b2f539df1c6efa794486abfb6ed2022561a39/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/rfourquet/BitIntegers.jl/tarball/091d591a060e43df1dd35faab3ca284925c48e46/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/timholy/ProgressMeter.jl/tarball/fbb92c6c56b34e1a2c4c36058f68f332bec840e7/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/tpapp/DefaultApplication.jl/tarball/c0dfa5a35710a193d83f03124356eef3386688fc/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(http block)pkg.julialang.org/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.status()(dns block)/usr/bin/julia julia -e using Pkg; Pkg.status("DAQPBase"; io=stdout)(dns block)/usr/bin/julia julia --project=/home/REDACTED/work/ParametricDAQP.jl/ParametricDAQP.jl -e using Pkg; Pkg.instantiate()(dns block)If you need me to access, download, or install something from one of these locations, you can either:
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.