-
-
Notifications
You must be signed in to change notification settings - Fork 161
fix(tooling): classify four net.Socket providers and unmask the native-result ledger gate #10740
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
Closed
+51
−2
Closed
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
36 changes: 36 additions & 0 deletions
36
changelog.d/10740-native-result-ledger-net-socket-providers.md
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,36 @@ | ||
| Fix `scripts/native_result_ledger.py`, which was red on `main` and blocking | ||
| the path-filtered `Native Result Ledger` workflow on every PR touching | ||
| `crates/perry-codegen/src/lower_call/native_table/**` or the ledger files. | ||
|
|
||
| Two defects, one masking the other. `EXPECTED_ROWS` was stale at 371 while | ||
| #10658's `net.Socket` surface cluster (merge train 221) grew | ||
| `native_table/net_events.rs` from 53 to 58 typed rows. Behind that stale | ||
| count sat the real problem: those five rows carry four runtime symbols that | ||
| had no entry in `scripts/native_result_ledger.tsv`, so the codegen table | ||
| declared a result class the provider inventory had no opinion about — and an | ||
| unclassified `result_kind` misrepresents to the GC what a native call | ||
| returns. Because `check()` raises on its first failure, the row-count check | ||
| never let the classification-coverage check run, so bumping the constant | ||
| alone would have turned the gate green and shipped the real defect. | ||
|
|
||
| Each provider was read rather than name-matched. All four return their | ||
| `handle: i64` argument unchanged — a `next_id_or_throw()` registry id and key | ||
| into `statics::sockets()`, not a heap address — so all four are | ||
| `NR_HANDLE_ID` (`NativeRetKind::HandleId`, "an integer registry id or | ||
| provider sentinel"): | ||
|
|
||
| - `js_ext_net_socket_on` — `crates/perry-ext-net/src/handle_exports.rs` | ||
| - `js_net_socket_prepend_listener` — `crates/perry-ext-net/src/lifecycle.rs` | ||
| - `js_net_socket_prepend_once_listener` — `crates/perry-ext-net/src/lifecycle.rs` | ||
| - `js_net_socket_unpipe` — `crates/perry-ext-net/src/pipe.rs` | ||
|
|
||
| Four symbols across five rows: `js_ext_net_socket_on` backs both the `on` and | ||
| the `addListener` rows. The sibling `js_net_socket_pipe` returns `f64` under | ||
| `ret: NR_F64`, which the scanner does not classify, so it needs no row. | ||
|
|
||
| `EXPECTED_ROWS` 371 → 376 and `EXPECTED_PROVIDERS` 322 → 326, with the | ||
| existing explanatory comment extended to attribute the delta to #10658 and | ||
| train 221. The gate was re-proved to bite: deleting a new row reddens it on | ||
| the provider count, deleting it with the count adjusted reddens it naming the | ||
| symbol, and misclassifying `js_net_socket_unpipe` as `NR_GCPTR` reddens it on | ||
| the table/provider disagreement. | ||
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
🔎 Supported by static analysis
🏁 Script executed:
Repository: PerryTS/perry
Length of output: 9836
🏁 Script executed:
Repository: PerryTS/perry
Length of output: 5137
Describe the deleted artifact as a provider-ledger entry.
check()checks the native row count before the provider count. Deleting a native table row would fail withexpected 376 classified rows, found 375. The provider-count failure therefore comes from deleting the corresponding entry inscripts/native_result_ledger.tsv. With the provider count adjusted, the missing entry fails with a symbol-specific “provider lacks a class” error.🤖 Prompt for AI Agents