Repository navigation
Conversation
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.
The subfield cache keys on
id(FieldDetails)but does not retain those objects. After a field detail is freed, CPython can reuse its identity for another field, returning the earlier field's selection set.Keep an immutable tuple of the key objects alongside each collected result. The existing identity keys and cache hits remain intact, including calls with a different list containing the same objects. Keeping a snapshot also handles callers clearing their input list; references are released with the shared execution cache.
The regression checks key lifetime, cache identity, distinct selection results, and eventual release. The reported reproducer produced 497 incorrect selections in 500 runs on main and none with this change. A separately installed wheel also passed 400 complete GraphQL schema/query/result journeys covering distinct fields, merged selections, and aliases.
Validation: Python 3.14 full suite 3,528 passed / 18 skipped with the required 100% source and test coverage; Python 3.10 floor 3,529 passed / 17 skipped. Ruff check/format, mypy (353 files), and the strict
sphinx -b html -nEWbuild pass. An independent AI reviewer inspected the cache's ownership across sub-executors and reran all 43 executor tests. Prepared with AI assistance.Fixes #284.