Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to lrslib v7.1a #41

Merged
merged 8 commits into from
May 31, 2021
Merged

Update to lrslib v7.1a #41

merged 8 commits into from
May 31, 2021

Conversation

blegat
Copy link
Member

@blegat blegat commented Apr 21, 2021

No description provided.

@blegat blegat force-pushed the lrslib-v7.1 branch 5 times, most recently from d160a90 to f737302 Compare April 21, 2021 10:08
@@ -46,10 +46,6 @@ end
function solve_nash(hr1::HMatrix, hr2::HMatrix)
NEs = NTuple{2,Vector{Rational{BigInt}}}[]

# Step 1
FirstTime = cglobal((:FirstTime, liblrsnash), Clong)
Copy link
Member Author

Choose a reason for hiding this comment

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

@oyamad Do you know what we should do in lrslib v7.1a for this ? With this line, it complains that FirstTime is not defined and without this line, I have a test failing (see the test logs, not sure if that's related to this line or if that's another change).

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed. In case helpful, my thoughts as a newcomer to this codebase are:

  • Changing the public API from an extern long that the user unsafe-sets to a reset() method is a good start. But probably more important, the re-implementation of lrs_solve_nash in Julia here seems like an anti-pattern to me. It indicates that FirstTime really isn't a public API, it's just needed to enable the implementation to be split across the C codebase and the Julia codebase. This is doable if it's needed, but perhaps we can revisit whether there's a way to bring all the logic into C with a documented API?
  • FirstTime appears to be global state for the Nash solver. I wonder if that state could be factored into a struct so that the logic in lrsnashlib could become stateless?
  • (I'm not sure why we're using a long for what apparently has the semantics of a boolean, but I assume there is a good reason for that.)

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree. If the API was sufficient, we shouldn't have to define the structs in Julia. However, it's sometimes difficult to bring the API to that level to the upstream package.
We already contacted David Avis trying to merge the changes we need upstream but we probably complicated things asking to have the build process work on more platforms which is now resolved and simplified thanks to the cross-compilation with Yggdrasil. We could aim at getting
JuliaPolyhedra/lrslib@3962f83
JuliaPolyhedra/lrslib@ab1a531
and
JuliaPolyhedra/lrslib#3
to the next lrslib release and we could get rid of the fork.

src/nash.jl Outdated Show resolved Hide resolved
src/nash.jl Show resolved Hide resolved
@blegat blegat marked this pull request as ready for review May 15, 2021 19:32
@codecov
Copy link

codecov bot commented May 15, 2021

Codecov Report

Merging #41 (364bb3a) into master (dba1279) will increase coverage by 0.15%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #41      +/-   ##
==========================================
+ Coverage   83.70%   83.85%   +0.15%     
==========================================
  Files           8        8              
  Lines         632      638       +6     
==========================================
+ Hits          529      535       +6     
  Misses        103      103              
Impacted Files Coverage Δ
src/LRSLib.jl 71.42% <0.00%> (ø)
src/lrstypes.jl 100.00% <ø> (ø)
src/matrix.jl 89.51% <100.00%> (+0.33%) ⬆️
src/nash.jl 92.30% <100.00%> (-0.06%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dba1279...364bb3a. Read the comment docs.

@blegat blegat merged commit 0c0989e into master May 31, 2021
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.

None yet

3 participants