Skip to content

release: rusty_alloc 2.7.0 — Windows commit footprint (#63), zero panic sites - #65

Merged
Ttimmahlax merged 3 commits into
mainfrom
fix/commit-footprint
Dec 4, 2026
Merged

Ttimmahlax merged 3 commits into
mainfrom
fix/commit-footprint

Conversation

@Ttimmahlax

Copy link
Copy Markdown
Contributor

Releases rusty_alloc 2.7.0 and rusty_alloc-api 2.7.0.

What changes

  • Windows commit footprint (fast-decomp corpus: rusty_alloc 2.2.6 vs the Windows heap #63). Medium pages and a size class's first small page now commit memory as they fill. Large blocks commit only up to their last OS page, and a segment commits 256 KiB ahead of its carve cursor. A heap also gives back free spans it has seen unused for a whole purge_delay. Peak commit against the Windows heap goes from 1.4–2.7× to 1.07–1.29× (ninja, OpenTTD, Godot editor), with no speed cost: the fault counts of free/reallocate loops are unchanged.
  • No reachable panics. Panic sites are counted in the machine code under both fat LTO and Cargo's default release profile, and that count is 0. tools/no-unwind-scan.sh gates on it, and its baseline is now empty.
  • Allocator guard off where proven. rusty_alloc_api skips the abort-on-unwind guard when rusty_alloc::NO_UNWIND_PROVEN holds: x86-64 Linux, release builds at opt-level 2 or 3, default features. A new build.rs reads OPT_LEVEL to derive that.
  • README performance sections refreshed from the 2026-12-02 corpus. All 23 per-operation scans measure below mimalloc. The only measurable regression against 2.6.0 is the block-above-32 MiB case, +0.4%, which the README notes.

Semver note: new pub fields on all-pub internal structs (Heap, Page, Segment) are flagged as major by cargo-semver-checks. They ship as minor, following the 2.2.4 and 2.6.0 precedent; the CHANGELOG lists them.

How it was verified

  • Local CI mirror: every clippy config, the test matrix, small-profile and bare-metal builds, wasm size, MSRV 1.88, the unsafe census, the no-unwind scan and the gate self-test all pass.
  • Windows matrix, 6 configurations: 223 / 267 / 248 / 197 / 196 / 197 tests pass.
  • Miri: the core crate in full, and the API crate's lib, allocator_conformance and api_miri targets (the set CI runs). All clean.
  • Callgrind instruction counts: every per-operation scan is flat or better against 2.6.0 except giant (+0.4%). Real programs (lua, perl, sqlite) are unchanged to 4 decimals.

🤖 Generated with Claude Code

tim-almond-house and others added 3 commits December 2, 2026 23:00
…uard off where proven

Windows (issue 63): peak commit within 1.07-1.29x of the Windows heap on
ninja, OpenTTD and the Godot editor (2.6.0: 1.4-2.7x), with no speed
traded. Medium pages and a class's first small page commit as they fill,
large blocks commit to their last OS page, giant blocks commit what they
reach, a segment commits 256 KiB ahead of its cursor, a partly purged span
commits only the part taken, and a heap purges free spans it has seen
unused for a whole purge_delay (all platforms). Fixed: a resident span
merged with a purged neighbour was never purged; the abandoned-segment
purge read the wrong option since 0.3.0; Heap::visit_blocks misplaced huge
blocks.

Optimization round: thread exit and start-up (no /dev/urandom read until
first draw, no delayed purge of a dying thread's spans, committed-prefix
chunk reuse), realloc copies up to 128 bytes inline and grows large blocks
in place, calloc skips zeroing of decommitted spans, collect sweeps only
live bin queues.

Panic sites reachable from an Allocator method: 28 -> 0, counted under fat
LTO and, new, under Cargo's default release profile (GOT-resolved). Bins
and subprocess ids out of range abort; walks go by pointer; std paths that
can panic replaced. rusty_alloc::NO_UNWIND_PROVEN (x86-64 Linux, release,
opt-level 2/3 via a new build.rs, default features) lets rusty_alloc_api
drop its abort-on-unwind guard: Vec::new_in(RustyAlloc) -27.6 Ir/step.
Every other instrument unchanged, outputs identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Changelogs, version bump, and the READMEs' performance sections refreshed
from a full corpus run on 2026-12-02 (callgrind, Rust 1.100): real programs
against mimalloc, jemalloc and glibc, the 23-operation scan, the Rust
GlobalAlloc/Allocator workloads, and Windows commit charge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The thread that reads an option first parses the environment and writes
the whole option table after the ENV_PARSED swap, so other threads already
take the fast path. A set() from one of them during the pass was then
overwritten with the default. Windows CI hit it as a one-in-five failure of
tests/heaps.rs generic_collect_fires_on_its_own: generic_collect lowered to
8 came back as 10,000, so the periodic collect never fired. 2.7.0 exposed
it because a new heap now reads that option once, when it is created.

The pass now fills only slots still holding the i64::MIN sentinel
(environment first, then defaults), so an explicit set always wins. Cold
path only; get and set are unchanged. heaps x30 on Windows: 0 failures
(1 in 5 before); the 6-config Windows matrix and clippy are clean.

deny.toml: a dated, crate-scoped ignore for pin-project-lite@0.2.17.
Upstream yanked every 0.2.x before 0.2.19, which the 3-day
global-min-publish-age refuses until 2026-12-05. It is dev-only (loom ->
tracing). Remove the ignore and `cargo update -p pin-project-lite` then.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Ttimmahlax
Ttimmahlax merged commit 155e3c0 into main Dec 4, 2026
16 of 17 checks passed
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.

2 participants