Fix a bug in catalog update and add catalog from MAS#974
Conversation
|
@rahulsavani I reset my laptop to arm successfully. Please help review this. |
There was a problem hiding this comment.
Pull request overview
This PR fixes build_support/catalog/update.py so catalog updates are generated from the checked-out catalog/ directory (not whatever catalog data happens to be bundled with / remembered by the currently-imported pygambit), and expands the catalog with additional EFGs plus DrawTree “original layout” .ef variants sourced from Multiagent Systems (Shoham & Leyton-Brown, 2008) and MAS-related material.
Changes:
- Force
pygambit.catalogto read from the repo’scatalog/directory during catalog generation (and restore the previous resource afterward). - Add tests to ensure the catalog resource override is applied and restored correctly.
- Add new Shoham & Leyton-Brown (2008) games + layout variants, and update bibliography/hierarchy metadata accordingly.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| doc/references.bib | Adds textbook categorization metadata for the Shoham & Leyton-Brown (2008) reference. |
| build_support/catalog/update.py | Introduces a scoped catalog-resource override to ensure catalog generation reads from the checked-out catalog. |
| build_support/catalog/test_update.py | Adds tests validating requested catalog-dir selection and restoration of the previous resource. |
| build_support/catalog/catalog.am | Includes newly added catalog game files and curated .ef layout variants in distribution lists. |
| build_support/catalog/catalog_hierarchy.yaml | Adds a hierarchy label entry for books/shohambrown2008. |
| catalog/journals/mor/vonstengelforges2008/fig1__Original_Layout.ef | Adds a curated DrawTree .ef “original layout” variant for the MAS figure. |
| catalog/books/shohambrown2008/fig6_8.efg | Adds the EFG transcription for Fig 6.8. |
| catalog/books/shohambrown2008/fig6_8__original_layout.ef | Adds the DrawTree “original layout” variant for Fig 6.8. |
| catalog/books/shohambrown2008/fig6_2.efg | Adds the EFG transcription for Fig 6.2. |
| catalog/books/shohambrown2008/fig6_2__original_layout.ef | Adds the DrawTree “original layout” variant for Fig 6.2. |
| catalog/books/shohambrown2008/fig5_9.efg | Adds the EFG transcription for Fig 5.9. |
| catalog/books/shohambrown2008/fig5_9__original_layout.ef | Adds the DrawTree “original layout” variant for Fig 5.9. |
| catalog/books/shohambrown2008/fig5_2.efg | Adds the EFG transcription for Fig 5.2. |
| catalog/books/shohambrown2008/fig5_2__original_layout.ef | Adds the DrawTree “original layout” variant for Fig 5.2. |
| catalog/books/shohambrown2008/fig5_15.efg | Adds the EFG transcription for Fig 5.15. |
| catalog/books/shohambrown2008/fig5_15__original_layout.ef | Adds the DrawTree “original layout” variant for Fig 5.15. |
| catalog/books/shohambrown2008/fig5_12.efg | Adds the EFG transcription for Fig 5.12. |
| catalog/books/shohambrown2008/fig5_12__original_layout.ef | Adds the DrawTree “original layout” variant for Fig 5.12. |
| catalog/books/shohambrown2008/fig5_11.efg | Adds the EFG transcription for Fig 5.11. |
| catalog/books/shohambrown2008/fig5_11__original_layout.ef | Adds the DrawTree “original layout” variant for Fig 5.11. |
| catalog/books/shohambrown2008/fig5_10.efg | Adds the EFG transcription for Fig 5.10. |
| catalog/books/shohambrown2008/fig5_10__original_layout.ef | Adds the DrawTree “original layout” variant for Fig 5.10. |
| catalog/books/shohambrown2008/fig5_1.efg | Adds the EFG transcription for Fig 5.1. |
| catalog/books/shohambrown2008/fig5_1__original_layout.ef | Adds the DrawTree “original layout” variant for Fig 5.1. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| This is the centipede game. In this game two players alternate in making decisions, at each | ||
| turn choosing between going down and ending the game or going across and | ||
| continuing it. | ||
| This example is usd to explain the criticisms of backward induction for finding subgame-perfect equilibrium. |
|
|
||
| " | ||
| Figure 5.12 from :cite:p:`ShoLeyB08`. | ||
| A game with imperfect recall. |
|
|
||
| " | ||
| Figure 5.15 from :cite:p:`ShoLeyB08`. | ||
| A game with imperfect information. |
| level 0 node 1 player 1 | ||
| level 2 node 1 xshift -3.58 from 0,1 move C | ||
| level 2 node 2 xshift 3.58 from 0,1 move D |
There was a problem hiding this comment.
@wyz2368 Do you have the pre-commit hooks installed? I would think these trailing whitespace problems would automatically be cleaned up by that.
There was a problem hiding this comment.
@tturocy I see. Let me install that. Thanks for mentioning this.
|
@wyz2368 I suspect that the pre-commit hooks are not setup to look at .ef files. You could perhaps look at that, or leave it to @tturocy and me, as you wish, just let us know. As for this PR, to get this merged right away, I suggest you just accept the changes as suggested by co-polit, via the github interface, unless there is some reason not to? |
|
@wyz2368 It is a separate question how the trailing white space got included in these .ef files -- were you doing manual edits? |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
I downloaded the .ef files for Chapter 5 MAS from gametheoryexplorer after I created them. For Chapter 6, I used ChatGPT to create the .ef files, which do not contain the trailing whitespaces.
I installed pre-commit hooks using .pre-commit-config.yaml in gambit project and then scanned all files. But probably it did not scan the ef files for some reasons. I can figure that out and probably update the .pre-commit-config.yaml. |
Yes, if we can get it working on .ef files too that would be good. |
As far as I know it should work on |
I just cloned this branch down and ran on it. It found and fixed the trailing whitespace: I haven't committed and pushed this so @wyz2368 can test it - but it looks like |
|
@tturocy This is interesting. I got the follow message after running |
|
@rahulsavani I might have done something with accepting Co-pilot's suggestions since I only see the trailing whitespace fixed in one .ef file. Can you run co-pilot again? I will search for how to accept all suggestions at a time. |
|
Don't worry about the Are you sure what you have locally is what's pushed onto GitHub? |
… into fix/catalog-update-local-source
|
@tturocy Good catch! Maybe the trailing whitespace was removed already when I tested pre-commit. That's why I cannot see the errors again. Pushed again. |
rahulsavani
left a comment
There was a problem hiding this comment.
Apart from fixing the trailing whitespace issue, I have only two things I recommend to change:
- fig6_8: here the infosets overal in both the default and original layouts:
Please fix these by changing the params and or .ef file to remove the overlap.
- "Please read carefully about the definition of perfect recall, which infers three types of imperfect recall." Let's remove this sentence from the description of fig5_12. "Infers" does not work as the very hear, but also, telling the user to "read carefully" is out of style with other descriptions. If you do want to you could change the first sentence to "A game with imperfect recall, in particular absent-mindedness".
|
@wyz2368 Can you please make this two PRs, one with the proposed fix to the catalog update and a separate one with the games? We should keep commits logically separate. |
|
@tturocy I have pushed a fixed version to this PR, but I will further create two PRs that separate the current PR. Now I have created a |
|
Adding games didn't require the other PR - we've been adding games for ages with no problem. But it's now been merged so basing off of |
@tturocy The development guide for catalog says: 6. Submit a pull request to GitHub with all changes. So what are the steps for adding games without creating a PR? Maybe I can create a PR to add the games following the guide for now and wait for your later clarification. |
|
What I meant was that the problem you flagged was indeed creating incorrect output in the documentation, but putting the games in the repository per se was not affected - you just need to stick the files in the prescribed places and update the manifest file used by |
|
Separated into two other PRs. |
The bug is that
build_support/catalog/update.pydoes not build a fresh catalog from Git directly. It calls:gbt.catalog.games(include_descriptions=True), so it uses whatever pygambit your current python imports. If that Python has an old installed/editable pygambit, or an oldbuild/lib.../pygambit/catalog_data, it will “remember” deleted games. The remembering is severe: even if one deletes the gambit locally and git clone a new one, reinstalling will still remember old games. Now this has been fixed by updatingupdate.py.After fixing the bug, EFGs from MAS and some original layouts were added.
I will close Add EFGs from Shoham and Leyton-Brown (2008) #936.