Repository navigation
WIP: dense CallSpec, lazy NodeKeywords, deferred TopRequest - #14766
Draft
RonnyPfannschmidt wants to merge 3 commits into
Draft
RonnyPfannschmidt wants to merge 3 commits into
RonnyPfannschmidt wants to merge 3 commits into
Conversation
Member
Author
|
this one doesn't bring in enough win yet |
7 of 8 tasks
RonnyPfannschmidt
force-pushed
the
exp/dense-callspec-lazy-keywords
branch
from
September 15, 2026 11:43
dcd3471 to
de5d6be
Compare
RonnyPfannschmidt
force-pushed
the
exp/dense-callspec-lazy-keywords
branch
from
September 23, 2026 06:21
de5d6be to
bd0222b
Compare
RonnyPfannschmidt
force-pushed
the
exp/dense-callspec-lazy-keywords
branch
from
October 4, 2026 13:06
bd0222b to
2d1464f
Compare
Experimental changes aimed at large parametrized suites (pytest-dev#619): store CallSpec2 as parallel tuples, derive NodeKeywords without eager marker dicts, and defer TopRequest until first use. Adds bench/collection_memory.py to measure RSS per collected item. Co-authored-by: Cursor AI <ai@cursor.sh> Co-authored-by: Cursor Grok 4.5 <grok@x.ai>
`_lookup_derived` scanned `own_markers` front-to-back and returned the first name match, but the eager `keywords.update((mark.name, mark) ...)` it replaces let *later* markers win. A Class stores MRO-inherited markers base class first, so `keywords["foo"]` silently changed from the subclass' marker to the base class' one. Scan in reverse instead. Note this direction is tied to `own_markers` order: it has to flip if Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The lazy NodeKeywords derived keywords from `_obj.__dict__` of every node, so a module's globals and a class's attributes - `pytestmark` among them - showed up in each item's keywords. The eager code it replaced only did `keywords.update(self.obj.__dict__)` in Function. `_folded_skips` folds skips from a module-level `pytestmark` by checking that "pytestmark" is *not* in the report keywords, so the leak broke `test_skipped_folding`. Co-Authored-By: Claude Opus 5.5 via Claude Code <noreply@anthropic.com>
RonnyPfannschmidt
force-pushed
the
exp/dense-callspec-lazy-keywords
branch
from
October 14, 2026 07:32
2d1464f to
8aa68e2
Compare
This branch has not been deployed
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.
Summary
CallSpec2densely as parallel tuples (_argnames/_values/_indices/_scopes) with tuplemarks, exposing dict-like views via_CallSpecMap.NodeKeywordslazy: derivenode.name, markers, function attributes, andcallspec.idon read instead of eagerly copying into a per-item dict.TopRequestuntil first access (None→ construct;Falsestill means cleared after a run).bench/collection_memory.pyto measure RSS delta per collected item.Local numbers (parametrized ints,
--collect-only)Test plan
python bench/collection_memory.py --counts 1000,10000,50000,100000pytest testing/test_mark.py testing/python/metafunc.py testing/python/fixtures.py::TestRequestBasic -q-kselectionNotes
Made with Cursor