docker: the test stage's parallelism and CPU budgets apart from the compile (build.sh -J, -B)

The per-binary CPU budgets are set on a fast machine. A VM on an EPYC 7302 spends 4.6x the quoted
CPU time on tokenizer_test's reference pass, so the image's test stage failed there on a correct
tree, and -j sized for the compile also sized the tests: twelve at once on a 24-thread host put
tests on busy SMT siblings, which costs CPU seconds too.

RAD_TEST_CPU_BUDGET_SCALE multiplies the budget where rad_test.h reads it, at run time, so a
direct ctest takes it as well and the build layer is untouched by it. The stage takes it as
TEST_CPU_BUDGET_SCALE (build.sh -B) and its parallelism as TEST_JOBS (build.sh -J), each empty by
default, which is the stage as before. harness_test checks the factor and keeps it out of its
fixture's environment; docs/DOCKER.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
NunzeandClaude Opus 5.5 committed 2026-10-19 13:37:01 +02:00
1 parent 44aecb0ab8
commit 748f63637e
5 files changed
+33 -6

No files matched your search

+8
View File
@@ -11,6 +11,9 @@
# docker/build.sh -r COMMIT another commit
# docker/build.sh -t 'gfx1200;gfx1201' other GPU architectures (default gfx1201)
# docker/build.sh -j 8 fewer compile jobs, for a host that is also serving
# docker/build.sh -J 4 fewer tests at a time (default: the compile jobs)
# docker/build.sh -B 5 multiply every test's CPU budget, for a host slower per
# thread than the one the budgets were set on
# docker/build.sh --target build stop at a stage (tagged radiance-<stage>), e.g. for the
# GPU test suites
#
@@ -22,6 +25,8 @@ REV=HEAD
HOST=
TARGETS=gfx1201
JOBS=
TEST_JOBS=
BUDGET_SCALE=
STAGE=
while [ $# -gt 0 ]; do
case "$1" in
@@ -29,6 +34,8 @@ while [ $# -gt 0 ]; do
-r) shift; REV="$1" ;;
-t) shift; TARGETS="$1" ;;
-j) shift; JOBS="$1" ;;
-J) shift; TEST_JOBS="$1" ;;
-B) shift; BUDGET_SCALE="$1" ;;
--target) shift; STAGE="$1" ;;
*) echo "docker/build.sh: unknown option $1" >&2; exit 2 ;;
esac
@@ -45,6 +52,7 @@ else
TAGS="-t radiance:$VERSION -t radiance:$SHA -t radiance:latest"
fi
CMD="docker buildx build --load --build-arg GPU_TARGETS='$TARGETS' --build-arg JOBS='$JOBS'"
CMD="$CMD --build-arg TEST_JOBS='$TEST_JOBS' --build-arg TEST_CPU_BUDGET_SCALE='$BUDGET_SCALE'"
CMD="$CMD --build-arg VERSION='$VERSION' --build-arg REVISION='$SHA' $TAGS -"
echo "radiance $VERSION ($SHA) for $TARGETS${HOST:+ on $HOST}${STAGE:+, stage $STAGE}"