534. The soft-float targets could now be flipped, and two measurements should come first
Promoted from the proposal the-soft-float-targets-could-now-be-flipped, filed 2026-09-20, on
calef's instruction of 2026-09-20 to give every proposal on main a number. The text below is the
proposal's own, unedited, by the promotion
rule. Filed by the
lane of milestone 447 (a thread's vector registers are its own), which built the thing that was
blocking the flip and deliberately did not take it.
Both measurements below run on the dev Mac and need nobody. The flip itself is calef's ruling rather than a lane's, which is what makes this a proposal.
Why this is a proposal and not a change
Every target in targets/ is soft-float. Milestone 184 (extend the std port to x86_64) calls
that a correctness requirement, because a kernel that saves no FPU or SSE state on a context switch
needs it. Milestone 447 (a thread's vector registers are its own) saves that state on all three
architectures, so the feature strings are a choice.
Taking that choice is not a lane's. Turning +soft-float off changes the calling convention for
every userspace binary and every std crate built against it, which is an ABI two programs agree
on. AGENTS.md's move fast on what can be undone tenet puts that squarely in the irreversible
category. And §22 (Rust std on the native ABI, the Hermit way) picked the current
one on purpose when it specified nife's target JSON as "softfloat, and singlethread = true".
What it would take
Four edits and a rebuild.
- Drop
+soft-floatand the-sse/-neon/-mmxfeature strings from the three files intargets/. - Drop
"rustc-abi": "softfloat"from the two that carry it. - Rebuild the
stdfarm (xtask std-src).nife-devis onerustup toolchain linkper user account, so this is machine-global and has to be sequenced against other lanes; notes/std.md has the 2026-08-18 cross-contamination that makes that a rule rather than a courtesy. - Rebuild every user program and every archive.
The kernel stays softfloat, and should. A kernel that emitted FP into its own fastpath would
pay the register-file save on every switch instead of only on the switches of threads that asked
for the unit, which is the whole of 447's cost argument.
What it would buy, honestly accounted
-
Seven flags disappear:
--cfg aes_force_softin.cargo/config.toml's[target.x86_64-unknown-none]block, and incryptography_provider, from milestone 442 (a crypto providerrustlscan use on all three bare-metal targets), aforce-softfeature onsha2and five--cfgflags selecting portable implementations.The correction is worth more than the count. A lane measures the tree it branched from, and a claim of the form "grep finds no other" is a statement about a moment. This one went stale before its own pull request merged, which is the hazard every block asserting an absence carries.
-
But not all seven, and this is the sharpest thing 447 can say about the flip. 447 saves the
FXSAVEarea: x87,MXCSRandxmm0-xmm15. It does not save AVX, and it cannot, becauseCR4.OSXSAVEstays clear and that is precisely what makes every VEX-encoded instruction#UDrather than a silent corruption (447'sarch/x86_64/fp.rscarries this as its firstBUGSentry).cryptography_exerciser/.cargo/config.tomlsayschacha20_force_softis there for a run-time reason where the others are compile-time ones:chacha20"compiles fine and then executes an AVX2 instruction in ring 3", and the program "dies withvector 6 (invalid opcode)before it prints a byte". Flipping the targets does not change that one byte. A crate that picks its implementation by asking the CPU rather than by asking the compiler stays a hazard after the flip, andchacha20_force_softstays with it until this kernel grows anxsavepath and setsXCR0. Anyone pricing the flip should count the flags it retires, not the flags that exist. -
AES-NI instead of a bitsliced software backend, roughly an order of magnitude by upstream RustCrypto's own figures. Still unmeasured, and 164's refusal to measure it still stands: nothing on x86_64 mounts an encrypted RedoxFS volume, so there is no workload and a synthetic number would be a fact leaving the machine with nothing behind it. What 447 changed is that the number is obtainable rather than blocked.
-
The seam of §31 (the foreign-language seam) widens, as 447's case for the flip says. A C component compiled by bare-metal clang currently cannot touch a vector register at all, and §31 says why: "the kernel never enables FP/SIMD for EL0, and the context switch" saves nothing, so such a register would be "a trap or a corruption depending on which of those two bit first". After the flip that sentence stops being true, which is a real gain for the vendored-component rung the seam exists to de-risk.
What it would cost
Every thread that executes an FP instruction takes one trap and then saves and restores the whole
register file on every subsequent switch for the rest of its life, because 447's live flag
never clears (its first BUGS entry). Today that costs nothing, because no thread in this tree has
ever taken the trap and crate::fp::ENABLES is zero on every boot. A hard-float userspace means
memcpy, std formatting and anything LLVM feels like vectorising will take it, so most threads
become live and 447's common case stops being common. 512 bytes each way per switch, against a
switch that costs about 565 instructions on aarch64 today.
Nothing measures that, and nothing can until there is a hard-float userspace to run.
The two measurements that should come first, and neither needs the decision made
- Re-measure 442's soft-float failures against nife's own targets. Its block
records that
sha2andpolyval"fail on soft-float x86_64", met throughembedded-tls, and in the next sentence warns that the probe behind that finding "ran against stock bare targets on the stable host toolchain, not against nife's own target specifications and pinned nightly". 442 has since done exactly that and is BUILT:script/crypto-probesmeasures againsttargets/*-unknown-nife.json, and the answer was that those crates do build here, with the force-soft flags above. So this item is closed rather than owed, and what it hands the flip is the concrete list of seven flags, not an unknown. - Price a live thread's switch. Build one user program hard-float against a scratch target
(not the committed ones), run
script/bench'syield_switchandctx_switchwith it in the mix, and report what a switch costs when both threads arelive. That turns the paragraph above from an argument into a number, and it is the number the flip is actually deciding.
What this proposal deliberately does not do
It does not recommend. The fork reaches calef with its questions already answered tenet asks for options and costs on an irreversible fork and explicitly not for a winner, because "a system-call-surface decision arriving with a recommendation is already most of the way made" and an ABI is the same shape of thing.
Index row
Every target in targets/ is soft-float.