Repository navigation
Description
Goal
Replace the Linux Wild-fork executable's default system allocator with the requested zackees/mimalloc-pprof allocator, then use the resulting profiling evidence to stage the Windows PE/COFF LLD work selected in #91.
The allocator is an implementation-only performance change: it must not change link artifacts or observable linker behavior.
Phase 1 — reld / Wild allocator
- Vendor a pinned
zackees/mimalloc-pprofrevision under_vendor/, bypassing crates.io. Do not add a crates.io dependency. - Make the default
reld/Wild executable allocator use its RustMiMallocintegration on Linux. Retain a build switch for the unprofiled allocator engine (MI_PPROF=OFF) and a separately named profiling build/configuration; do not make the known profiler-enabled fast-path overhead the release default without a benchmark win. - Start by validating that the allocator works unchanged:
soldr cargobuild/test, native Linux acceptance, and the existing benchmark corpus. - Establish the measurement matrix: current system allocator vs vendored mimalloc-pprof with
MI_PPROF=OFFvs profiling-enabled sampling. Capture wall time, CPU time, peak RSS, allocation profile, and enough repetitions to report variation. - Per
DESIGN.md§3.1, run each deterministic fixture twice, then require byte identity against the pinned pre-change reld/Wild baseline for every performance-only configuration. Also require native execution with exact observable output.
Phase 2 — isolated Windows LLD fork
Create zackees/llvm-ld as a minimal C/C++ library-only extraction/fork of LLVM LLD's COFF driver for both MSVC and MinGW personas. This repository owns the pinned LLVM revision, the C/C++ build, allocator replacement, and manual import of selected upstream LLVM/LLD changes. It should not own the Rust API.
Its first milestone is deliberately small:
- Expose the COFF linker through a narrow C ABI around LLD's library entry point; do not shell out to an executable.
- Build it with the same pinned vendored
mimalloc-pprofimplementation, first withMI_PPROF=OFF, then verify sampled profiling works as-is. - Prove link correctness against the pinned unmodified LLD baseline: same effective args, input files, executable path/cwd, deterministic switches, byte-identical EXE and PDB; then native Windows execution with exact stdout/stderr/exit status.
- Benchmark MSVC and GNU/MinGW separately, debug/PDB and non-debug, non-LTO and LTO. Report allocator effects before changing linker algorithms.
Phase 3 — Rust ownership in reld
Keep zackees/llvm-ld C/C++-only. Add the Rust wrapper inside reld, vendoring the pinned llvm-ld source below _vendor/ as a git-backed source import/submodule (not crates.io). The Rust wrapper owns the safe API and reld routing; the C/C++ repository stays a minimal upstream-syncable LLD isolation.
The integration must preserve the Windows guide's current bridge oracle until a new engine is accepted: direct pinned lld-link and reld must be run with the same inputs/environment/determinism switches, with byte comparison of EXE and PDB plus native MSVC and MinGW acceptance.
Existing prior art and decision
mun-lang/lld-rs (lld_rs) is relevant prior art, but it targets LLVM 14, links all LLD drivers, and its docs.rs build currently fails. It is not an appropriate fork base for a current minimal COFF-only library. Use the current LLVM LLD COFF library API as the base and maintain a small C ABI shim instead. LLD itself has COFF-as-a-library coverage.
Guardrails
- The dependency approval in this issue is specifically for vendoring
zackees/mimalloc-pprof; record the exact revision, license, and update procedure. No other dependency is approved by implication. - No performance claim without the artifact-equivalence evidence above.
- Pin the LLVM revision, Rust toolchain, MSVC/MinGW toolchains, workload inputs, and all allocator configuration.
- Update
agents/platforms/linux.mdandagents/platforms/windows.mdwhen their validation/build workflow changes. - Do not start linker optimizations before the allocator baseline and profiles are attached here and summarized on Research: Windows PE/COFF fast-linking strategy - optimize LLD-COFF fork vs retrofit COFF into Wild #91.
Completion criteria
- Linux reld/Wild has a reproducible, vendored mimalloc-pprof integration and an evidence-backed keep/revert decision.
zackees/llvm-ldbuilds a COFF library with the allocator replacement and passes its baseline comparison suite for both Windows personas.- reld's in-tree Rust wrapper loads the vendored library and demonstrates an artifact-identical, native-executed Windows link.
Activity
zackees commentedon Sep 17, 2026
Closing as superseded by #97, which states this in its own text: the
_vendor/mimalloc-pprofdirection here conflicts with the approved registry direction, and #97 replaces both this issue and #94's vendoring approach. The Windows COFF strategy selected in #91 is sequenced there and in thezackees/llvm-ldrepository. Long-horizon tracking now lives in #154; near-term burn-down in #153 (Wave 0).