feat: four rounds of instruction wins, a Rust GlobalAlloc fast path, 16-byte natural alignment - #40
Merged
Merged
Conversation
bench/wasm-speed/target/ was committed by mistake: fingerprints, lock files and a built .wasm. It is build output, regenerated on every run. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…irror and Silesia
Two rows had been passing while testing the crates.io allocator:
rusty_zstd reaches us through the published rusty_alloc_default shim
(its 2026-09-08 PASS never built this tree), and a TMPDIR under this repo
made repoint skip every manifest. The runner now patches the shim to a
repointed local copy, refuses a work dir inside the repo, leaves
{ workspace = true } entries alone, and reads each candidate's Cargo.lock:
a registry rusty_alloc is NOT-REPOINTED, never PASS.
Adds spacedb (published mirror) to corpus.toml and tools/corpus/silesia.sh
(Silesia through rzstd: byte-identical to the published-allocator build,
round-trip through C zstd both ways).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…oc fast path, and 16-byte natural alignment Every change was measured alone on exact callgrind counts (opscan plus perl, sqlite, lua, python, jq, gawk and sort) and gated on the full suites on Windows and Linux. docs/LEDGER.md has each number and each refutation (CURIOSITY rounds one to four, DOWNSTREAM CORPUS). Against 2.2.0 (c9631f4), opscan Ir/op: xthread 113.71 -> 77.26, huge 689.68 -> 293.68, big 121.00 -> 92.00, mixed 110.93 -> 92.82, calloc 107.57 -> 93.19, posix_memalign 97.88 -> 83.69, realloc 259.86 -> 231.20. Allocator-only vs mimalloc: lua 0.52, perl 0.81, sqlite 0.83. Rust workloads (bench/rust-globalalloc.sh): -21.1 % boxed trees, -5.8 % maps, -27.3 % over-aligned realloc. Allocator core: - remote free to a parked page releases FREEING to NORMAL, as upstream does (MI_NO_DELAYED_FREE); single-block pages keep DELAYED - page_extend links at least four blocks (upstream MI_MIN_EXTEND) - span_mark skips interior slices that already point to their start - the medium arm pops before it collects; OOM retry only on fallible exits; realloc decides a move in one compare; frameless free_general; huge_alloc out of line; u8 zero flag in the generic chain - options: no allocation at start-up (prim::getenv), and one walk of environ on Linux instead of 76 getenv calls - huge blocks report the request rounded to a slice as usable size - malloc_aligned_pow2 (new, #[inline]) for callers that proved the alignment: posix_memalign, GlobalAlloc, C++ aligned new - ra_small_wsize knob (default unchanged) for 32-bit targets rusty_alloc-api: - GlobalAlloc methods are #[inline]; dealloc is the inline free - alignment up to two words served from the natural size classes - realloc keeps a block in place at any alignment when it fits Tests: options_env, natural_align, reentrancy. Unsafe census 947 -> 963, every site in UNSAFE.md. Downstream: SpaceDB and rusty_zstd full suites, Silesia byte-identical against the 2.2.0 build. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Four rounds of deterministic, exact-instruction work on the allocator, plus the Rust
GlobalAllocpath that no instrument had measured, and a corpus harness that now proves each consumer actually built this tree.Numbers (callgrind, exact; against 2.2.0 =
c9631f4)Allocator-only vs mimalloc on real programs: lua 0.52, perl 0.81, sqlite 0.83. Rust workloads (
bench/rust-globalalloc.sh): boxed trees −21.1 %, maps −5.8 %, over-aligned realloc −27.3 %, identical checksums.Validation
debug_checks,secure,blockmap, small profile; api (also i686); ffi;--all-featuresworkspace tests 172/0.debug_checks,secure; thread-heavy tests 10× in release, 0 failures.-D warnings(workspace all-features and each feature), everyembeddedstep (small profile, aligned-region, 256k, no_std, bare metal on both RISC-V targets, api no_std), wasm self-test and size ratchet (20,511 B gz, limit 20,930), semgrep and its self-test, gate self-test, unsafe census (963, each inUNSAFE.md).tools/corpus, every row verified from itsCargo.lockto build THIS tree): SpaceDB (both configs, and its published mirror), rusty_alloc_default, rusty_zstd all PASS; SpaceDB whole workspace 314/0 and rusty_zstd 194/0 with this allocator preloaded on Linux; Silesia throughrzstdbyte-identical to the 2.2.0 build and round-tripped through C zstd 1.5.7, Windows and Linux. rusty_maplibre still needs its documented 2.0features = ["std"]migration; with it, 1,199/0.Notes for review
main(it has never passed as written); no CI job runs it. Tracked in the LEDGER as open.ra_small_wsizeknob (default unchanged; cfg now registered) and moves two finished plans intodocs/plans/finished/.main(stress_mtin "test (all features)",cargo vet, longmiri) are expected to stay red here.🤖 Generated with Claude Code