Skip to content

test(checker): pin rename invalidation for transitive callers - #147

Merged
sims1253 merged 3 commits into
mainfrom
fix/fixpoint-recollection-invalidation
Sep 1, 2026
Merged

sims1253 merged 3 commits into
mainfrom
fix/fixpoint-recollection-invalidation

Conversation

@sims1253

Copy link
Copy Markdown
Owner

Summary

#90 asked for a fix in force_full_recollection: it cleared collected_files before update_file could move old function names into invalidated_fns. #90 also said to check #81 first.

#81 closed as a harness race, not a checker defect. #93 then deleted force_full_recollection. The invalidation #90 asked for already lives in update_file and remove_file, added in #58: each extends invalidated_fns from the removed pass-1 entry before the entry leaves the map.

So this PR is test-only. The rename path had no regression test. I reverted the invalidation locally and ran the new test: it failed with the exact staleness #90 describes. The transitive caller kept RY040 cannot apply arithmetic op to `character` and `integer` after the rename. With the invalidation restored, it passes.

Changes

  • crates/ry-checker/tests/project.rs: add renamed_function_matches_cold_for_transitive_callers. leaf.R defines helper, middle.R wraps it, top.R calls the wrapper. An update renames helper to renamed. The old name is absent from the new function table, so only the retained name seeds the reverse call graph. The test asserts the incremental result matches a cold check.

Verification

  • cargo fmt -p ry-checker
  • cargo clippy -p ry-checker --all-targets -- -D warnings
  • cargo test -p ry-checker — all 17 suites green

Stacked on #142. Merge after it.

#90 item status

Item Status
ry-analysis SetOpenFile version comparison Moot. PR #112 dissolved ry-analysis.
ry-analysis snapshot HashMap ordering Moot. PR #112 dissolved ry-analysis.
project.rs recollection clearing order Production fix predates the deletion (#58, #93). This PR adds the rename regression test.
Zed cached_path_precedence test Fixed by #141. binary_source_precedence now exercises the cache branch.
p36_contract drain loop stops at first timeout Re-bounded by a total drain deadline in crates/ry-lsp/tests/protocol_contract.rs.
check-ledger.py per-key comparison Fixed on main. compare_summary compares each summary map against its Counter.
ry-cli forward resolved degraded scopes Already handled. ry check prints them via print_degraded(); dump-types prints one line per scope. WorkspaceContext.degraded_scopes has no consumer in the check path.

Every item is resolved or moot.

Closes #90

- Replace Project::prev_return_slots with a has_prev_emit bool; the
  full RType vector was cloned every emit and only tested for presence.
- compute_fixpoint_scope now calls with_transitive_callers instead of
  re-implementing its reverse-caller closure loop.
- The shared test helper check_with_scope delegates to the public
  Checker::check_with_scope instead of replaying collect plus a manual
  fixpoint.
- Drop the unused rationale field from Verdict in rule_evidence.rs;
  code and verdict are the asserted fields.
- Drop the cfg(test) is_package_library_file helper and its single
  assertion, which re-tested ry-workspace classification.
- Rename infer_schema_call's unused span parameter to _span.
- State the current constraint in the filter-builder comment instead
  of the move history.
#90 flagged force_full_recollection for clearing collected_files before
update_file could move old function names into invalidated_fns. #81
closed as a harness race; #93 deleted the function. The invalidation
#90 asked for already lives in update_file from #58.

The rename path had no regression test. Add one. A rename drops the old
name from the new function table, so only the retained name seeds the
reverse call graph. The test asserts a transitive caller matches a cold
check. Reverting the invalidation locally fails it with the stale RY040
#90 describes.
@coderabbitai

coderabbitai Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 15 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 1f5a26ae-d00f-48e1-89d7-c417df6c5720

📥 Commits

Reviewing files that changed from the base of the PR and between 196850f and 0706a9e.

📒 Files selected for processing (1)
  • crates/ry-checker/tests/project.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Reviewed the full diff of crates/ry-checker/tests/project.rs — one new integration test, renamed_function_matches_cold_for_transitive_callers, pinning the rename-invalidation path from #90.

  • Verified the test is real coverage, not theatre. I mutation-checked it locally: deleting the invalidated_fns.extend(...) block in Project::update_file (crates/ry-checker/src/project.rs:196-200) makes the test fail with exactly the staleness #90 describes — top.R keeps RY040 cannot apply arithmetic op to `character` and `integer` after the rename while the cold check has none. With the invalidation restored, the full --test project suite passes 22/22.

  • Confirmed the coverage claim. No pre-existing regression test exercises the rename path; the closest sibling, removed_function_matches_cold, covers removal with a direct caller only. The new test's transitive-caller chain (leaf.R → middle.R → top.R) subsumes the direct case, and the precondition assertion pins the pre-rename RY040 so the test can't silently degrade into comparing two empty result sets.

  • Checked the test against file conventions. It follows the established *_matches_cold before/update/incremental/cold pattern, including the Arc::new(parse(...)) update idiom and the doc comment citing the issue. No CHANGELOG entry needed for a test-only change.

Pullfrog  | View workflow run | Using openai-compatible/glm-5.3 | 𝕏

@sims1253
sims1253 deleted the branch main August 31, 2026 19:37
@sims1253 sims1253 closed this Aug 31, 2026
@sims1253 sims1253 reopened this Aug 31, 2026
@sims1253
sims1253 changed the base branch from cleanup/checker-dead-code to main August 31, 2026 21:25
@sims1253
sims1253 merged commit b6cdd3d into main Sep 1, 2026
15 checks passed
@sims1253
sims1253 deleted the fix/fixpoint-recollection-invalidation branch September 1, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PR #79 review leftovers: triaged as real, never implemented

1 participant