Repository navigation
test(scaling): count children-index work instead of timing it (#4753) - #4791
Merged
Daniel Meppiel (danielmeppiel) merged 4 commits intoNov 22, 2026
Merged
Daniel Meppiel (danielmeppiel) merged 4 commits into
Daniel Meppiel (danielmeppiel) merged 4 commits into
Conversation
TestChildrenIndexScaling compared microsecond timings at 50 and 500 deps against a 15x bound and flaked at 17.2x on a loaded runner. It now counts the dependencies the index receives and the attributes it reads through a counting lockfile view: linear work is exactly 10x for 10x input, quadratic work about 100x. The index content is also checked against the real lockfile. Fixes #4753 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…eppiel-4753-children-index-op-count
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 22, 2026 18:36
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The scaling guard misses quadratic child-list copying because its counter and negative control cover only dependency access, leaving an output-equivalent performance regression undetected.
1 open issue
What changed in this PR
This test-only change addresses the flaky children-index scaling check from #4753 by replacing microsecond timing comparisons with deterministic dependency-access counts. Production code and other scaling guards remain unchanged.
Changes:
- Counts dependency retrievals and attribute reads for 50 and 500 dependencies, enforcing a 10x growth bound.
- Checks index contents against the real lockfile and adds a quadratic rescanning negative control.
| File | Description |
|---|---|
tests/benchmarks/test_scaling_guards.py |
Replaces the children-index timing check with counting wrappers, output checks, and a negative control. |
Review effort: Balanced
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-4753-children-index-op-count
branch
November 22, 2026 19:51
This was referenced Nov 22, 2026
Merged
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.

Description
TestChildrenIndexScalingtimed_build_children_indexon 50 and 500 deps (microseconds) and asserted a ratio below 15x. It flaked at 17.2x on a loaded runner (#4711 Integration run 45029284682).It now counts work instead of timing it, the same idea as #4726 (a deterministic quantity):
ops(500) <= 10 * ops(50).No production source change; other scaling guards are untouched (out of scope).
Issue and approved scope
Issue: Fixes #4753
Human scope-approval comment: #4753 (comment)
Does this PR complete the issue, or what remains? It completes the issue.
Type of change
Testing
Local, via the host guard (
/tmp/eng4753-proof.sh):pytest tests/benchmarks/test_scaling_guards.py::TestChildrenIndexScaling -n 0: passed.{50: 125, 500: 1250}, so the bound can never be crossed by noise._build_children_indexcallsget_package_dependencies()per edge; reverted):AssertionError: _build_children_index did 126250 operations for 500 deps and 1375 for 50, an O(n^2) regression, i.e. 1 failed.ruff check/format --check(0.15.12): cleanscripts/check_test_assertions.py: ratchet clean (AQ003 unchanged)python -m tests.quality.taxonomy --changed: cleanChangelog
changelog.d/<pr>.<section>.md, holdingone line: user-visible effect first, 25 words or fewer, ending with
(#PR); breaking changes only under upgrade notes; no Highlights; nonew lines under
## [Unreleased]. Seechangelog.d/README.mdand.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)
CONFORMANCE.{md,json}regenerated