ADR-363: The Toolchain’s Own Nikaia Package Is Lowered at user_parallelism = yes; std’s Modules Still Lower the Same at Both Settings

Status: Accepted Date: October 17, 2026 Answers: whether the compiler’s own Nikaia (src/tools) may use par_iter and task::scope, which ADR-002 D4’s byte comparison forbids today Related: ADR-002 D4 (std lowered once, linked at either setting); ADR-312 D10 (the cheap count at no); ADR-294 D18 (the toolchain’s Nikaia is one package in nikaia-std); ADR-235 (par_iter); Part I 1.2 (the compiler may be concurrent even when the program is not); Part II 12.6, 12.7

1. Question

std’s Nikaia half is lowered once and linked into programs built at either setting of user_parallelism, so nothing in it may lower differently per setting: a Shared lowered at no carries a count that cannot cross a thread, and linked into a program built at yes it would be a silent fault. tests/sysroot.rs enforces this by comparing both lowerings byte for byte.

The compiler’s own Nikaia, src/tools, lives in the same crate since the move to self-hosting (ADR-294 D18), and so falls under the same comparison, though no program calls it. par_iter and task::scope lower differently per setting, so one of them in a tools file turns develop red: the compiler, whose work is checking and lowering many files against one ledger, cannot be concurrent, against Part I 1.2.

2. Options

Option Why it lost or waits
Keep the comparison for src/tools the compiler stays sequential; the rule guards programs, and no program runs this code
Lower all of std at yes every program at no would pay atomic counts and a pool it does not use
Move src/tools into a crate of its own (nikaia-tools) the cleaner end state, decided as the next step (D2); a rebuild of lower-std, the sysroot and the build in the middle of the move to self-hosting

3. Decision

D1 — The toolchain’s package is lowered at yes.

nikaia lower-std lowers src/tools at user_parallelism = yes, whatever the build’s setting, and the byte comparison of ADR-002 D4 covers std’s own modules only. The direction is the safe one: code lowered at yes is correct in a program that runs one thread - it only pays for what it does not use - while code lowered at no is not correct at yes. Only the compiler runs this code, and the compiler may be concurrent (Part I 1.2).

D2 — Later, the toolchain gets a crate of its own.

When the move to self-hosting allows, src/tools leaves nikaia-std for a crate of its own, and std and the compiler no longer share a lowering rule.

4. Consequences

Decided October 17, 2026.

This site is open source. Improve this page.