-
-
Notifications
You must be signed in to change notification settings - Fork 159
fix(opt-report): report spec_no_call_sites instead of silence when every call was inlined away (#7111) #7818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+44
−3
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| **`--opt-report` now says `spec_no_call_sites` where it used to say nothing** (#7111). | ||
|
|
||
| A function whose call sites were all removed by an earlier pass — the inliner, then `unroll_static_loops` constant-folding what it produced — has no entry in `spec_facts.call_sites`, which is built by walking `hir.init` and every body for direct `Call` expressions. The spec-ABI decision loop `continue`d on that **before** constructing any `TypedCloneRejectionReason`, so nothing reached `record_typed_clone_rejection` and nothing reached `opt_report::deny_named`. | ||
|
|
||
| The result was silence, and silence is the one answer this report cannot afford: it is indistinguishable from "not analysed" and from "analysed and denied". A reader now sees that the loop was reached and had nothing to decide. | ||
|
|
||
| Measured on a four-line fixture whose only call to `tiny()` is inlined and folded away: | ||
|
|
||
| | | entries | rules | | ||
| |---|--:|---| | ||
| | before | 1 | `not_index_used_or_bounded` | | ||
| | after | 2 | `not_index_used_or_bounded`, **`spec_no_call_sites`** | | ||
|
|
||
| The new `TypedCloneRejectionReason::SpecNoCallSites` is deliberately not framed as a denial — its doc says so — because there is nothing to specialise *for*; it is reported so the absence is legible rather than inferred. | ||
|
|
||
| Worth recording for the next person: `--opt-report` writes to **stderr**, deliberately, so it cannot contaminate a `--format json` stdout payload or piped program output. Three of my attempts to observe it came back empty because they were running under `2>/dev/null`. That is also the likeliest reason a report looks like it "did not render". | ||
|
|
||
| `cargo test -p perry-codegen --lib` 851 passed / 0 failed; fmt and file-size clean. |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: PerryTS/perry
Length of output: 1713
🏁 Script executed:
Repository: PerryTS/perry
Length of output: 50370
🏁 Script executed:
Repository: PerryTS/perry
Length of output: 50369
🏁 Script executed:
Repository: PerryTS/perry
Length of output: 50370
🏁 Script executed:
Repository: PerryTS/perry
Length of output: 29939
Add an explicit
SpecNoCallSitesreport explanation.The wildcard text incorrectly describes a failed specialized-ABI precondition and a boxed entry.
SpecNoCallSitesmeans that all direct call sites were removed, so specialization was moot. Add a dedicated explanation and assert it in the regression fixture.🤖 Prompt for AI Agents
Source: MCP tools