Skip to content

Enhanced certification test: now results match analytical solution#94

Merged
mdmitry1 merged 23 commits intomasterfrom
smlp_certify
Apr 22, 2026
Merged

Enhanced certification test: now results match analytical solution#94
mdmitry1 merged 23 commits intomasterfrom
smlp_certify

Conversation

@mdmitry1
Copy link
Copy Markdown
Collaborator

@mdmitry1 mdmitry1 commented Mar 30, 2026

Added SMLP certify test for BNH problem

@mdmitry1 mdmitry1 self-assigned this Mar 30, 2026
Copy link
Copy Markdown
Collaborator Author

@mdmitry1 mdmitry1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SMLP results are verified by:

  1. Analytical solution
  2. Wolfram Alpha

@mdmitry1 mdmitry1 marked this pull request as draft March 30, 2026 16:11
@mdmitry1 mdmitry1 requested a review from zurabksmlp March 30, 2026 16:11
Copy link
Copy Markdown
Collaborator Author

@mdmitry1 mdmitry1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added certify result visualization

@mdmitry1 mdmitry1 marked this pull request as ready for review April 1, 2026 14:01
@konstantin-korovin
Copy link
Copy Markdown
Collaborator

konstantin-korovin commented Apr 1, 2026

Good work!

I tried on MacOS the bhn example with certification, have some errors:

tutorial % examples/bnh/smlp/run_certify.sh
examples/bnh/smlp/run_certify.sh: line 14: ${test,,}: bad substitution
=============================================== PROBLEM ======================================================
For function f₁(x₁,x₂) = 4x₁² + 4x₂²                                                                          
Certify stability of analytical Pareto solution for witness f₁(x₁,x₂) = 0.692042, where  x₁ = x₂ = 0.294118 
And specified absolute radius rad-abs                                                                         
----------------------------------------------- Expected result: ---------------------------------------------
From inequality: (f₁(x₁,x₂) - 0.692042)² < 4                                                                  
| x₁ | = | x₂ |  < sqrt((2+0.692042)/8) = 0.580091                                                            
Pass/Fail absolute radius boundary point: 0.580091-0.294118 = 0.285973                                        
Checking two values of rad-abs: 0.285 and 0.286                                                               
Expected result: 0.285 -> PASS, 0.286 -> FAIL                                                                 
==============================================================================================================
=============================================== SMLP CERTIFY SOLUTIONS =======================================
gunzip: can't stat: .csv.gz (.csv.gz.gz): No such file or directory
jq: error: Could not open file /Users/korovin/smlp/tutorial/examples/bnh/smlp/_certify_pass.json: No such file or directory

jq: error: Could not open file BNH_BNH_certify_results.json: No such file or directory
(F1-0.692042)*(F1-0.692042) < 4 
jq: error: Could not open file /Users/korovin/smlp/tutorial/examples/bnh/smlp/_certify_fail.json: No such file or directory

jq: error: Could not open file BNH_BNH_certify_results.json: No such file or directory
(F1-0.692042)*(F1-0.692042) < 4 
=============================================== DONE ========================================================
Saved witness_certify.png

===========
Interestingly the generated png file looks ok.

@konstantin-korovin
Copy link
Copy Markdown
Collaborator

On my Ubuntu 22.04 laptop I have another error:

tutorial$ examples/bnh/smlp/run_certify.sh
=============================================== PROBLEM ======================================================
For function f₁(x₁,x₂) = 4x₁² + 4x₂²                                                                          
Certify stability of analytical Pareto solution for witness f₁(x₁,x₂) = 0.692042, where  x₁ = x₂ = 0.294118
And specified absolute radius rad-abs                                                                        
----------------------------------------------- Expected result: ---------------------------------------------
From inequality: (f₁(x₁,x₂) - 0.692042)² < 4                                                                  
| x₁ | = | x₂ |  < sqrt((2+0.692042)/8) = 0.580091                                                            
Pass/Fail absolute radius boundary point: 0.580091-0.294118 = 0.285973                                        
Checking two values of rad-abs: 0.285 and 0.286                                                              
Expected result: 0.285 -> PASS, 0.286 -> FAIL                                                                
==============================================================================================================
=============================================== SMLP CERTIFY SOLUTIONS =======================================
jq: error: syntax error, unexpected ',', expecting ':' (Unix shell quoting issues?) at <top-level>, line 1:
[.variables[] | select(has("rad-abs")) | {label, "rad-abs"}]                                              
jq: 1 compile error

(F1-0.692042)*(F1-0.692042) < 4 "PASS"
jq: error: syntax error, unexpected ',', expecting ':' (Unix shell quoting issues?) at <top-level>, line 1:
[.variables[] | select(has("rad-abs")) | {label, "rad-abs"}]                                              
jq: 1 compile error

(F1-0.692042)*(F1-0.692042) < 4 "FAIL"
=============================================== DONE ========================================================
Saved witness_certify.png

File witness_certify.png looks ok.

@konstantin-korovin
Copy link
Copy Markdown
Collaborator

Before that:

# Generate dataset
./examples/bnh/smlp/run_poly_pareto/bnh_dataset.py

should be

# Generate dataset
./examples/bnh/smlp/bnh_dataset.py

Which I took into account in above.

Comment thread tutorial/README.md Outdated
Comment thread tutorial/README.md Outdated
@mdmitry1 mdmitry1 requested a review from fbrausse April 2, 2026 08:50
@konstantin-korovin
Copy link
Copy Markdown
Collaborator

konstantin-korovin commented Apr 2, 2026

Updates fixed the issue on both MacOS and Ubuntu for me.
Minor: reduce size of the certification figure in tutorial/README.md

For this or next PR: dump results and data into a results/ data/ directories rather than directly to ./

Copy link
Copy Markdown
Collaborator Author

@mdmitry1 mdmitry1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged with master

Copy link
Copy Markdown
Collaborator Author

@mdmitry1 mdmitry1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All requested changes were implemented

@mdmitry1 mdmitry1 changed the title Enhanced certification test: now results match analytical solutuion Enhanced certification test: now results match analytical solution Apr 18, 2026
@mdmitry1
Copy link
Copy Markdown
Collaborator Author

@fbrausse : both requested changes are marked as resolved. However, GitHub status is "requested changes". Please, fix

@fbrausse fbrausse dismissed their stale review April 21, 2026 17:41

Requests have been addressed.

Copy link
Copy Markdown
Collaborator

@fbrausse fbrausse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've run the BNH example modified here and results and plots look nice.

@mdmitry1 mdmitry1 merged commit a86d586 into master Apr 22, 2026
@mdmitry1 mdmitry1 deleted the smlp_certify branch April 22, 2026 08:23
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.

3 participants