Skip to content

build: drop the MI_NO_SET_VMA_NAME define mimalloc never read - #37080

Merged
Jarred-Sumner merged 3 commits into
mainfrom
claude/drop-mi-no-set-vma-name
Aug 7, 2026
Merged

build: drop the MI_NO_SET_VMA_NAME define mimalloc never read#37080
Jarred-Sumner merged 3 commits into
mainfrom
claude/drop-mi-no-set-vma-name

Conversation

@dylan-conway

Copy link
Copy Markdown
Member

What does this PR do?

scripts/build/deps/mimalloc.ts passes -DMI_NO_SET_VMA_NAME=1 on Linux with a comment claiming it disables mimalloc's prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, ...) after each mmap. No revision of oven-sh/mimalloc has ever referenced that macro (git log --all -S MI_NO_SET_VMA_NAME is empty; the call in src/prim/unix/prim.c is gated only on defined(PR_SET_VMA)), so it has been a no-op since it was added and mimalloc's regions have always shown up as [anon:mimalloc] in /proc/<pid>/maps. That labelling is genuinely useful for RSS attribution (it's how the numbers in #36990 were broken down), and the cost is one prctl per arena reservation, so this keeps the behavior and deletes the dead define plus its misleading comment. Same for the copy in scripts/bench-json-rust.sh.

No functional change: the compiled mimalloc object is identical with or without the define.

How did you verify your code works?

grep -rn MI_NO_SET_VMA_NAME over the repo and over oven-sh/mimalloc history is empty after this change; a Linux release build still shows [anon:mimalloc] VMAs in /proc/self/maps, same as before.

scripts/build/deps/mimalloc.ts passed -DMI_NO_SET_VMA_NAME=1 with a
comment saying it skips prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME) after
each mmap. No revision of oven-sh/mimalloc has ever checked that macro
(git log --all -S finds nothing), so the prctl has always run and
mimalloc's regions show up as [anon:mimalloc] in /proc/<pid>/maps --
which is useful, so keep the behavior and delete the dead knob and its
misleading comment. Same for the copy in the JSON bench script.

No-Verification-Needed: removes an unread preprocessor define; compiled output is unchanged
@robobun

robobun commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator
Updated 7:13 PM PT - Aug 6th, 2026

@dylan-conway, your commit 9f8839385698d62536ac0cb1f48c5c0c4df049b7 passed in Build #89790! 🎉


🧪   To try this PR locally:

bunx bun-pr 37080

That installs a local version of the PR into your bun-37080 executable, so you can run:

bun-37080 --bun

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 37 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 43ceb0fc-7586-47b5-bdda-8aa83f21c078

📥 Commits

Reviewing files that changed from the base of the PR and between bdb61a5 and a9049b6.

📒 Files selected for processing (4)
  • src/bun_core/tty.rs
  • src/md/ansi_renderer.rs
  • src/runtime/bake/bake_body.rs
  • src/runtime/server/server_body.rs

Walkthrough

The changes stop defining MI_NO_SET_VMA_NAME in mimalloc build configurations. This enables mimalloc’s Linux VMA naming calls in the benchmark script and dependency build configuration.

Changes

Mimalloc build flags

Layer / File(s) Summary
Enable mimalloc VMA naming
scripts/bench-json-rust.sh, scripts/build/deps/mimalloc.ts
The benchmark flags and Linux-specific dependency configuration no longer define MI_NO_SET_VMA_NAME.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: removing the unused MI_NO_SET_VMA_NAME define from the mimalloc build.
Description check ✅ Passed The description includes both required sections and clearly explains the change, rationale, impact, and verification performed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — deletes a dead -D define that mimalloc never read, plus rustfmt-only reflows from autofix.

What was reviewed

  • Confirmed MI_NO_SET_VMA_NAME has no remaining references in the repo; the vendored mimalloc gates the prctl only on defined(PR_SET_VMA), so the define was a no-op.
  • The four .rs file changes are pure formatting (line wraps, import sort) from the autofix.ci commit — no semantic change.
  • Checked the remaining MI_FLAGS in bench-json-rust.sh are unaffected.
