Skip to content

NDArray: go-ndarray v0.12.0 (Repr prints exactly what NumPy prints) #1170

NDArray: go-ndarray v0.12.0 (Repr prints exactly what NumPy prints)

NDArray: go-ndarray v0.12.0 (Repr prints exactly what NumPy prints) #1170

name: rubyspec-ratchet
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
# Shrink-only ruby/spec conformance gate: run the language + core suites through
# rbgo and judge the sweep FILE BY FILE against scripts/conformance/rubyspec/BASELINE.
# The run fails if any spec file passes fewer examples than its record, or stops
# loading. rbgo's language conformance is thereby tracked and can only go up —
# see scripts/conformance/rubyspec/README.md for why a per-file record replaced
# the single frozen total it used to gate on.
jobs:
ratchet:
name: ruby/spec ratchet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: 1.27.2
- run: go version
- name: What the runner has to start with
run: |
echo "== cpus =="; nproc
echo "== memory =="; free -m
echo "== disk =="; df -h /
- name: Run ruby/spec ratchet
shell: bash
# Raise the per-file timeout above run.sh's 25s default: a few heavy spec
# files (large core suites) can exceed 25s on a loaded/degraded runner and
# then "fail to load", dropping ~150 examples each and producing a spurious
# below-floor REGRESSION. 60s absorbs that jitter without masking real hangs.
env:
TIMEOUT: "60"
# The lane dies intermittently with "the runner has received a
# shutdown signal", three to five minutes into a sweep that takes nine
# when it finishes. This watcher is what found out why, on its first
# failure: memory available fell from 9325 MB to 269 MB in thirty
# seconds, and the runner was gone two seconds later.
#
# Four spec files ask for tens of gigabytes on their own — measured over
# the whole corpus, peak resident set per file:
#
# core/io/seek_spec.rb 63.9 GB
# language/singleton_class_spec.rb 59.4 GB
# core/array/product_spec.rb 37.4 GB
# core/enumerator/arithmetic_sequence/size_spec.rb 34.8 GB
# core/enumerator/lazy/flat_map_spec.rb 17.6 GB
# core/string/multiply_spec.rb 6.2 GB
#
# against a runner with sixteen. Whichever of them the sweep reaches
# first takes the machine with it, which is why the failure moves around
# and why it sometimes finishes. They are runaway allocations in rbgo —
# MRI does not materialise any of these — and they are worth fixing
# there rather than worked around here.
#
# The watcher stays: it is what will say so next time, instead of the
# shrug this lane produced for three days.
run: |
( while true; do
printf '[watch %s] disk_avail=%s mem_avail=%sMB load=%s\n' \
"$(date -u +%H:%M:%S)" \
"$(df -h --output=avail / | tail -1 | tr -d ' ')" \
"$(awk '/MemAvailable/{print int($2/1024)}' /proc/meminfo)" \
"$(cut -d' ' -f1-3 /proc/loadavg)"
sleep 30
done ) &
watcher=$!
# Take the ratchet's own status and exit with it, rather than leaving
# the step's status to whatever tearing down the watcher leaves behind.
#
# An EXIT trap did the tearing down at first, and twice reported a run
# that had printed "ruby/spec ratchet OK" as a failure — "Terminated",
# then exit 1. The race is not reproducible on demand, which is reason
# to remove the mechanism rather than to keep timing it: the status is
# captured before anything is killed, and handed back explicitly.
#
# The child sleep outlives a kill of the subshell alone, so it is
# killed first and waited for — otherwise the runner reports an orphan
# it had to terminate, which is noise in the very log this exists to
# make readable.
set +e
scripts/conformance/rubyspec/run.sh
status=$?
set -e
pkill -P "$watcher" 2>/dev/null || true
kill "$watcher" 2>/dev/null || true
wait "$watcher" 2>/dev/null || true
exit "$status"