Skip to content

build: derive TEST_BINS by wildcard — stop manufacturing Makefile conflicts - #731

Merged
JustVugg merged 1 commit into
devfrom
build/test-bins-autodiscover
Jul 31, 2026
Merged

build: derive TEST_BINS by wildcard — stop manufacturing Makefile conflicts#731
JustVugg merged 1 commit into
devfrom
build/test-bins-autodiscover

Conversation

@JustVugg

Copy link
Copy Markdown
Owner

A structural fix for the rebase churn, not a cleanup.

The problem

TEST_BINS was a single shared line listing 28 test gates. Every PR that adds a test appended to that same line, so any two such PRs conflicted in c/Makefile by construction — even when they touched completely unrelated parts of the engine.

This is measurable rather than theoretical: c/Makefile appears in 26 of the 40 currently open PRs. And #386 hit this exact conflict twice while being rebased:

"One conflict (both sides appended a test binary to TEST_BINS)"

Every one of those rebases was real work by a contributor, caused by a line that did not need to be shared.

The fix

Derive the list with a wildcard. Adding a gate now means adding your tests/test_*.c and its own build rule — those land in different places in the file, so they do not collide.

TEST_EXCLUDE holds the ones that are deliberately not default gates, each with its reason in a comment:

  • test_uring — Linux-only, appended conditionally just below. A bare wildcard would have promoted it to every platform; this is the behaviour change the exclusion prevents.
  • test_vk_mxfp4 — needs a Vulkan build (VK=1) to link the backend.
  • test_fse, test_tok, test_tok_kimi — no build rule in the Makefile; never were gates.

Verification

  • The derived set is identical to the hand-written one: 29 entries including test_uring on Linux, same names. Compared by rendering $(TEST_BINS) from both the old and new Makefile and diffing — no differences.
  • make test-c passes.
  • A freshly created tests/test_zz_probe.c is picked up automatically, without touching any shared line.

One file, build system only. No engine code, no behaviour change.

…nflicts

TEST_BINS was one long shared line listing 28 gates. Every PR that adds a test
appended to that same line, so any two such PRs conflicted in the Makefile by
construction — even when they touched entirely unrelated parts of the engine.

That is not a hypothetical. c/Makefile appears in 26 of the 40 currently open
PRs, and #386 hit this specific conflict twice across its rebases:

    "One conflict (both sides appended a test binary to TEST_BINS)"

Adding a gate now means adding your tests/test_*.c and its own build rule, which
land in different places in the file. Nobody edits a line somebody else is also
editing.

TEST_EXCLUDE keeps the four test_*.c that were never default gates, plus
test_uring which is appended conditionally on Linux just below — a bare wildcard
would have promoted it to every platform.

Verified the derived set is byte-identical to the hand-written one (29 entries
including test_uring on Linux, same names), `make test-c` passes, and a freshly
created tests/test_*.c is picked up without touching this line.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@JustVugg
JustVugg merged commit 2c6ef58 into dev Jul 31, 2026
10 checks passed
@JustVugg
JustVugg deleted the build/test-bins-autodiscover branch July 31, 2026 21:22
JustVugg added a commit to monotophic/colibri that referenced this pull request Jul 31, 2026
…the wildcard

Resolved by a maintainer rather than asking for an eleventh rebase, because the
conflict was caused by a merge made minutes earlier and the resolution deletes
work rather than adding any.

The only conflicting hunk was TEST_BINS. This branch appended
test_cap_precedence and test_ssd_probe to the hand-written list; dev (JustVugg#731) now
derives that list with a wildcard, specifically so that adding a test stops
conflicting with every other PR that adds a test. So the branch's append is
dropped: both tests are discovered automatically, and their build rules — which
merged cleanly, in a different part of the file — are untouched.

Verified: TEST_BINS goes from 29 to 31 entries, both new gates included;
`make test-c` passes; test_cap_precedence and test_ssd_probe both report ok.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
JustVugg added a commit that referenced this pull request Jul 31, 2026
build: derive TEST_BINS from the build rules, not the .c files (corrects #731)
JustVugg added a commit to monotophic/colibri that referenced this pull request Jul 31, 2026
Corrects JustVugg#731, which globbed tests/test_*.c. That was wrong in the opposite
direction from the hand-written list it replaced: it promoted files that
deliberately have no build rule into gates. On dev the four such files were
known and excluded by name, so the set came out identical and the mistake was
invisible; on a contributor branch it is not. Merging dev into JustVugg#529 promoted
that branch's tests/test_fp8_e2e_loader.c -- a file monotophic has but never
gated -- and the build failed on an undefined reference to sqrtf.

Having a build rule is the honest definition of a gate, so derive the list from
the rules. TEST_EXCLUDE drops from five entries to one: test_uring, which has a
rule but is Linux-only and is appended conditionally just below.

The property that motivated all of this is unchanged and now stronger: adding a
gate means adding your .c and its own rule, which land in different places in
the file. There is no shared list left to conflict on at all.

Verified identical to current dev (31 entries, same names) and make test-c green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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