From 5d2e4252e695644c34be605b44a14bd80a98a0a6 Mon Sep 17 00:00:00 2001 From: jdj Date: Wed, 18 Nov 2026 14:47:33 -0800 Subject: Boris-2 training code The code, configuration and data filters used to train Boris-2 (144M, 200B tokens, single V100): model, training loop, data preparation, n-gram table, V100 kernels, final stages and the exact run configs. --- libremath/arithcheck.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 libremath/arithcheck.py (limited to 'libremath/arithcheck.py') diff --git a/libremath/arithcheck.py b/libremath/arithcheck.py new file mode 100644 index 0000000..d8f78ac --- /dev/null +++ b/libremath/arithcheck.py @@ -0,0 +1,27 @@ +"""Recompute every simple binary step "a op b = c" written in a solution. +Returns the list of wrong steps (empty if all check out). Times (10:20), ratios (3:4) and +fractions written inside larger expressions are skipped rather than misread.""" +import re +NUM = r"\d{1,3}(?:,\d{3})+(?:\.\d+)?|\d+(?:\.\d+)?" +STEP = re.compile(rf"(? 1e-6 and abs(round(v, 2) - c) < 0.006: continue # rounded quotient + if c == int(a // b): continue # whole-number quotient (remainder stated separately) + if abs(v - c) > 1e-6 * max(1, abs(v)) and abs(round(v, 2) - c) > 1e-9: + bad.append(m.group(0)) + return bad -- cgit v1.2.3