---
fkc_version: 1
provider:
name: fuel-cpu-backend
backend: Cpu # maps to BackendId::Cpu
kernel_source: "portable-cpu" # the BindingEntry.kernel_source tag
link_registry: fuel_cpu_backend::fkc::ENTRY_POINTS # §12.6 symbol→KernelRef map
revision_base: "git:f41137b4" # provider build id, folded into kernel_revision_hash
---
# fuel-cpu-backend — elementwise-binary kernel contracts
The portable CPU elementwise-binary family: `out[i] = op(lhs[i], rhs[i])` over two
contiguous, zero-offset, row-major buffers of equal element count. Eight ops
(Add / Sub / Mul / Div / Maximum / Minimum / Pow / Rem) × four dtypes
(F32 / F64 / BF16 / F16). One shared chassis `binary<T, U>`
(`fuel-cpu-backend/src/chassis/binary.rs:78`); per-`(op, dtype)` public thunks generated by
`binary_thunk!` (`fuel-cpu-backend/src/byte_kernels.rs:54`).
**Family-wide facts (every kernel below shares these unless its section says otherwise):**
- **Layout: contiguous-only, zero-offset, row-major, no broadcasting.** The chassis validates
byte lengths `lhs.len_bytes() == rhs.len_bytes() == out.len_bytes()`
(`chassis/binary.rs:88-96`) then walks a pure positional loop `out[i] = U::apply(lhs[i], rhs[i])`
(`chassis/binary.rs:100-102`). It never consults a `Layout`/strides/offset. The five-flag
layout capability is therefore `{contiguous: required, strided: rejected, broadcast_stride0:
rejected, start_offset: rejected, reverse_strides: rejected}` on **both** operands — the
pipelined executor's auto-Contiguize pass realizes any strided / broadcast / offset input into a
dense buffer *before* these kernels run (`awkward_layout_strategy: requires_contiguous`).
Shapes must already be identical and contiguous (no NumPy/PyTorch broadcasting in the kernel).
- **Dtype monomorphization.** Each thunk is one `(op, dtype)` pair. `f32` / `f64` evaluate
natively (`BinaryOpCore::{f32,f64}`); `bf16` / `f16` widen each element to **f32**, do the math,
and narrow back on store (the blanket `BinaryOp<half::{bf16,f16}>` impls,
`chassis/binary.rs:57-67`). There is no half-native arithmetic path.
- **Output: pre-allocated, fully overwritten.** The output buffer is caller-allocated to the
exact byte size; the kernel overwrites every element (no read of prior contents, no aliasing
with the inputs). Output dtype = input dtype, output shape = input shape, output layout =
contiguous row-major.
- **Validation is build/runtime byte-length checks returning `Result`** (never panics on the
production path); the error message carries the thunk name and the three observed byte lengths.
**Cost provenance.** Every kernel in this family marks `cost.provenance: judge_measured` — the
Judge bootstraps and refines the measured cost for this CPU surface. Where genuinely derivable
from the op the cost block carries the **formula hints** an elementwise kernel admits — it is
bandwidth-bound: it touches `n` output elements, reading `lhs` + `rhs` and writing `out`
(`bytes_moved ≈ 3 · n · dtype_bytes`), with one scalar op per element (`flops ≈ n`). These hints
are structural facts of the loop, not fabricated coefficients; the launch overhead and any
absolute timing are left for the Judge to populate (no placeholder numbers).
**Precision.** `f32` / `f64` are the native IEEE-754 operation, bit-stable on the same hardware;
`bf16` / `f16` are bit-stable on the same hardware via the deterministic f32 round-trip
(widen → op → narrow). Per-op IEEE semantics (Div inf/NaN; Max/Min NaN-propagating — torch
parity, pinned 2026-07-08, `docs/architecture/10-decisions-log.md`; Pow `powf`; Rem floored) are
noted per section. All bounds are author-declared seeds the Judge audits.
---
## binary (Add / Sub / Mul / Div / Maximum / Minimum / Pow / Rem — the shared chassis)
Elementwise binary arithmetic and extremum over a contiguous, same-shape operand pair; half
floats via an f32 round-trip.
This is the umbrella entry for the one logical chassis kernel `binary<T, U>`
(`chassis/binary.rs:78`) that backs all 32 per-`(op, dtype)` thunks below. It does a positional
walk `out[i] = op(lhs[i], rhs[i])` over contiguous, zero-offset, row-major buffers — **no
broadcasting** (the chassis validates `lhs.len_bytes() == rhs.len_bytes() == out.len_bytes()` and
walks element-for-element). The op is selected by the `BinaryOp<T>` marker (`Add`, `Sub`, `Mul`,
`Div`, `Maximum`, `Minimum`, `Pow`, `Rem`), the dtype by the monomorphized `T`. `f32` / `f64`
evaluate natively; `bf16` / `f16` widen to f32, compute, and narrow on store. Each concrete op
maps to a distinct Fuel `OpKind` (`AddElementwise`, `SubElementwise`, `MulElementwise`,
`DivElementwise`, `MaximumElementwise`, `MinimumElementwise`, `PowElementwise`, `RemElementwise`),
so this umbrella section is documentation of the shared algorithm; the registrable contracts are
the per-`(op, dtype)` sections that follow (each names its own `op_kind` + `entry_point`). Known
limitation: contiguous-only — any strided / broadcast / non-zero-offset operand must be
contiguized by the planner first (`requires_contiguous`).
```fkc
kernel: binary
op_kind: AddElementwise # representative; the shared chassis backs Add/Sub/Mul/Div/Maximum/Minimum/Pow/Rem
registrable: false # §3.10 describe-only: shared chassis umbrella (a generic binary<T,U>), NOT a dispatch target — the per-(op,dtype) sections below are the registrable contracts
blurb: "Elementwise binary arithmetic/extremum; contiguous same-shape; half via f32."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::chassis::binary::binary" # the shared chassis fn; §12.6
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F32, F64, BF16, F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F32, F64, BF16, F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous # planner inserts Op::Contiguize (itself an FKC kernel) + sums its cost
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 8
cost:
provenance: judge_measured # Judge bootstraps/refines; formula hints below are derivable, not fabricated
class: cheap_elementwise
flops: "n" # one scalar op per element (n = output element count)
bytes_moved: "3 * n * dtype_bytes" # read lhs + rhs, write out — bandwidth-bound
memory: { device_bytes: 0, host_bytes: "n * dtype_bytes", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "f32/f64 native IEEE op; bf16/f16 widen to f32 then narrow on store. Per-op IEEE semantics vary (see concrete sections)."
determinism: same_hardware_bitwise
```
---
## add_f32 (elementwise addition, F32)
`out[i] = lhs[i] + lhs[i]` in native f32 (`chassis/binary.rs:115-118`). Exact IEEE-754 single-
precision addition; contiguous, same-shape, no broadcasting. Thunk `add_f32`
(`byte_kernels.rs:68`).
```fkc
kernel: add_f32
op_kind: AddElementwise
blurb: "Elementwise F32 addition; contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::add_f32"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F32]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F32]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 32
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 4" # F32 = 4 bytes/elem
memory: { device_bytes: 0, host_bytes: "n * 4", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: 0
max_relative: ~
max_absolute: ~
audited: true
notes: "Exact IEEE-754 f32 addition (round-to-nearest-even)."
determinism: same_hardware_bitwise
```
---
## add_f64 (elementwise addition, F64)
`out[i] = lhs[i] + rhs[i]` in native f64 (`chassis/binary.rs:117`). Exact IEEE-754 double-
precision addition. Thunk `add_f64` (`byte_kernels.rs:73`).
```fkc
kernel: add_f64
op_kind: AddElementwise
blurb: "Elementwise F64 addition; contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::add_f64"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F64]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F64]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 64
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 8" # F64 = 8 bytes/elem
memory: { device_bytes: 0, host_bytes: "n * 8", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: 0
max_relative: ~
max_absolute: ~
audited: true
notes: "Exact IEEE-754 f64 addition (round-to-nearest-even)."
determinism: same_hardware_bitwise
```
---
## add_bf16 (elementwise addition, BF16 via f32)
`out[i] = bf16(f32(lhs[i]) + f32(rhs[i]))` — operands widen to f32, add, narrow on store
(`chassis/binary.rs:57-61`, `Add::f32`). Thunk `add_bf16` (`byte_kernels.rs:160`).
```fkc
kernel: add_bf16
op_kind: AddElementwise
blurb: "Elementwise BF16 addition via f32 round-trip; contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::add_bf16"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [BF16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [BF16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 16
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 2" # BF16 = 2 bytes/elem
memory: { device_bytes: 0, host_bytes: "n * 2", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "Widen to f32, add, narrow to bf16 on store (round-trip). Deterministic; bit-stable on same hardware. Result reflects the single bf16 rounding of the f32 sum."
determinism: same_hardware_bitwise
```
---
## add_f16 (elementwise addition, F16 via f32)
`out[i] = f16(f32(lhs[i]) + f32(rhs[i]))` — operands widen to f32, add, narrow on store
(`chassis/binary.rs:63-67`, `Add::f32`). Thunk `add_f16` (`byte_kernels.rs`, f16 elementwise
block).
```fkc
kernel: add_f16
op_kind: AddElementwise
blurb: "Elementwise F16 addition via f32 round-trip; contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::add_f16"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 16
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 2" # F16 = 2 bytes/elem
memory: { device_bytes: 0, host_bytes: "n * 2", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "Widen to f32, add, narrow to f16 on store (round-trip). Deterministic; bit-stable on same hardware. Result reflects the single f16 rounding of the f32 sum."
determinism: same_hardware_bitwise
```
---
## sub_f32 (elementwise subtraction, F32)
`out[i] = lhs[i] - rhs[i]` in native f32 (`chassis/binary.rs:122-125`). Thunk `sub_f32`
(`byte_kernels.rs:69`).
```fkc
kernel: sub_f32
op_kind: SubElementwise
blurb: "Elementwise F32 subtraction; contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::sub_f32"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F32]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F32]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 32
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 4"
memory: { device_bytes: 0, host_bytes: "n * 4", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: 0
max_relative: ~
max_absolute: ~
audited: true
notes: "Exact IEEE-754 f32 subtraction (round-to-nearest-even)."
determinism: same_hardware_bitwise
```
---
## sub_f64 (elementwise subtraction, F64)
`out[i] = lhs[i] - rhs[i]` in native f64 (`chassis/binary.rs:124`). Thunk `sub_f64`
(`byte_kernels.rs:74`).
```fkc
kernel: sub_f64
op_kind: SubElementwise
blurb: "Elementwise F64 subtraction; contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::sub_f64"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F64]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F64]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 64
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 8"
memory: { device_bytes: 0, host_bytes: "n * 8", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: 0
max_relative: ~
max_absolute: ~
audited: true
notes: "Exact IEEE-754 f64 subtraction (round-to-nearest-even)."
determinism: same_hardware_bitwise
```
---
## sub_bf16 (elementwise subtraction, BF16 via f32)
`out[i] = bf16(f32(lhs[i]) - f32(rhs[i]))` (`chassis/binary.rs:57-61`, `Sub::f32`). Thunk
`sub_bf16` (`byte_kernels.rs:161`).
```fkc
kernel: sub_bf16
op_kind: SubElementwise
blurb: "Elementwise BF16 subtraction via f32 round-trip; contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::sub_bf16"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [BF16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [BF16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 16
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 2"
memory: { device_bytes: 0, host_bytes: "n * 2", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "Widen to f32, subtract, narrow to bf16 on store. Deterministic; bit-stable on same hardware."
determinism: same_hardware_bitwise
```
---
## sub_f16 (elementwise subtraction, F16 via f32)
`out[i] = f16(f32(lhs[i]) - f32(rhs[i]))` (`chassis/binary.rs:63-67`, `Sub::f32`). Thunk
`sub_f16` (`byte_kernels.rs`, f16 elementwise block).
```fkc
kernel: sub_f16
op_kind: SubElementwise
blurb: "Elementwise F16 subtraction via f32 round-trip; contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::sub_f16"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 16
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 2"
memory: { device_bytes: 0, host_bytes: "n * 2", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "Widen to f32, subtract, narrow to f16 on store. Deterministic; bit-stable on same hardware."
determinism: same_hardware_bitwise
```
---
## mul_f32 (elementwise multiplication, F32)
`out[i] = lhs[i] * rhs[i]` in native f32 (`chassis/binary.rs:129-132`). Thunk `mul_f32`
(`byte_kernels.rs:70`).
```fkc
kernel: mul_f32
op_kind: MulElementwise
blurb: "Elementwise F32 multiplication; contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::mul_f32"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F32]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F32]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 32
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 4"
memory: { device_bytes: 0, host_bytes: "n * 4", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: 0
max_relative: ~
max_absolute: ~
audited: true
notes: "Exact IEEE-754 f32 multiplication (round-to-nearest-even)."
determinism: same_hardware_bitwise
```
---
## mul_f64 (elementwise multiplication, F64)
`out[i] = lhs[i] * rhs[i]` in native f64 (`chassis/binary.rs:131`). Thunk `mul_f64`
(`byte_kernels.rs:75`).
```fkc
kernel: mul_f64
op_kind: MulElementwise
blurb: "Elementwise F64 multiplication; contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::mul_f64"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F64]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F64]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 64
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 8"
memory: { device_bytes: 0, host_bytes: "n * 8", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: 0
max_relative: ~
max_absolute: ~
audited: true
notes: "Exact IEEE-754 f64 multiplication (round-to-nearest-even)."
determinism: same_hardware_bitwise
```
---
## mul_bf16 (elementwise multiplication, BF16 via f32)
`out[i] = bf16(f32(lhs[i]) * f32(rhs[i]))` (`chassis/binary.rs:57-61`, `Mul::f32`). The f32
round-trip is the precision-correct path — native bf16 multiply would truncate the intermediate
product (`chassis/binary.rs:210-219` test). Thunk `mul_bf16` (`byte_kernels.rs:162`).
```fkc
kernel: mul_bf16
op_kind: MulElementwise
blurb: "Elementwise BF16 multiplication via f32 round-trip; contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::mul_bf16"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [BF16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [BF16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 16
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 2"
memory: { device_bytes: 0, host_bytes: "n * 2", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "Widen to f32, multiply, narrow to bf16 on store. Avoids the intermediate truncation a native bf16 multiply would incur. Deterministic; bit-stable on same hardware."
determinism: same_hardware_bitwise
```
---
## mul_f16 (elementwise multiplication, F16 via f32)
`out[i] = f16(f32(lhs[i]) * f32(rhs[i]))` (`chassis/binary.rs:63-67`, `Mul::f32`). Thunk `mul_f16`
(`byte_kernels.rs`, f16 elementwise block).
```fkc
kernel: mul_f16
op_kind: MulElementwise
blurb: "Elementwise F16 multiplication via f32 round-trip; contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::mul_f16"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 16
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 2"
memory: { device_bytes: 0, host_bytes: "n * 2", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "Widen to f32, multiply, narrow to f16 on store. Deterministic; bit-stable on same hardware."
determinism: same_hardware_bitwise
```
---
## div_f32 (elementwise division, F32)
`out[i] = lhs[i] / rhs[i]` in native f32 (`chassis/binary.rs:136-139`). Division by zero yields
IEEE-754 ±inf; `0/0` and `inf/inf` yield NaN. Thunk `div_f32` (`byte_kernels.rs:71`).
```fkc
kernel: div_f32
op_kind: DivElementwise
blurb: "Elementwise F32 division; IEEE inf/NaN; contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::div_f32"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F32]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F32]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 32
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 4"
memory: { device_bytes: 0, host_bytes: "n * 4", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: 0
max_relative: ~
max_absolute: ~
audited: true
notes: "Exact IEEE-754 f32 division (round-to-nearest-even). Div-by-zero → ±inf; 0/0, inf/inf → NaN."
determinism: same_hardware_bitwise
```
---
## div_f64 (elementwise division, F64)
`out[i] = lhs[i] / rhs[i]` in native f64 (`chassis/binary.rs:138`). IEEE inf/NaN per div_f32.
Thunk `div_f64` (`byte_kernels.rs:76`).
```fkc
kernel: div_f64
op_kind: DivElementwise
blurb: "Elementwise F64 division; IEEE inf/NaN; contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::div_f64"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F64]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F64]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 64
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 8"
memory: { device_bytes: 0, host_bytes: "n * 8", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: 0
max_relative: ~
max_absolute: ~
audited: true
notes: "Exact IEEE-754 f64 division (round-to-nearest-even). Div-by-zero → ±inf; 0/0, inf/inf → NaN."
determinism: same_hardware_bitwise
```
---
## div_bf16 (elementwise division, BF16 via f32)
`out[i] = bf16(f32(lhs[i]) / f32(rhs[i]))` (`chassis/binary.rs:57-61`, `Div::f32`). IEEE inf/NaN
arise in the f32 division before the narrow. Thunk `div_bf16` (`byte_kernels.rs:163`).
```fkc
kernel: div_bf16
op_kind: DivElementwise
blurb: "Elementwise BF16 division via f32 round-trip; IEEE inf/NaN; contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::div_bf16"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [BF16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [BF16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 16
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 2"
memory: { device_bytes: 0, host_bytes: "n * 2", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "Widen to f32, divide, narrow to bf16 on store. Div-by-zero → ±inf; 0/0, inf/inf → NaN (in the f32 step). Deterministic; bit-stable on same hardware."
determinism: same_hardware_bitwise
```
---
## div_f16 (elementwise division, F16 via f32)
`out[i] = f16(f32(lhs[i]) / f32(rhs[i]))` (`chassis/binary.rs:63-67`, `Div::f32`). Thunk `div_f16`
(`byte_kernels.rs`, f16 elementwise block).
```fkc
kernel: div_f16
op_kind: DivElementwise
blurb: "Elementwise F16 division via f32 round-trip; IEEE inf/NaN; contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::div_f16"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 16
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 2"
memory: { device_bytes: 0, host_bytes: "n * 2", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "Widen to f32, divide, narrow to f16 on store. Div-by-zero → ±inf; 0/0, inf/inf → NaN (in the f32 step). Deterministic; bit-stable on same hardware."
determinism: same_hardware_bitwise
```
---
## maximum_f32 (elementwise maximum, F32)
`out[i] = if lhs[i].is_nan() { lhs[i] } else if rhs[i].is_nan() { rhs[i] } else { lhs[i].max(rhs[i]) }`
(`chassis/binary.rs:145-152`). NaN-propagating (torch parity — `torch.maximum` returns NaN if
*either* operand is NaN), pinned 2026-07-08 (`docs/architecture/10-decisions-log.md`); deliberately
does not use bare `f32::max` (which is NaN-as-missing). Thunk `maximum_f32` (`byte_kernels.rs:3101`).
```fkc
kernel: maximum_f32
op_kind: MaximumElementwise
blurb: "Elementwise F32 maximum (NaN-propagating, torch parity); contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::maximum_f32"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F32]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F32]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 32
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 4"
memory: { device_bytes: 0, host_bytes: "n * 4", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: 0
max_relative: ~
max_absolute: ~
audited: true
notes: "Exact: returns one of the two operands (or a NaN operand unchanged). NaN-propagating (torch parity) — NaN if either operand is NaN; the non-NaN result is otherwise the larger operand. On a ±0 tie, operand a (lhs) wins — a-biased per KISS §6.13. Two authorities: the NaN-propagation and lhs-first payload above are torch parity; the ±0 tie is pinned by KISS §6.13, NOT torch. (binary.rs avoids the native f32/f64 min/max intrinsics precisely because they leave the ±0 tie unspecified.)"
determinism: same_hardware_bitwise
```
---
## maximum_f64 (elementwise maximum, F64)
`out[i] = if lhs[i].is_nan() { lhs[i] } else if rhs[i].is_nan() { rhs[i] } else { lhs[i].max(rhs[i]) }`
(`chassis/binary.rs:145-152`). NaN-propagating (torch parity), pinned 2026-07-08. Thunk
`maximum_f64` (`byte_kernels.rs:144`).
```fkc
kernel: maximum_f64
op_kind: MaximumElementwise
blurb: "Elementwise F64 maximum (NaN-propagating, torch parity); contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::maximum_f64"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F64]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F64]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 64
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 8"
memory: { device_bytes: 0, host_bytes: "n * 8", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: 0
max_relative: ~
max_absolute: ~
audited: true
notes: "Exact: returns one of the two operands (or a NaN operand unchanged). NaN-propagating (torch parity) — NaN if either operand is NaN; the non-NaN result is otherwise the larger operand. On a ±0 tie, operand a (lhs) wins — a-biased per KISS §6.13. Two authorities: the NaN-propagation and lhs-first payload above are torch parity; the ±0 tie is pinned by KISS §6.13, NOT torch. (binary.rs avoids the native f32/f64 min/max intrinsics precisely because they leave the ±0 tie unspecified.)"
determinism: same_hardware_bitwise
```
---
## maximum_bf16 (elementwise maximum, BF16 via f32)
`out[i] = bf16(Maximum::f32(f32(lhs[i]), f32(rhs[i])))` (`chassis/binary.rs:57-61`,
`Maximum::f32`). The max is computed on widened f32 then narrowed; NaN-propagating (torch parity)
per `Maximum::f32`, pinned 2026-07-08. Thunk `maximum_bf16` (`byte_kernels.rs:164`).
```fkc
kernel: maximum_bf16
op_kind: MaximumElementwise
blurb: "Elementwise BF16 maximum via f32 round-trip (NaN-propagating, torch parity); contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::maximum_bf16"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [BF16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [BF16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 16
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 2"
memory: { device_bytes: 0, host_bytes: "n * 2", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "Widen to f32, take Maximum::f32 (NaN-propagating, torch parity), narrow to bf16 on store (lossless re-narrow of an already-bf16-representable operand). Deterministic; bit-stable on same hardware. On a ±0 tie the f32 Maximum wins operand a (lhs) — a-biased per KISS §6.13, a SEPARATE authority from the torch parity above (torch governs NaN + lhs-first payload, NOT the ±0 tie)."
determinism: same_hardware_bitwise
```
---
## maximum_f16 (elementwise maximum, F16 via f32)
`out[i] = f16(Maximum::f32(f32(lhs[i]), f32(rhs[i])))` (`chassis/binary.rs:63-67`,
`Maximum::f32`). NaN-propagating (torch parity), pinned 2026-07-08. Thunk `maximum_f16`
(`byte_kernels.rs:190`).
```fkc
kernel: maximum_f16
op_kind: MaximumElementwise
blurb: "Elementwise F16 maximum via f32 round-trip (NaN-propagating, torch parity); contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::maximum_f16"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 16
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 2"
memory: { device_bytes: 0, host_bytes: "n * 2", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "Widen to f32, take Maximum::f32 (NaN-propagating, torch parity), narrow to f16 on store. Deterministic; bit-stable on same hardware. On a ±0 tie the f32 Maximum wins operand a (lhs) — a-biased per KISS §6.13, a SEPARATE authority from the torch parity above (torch governs NaN + lhs-first payload, NOT the ±0 tie)."
determinism: same_hardware_bitwise
```
---
## minimum_f32 (elementwise minimum, F32)
`out[i] = if lhs[i].is_nan() { lhs[i] } else if rhs[i].is_nan() { rhs[i] } else { lhs[i].min(rhs[i]) }`
(`chassis/binary.rs:158-165`). NaN-propagating (torch parity), mirroring maximum, pinned
2026-07-08. Thunk `minimum_f32` (`byte_kernels.rs:3102`).
```fkc
kernel: minimum_f32
op_kind: MinimumElementwise
blurb: "Elementwise F32 minimum (NaN-propagating, torch parity); contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::minimum_f32"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F32]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F32]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 32
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 4"
memory: { device_bytes: 0, host_bytes: "n * 4", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: 0
max_relative: ~
max_absolute: ~
audited: true
notes: "Exact: returns one of the two operands (or a NaN operand unchanged). NaN-propagating (torch parity) — NaN if either operand is NaN; the non-NaN result is otherwise the smaller operand. On a ±0 tie, operand a (lhs) wins — a-biased per KISS §6.13. Two authorities: the NaN-propagation and lhs-first payload above are torch parity; the ±0 tie is pinned by KISS §6.13, NOT torch. (binary.rs avoids the native f32/f64 min/max intrinsics precisely because they leave the ±0 tie unspecified.)"
determinism: same_hardware_bitwise
```
---
## minimum_f64 (elementwise minimum, F64)
`out[i] = if lhs[i].is_nan() { lhs[i] } else if rhs[i].is_nan() { rhs[i] } else { lhs[i].min(rhs[i]) }`
(`chassis/binary.rs:158-165`). NaN-propagating (torch parity), pinned 2026-07-08. Thunk
`minimum_f64` (`byte_kernels.rs:145`).
```fkc
kernel: minimum_f64
op_kind: MinimumElementwise
blurb: "Elementwise F64 minimum (NaN-propagating, torch parity); contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::minimum_f64"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F64]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F64]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 64
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 8"
memory: { device_bytes: 0, host_bytes: "n * 8", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: 0
max_relative: ~
max_absolute: ~
audited: true
notes: "Exact: returns one of the two operands (or a NaN operand unchanged). NaN-propagating (torch parity) — NaN if either operand is NaN; the non-NaN result is otherwise the smaller operand. On a ±0 tie, operand a (lhs) wins — a-biased per KISS §6.13. Two authorities: the NaN-propagation and lhs-first payload above are torch parity; the ±0 tie is pinned by KISS §6.13, NOT torch. (binary.rs avoids the native f32/f64 min/max intrinsics precisely because they leave the ±0 tie unspecified.)"
determinism: same_hardware_bitwise
```
---
## minimum_bf16 (elementwise minimum, BF16 via f32)
`out[i] = bf16(Minimum::f32(f32(lhs[i]), f32(rhs[i])))` (`chassis/binary.rs:57-61`,
`Minimum::f32`). NaN-propagating (torch parity), pinned 2026-07-08. Thunk `minimum_bf16`
(`byte_kernels.rs:165`).
```fkc
kernel: minimum_bf16
op_kind: MinimumElementwise
blurb: "Elementwise BF16 minimum via f32 round-trip (NaN-propagating, torch parity); contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::minimum_bf16"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [BF16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [BF16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 16
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 2"
memory: { device_bytes: 0, host_bytes: "n * 2", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "Widen to f32, take Minimum::f32 (NaN-propagating, torch parity), narrow to bf16 on store. Deterministic; bit-stable on same hardware. On a ±0 tie the f32 Minimum wins operand a (lhs) — a-biased per KISS §6.13, a SEPARATE authority from the torch parity above (torch governs NaN + lhs-first payload, NOT the ±0 tie)."
determinism: same_hardware_bitwise
```
---
## minimum_f16 (elementwise minimum, F16 via f32)
`out[i] = f16(Minimum::f32(f32(lhs[i]), f32(rhs[i])))` (`chassis/binary.rs:63-67`,
`Minimum::f32`). NaN-propagating (torch parity), pinned 2026-07-08. Thunk `minimum_f16`
(`byte_kernels.rs:191`).
```fkc
kernel: minimum_f16
op_kind: MinimumElementwise
blurb: "Elementwise F16 minimum via f32 round-trip (NaN-propagating, torch parity); contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::minimum_f16"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 16
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 2"
memory: { device_bytes: 0, host_bytes: "n * 2", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "Widen to f32, take Minimum::f32 (NaN-propagating, torch parity), narrow to f16 on store. Deterministic; bit-stable on same hardware. On a ±0 tie the f32 Minimum wins operand a (lhs) — a-biased per KISS §6.13, a SEPARATE authority from the torch parity above (torch governs NaN + lhs-first payload, NOT the ±0 tie)."
determinism: same_hardware_bitwise
```
---
## pow_f32 (elementwise power, F32)
`out[i] = lhs[i].powf(rhs[i])` via `f32::powf` (`chassis/binary.rs:160-163`). IEEE NaN — e.g.
`pow(-2, 0.5) = NaN`. Distinct from `PowIElementwise` (scalar i32 exponent); this is the
tensor-exponent op. Thunk `pow_f32` (`byte_kernels.rs:374`).
```fkc
kernel: pow_f32
op_kind: PowElementwise
blurb: "Elementwise F32 power a^b via powf (IEEE NaN); contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::pow_f32"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F32]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F32]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 32
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n" # 1 transcendental powf per element (a heavier op than +-*/; the Judge calibrates the per-element cost)
bytes_moved: "3 * n * 4"
memory: { device_bytes: 0, host_bytes: "n * 4", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "f32::powf — libm-class transcendental, not a hardware-exact op; ULP bound depends on the platform powf and is left for the Judge to calibrate. IEEE NaN (e.g. negative base, fractional exponent → NaN). Deterministic on same hardware (same powf implementation). [evidence: bit_stable_on_same_hardware earned EMPIRICALLY per registered dtype — 16 byte-identical repeat invocations of ONE probe, on the recording hardware and under the pinned toolchain (rust-toolchain.toml channel = 1.98.0). Not a source-level determinism argument, and not evidence about other inputs, OTHER PARAMETER CONFIGURATIONS (one probe fixes one; branches such as causal/softcap/window go untaken), other machines, or other compilers.]"
determinism: same_hardware_bitwise
```
---
## pow_f64 (elementwise power, F64)
`out[i] = lhs[i].powf(rhs[i])` via `f64::powf` (`chassis/binary.rs:162`). IEEE NaN. Thunk
`pow_f64` (`byte_kernels.rs`, f64 pow thunk near `byte_kernels.rs:375`).
```fkc
kernel: pow_f64
op_kind: PowElementwise
blurb: "Elementwise F64 power a^b via powf (IEEE NaN); contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::pow_f64"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F64]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F64]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 64
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 8"
memory: { device_bytes: 0, host_bytes: "n * 8", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "f64::powf — libm-class transcendental; ULP bound platform-dependent, left for the Judge. IEEE NaN (negative base, fractional exponent → NaN). Deterministic on same hardware. [evidence: bit_stable_on_same_hardware earned EMPIRICALLY per registered dtype — 16 byte-identical repeat invocations of ONE probe, on the recording hardware and under the pinned toolchain (rust-toolchain.toml channel = 1.98.0). Not a source-level determinism argument, and not evidence about other inputs, OTHER PARAMETER CONFIGURATIONS (one probe fixes one; branches such as causal/softcap/window go untaken), other machines, or other compilers.]"
determinism: same_hardware_bitwise
```
---
## pow_bf16 (elementwise power, BF16 via f32)
`out[i] = bf16(f32(lhs[i]).powf(f32(rhs[i])))` (`chassis/binary.rs:57-61`, `Pow::f32`). The
transcendental runs at f32 then narrows. Thunk `pow_bf16` (`byte_kernels.rs`, bf16 pow thunk near
`byte_kernels.rs:376`).
```fkc
kernel: pow_bf16
op_kind: PowElementwise
blurb: "Elementwise BF16 power a^b via f32 powf round-trip (IEEE NaN); contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::pow_bf16"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [BF16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [BF16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 16
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 2"
memory: { device_bytes: 0, host_bytes: "n * 2", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "Widen to f32, f32::powf, narrow to bf16 on store. Transcendental ULP platform-dependent (Judge calibrates) plus one bf16 rounding. IEEE NaN. Deterministic on same hardware. [evidence: bit_stable_on_same_hardware earned EMPIRICALLY per registered dtype — 16 byte-identical repeat invocations of ONE probe, on the recording hardware and under the pinned toolchain (rust-toolchain.toml channel = 1.98.0). Not a source-level determinism argument, and not evidence about other inputs, OTHER PARAMETER CONFIGURATIONS (one probe fixes one; branches such as causal/softcap/window go untaken), other machines, or other compilers.]"
determinism: same_hardware_bitwise
```
---
## pow_f16 (elementwise power, F16 via f32)
`out[i] = f16(f32(lhs[i]).powf(f32(rhs[i])))` (`chassis/binary.rs:63-67`, `Pow::f32`). Thunk
`pow_f16` (`byte_kernels.rs:377`).
```fkc
kernel: pow_f16
op_kind: PowElementwise
blurb: "Elementwise F16 power a^b via f32 powf round-trip (IEEE NaN); contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::pow_f16"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 16
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 2"
memory: { device_bytes: 0, host_bytes: "n * 2", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "Widen to f32, f32::powf, narrow to f16 on store. Transcendental ULP platform-dependent (Judge calibrates) plus one f16 rounding. IEEE NaN. Deterministic on same hardware. [evidence: bit_stable_on_same_hardware earned EMPIRICALLY per registered dtype — 16 byte-identical repeat invocations of ONE probe, on the recording hardware and under the pinned toolchain (rust-toolchain.toml channel = 1.98.0). Not a source-level determinism argument, and not evidence about other inputs, OTHER PARAMETER CONFIGURATIONS (one probe fixes one; branches such as causal/softcap/window go untaken), other machines, or other compilers.]"
determinism: same_hardware_bitwise
```
---
## rem_f32 (elementwise remainder, F32, PyTorch convention)
`out[i] = lhs[i] - (lhs[i] / rhs[i]).floor() * rhs[i]` in native f32 (`chassis/binary.rs:168-171`).
PyTorch `remainder` convention — the result's sign follows the **divisor** `rhs` (not the dividend,
as Rust `%` would). E.g. `rem(7, -3) = -2`, `rem(-7, 3) = 2`. Thunk `rem_f32`
(`byte_kernels.rs:393`).
```fkc
kernel: rem_f32
op_kind: RemElementwise
blurb: "Elementwise F32 remainder (PyTorch a-floor(a/b)*b, sign follows divisor); contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::rem_f32"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F32]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F32]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 32
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n" # div + floor + mul + sub per element
bytes_moved: "3 * n * 4"
memory: { device_bytes: 0, host_bytes: "n * 4", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "PyTorch remainder a - floor(a/b)*b (sign follows divisor). Composed of IEEE f32 div/floor/mul/sub; deterministic, bit-stable on same hardware. NaN/inf per IEEE on the component ops (e.g. b=0 → NaN)."
determinism: same_hardware_bitwise
```
---
## rem_f64 (elementwise remainder, F64, PyTorch convention)
`out[i] = lhs[i] - (lhs[i] / rhs[i]).floor() * rhs[i]` in native f64 (`chassis/binary.rs:170`).
Sign follows divisor. Thunk `rem_f64` (`byte_kernels.rs`, f64 rem thunk near `byte_kernels.rs:394`).
```fkc
kernel: rem_f64
op_kind: RemElementwise
blurb: "Elementwise F64 remainder (PyTorch a-floor(a/b)*b, sign follows divisor); contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::rem_f64"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F64]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F64]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 64
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 8"
memory: { device_bytes: 0, host_bytes: "n * 8", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "PyTorch remainder a - floor(a/b)*b (sign follows divisor). Composed of IEEE f64 div/floor/mul/sub; deterministic, bit-stable on same hardware. NaN/inf per IEEE on the component ops (e.g. b=0 → NaN)."
determinism: same_hardware_bitwise
```
---
## rem_bf16 (elementwise remainder, BF16 via f32, PyTorch convention)
`out[i] = bf16(f32(lhs[i]) - (f32(lhs[i]) / f32(rhs[i])).floor() * f32(rhs[i]))`
(`chassis/binary.rs:57-61`, `Rem::f32`). Sign follows divisor. Thunk `rem_bf16`
(`byte_kernels.rs`, bf16 rem thunk near `byte_kernels.rs:395`).
```fkc
kernel: rem_bf16
op_kind: RemElementwise
blurb: "Elementwise BF16 remainder via f32 round-trip (PyTorch, sign follows divisor); contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::rem_bf16"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [BF16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [BF16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 16
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 2"
memory: { device_bytes: 0, host_bytes: "n * 2", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "Widen to f32, compute a - floor(a/b)*b (sign follows divisor), narrow to bf16 on store. Deterministic; bit-stable on same hardware. NaN/inf per IEEE (e.g. b=0 → NaN)."
determinism: same_hardware_bitwise
```
---
## rem_f16 (elementwise remainder, F16 via f32, PyTorch convention)
`out[i] = f16(f32(lhs[i]) - (f32(lhs[i]) / f32(rhs[i])).floor() * f32(rhs[i]))`
(`chassis/binary.rs:63-67`, `Rem::f32`). Sign follows divisor. Thunk `rem_f16`
(`byte_kernels.rs:396`).
```fkc
kernel: rem_f16
op_kind: RemElementwise
blurb: "Elementwise F16 remainder via f32 round-trip (PyTorch, sign follows divisor); contiguous same-shape."
backend: Cpu
kernel_source: "portable-cpu"
entry_point: "fuel_cpu_backend::byte_kernels::rem_f16"
kernel_revision_hash: auto
accept:
inputs:
- name: lhs
dtypes: [F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=rhs
- name: rhs
dtypes: [F16]
layout: { contiguous: required, strided: rejected, broadcast_stride0: rejected, start_offset: rejected, reverse_strides: rejected }
rank: any
shape_constraint: same_as=lhs
op_params: { variant: None }
return:
outputs:
- name: out
dtype_rule: passthrough(lhs)
shape_rule: same_as(lhs)
layout_guarantee: contiguous
aliasing: none
caps:
awkward_layout_strategy: requires_contiguous
fast_paths:
- { when: "all_inputs_contiguous", class: cheap_elementwise }
in_place: false
alignment_bytes: 64
access_granularity_bits: 16
cost:
provenance: judge_measured
class: cheap_elementwise
flops: "n"
bytes_moved: "3 * n * 2"
memory: { device_bytes: 0, host_bytes: "n * 2", disk_bytes: 0 }
precision:
bit_stable_on_same_hardware: true
max_ulp: ~
max_relative: ~
max_absolute: ~
audited: true
notes: "Widen to f32, compute a - floor(a/b)*b (sign follows divisor), narrow to f16 on store. Deterministic; bit-stable on same hardware. NaN/inf per IEEE (e.g. b=0 → NaN)."
determinism: same_hardware_bitwise
```