Repository navigation
[guards] Attribute an unpicklable guard value by identity, not by type name - #194388
Closed
bobrenjc93 wants to merge 3 commits into
Closed
bobrenjc93 wants to merge 3 commits into
bobrenjc93 wants to merge 3 commits into
Conversation
This was referenced Aug 21, 2026
Closed
Closed
This was referenced Aug 22, 2026
Closed
Contributor
Author
|
@bobrenjc93 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
1 similar comment
Contributor
Author
|
@bobrenjc93 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Contributor
Author
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.
Stack from ghstack (oldest at bottom):
_offending_value_pathregexed the type name out of the pickle error and thensearched the guard state's scopes for a value of that type. It does not have to
guess:
reducer_overrideis handed the object it is reducing, so recordingthat gives the exact value and the search becomes an identity match.
Guessing was wrong in a way that matters. With two values of the same type in
scope it reported whichever it found first:
and
bis the one that failed. On a large model the whole value of thisdiagnostic is that it saves bisecting by hand, so pointing at the wrong
attribute is worse than pointing at nothing.
Deletes the type-name extraction: the
re.search, thersplit('.', 1)that existed only because CPython qualifies the name for anything outside
builtins, and the early-out for an error whose text did not match the pattern --
which also means a
__reduce__that raises something other than "cannotpickle 'X' object" now gets a path too, where before it got nothing.
Test Plan:
The existing unit test grows a same-typed decoy in front of the real value, so
it pins identity-matching rather than type-matching.
Authored with an AI assistant.
Differential Revision: D116962600