Repository navigation
test(python): bound pyc parser work by counts instead of elapsed time - #11608
Merged
Merged
Conversation
PythonPycParser takes an optional work counter (digested bytes, constant summaries, listed container children, nested and key walk steps, key bytes and report flattening visits). The eight pyc tests that bounded wall-clock time now assert those counts, so each regression they guard (repeated hashing, per-reference summaries, per-step child copies, shared walks, exponential key expansion) fails deterministically on any machine. Refs #10513
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
[Low impact] The PR appears safe to merge; no blocking code issues were found. SummaryThe PR replaces eight elapsed-time assertions with counts recorded by the parser.
Reviews (2) · Last reviewed commit: "test(python): bound pyc parser work by c..." · Reviewed by Greptile |
11 tasks done
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
Refs #10513. The eight wall-clock bounds in
src/python/PythonPycParser.test.tsare replaced by exact work counts from an optional counter the parser accepts.Problem and expected behavior
Eight pyc tests asserted
Date.now() - started < 1000(one< 250). Each guards an algorithmic property (a shared byte string hashed once, one summary per TYPE_REF'd object, a wide dict listed once, a shared container walked once for all owners, linear TYPE_REF walks, tuple-key expansion refused before it doubles). Elapsed time fails on loaded CI shards without a regression and passes on a fast machine with one. Expected: the same properties asserted as deterministic counts.Change and scope
parsePythonPyc(bytes, artifact, input, work?): optionalPythonPycWork(emptyPythonPycWork()); production callers pass nothing. Counted where the work happens:digestedBytes(SHA-256 input),constSummaries,listedChildren(container child slots listed for the nested walk),nestedSteps,keySteps,keyBytes(joined key bytes),codeVisits(report flattening). Counts accumulate even when the parse throws, so a refused parse is measurable too.listedChildren === 2 * keys, shared containernestedSteps === copies + 1, shared byte stringconstSummaries === 1anddigestedBytes < 2 * payload, TYPE_REF tuple chainkeySteps === 2 * links + 1, tuple-key refusal withkeySteps <= 4 * depthandkeyBytes <= 8 * depth.Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.
Contract and boundary impact
docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): None.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/python/PythonPycParser.test.ts: 8 tests converted; no wall-clock assertion remains in the file.For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.
For evidence-bearing changes:
Validation performed
npm run test:focused -- src/python/PythonPycParser.test.ts src/artifacts/pyinstaller/PyzArchive.test.ts src/artifacts/pyinstaller/PyInstallerArtifactReader.test.ts: 128 passed.npm run test:local -- src/python/PythonPycParser.test.ts: the expected tests fail.npm run check:fast(typecheck, lint, architecture guards): passed.npx oxfmton both files; pre-commit and pre-push hooks ran.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.