Skip to content

Make bisect_ppx actually instrument the library — coverage was measuring nothing - #713

Merged
hyperpolymath merged 2 commits into
mainfrom
feat/test-bench-coverage
Aug 3, 2026
Merged

Make bisect_ppx actually instrument the library — coverage was measuring nothing#713
hyperpolymath merged 2 commits into
mainfrom
feat/test-bench-coverage

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

The coverage job runs, passes, and measures nothing.

$ dune runtest --force --instrument-with bisect_ppx
537 tests OK, exit 0
$ bisect-ppx-report summary
Error: no *.coverage files found

Zero .coverage files are written anywhere in the tree.

Root cause

lib/dune declares (preprocess (pps …)) but no instrumentation backend. --instrument-with bisect_ppx only instruments libraries that opt in with an (instrumentation (backend bisect_ppx)) stanza. Without one, dune instruments nothing, the tests run uninstrumented, and there is no coverage data to report.

Why nobody noticed

.github/workflows/ci.yml:213 sets continue-on-error: true on the step that calls bisect-ppx-report. So the report failed on every run, the failure was swallowed, and the coverage job went green while producing no data — the same hollow-gate shape as a test that passes without running.

The continue-on-error is left in place: it's defensible for a visibility-only artefact step, and with this fix the step now has something to report. Worth revisiting separately if coverage ever becomes gating.

After the fix

before after
.coverage files 0 2
Coverage unmeasurable 8103/16243 (49.89%)

That number has never been measurable before, so treat it as a baseline — not a regression, and not an improvement.

What it says needs attention

Core paths are reasonably covered:

Module Coverage
parser.ml 75.64% 969/1281
quantity.ml 79.28% 241/304
typecheck.ml 68.37% 1042/1524
borrow.ml 68.03% 800/1176
resolve.ml 59.21% 405/684
lexer.ml 58.33% 49/84

The gaps are concentrated in backends and tooling, not the front end:

Module Coverage
wasm_gc.ml 0.00% 0/178 ← entirely unexercised
wasm.ml 0.24% 1/423
types.ml 9.95% 19/191
lean_codegen.ml 10.48% 13/124
value.ml 13.13% 26/198
c_codegen.ml 14.60% 67/459
lsp_server.ml 15.47% 43/278

wasm_gc.ml at 0/178 is the standout — 178 points, none reached by any of the 537 tests.

Two things I checked and did not change

The 32 [SKIP]s in res-to-affine-walker are correct behaviour, not a fake gate. test_walker.ml:65 skips with an actionable message when the tree-sitter CLI isn't on PATH, and CI does install it (ci.yml:59–68) — so those tests run in CI and skip only locally. Good design; left alone.

The suite is otherwise healthy: 537 tests run, 0 fail. Better than the estate norm.

Scope

One file changed: lib/dune.

🤖 Generated with Claude Code

The coverage job runs, passes, and measures nothing.

    $ dune runtest --force --instrument-with bisect_ppx
    537 tests OK, exit 0
    $ bisect-ppx-report summary
    Error: no *.coverage files found

Zero .coverage files are written anywhere in the tree.

== Root cause

lib/dune declares `(preprocess (pps ...))` but no instrumentation backend.
`--instrument-with bisect_ppx` only instruments libraries that opt in with an
`(instrumentation (backend bisect_ppx))` stanza; without one, dune instruments
nothing, the tests run uninstrumented, and no coverage data exists to report.

== Why nobody noticed

.github/workflows/ci.yml:213 sets `continue-on-error: true` on the step that
calls bisect-ppx-report. So the report failed on every run, the failure was
swallowed, and the coverage job went green while producing no data. The same
hollow-gate shape as a test that passes without running.

The `continue-on-error` is left in place — it is defensible for a
visibility-only artefact step, and with this fix the step now has something to
report. Worth revisiting separately if coverage ever becomes gating.

== After the fix

    .coverage files: 0 -> 2
    Coverage: 8103/16243 (49.89%)

That number has never been measurable before, so it is a baseline rather than a
regression or an improvement.

== What it says needs attention

Core paths are reasonably covered:

    parser.ml      75.64%   969/1281
    quantity.ml    79.28%   241/304
    typecheck.ml   68.37%  1042/1524
    borrow.ml      68.03%   800/1176
    resolve.ml     59.21%   405/684
    lexer.ml       58.33%    49/84

The gaps are concentrated in backends and tooling, not the front end:

    wasm_gc.ml      0.00%     0/178    <- entirely unexercised
    wasm.ml         0.24%     1/423
    types.ml        9.95%    19/191
    lean_codegen   10.48%    13/124
    value.ml       13.13%    26/198
    c_codegen.ml   14.60%    67/459
    lsp_server.ml  15.47%    43/278

wasm_gc.ml at 0/178 is the standout: 178 points, none reached by any of the 537
tests.

One change only: lib/dune.
@gitar-bot

gitar-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

Note

Automatic reviews are paused because your trial's included automatic processing has been used for this period. Upgrade now, or comment "Gitar review" to run a review anytime.
Learn more

Code Review ✅ Approved

Adds the missing bisect_ppx instrumentation stanza to lib/dune, enabling code coverage measurement and establishing a 49.89% baseline. No issues found.

Auto-approved and auto-merge armed: No blocking issues found.
Please see Auto-approve Docs for details on setting custom approval criteria. — merges when pipeline and required approvals pass.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Important

Your trial ends in 7 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more.

Was this helpful? React with 👍 / 👎 | Gitar

@gitar-bot
gitar-bot Bot enabled auto-merge (squash) August 3, 2026 13:33
@gitar-bot gitar-bot Bot added the gitar-approved Added by Gitar label Aug 3, 2026

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gitar has auto-approved this PR and enabled auto-merge (configure)

@hyperpolymath
hyperpolymath disabled auto-merge August 3, 2026 13:54
@hyperpolymath
hyperpolymath merged commit 8f1b06a into main Aug 3, 2026
16 checks passed
@hyperpolymath
hyperpolymath deleted the feat/test-bench-coverage branch August 3, 2026 13:54
@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

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

Labels

gitar-approved Added by Gitar

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant