Skip to content

v5.50.3: sub-phase 5C, Standard Library & First Training Run

Latest

Choose a tag to compare

@PanzerPeter PanzerPeter released this 15 Nov 17:24
· 42 commits to main since this release

Closes sub-phase 5C: Standard Library & First Training Run, built across v5.38.0 to v5.50.3.

Someone with no LLVM toolchain can now download neurc, read a batch that Python wrote, train on it on the CPU and the GPU, save a checkpoint, load it and keep training. The standard library is Neuro source rooted at std and embedded in the compiler, so a binary needs no library tree beside it. The neural network library that comes next is designed against a program that already runs on real data.

What landed:

  • Prebuilt Linux compiler. Each release carries neurc-x86_64-unknown-linux-gnu.tar.gz and its SHA-256 checksum. It runs on glibc 2.28 and newer and needs only a C compiler, since LLVM, MLIR and libstdc++ are linked in. The release workflow attaches it only after every example compiles, runs and matches its pins in clean AlmaLinux 8 and Debian 13 containers, with a signed provenance attestation.
  • Modules are namespaces. Two files may each declare helper. Paths work in every position a name takes (patterns, struct literals, impl headers, bounds), export module opens an inline block, import Shape::Circle imports one variant, and a local binding shadows an imported name.
  • Per-file source spans. A compile error, a panic, a failed assert or an overflow trap in any module names that module's own file, line and column.
  • A standard library in Neuro. std is embedded in neurc and compiled with the program; the prelude is std::prelude, and @no_prelude takes it away from one file.
  • @test and neurc test. Discovery, one subprocess per test so a panic fails only its own test, and std::testing::assert_close for floats.
  • Borrowing iterator values. .iter() on arrays, slices and Vec, and m.keys() / m.values() on maps, return iterator values that adapters chain and functions store and return.
  • String ownership in the value. A string records whether it owns its buffer in the top bit of its length, so every position that holds one (fields, payloads, arguments, captures, returns) releases it by the ordinary drop rules. This closed three string leaks.
  • String literals where &string is expected, typed from context: length("text"), open("weights.safetensors").
  • std::fs, std::env, std::time and std::io::read_line, failing with IoError rather than crashing, over a small linked C runtime. neurc run file.nr -- args passes arguments through.
  • Return-position impl Trait over any body, including a call result or an adapter chain.
  • .lines() and .split(sep) yield &string views into the text.
  • std::safetensors. A validated header, fixed-shape reads typed by their annotation through ?, ?? and val ... else, and a Writer for saving. Truncated and malformed files are refused with an error.
  • First training run from a file. The new tutorial has Python write a batch, Neuro train five steps on the CPU, save, reload and train five more on the GPU. Its weights match NumPy's to the bit, and the suite trains thirty steps on the CPU and the GPU side by side and finds the same bits at every step.

Known gaps are in docs/BUGS.md:

  • BUG-164: a program function named like a C library function (exp, free, malloc) takes the library's place.
  • BUG-077: a store through a borrow leaks the tensor it displaces.
  • BUG-152: a method returning its own type nested in itself does not compile.

Next: sub-phase 5D, Tensor Type System Completion (generic element types, shape parameters, named dynamic extents, masks, FP8 and tensor-core @).

Per-version detail is in CHANGELOG.md.