Extended reasoning...

Overview

Two substantive edits: scripts/build/deps/mimalloc.ts drops the Linux-only defines.MI_NO_SET_VMA_NAME = 1 block (and its 7-line comment), and scripts/bench-json-rust.sh drops the same flag from MI_FLAGS. The PR description documents that no revision of oven-sh/mimalloc has ever referenced this macro — the prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, …) call in src/prim/unix/prim.c is gated only on defined(PR_SET_VMA) — so the define has always compiled to nothing and the [anon:mimalloc] VMA labels have always been present. A repo-wide grep after the change confirms zero remaining references.

The other four files (tty.rs, ansi_renderer.rs, bake_body.rs, server_body.rs) are the autofix.ci commit and contain only rustfmt reflows: wrapping single-line calls across multiple lines and alphabetizing a use group. Byte-for-byte inspection of the diff shows no token changes, only whitespace/line-break reformatting.

Security risks

None. This removes an unread preprocessor define from build scripts; the compiled mimalloc object is identical. No runtime code paths, inputs, or trust boundaries are touched.

Level of scrutiny

Low. Build-config dead-code deletion with a well-documented rationale, plus formatter noise. The one thing worth verifying — that the macro is truly unread — is confirmed by grep and the PR author's git log -S over the mimalloc fork history.

Other factors

No prior human review comments to address. The change aligns with REVIEW.md's "delete dead code in the same PR that makes it dead" guidance, and the misleading comment (which claimed the define suppressed a syscall it never suppressed) is exactly the kind of stale documentation worth removing.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — removes a dead -D define that mimalloc never read; no functional change.

What was reviewed:

  • Confirmed MI_NO_SET_VMA_NAME has no remaining references anywhere in the repo.
  • Checked the MI_FLAGS array in bench-json-rust.sh is still well-formed after the trailing item was dropped.
  • Verified surrounding defines in mimalloc.ts (MI_DEFAULT_ALLOW_THP, MI_LIBC_MUSL, MI_MALLOC_OVERRIDE) are untouched.
Extended reasoning...

Overview

This PR deletes the -DMI_NO_SET_VMA_NAME=1 define from two places: the mimalloc dependency build config (scripts/build/deps/mimalloc.ts) and the JSON bench helper script (scripts/bench-json-rust.sh). The accompanying 7-line explanatory comment in mimalloc.ts is also removed. The PR description states — and a repo-wide grep confirms — that this macro is not consumed anywhere; the vendored mimalloc gates its prctl(PR_SET_VMA, ...) call only on defined(PR_SET_VMA), so the define was always a no-op and the compiled object is byte-identical with or without it.

Security risks

None. This is a build-flag deletion in tooling scripts; no runtime code, no user-facing surface, no auth/crypto/permissions paths involved.

Level of scrutiny

Low. The change is a pure deletion of dead configuration, which REVIEW.md explicitly encourages ("delete dead code in the same PR that makes it dead"). The only correctness question is whether the macro was actually dead — the author verified this against the full history of oven-sh/mimalloc, and I confirmed there are zero references to MI_NO_SET_VMA_NAME remaining in this repo. Even if the macro were live, its removal would only re-enable VMA naming (a debugging aid), which the PR argues is desirable anyway.

Other factors

Both edit sites remain syntactically valid: the bash array in bench-json-rust.sh still closes cleanly on the previous element, and the TS defines object flows straight from the MI_DEFAULT_ALLOW_THP block into the musl/override checks with no dangling references. No prior reviewer comments to address; no CODEOWNER-gated paths; the bug hunting system found nothing. This falls squarely into "simple, mechanical, self-contained with clear intent."

@Jarred-Sumner
Jarred-Sumner merged commit c6f3f7d into main Aug 7, 2026
54 checks passed
@Jarred-Sumner
Jarred-Sumner deleted the claude/drop-mi-no-set-vma-name branch August 7, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants