Repository navigation
oracles: the last fp32-to-bf16 copies round with core's bits() (#1863) - #2055
Merged
Merged
Conversation
ashhart
force-pushed
the
lead/1863-oracles
branch
from
November 3, 2026 18:56
6df9769 to
455a6e7
Compare
Owner
Author
|
Rebased onto #2052. The macOS dev-tools build failed here with |
ashhart
force-pushed
the
lead/1863-oracles
branch
from
November 3, 2026 18:56
455a6e7 to
9c8333b
Compare
9 of 16 tasks
Merged
8 tasks done
GLM's attn, eh and launch checks and CUDA FP8 KV reference, Nemotron's training scan check, LFM2's DSpark taps test, Flash Next's HIP kernel tests and the XPU FP64 GDN reference added the rounding bias with a plain `+` and no NaN branch, so 0xffff8000-0xffffffff overflowed (a Debug panic). Each now imports bf16_round by name, as #2052's callers do; a path import would put core/bf16_round.zig in a second module beside the named one, so tf-kernel-contract and the other tools importing the engine would not compile. No build change. A test in each file pins 0xffffffff to a NaN and the old bits on every bf16 value's tie and carry edges plus random words; a one-off sweep of all 2^32 inputs gives the old bits on every non-NaN and a NaN on every NaN. Part of #1863; sits on #2052.
…st under zig build test xpu/fp64_gdn.zig was compiled only into the xpu-qwen27 runner executable, so its test ran under no build step, even with an Intel GPU. hostTests now roots a host module at it with the same stand-ins as the host Qwen27 module (empty kernel images, the host ze table, core), so it needs neither ocloc nor a device and runs on Linux and macOS. Dropping bits()'s NaN branch fails it at 0xffffffff. Part of #1863; sits on #2052.
ashhart
force-pushed
the
lead/1863-oracles
branch
from
November 4, 2026 01:56
f85235a to
13435b6
Compare
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.
Part of #1863, the last part, after #1986 and #2052. The last eight copies that added the rounding bias with a plain
+now use core'sbf16_round: seven test oracles (GLM attention, KV8, launch and EH checks; the Nemotron train check; HIP Flash Next kernel tests; LFM2 DSpark), plus XPU's FP64 GDN reference. Inputs 0xffff8000-0xffffffff used to overflow, panicking in Debug and wrapping in ReleaseFast. They now give a NaN.A one-off sweep over all 2^32 inputs found the 4,278,190,082 non-NaN inputs bit-identical, and all 16,777,214 NaNs give a NaN. 131,072 positive NaNs used to round to Inf or -0. No finite input changes. Each file gets a test of 0xffffffff plus 2^19 sampled inputs (the tie and carry edges, then random words), and each failed before the fix. Lean is unchanged, and
zig fmtis clean.