Skip to content

tests: build the kernel library and a missing simulator once before the per-test makes - #489

Open
tinebp wants to merge 1 commit into
masterfrom
ci/kernel-tests-lib-race
Open

tinebp wants to merge 1 commit into
masterfrom
ci/kernel-tests-lib-race

Conversation

@tinebp

@tinebp tinebp commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Parallel test builds raced on the kernel library. Every kernel and regression test links a sw/kernel library, and each test's own Makefile built it on demand.

  • With make -jN on a fresh tree, the per-test makes compiled and archived the library concurrently.
  • An archive step could then miss an object that another build was rewriting (ar: vx_spawn.c.2.o: No such file).
  • tests/Makefile runs kernel and regression side by side, so it raced the same way.

The fix:

  • The library is built once, as a prerequisite of build-% and run-% in tests/kernel and tests/regression, and of kernel and regression in tests/Makefile.
  • tests/kernel builds a missing simulator once, as sim-<backend>, before its per-test runs.

Impact and evidence

Impact class: R2 (ci/change_impact.py classify)

Contracts touched: none

evidence status detail
functional tests (simx / rtlsim / xrt) run From a cleaned sw/kernel, each library is archived once by each of: make -j4 of tests/kernel all, five regression build-* targets, and tests kernel-lib kernel. Before, it was archived up to four times concurrently. make -n run-simx orders the library and simulator before the per-test runs.
model_parity n/a
perf_gate n/a
Beacon logic_gate n/a
synthesis n/a
XLEN 64 build n/a Makefiles only

🤖 Generated with Claude Code

…he per-test makes

Every kernel and regression test links a sw/kernel library, and each test's
own Makefile builds it on demand. With make -jN at tests/kernel or
tests/regression on a tree where the library was not built yet, every test
directory started its own build of sw/kernel at the same time: a clean -j8
run compiled and archived the library four times concurrently, and an
archive step could miss an object another build was rewriting
("ar: vx_spawn.c.2.o: No such file"). tests/Makefile runs kernel and
regression side by side and so raced the same way, and the kernel tests'
runs built a missing simulator once per test.

Build the library once, as a prerequisite of build-% and run-% in
tests/kernel and tests/regression and of kernel and regression in
tests/Makefile, and in tests/kernel build a missing simulator once
(sim-<backend>) before the per-test runs, so the per-test makes find both
up to date. Clean -j4 builds of tests/kernel, of five regression tests and
of tests' kernel-lib and kernel targets now archive each library once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant