| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
Some checks failed
standards workspaces build + test / which workspaces this change touches (pull_request) Successful in 8s
jouleclaw fabrics / cuda (linux, RTX 4050 + Vulkan loader) (pull_request) Successful in 15s
jouleclaw fabrics / vulkan (linux, RTX 4050 + Vulkan loader) (pull_request) Successful in 16s
repository checks / lockfiles, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Successful in 1m7s
standards workspaces build + test / mesh-rs (mesh/mesh-rs, -p mesh-engine-gguf -p mesh-openai --features mesh-engine-gguf/gguf,mesh-openai/server, mesh-rs, linux-arm64) (pull_request) Successful in 1m13s
standards workspaces build + test / jouleclaw-rs (-nodebug, jouleclaw/jouleclaw-rs, -p jouleclaw-energy --features rapl,nvml, jouleclaw-rs, linux-arm64, -C target-feature=+fp16) (pull_request) Successful in 2m47s
jouleclaw public surface must stay documented / Public-surface audit (jouleclaw-rs) (pull_request) Successful in 1m16s
jouleclaw fabrics / metal (macOS, Apple GPU) (pull_request) Has been cancelled
standards workspaces build + test / macOS energy backends (pull_request) Has been cancelled
standards workspaces build + test / jouledesk-rs (jouledesk/jouledesk-rs, jouledesk-rs, macos) (pull_request) Has been cancelled
`clippy::cast_ptr_alignment` flagged eight casts from `*const u8` to
more-strictly-aligned pointers. The previous commit allowed the lint
crate-wide with a note that GGUF aligns tensor data in practice. That
note was true and the reasoning was still wrong: these functions take
plain `&[u8]` slices and a `metal::Buffer`, and neither carries the
alignment the cast asserts.
let src_f32 = std::slice::from_raw_parts(src.as_ptr().cast::<f32>(), src.len() / 4);
`src` is an mmap'd region at whatever offset the file chose. Misaligned
`from_raw_parts` is undefined behaviour, not a slow load, and the
compiler is entitled to assume it cannot happen.
The three that looked safest were the least safe to reason about:
`contents()` on a buffer built with `new_buffer_with_bytes_no_copy` is
the mmap'd pointer itself, so "it's a Metal allocation, those are page
aligned" does not hold for them either.
All eight now decode byte-wise through `from_le_bytes` over
`as_chunks::<N>()`, which needs no unsafe alignment claim at all --
`u8` has alignment 1. The two staging loops keep one cast each, for the
destination, which really is a fresh Metal allocation; the comment says
which side is which and why. The crate-level allow is gone, and
`clippy -- -D warnings` passes without it.
Four unit tests, because the rewrite moved every byte index and a wrong
one would be silent:
- the bf16 and f32 buffer walks must agree with the scalar converters
element for element, over zero, ±1, pi, +inf, a NaN and f16's max;
- conversion from an odd offset on BOTH sides, which is the case the old
code could not express without UB;
- a trailing partial element is dropped rather than read past the end.
The metal CI job also now runs every target under `--features metal`.
It ran only `--test metal_kernels`, which left the crate's 46
metal-gated lib tests unrun -- a feature's unit tests being as invisible
to CI as its code was is the same mistake one level down. That job now
runs 48 lib tests and the 26 kernel tests.
Still outstanding from the same sweep: `mut_from_ref` on
`MetalBuffer::as_mut_slice(&self)`, which hands out a `&mut` from a `&`.
Co-Authored-By: Claude Opus 5 <[email protected]>
|
||
| .. | ||
| conformance.yml | ||
| energy-hardware.yml | ||
| joule-code-conformance.yml | ||
| joule-moq-room.yml | ||
| joule-moq-web.yml | ||
| jouleclaw-fabrics.yml | ||
| jouleclaw-public-surface-documented.yml | ||
| repo-checks.yml | ||
| standards-build.yml | ||
| wai-byte-equality.yml | ||
| wai-conformance.yml | ||
| wai-energy-receipts.yml | ||
| wai-formal-verification.yml | ||
| wai-fuzz.yml | ||
| wai-http.yml | ||
| wai-jpegai-e2e.yml | ||
| wai-neural-e2e.yml | ||
| wai-neural-gates.yml | ||
| wai-ops-differential.yml | ||
| wai-ops.yml | ||
| wai-pack.yml | ||
| wai-quantum-cuda.yml | ||
| wai-quantum-dataflow.yml | ||
| wai-quantum-dsp.yml | ||
| wai-quantum-fpga.yml | ||
| wai-quantum-hip.yml | ||
| wai-quantum-metal.yml | ||
| wai-quantum-npu-cores.yml | ||
| wai-quantum-npu.yml | ||
| wai-quantum-opencl.yml | ||
| wai-quantum-processors.yml | ||
| wai-quantum-qpu.yml | ||
| wai-quantum-service.yml | ||
| wai-quantum-sme.yml | ||
| wai-quantum-tensor-engine.yml | ||
| wai-quantum-tensor-program.yml | ||
| wai-quantum-vector.yml | ||
| wai-quantum-webgpu.yml | ||
| wai-sota-vectors.yml | ||
| wai-vector.yml | ||
| wai-web-reach.yml | ||
| wai-web-wasm.yml | ||