From 448dacdb58cfaed373bb79b9b9b369bf3af8c07e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralph=20K=C3=BCpper?= Date: Sun, 20 Sep 2026 14:40:34 +0200 Subject: [PATCH 1/2] fix(codegen): point the module-global Ptr denial at #10803, not closed #7109 --- changelog.d/stale-denial-issue-pointer.md | 29 +++++++++++++++++++++++ crates/perry-codegen/src/expr/slot_rep.rs | 10 +++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 changelog.d/stale-denial-issue-pointer.md diff --git a/changelog.d/stale-denial-issue-pointer.md b/changelog.d/stale-denial-issue-pointer.md new file mode 100644 index 0000000000..361ab6e48a --- /dev/null +++ b/changelog.d/stale-denial-issue-pointer.md @@ -0,0 +1,29 @@ +**fix(codegen): point the module-global `Ptr` denial at its real issue.** +`MODULE_GLOBAL_ISSUE` in `expr/slot_rep.rs` — the issue number the optimiser +report prints when a module-level binding is denied a canonical slot — cited +**#7109**. That is a different mechanism: #7109 is the module-init / +program-entry *context* gate, which `MODULE_INIT_CONTEXT` in the same file +still cites correctly. #7109 is closed, and so is #10774, which lifted that +gate. + +So every reader who followed the denial's own pointer landed on a closed issue +about something else, and could reasonably conclude the module-global class was +already handled. That is not hypothetical: one optimisation pass recorded +module-global storage as "less important" on exactly that reading, and a +separate campaign spent a day repeating "#7109 is the blocker" on inherited +belief before checking the issue state. + +Now points at **#10803** (`Ptr` is denied to three storage classes: +module globals, function parameters, and locals escaping into a module global), +with a comment recording why the old pointer was wrong so the correction is not +silently reverted. + +Deliberately unchanged: `MODULE_INIT_CONTEXT`'s `#7109`, which is accurate to +that rule's subject, and the `#7109` fixture string in `opt_report/render.rs`'s +test helper. Only the live user-facing pointer for the module-global storage +class moved. `the_context_gate_is_reported_when_every_value_rule_passed` +asserts the `MODULE_INIT_CONTEXT` pointer and still passes unchanged, which is +what confirms the two were separable. + +Found by cross-session review while handing the module-global lane to another +campaign; the denial classes it names are that campaign's #10803. diff --git a/crates/perry-codegen/src/expr/slot_rep.rs b/crates/perry-codegen/src/expr/slot_rep.rs index 21e77799e8..4f310c313c 100644 --- a/crates/perry-codegen/src/expr/slot_rep.rs +++ b/crates/perry-codegen/src/expr/slot_rep.rs @@ -450,7 +450,15 @@ pub(crate) fn deny_canonical_i32(ctx: &FnCtx<'_>, id: u32, name: &str, denial: C } /// Tracking issue for "a module-level binding can never take a canonical slot". -const MODULE_GLOBAL_ISSUE: &str = "#7109"; +/// +/// This pointed at #7109 until #10803. #7109 is a *different* mechanism — the +/// module-init / program-entry context gate, which `MODULE_INIT_CONTEXT` below +/// still cites correctly — and it is closed, as is #10774 which lifted that +/// gate. A reader who followed this denial's own pointer therefore landed on a +/// closed issue about something else and could reasonably conclude the +/// module-global class was already handled; that is how one optimisation pass +/// came to record module-global storage as "less important". +const MODULE_GLOBAL_ISSUE: &str = "#10803"; /// Tracking issue for the index-use / i32-bound precondition. const NOT_BOUNDED_ISSUE: &str = "#7123"; /// Tracking issue for the profitability refusal — the one denial in this list From f2f5d2fc1634fc5397dd86a8105c49f13ac85290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralph=20K=C3=BCpper?= Date: Sun, 20 Sep 2026 14:41:08 +0200 Subject: [PATCH 2/2] changelog: key fragment to #10804 --- ...enial-issue-pointer.md => 10804-stale-denial-issue-pointer.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog.d/{stale-denial-issue-pointer.md => 10804-stale-denial-issue-pointer.md} (100%) diff --git a/changelog.d/stale-denial-issue-pointer.md b/changelog.d/10804-stale-denial-issue-pointer.md similarity index 100% rename from changelog.d/stale-denial-issue-pointer.md rename to changelog.d/10804-stale-denial-issue-pointer.md