simbracket: A' as a compiled library (Cython, abi3 wheels for Windows and Linux, Python >= 3.10).
lib/simbracket/_core.pyx ports exactly the A' path of simroot.pure.pure_root (tent similarity, three-point scale, projection c=2, contra+flatanalogmempt+exp+half+close+sub, pattern) with Python's semantics kept where they differ from C: min/max keep the first argument on ties and NaN, float division by zero raises, math.log raises at 0, and math.hypot and the builtin sum (compensated since 3.12) are called rather than re-coded. find_root(f, a, b, xtol, maxfev) -> (x, nfev, converged); evaluation_bound(a, b, xtol) = 2*ceil(log2(|b-a|/xtol)) + 3. tests/test_simbracket_equivalence.py: bit-identical x and evaluation count against pure_root on all 868 problems of the six corpora (the 91 Roots.jl problems in full), at xtol 1e-12 and 1e-8 and with the budget cut to 12; errors match; the loaded module is the compiled one. 7/7 on Windows and on Linux. check_simbracket.py: removing any one component from the reference makes 36 to 455 problems differ (the test discriminates); the compiled form is 4x faster. The wheel carries only the compiled extension; _core.c is generated (gen_c.py) and ignored. Regression on the server x2: 1232 passed, 0 failed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
# Two regression passes on the server with the compiled library on the path, 6 workers
|
||||
# (40% of the free cores measured before the run), BLAS pinned to one thread per worker.
|
||||
export OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1
|
||||
export PYTHONPATH="$HOME/simbracket_build/site:."
|
||||
cd "$HOME/sim-numerics" || exit 1
|
||||
for pass in 1 2; do
|
||||
echo "=== PASS $pass ==="
|
||||
~/torchenv/bin/python -m pytest tests -q -p no:cacheprovider -n 6 2>&1 | tail -4
|
||||
done
|
||||
echo "=== REGRESSION DONE ==="
|
||||
Reference in New Issue
Block a user