Skip to content

Untrack the bench binary my own PR committed - #835

Merged
JustVugg merged 1 commit into
JustVugg:devfrom
ZacharyZcR:fix/tracked-bench-binary
Aug 5, 2026
Merged

Untrack the bench binary my own PR committed#835
JustVugg merged 1 commit into
JustVugg:devfrom
ZacharyZcR:fix/tracked-bench-binary

Conversation

@ZacharyZcR

Copy link
Copy Markdown
Contributor

c/tests/bench_omp_grain is a 16,880-byte ELF executable, mode 100755, tracked in dev. It was added by 00129d2 (#808) β€” mine β€” and it is the only tracked build artifact under c/tests/.

The gap, not just the file

.gitignore already guards test binaries properly:

c/tests/test_*
!c/tests/test_*.c
!c/tests/test_*.cu
!c/tests/test_*.mm
!c/tests/test_*.py

That pattern was never extended to bench_* or fuzz_*, which build to extensionless binaries in the same directory. So this fixes the gap rather than the one file β€” same shape, same source exceptions, for both prefixes. Verified both directions: the binaries are ignored, and bench_omp_grain.c / fuzz_rans.c are not.

After this, git ls-files c/tests/ has no extensionless entries left.

Why it matters beyond tidiness

This interacts with #801. tools/clean.py today globs only tests/test_*.exe, so make clean removes nothing on Linux or macOS. #801 fixes that. The moment it lands, make clean would delete a tracked file and hand every contributor a dirty tree β€” a confusing failure whose cause is here, not there.

Removing the binary is what keeps that fix harmless, so this is worth taking regardless of what happens to #801.

Note on how it got in

#808 added bench-omp-grain, whose recipe builds tests/bench_omp_grain in-tree. git add picked it up because nothing ignored it. The irony is not lost on me β€” #808's stated purpose was running structural checks in CI, and it shipped an artifact no structural check was looking for.

c/tests/bench_omp_grain is a 16,880-byte ELF executable, mode 100755,
added by 00129d2 (JustVugg#808). It is the only tracked build artifact under
c/tests/ and it is mine.

.gitignore already guards c/tests/test_* with source-file exceptions, but
the pattern was never extended to bench_* or fuzz_*, which build to
extensionless binaries in the same directory. That gap is how it got in,
so the fix is the gap rather than the one file: same shape, same
exceptions, for both prefixes.

This also matters for JustVugg#801. That PR fixes tools/clean.py, which today
globs only tests/test_*.exe and therefore deletes nothing on Unix; once
it correctly removes extensionless test binaries, `make clean` would
delete a tracked file and leave every contributor with a dirty tree.
Removing the binary is what keeps that fix harmless.
@ZacharyZcR

Copy link
Copy Markdown
Contributor Author

Found the missing half of this story while rebasing #819, and it makes the case for git rm --cached rather than an ignore rule.

c/.gitignore already ignores this binary, and has since the day it was committed. I added the line myself, in 4dbada9, the same series that added the binary:

c/.gitignore:  tests/bench_omp_grain

So this was never "forgot to ignore it". It is the older trap: .gitignore has no effect on a path git is already tracking. The rule went in, git kept tracking the file anyway, and the ignore silently did nothing β€” which is also why nothing downstream ever flagged it.

That changes what the fix has to be. An ignore rule alone cannot remove this file no matter where it is written; only git rm --cached can, which is what this PR does. The .gitignore work here is for the next one β€” c/tests/bench_* and fuzz_* in the root ignore file, so a future bench_* binary is never staged in the first place.

Worth noting the two ignore files were both already trying: c/.gitignore named this exact path, and the root .gitignore guarded c/tests/test_* with source exceptions but stopped there. Two rules pointing at the problem, neither able to fix it after the fact.

I have left the c/.gitignore line alone β€” it is correct, it was simply never sufficient on its own.

@JustVugg
JustVugg merged commit 2e45ad3 into JustVugg:dev Aug 5, 2026
16 checks passed
JustVugg pushed a commit that referenced this pull request Aug 7, 2026
#868 closed most of this: c/COLI_V4_UNIT_*.o covers the twelve objects the
amalgamated deepseek_v4 Makefile leaves next to the sources. Four more go
somewhere else.

    c/Makefile:895:  V4_OWN_DIR = build/ownership

so `make check` also writes build/ownership/COLI_V4_UNIT_{RUNTIME,CONFIG,
ST,NATIVE_QUANT}.o, which no rule matched. On current dev a clean checkout
plus `make check` still leaves `?? c/build/` in git status -- one
`git add -A` away from the same accident #868 was written to stop, and the
one I made on #849 and #800.

Ignoring c/build/ wholesale rather than the four names: nothing under it is
tracked, and it is a build output directory, so a rule per object would need
editing every time the ownership suite grows.

Worth stating because it caught me on #849: an ignore rule does not untrack
what is already committed. #868 made the twelve invisible in git status while
leaving them in the tree; git rm --cached is what removed them. Same shape as
#835. This prevents the next one, it does not clean up an existing one.
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.

2 participants