docs(runtime): narrow the diagnostics feature comment to what it actually gates - #10820
proggeramlug wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe PR corrects the ChangesDiagnostics feature scope
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Other 🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
Full details: Description checkExplanation The description provides a detailed summary, rationale, concrete technical changes, and benchmark results. However, it does not follow the required template structure and omits the required Related issue, standard Test plan checklist, Screenshots / output section, and Checklist. Full details: Linked Issues checkExplanation Issue Full details: Out of Scope Changes checkExplanation The changed files concern runtime diagnostic-feature documentation and a changelog entry for issue
✨ Finishing Touches 💡 1🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
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. Comment |
|
Landed via merge train 242 (#10830) as v0.5.1621 — Eight PRs travelled together because their file sets are disjoint — 30 files, +1,514/−101, zero overlap. Validated as one tree: ten cheap gates, Two of the eight needed a fix before they could land, both made in the train rather than bounced back. #10816 bound #10817 added 15 dispatch entries without regenerating the docs, so the API-docs-drift check failed. Regenerated from a built binary: 2855 → 2870, exactly your 15, with For future PRs in this area: One more thing, aimed at whoever cuts the next PR here: |
crates/perry-runtime/Cargo.toml's comment abovediagnostics = []says "None are on a hot path." That is true of the four things it enumerates —PERRY_GC_DIAG, the typed-feedback trace dump, the v8 heap-snapshot builder,process.report— and false as a blanket statement, because the feature does not gatehot_diagat all:lib.rsdeclarespub mod hot_diag;with no#[cfg].hot_diag.rscontains zerocfg(featureoccurrences.enum_on()is called per string concat (string/concat.rs:688and:1052) and per property enumeration, in every build including what ships.So stripping the
diagnosticsfeature does not remove that call, and a reader who takes the comment at face value concludes it does.This is worth narrowing because comments in this tree are load-bearing in people's reasoning. A peer session quoted a neighbouring
hot_diagcomment ("an unarmed build pays one relaxed load") as evidence about generated code and proposed a fix on that basis; reading the actual gate bodies showed both gates carry the sameOnceLockprobe and the difference is a short-circuit at the call site. Same failure shape as the tautologicaldebug_assertthe GC-header gate replaced, and as the denial pointing at closed #7109 that #10804 fixes: a reference that reads as evidence and isn't.No performance claim attached — deliberately
The obvious follow-up was implemented, measured, and reverted: collapse
enum_on()'sOnceLock-probe-plus-AtomicBool-load into one three-stateAtomicU8with a#[cold] #[inline(never)]resolve arm.Measured against its exact parent commit (the branch was rebased onto the base arm's commit first, so the comparison isolates one variable rather than mixing in five commits of unrelated churn):
+1.43 on ~400 — indistinguishable from zero. The control is valid in both arms, so the measurement is sound and the hypothesis is simply wrong.
Why it was wrong is the useful part. A peer measured a real win — zod −5.2%, an S40 fixture −12.4% — from deleting an early-returning diagnostic gate. That came from removing the call and its inlining barrier entirely, not from making the gate's body cheaper. Saving one load out of four hundred instructions is below what any probe here resolves. Recorded in the changelog so the next person doesn't re-derive it.
Summary by CodeRabbit