bend-safetensors-reader@0.1.0.0 relies on unsafe/foreign
0xd8619c297e019f1c512e443a1b7ff426
bend-safetensors-reader: read .safetensors files into Bend arrays: a checked header parser (with laws), tensor lookup by name, raw and F32 loads.
bend-safetensors-reader@0.1.0.0 by tjpa
- Published
- 2026-11-11
- Size
- 61,999 bytes, 12 files
- License
- MIT-0 (no LICENSE file; the hub's default)
- Declarations
- 7 laws (7 proved), 166 defs, 15 types
Import
import bend-safetensors-reader@0.1.0.0/LAWS.bend as LAWS import 0xd8619c297e019f1c512e443a1b7ff426/LAWS.bend as LAWS import bend-safetensors-reader@0.1.0.0/PROOF.bend as PROOF import 0xd8619c297e019f1c512e443a1b7ff426/PROOF.bend as PROOF import bend-safetensors-reader@0.1.0.0/header.bend as Header import 0xd8619c297e019f1c512e443a1b7ff426/header.bend as Header import bend-safetensors-reader@0.1.0.0/lex.bend as Lex import 0xd8619c297e019f1c512e443a1b7ff426/lex.bend as Lex import bend-safetensors-reader@0.1.0.0/package.bend as Package import 0xd8619c297e019f1c512e443a1b7ff426/package.bend as Package import bend-safetensors-reader@0.1.0.0/st.bend as St import 0xd8619c297e019f1c512e443a1b7ff426/st.bend as St import bend-safetensors-reader@0.1.0.0/test/f16_all.bend as F16_all import 0xd8619c297e019f1c512e443a1b7ff426/test/f16_all.bend as F16_all import bend-safetensors-reader@0.1.0.0/test/list.bend as MList import 0xd8619c297e019f1c512e443a1b7ff426/test/list.bend as MList import bend-safetensors-reader@0.1.0.0/test/read.bend as Read import 0xd8619c297e019f1c512e443a1b7ff426/test/read.bend as Read import bend-safetensors-reader@0.1.0.0/w64.bend as W64 import 0xd8619c297e019f1c512e443a1b7ff426/w64.bend as W64 import bend-safetensors-reader@0.1.0.0/widen.bend as Widen import 0xd8619c297e019f1c512e443a1b7ff426/widen.bend as Widen
Modules
- LAWS.bend 10 declarations, 7 laws — bend-safetensors-reader: the laws about the pure core (header.bend, w64.bend).
- PROOF.bend 5 declarations — bend-safetensors-reader: the proofs of LAWS.bend.
- header.bend 89 declarations — A safetensors header, from its bytes to a checked table of tensors. Pure: no IO, no @unsafe.
- lex.bend 72 declarations — The tokens of a safetensors header (JSON), from its bytes: one step a byte, so every step is a plain state change.
- package.bend 0 declarations — bend-safetensors-reader: read .safetensors files into Bend arrays: a checked header parser (with laws), tensor lookup by name, raw and F32 loads.
- st.bend 38 declarations — bend-safetensors-reader: read .safetensors files into Bend arrays: open a file (its header parsed and checked), find
- test/f16_all.bend 2 declarations — Prints V.f16(h) for every 16-bit h, one a line; check_f16_all.py compares them with NumPy's float16 -> float32.
- test/list.bend 7 declarations — Prints one line a tensor (name, dtype, shape, data_offsets as hex) for the file given as the argument, sorted by
- test/read.bend 12 declarations — For each tensor name given after the file, reads the tensor with St.read and (for F32, BF16, F16) St.read_f32, and
- w64.bend 25 declarations — Unsigned 64-bit numbers as two U32 halves, for file offsets and byte counts past 4 GiB. Bend's Nat is unary at run
- widen.bend 5 declarations — 16-bit floats to F32, on bits: a BF16 or F16 value in the low 16 bits of a U32 to the bits of the same value as
Other files
- README.md 5,837 bytes
Dependencies
- bend-raw-cells@0.1.0.0 via
st.bend: import bend-raw-cells@0.1.0.0/raw.bend as R
Dependents
No package in this build imports it.
Status on bend 2.0.40
| File | Status | Checker says | Time |
|---|---|---|---|
| LAWS.bend | open laws/TODOs | 7 TODOs found. Checked alone, a law without a def is a TODO; all of them are proved in files that check, so the package counts this file as checks. outputSOME PROOFS FAIL Error: 7 TODOs found. The code is incomplete, and not a valid proof yet. | 0.5 s |
| PROOF.bend | checks | ALL PROOFS CHECK | 6.2 s |
| header.bend | checks | ALL PROOFS CHECK | 0.5 s |
| lex.bend | checks | ALL PROOFS CHECK | 0.4 s |
| package.bend | relies on unsafe/foreign | 23 defs rely on unsafe or foreign codeoutputSOME PROOFS FAIL Error: 23 defs rely on unsafe or foreign code: defs that depend on @unsafe: 0xd8619c297e019f1c512e443a1b7ff426/st.wid, 0xd8619c297e019f1c512e443a1b7ff426/st.wid_get, 0xd8619c297e019f1c512e443a1b7ff426/st.St.widen, 0xd8619c297e019f1c512e443a1b7ff426/st.read16, 0xd8619c297e019f1c512e443a1b7ff426/st.St.read_f32, 0xd8619c297e019f1c512e443a1b7ff426/test/read.fold, 0xd8619c297e019f1c512e443a1b7ff426/test/read.fold_get, 0xd8619c297e019f1c512e443a1b7ff426/test/read.sums, 0xd8619c297e019f1c512e443a1b7ff426/test/read.f32_part, 0xd8619c297e019f1c512e443a1b7ff426/test/read.one, 0xd8619c297e019f1c512e443a1b7ff426/test/read.each, 0xd8619c297e019f1c512e443a1b7ff426/test/read.opened, 0xd8619c297e019f1c512e443a1b7ff426/test/read.arg, 0xd8619c297e019f1c512e443a1b7ff426/test/read.main, 0xd8619c297e019f1c512e443a1b7ff426/test/f16_all.go, 0xd8619c297e019f1c512e443a1b7ff426/test/f16_all.main defs that depend on foreign effects: 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.read, 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.write, 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.read_at, 0xd8619c297e019f1c512e443a1b7ff426/st.tail, 0xd8619c297e019f1c512e443a1b7ff426/st.read_tail, 0xd8619c297e019f1c512e443a1b7ff426/st.read_go, 0xd8619c297e019f1c512e443a1b7ff426/st.St.read, 0xd8619c297e019f1c512e443a1b7ff426/st.read16, 0xd8619c297e019f1c512e443a1b7ff426/st.St.read_f32, 0xd8619c297e019f1c512e443a1b7ff426/test/read.f32_part, 0xd8619c297e019f1c512e443a1b7ff426/test/read.one, 0xd8619c297e019f1c512e443a1b7ff426/test/read.each, 0xd8619c297e019f1c512e443a1b7ff426/test/read.opened, 0xd8619c297e019f1c512e443a1b7ff426/test/read.arg, 0xd8619c297e019f1c512e443a1b7ff426/test/read.main Hint: no law or proof uses these defs. Move them to a file this proof does not import, and the proofs will check: 0xd8619c297e019f1c512e443a1b7ff426/st.wid, 0xd8619c297e019f1c512e443a1b7ff426/st.wid_get, 0xd8619c297e019f1c512e443a1b7ff426/st.St.widen, 0xd8619c297e019f1c512e443a1b7ff426/st.read16, 0xd8619c297e019f1c512e443a1b7ff426/st.St.read_f32, 0xd8619c297e019f1c512e443a1b7ff426/test/read.fold, 0xd8619c297e019f1c512e443a1b7ff426/test/read.fold_get, 0xd8619c297e019f1c512e443a1b7ff426/test/read.sums, 0xd8619c297e019f1c512e443a1b7ff426/test/read.f32_part, 0xd8619c297e019f1c512e443a1b7ff426/test/read.one, 0xd8619c297e019f1c512e443a1b7ff426/test/read.each, 0xd8619c297e019f1c512e443a1b7ff426/test/read.opened, 0xd8619c297e019f1c512e443a1b7ff426/test/read.arg, 0xd8619c297e019f1c512e443a1b7ff426/test/read.main, 0xd8619c297e019f1c512e443a1b7ff426/test/f16_all.go, 0xd8619c297e019f1c512e443a1b7ff426/test/f16_all.main, 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.read, 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.write, 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.read_at, 0xd8619c297e019f1c512e443a1b7ff426/st.tail, 0xd8619c297e019f1c512e443a1b7ff426/st.read_tail, 0xd8619c297e019f1c512e443a1b7ff426/st.read_go, 0xd8619c297e019f1c512e443a1b7ff426/st.St.read | 4.9 s |
| st.bend | relies on unsafe/foreign | 12 defs rely on unsafe or foreign codeoutputSOME PROOFS FAIL Error: 12 defs rely on unsafe or foreign code: defs that depend on @unsafe: wid, wid_get, St.widen, read16, St.read_f32 defs that depend on foreign effects: 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.read, 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.write, 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.read_at, tail, read_tail, read_go, St.read, read16, St.read_f32 | 0.5 s |
| test/f16_all.bend | relies on unsafe/foreign | 2 defs rely on unsafe or foreign codeoutputSOME PROOFS FAIL Error: 2 defs rely on unsafe or foreign code: defs that depend on @unsafe: go, main | 0.4 s |
| test/list.bend | relies on unsafe/foreign | 12 defs rely on unsafe or foreign codeoutputSOME PROOFS FAIL Error: 12 defs rely on unsafe or foreign code: defs that depend on @unsafe: 0xd8619c297e019f1c512e443a1b7ff426/st.wid, 0xd8619c297e019f1c512e443a1b7ff426/st.wid_get, 0xd8619c297e019f1c512e443a1b7ff426/st.St.widen, 0xd8619c297e019f1c512e443a1b7ff426/st.read16, 0xd8619c297e019f1c512e443a1b7ff426/st.St.read_f32 defs that depend on foreign effects: 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.read, 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.write, 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.read_at, 0xd8619c297e019f1c512e443a1b7ff426/st.tail, 0xd8619c297e019f1c512e443a1b7ff426/st.read_tail, 0xd8619c297e019f1c512e443a1b7ff426/st.read_go, 0xd8619c297e019f1c512e443a1b7ff426/st.St.read, 0xd8619c297e019f1c512e443a1b7ff426/st.read16, 0xd8619c297e019f1c512e443a1b7ff426/st.St.read_f32 Hint: no law or proof uses these defs. Move them to a file this proof does not import, and the proofs will check: 0xd8619c297e019f1c512e443a1b7ff426/st.wid, 0xd8619c297e019f1c512e443a1b7ff426/st.wid_get, 0xd8619c297e019f1c512e443a1b7ff426/st.St.widen, 0xd8619c297e019f1c512e443a1b7ff426/st.read16, 0xd8619c297e019f1c512e443a1b7ff426/st.St.read_f32, 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.read, 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.write, 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.read_at, 0xd8619c297e019f1c512e443a1b7ff426/st.tail, 0xd8619c297e019f1c512e443a1b7ff426/st.read_tail, 0xd8619c297e019f1c512e443a1b7ff426/st.read_go, 0xd8619c297e019f1c512e443a1b7ff426/st.St.read | 0.6 s |
| test/read.bend | relies on unsafe/foreign | 21 defs rely on unsafe or foreign codeoutputSOME PROOFS FAIL Error: 21 defs rely on unsafe or foreign code: defs that depend on @unsafe: 0xd8619c297e019f1c512e443a1b7ff426/st.wid, 0xd8619c297e019f1c512e443a1b7ff426/st.wid_get, 0xd8619c297e019f1c512e443a1b7ff426/st.St.widen, 0xd8619c297e019f1c512e443a1b7ff426/st.read16, 0xd8619c297e019f1c512e443a1b7ff426/st.St.read_f32, fold, fold_get, sums, f32_part, one, each, opened, arg, main defs that depend on foreign effects: 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.read, 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.write, 0x3a5a2b27c16f21aea8fab4bc162bd90a/raw.Raw.read_at, 0xd8619c297e019f1c512e443a1b7ff426/st.tail, 0xd8619c297e019f1c512e443a1b7ff426/st.read_tail, 0xd8619c297e019f1c512e443a1b7ff426/st.read_go, 0xd8619c297e019f1c512e443a1b7ff426/st.St.read, 0xd8619c297e019f1c512e443a1b7ff426/st.read16, 0xd8619c297e019f1c512e443a1b7ff426/st.St.read_f32, f32_part, one, each, opened, arg, main | 0.4 s |
| w64.bend | checks | ALL PROOFS CHECK | 0.5 s |
| widen.bend | checks | ALL PROOFS CHECK | 0.4 s |