-
-
Notifications
You must be signed in to change notification settings - Fork 159
test(codegen): pin the GC strategy onto the define line, in BOTH root lowerings #8000
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
+115
−0
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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,30 @@ | ||
| ### Codegen: pin the GC strategy onto the define line, in both root lowerings (#7982 follow-up) | ||
|
|
||
| #7998 made `LlFunction::define_header` the single renderer of the `define … {` | ||
| line, after the in-process native path's private copy silently lost | ||
| `gc "statepoint-example"` — a natively-constructed module then got no RS4GC | ||
| pass and therefore **no precise roots at all**, while verifying, linking and | ||
| running correctly on any program that does not collect. | ||
|
|
||
| The test that shipped with it does not actually pin that property, and the two | ||
| attempts to fix it failed the same way the original bug did. Recorded because | ||
| it is this change's own bug class occurring inside its own test: | ||
|
|
||
| 1. The `to_ir` == `define_header` agreement test **cannot** see a dropped | ||
| strategy: with one shared renderer both sides change identically. Sabotage | ||
| passed. | ||
| 2. A dedicated strategy test that branched on `native_stack_roots_enabled()` | ||
| never ran its ON arm under `cargo test` — no module has called | ||
| `set_native_roots_for_target`, so the predicate is false in the test | ||
| process. Sabotage passed again. | ||
| 3. Only pinning **both** lowerings with `NativeRootsPin::{native,shadow}`, and | ||
| asserting `stack_map_slot_count` in each arm first so neither can pass | ||
| vacuously, goes red on the sabotage. | ||
|
|
||
| Native-roots must take the stack-map path AND name the strategy; shadow-stack | ||
| must not take it AND must not name the strategy. The tests live in | ||
| `function.rs`, which compiles WITHOUT the `llvm-inprocess` feature, so they run | ||
| in per-PR `cargo-test` rather than only in the feature job. | ||
|
|
||
| Sabotage-verified with the fix committed first, then restored and REBUILT: 935 | ||
| `perry-codegen` lib tests green under `--features llvm-inprocess`. | ||
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.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Keep the changelog fragment focused on shipped behavior.
The fragment mixes the final behavior with failed-test history, sabotage steps, and internal test-run details. Keep one concise entry that states the shipped contract: native-roots functions that reserve stack-map slots emit
gc "statepoint-example"; shadow-stack functions do not; regression coverage covers both.Based on learnings: “For changelog fragments under
changelog.d/, describe the final shipped behavior as one coherent release-note entry. Do not include separate development-slice narratives.”🤖 Prompt for AI Agents
Source: Learnings