Run the 386 lane without an emulator, because qemu-i386 loses float state - #26
Merged
Merged
Conversation
…tate The 386 lane panicked in go-gfx/gfx at a line the arithmetic makes impossible, and sampling eight identical lanes per condition on one commit said why: under qemu-i386 5 failures out of 8 under qemu-i386, asyncpreemptoff=1 0 out of 8 native on the same runner 0 out of 8 under qemu-arm 0 out of 8 Each failure landed on a different input although the seed is fixed, and the wrong value was a sign flip rather than a rounding difference. qemu-i386 loses the guest's floating-point state across the signal Go delivers for asynchronous preemption. A 386 ELF runs natively on an x86-64 runner, so the emulator bought nothing. Control that it really ran native: qemu-user-static registers binfmt handlers, the riscv64 lane took 71 s under both conditions, and the 386 lane went from ~85 s to ~40 s. arm keeps its emulator: there is no native option and it was clean 8 of 8.
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.
What this changes
The
386lane stops usingqemu-i386and runs the test binary directly on thex86-64 runner. Every other lane is unchanged.
Why — measured, not assumed
The 386 lane panicked in
go-gfx/gfxat a line the arithmetic makes impossible.Two instrumented runs passed, which looked like the instrumentation mattering —
until the lane was sampled properly. Eight identical lanes on one commit,
repeated for each condition:
qemu-i386qemu-i386,GODEBUG=asyncpreemptoff=1qemu-armIf the true rate under emulation were 5/8, seeing 0/8 has probability
0.375^8 ≈ 4e-4, so asynchronous preemption is the mechanism and the emulator isthe variable. Each failure landed on a different input although the seed is
fixed, and the wrong value was a sign flip rather than a rounding difference:
qemu-i386loses the guest's floating-point state across the signal Go deliversto preempt a goroutine.
The control for "did it really run without the emulator":
qemu-user-staticregisters
binfmt_mischandlers, so the riscv64 lane ran under qemu in bothconditions and took 71 s in both. The 386 lane went from ~85 s to ~40 s. Same job
shape, one lane moved.
Why this is the right fix rather than a retry
A lane that goes red at random teaches people to ignore red. Emulating 386 buys
nothing here — a 386 ELF is a native binary on this runner — so the lane is
faster and it only fails for reasons that belong to us.
armstays underqemu-arm: there is no native option, and it was clean in8 of 8.
🤖 Generated with Claude Code