Repository navigation
test(python): pin one workspace parse per run for the foreign-write index (#10125) - #10264
Conversation
…ce per run (#10125) A thread-local parse counter in the foreign index and an analyze_diff test over one versus three changed modules require identical parse counts. Moving the index build into the per-changed-file loop makes the count double. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Md92nb17wXfHAmQNvaWYu3
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 49 minutes. View limit details
Comment |
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm the new test-only thread-local counter can be affected by concurrent tests on the same worker thread.
- Confirm sibling Python analysis routes that may independently construct ForeignIndex were not exhaustively scanned, so the test proves the analyze_diff route rather than a repository-wide parse invariant.
- Confirm the acceptance claim is supported by the changed test structure, but successful test execution is still required because the ripr sensor failed.
Refuted
- Adding the regression test could change production behavior through shared state.; refuted because: Both the thread-local and its increment are guarded by #[cfg(test)], so release builds exclude the added state and instructions.
- The test duplicates or over-couples to unrelated analysis behavior instead of isolating the performance invariant.; refuted because: The helper constructs only minimal Python sources, changes only the number of changed modules, and asserts findings plus stable parse counts; the counter is placed at the single assigned_attributes call used by ForeignIndex::build.
- The PR title/body overclaim a workspace-level parse guarantee that a six-file synthetic fixture cannot establish for all Python sources or parse failures.; refuted because: The changed behavior being tested is that analyze_diff does not rebuild one shared foreign index per changed module; the fixture directly checks that invariant. It does not claim that every possible workspace parses successfully.
Evidence gaps
- The only material correctness question is whether the focused test actually executes and distinguishes the intended one-index-build implementation from a per-changed-file rebuild.
|
The fix of record is #10269 (re-blesses exactly these 14, merge-ready, CI running). I am not opening another. Once it lands I will merge main here and re-apply Generated by Claude Code |
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm the counter increments once per ForeignIndex::build candidate source, not necessarily once per successful parse; the test's six-parse label may overstate what the counter measures.
- Confirm the test demonstrates the analyze_diff route but does not establish a repository-wide invariant for sibling Python analysis routes.
- Confirm the test does not establish that every sibling Python analysis route builds ForeignIndex only once; it pins the claim for analyze_diff with one changed file and three changed files.
Refuted
- The test proves that every Python analysis route parses the workspace once, rather than only analyze_diff.; refuted because: The test invokes PythonAdapter.analyze_diff and compares runs that differ only in changed-file count; it does not claim or exhaustively test sibling routes.
- Instrumentation could leak into production or materially change ForeignIndex construction.; refuted because: The counter declaration and increment are both cfg(test)-guarded, and the added test-only state does not alter release code.
- The test cannot detect rebuilding the workspace index once per changed file.; refuted because: The helper creates six source files, invokes analyze_diff with one and then three changed modules, expects six parses for each run, and requires equal counts. A per-file rebuild would parse 18 times in the three-file run, contradicting the equality assertion.
Parked follow-ups
- A failed analyze_diff still records and returns the parse count, but cleanup is skipped because result? occurs after remove_dir_all is scheduled; the test may leave temporary directories on error.
Evidence gaps
- The acceptance claim lacks trustworthy execution evidence in this packet: ripr failed, while cargo-test is only scheduled late.
- Current-head automated test success is not established by the supplied sensor receipts.
- Model proof intent was rejected by deterministic validation.
- The regression test is blocked only on execution.
|
Review of record, head 6eb9f1f CI: Angles:
No blocking finding. Generated by Claude Code |
Governing issue or accepted claim: #10125 (perf claim made in #9861; independent review of 80f279a found the equivalence test shares the code it checks and never counts parses)
Acceptance delta (one sentence):
analyze_diffover one versus three changed Python modules must parse the workspace the same number of times, so rebuilding the foreign-write index per changed file fails a test.Change
module_value.rs: a#[cfg(test)]thread-localFOREIGN_PARSESincremented at the oneassigned_attributescall inForeignIndex::build. No release-build state.python_tests.rs:analyze_diff_parses_the_workspace_once_however_many_files_changedruns the adapter over six sources with one and then three changed constants; requires one finding per changed constant, six parses for six sources, and equal counts across both runs.Verification
cargo xtask precommitexit 0.for changedloop makes the test fail (12 parses against the expected 6); reverted.Generated by Claude Code