-
Notifications
You must be signed in to change notification settings - Fork 72
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
RepairManager::add_path_to_goal_WMEs sometimes fails to ground dangling symbols #520
Comments
Thank you for the thorough explanation! I did not know you could coun by 4's to a specified offset to find the offending instruction in this way. Here's the method we're talking about: https://github.com/SoarGroup/Soar/blob/development/Core/SoarKernel/src/explanation_based_chunking/ebc_repair.cpp#L49 It doesn't have a comment, but going by the name it seems like it takes a symbol that's present in a matched production and finds the WME path from the current goal to the symbol. If a path is not found, it does indeed return null! The one caller, All of this logic occurs within I can't tell if there's some logic issue with finding the path to the symbol, or if it's actually not possible to guarantee that a path will be found, and we need to check for this case and reject the chunk. Having your code to debug with would help. Comments from others in this area would help, as well (Steven or John, perhaps, since I know they have stories of hitting chunking bugs). |
So adding the simple null check at least keeps my program from crashing. I have no idea if anything else needs to be done but this is at least an improvement. |
Good to know! 🤔 Trying to think of what the implication here is. If the symbol cannot be grounded, then wouldn't the resulting chunk be ungrounded? I think we might already have some warnings in there with a message to that effect. I think an ungrounded chunk should be rejected outright. The PR improves Soar's stability by eliminating a segfault, but I think we should add an else{} branch that prints an informative warning here. |
Is a chunk still learned after this fix? If so, can you share it? I want to see if it is ungrounded. |
Mazin's thesis, page 74 footnote:
So I want to know what situation caused this failure! |
Maybe one way that this could happen: the symbol is connected to one of the supergoals. I actually thought this was handled in Mazin's thesis already, but perhaps at this point in the code, the specified symbol is not grounded in the lowest goal. If line 85 does not include the superstate, then it would never find a path to the symbol. That might be a stretch, though. |
There are chunks that are learned but I don't know if any of them are the one that triggered this because I didn't bother to try to get this running in a c++ debugger. I guess if the code outputted a suitable warning I could tell. |
Can you share all the learned chunks here? Or, if you paste the chunks into a new agent, do any give you a warning about ungrounded symbols? |
I don't have an small reproducible example I can post, but I am getting a segfault when I turn on chunking using 9.6.3. on MacOS M1:
I get a stack dump like:
The disassembled add_path_to_goal_WMEs function starts with:
So you can see that it is getting a null pointer back from
Repair_Manager::find_path_to_goal_for_symbol
.I don't know what else is wrong, but it seems that
Repair_Manager::add_path_to_goal_WMEs
should do a null check.The text was updated successfully, but these errors were encountered: