Repository navigation
Description
What was observed
Twice during one long session, bash test --cpp reported a confident full-suite pass with a denominator that was not the full suite, where a clean run gives 357.
Verbatim, both from bash test --cpp (not a filtered invocation):
✓ Fingerprint cache valid - skipping C++ unit tests (no changes detected) [1/1 passed in 16.98s]
cpp_unit_tests (1/1 passed in 16.98s) | skipped
✅ All tests passed (274/274 in 36.87s)
cpp_unit_tests (274/274 passed) | 36.87s
Immediately after the second one, bash test --cpp --clean gave:
✅ All tests passed (357/357 in 94.51s)
The concern is not that fewer tests ran — incremental/selected runs are a legitimate optimization. It is that the output is indistinguishable from a full pass: ✅ All tests passed (274/274) reads as "everything is green" with no indication that 83 test binaries were not part of that number. A reader (or an agent deciding whether to merge) cannot tell a full run from a partial one.
I acted on that once during the session — treated a 1/1 passed as evidence of suite health — and only caught it because the number looked wrong.
Not reproducible on demand
I tried to reproduce deliberately and could not. Recording what I ruled out so nobody repeats it:
-
mtime-only change —
touch src/fl/gfx/rgbw.cpp.hpp(content identical,git statusclean):
→ correctly stayed cached, no rebuild. Source fingerprinting is content-based, which is right. -
Real content change — appended a comment line to
src/fl/gfx/rgbw.cpp.hpp:
→✅ All tests passed (357/357 in 26.48s). Full suite, not a subset. -
Narrow run poisoning the full-run cache entry — my main hypothesis, since the
1/1case looks exactly like a single-test result being replayed:bash test fltest --cpp -> ✅ All tests passed (1/1 in 0.02s) bash test --cpp -> ✓ Fingerprint cache valid ... [357/357 passed in 35.95s]→ the full-mode entry correctly held 357/357. The filtered and full results appear to be keyed separately, so this hypothesis is disproved.
So whatever produced [1/1 passed in 16.98s] under a plain bash test --cpp depends on state I have not identified — plausibly an ordering involving --clean, a failed/interrupted run, or a build-dir reconfigure between invocations.
Why file it anyway
The cached-result string is replayed verbatim on later runs (skipping C++ unit tests ... [N/N passed in Xs]), so if a wrong N ever lands in that slot it is reported as an authoritative pass until something invalidates the fingerprint. That is a silent-wrong-answer failure mode in the gate the project relies on, which seems worth a look even without a reliable repro.
Cheap mitigation, independent of the root cause
Have the summary state the denominator's provenance, so a partial run cannot be mistaken for a full one:
✅ All tests passed (274 of 357 selected)for a filtered/incremental run✅ All tests passed (357/357)only when the run genuinely covered everything- for the cache-replay line, echo what kind of run produced the cached number
That makes the anomaly self-evident the next time it happens, and is useful on its own merits.
Environment
Windows, bash test --cpp, during a session with heavy branch switching and git worktree use (which is also relevant to #3761 — the mtime-hashed example cache). Clean-tree baseline throughout the session was consistently 357/357.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Jul 31, 2026
Root-caused. The
274in your report is not a truncated suite — it is a different set being counted under identical wording, and the arithmetic confirms it.The two denominators
discover_test_files()(authoritative).dllbinaries in.build/meson-quick/tests/test_list_cache.txt357 - 274 = 83— which is exactly the "83 test binaries were not part of that number" you computed. Those 83 are the example targets.--cppmode runs "unit tests and examples", and both feed the same✅ All tests passed (N/N)line.So the headline means unit tests + examples on a run where examples executed, and unit tests only on a run where the examples fingerprint was already valid — with no wording change whatsoever. Reproduced on demand:
versus a run where the examples also execute, which yields 357 under the same sentence.
Your instinct was right and your hypothesis #3 was closer than the test showed. You checked
.full_run_cache.jsonand correctly found it keyed separately — but the number in the replay line does not come from there. It comes from the fingerprint metadata for thecpp_testkey (FingerprintResult.get_cache_summary(),ci/util/test_types.py), written byupdate_test_metadata("cpp_test", ...)at two sites inci/util/test_runner.py. That is the slot a wrongNlands in and is then replayed as authoritative, which is the silent-wrong-answer mechanism you described.On the
1/1caseI could not reproduce that one either.
bash test fltest --cppfollowed bybash test --cppdid not poison the entry for me. But note the write is unguarded: neither call site checks whether a filter was active before recording the counts, so today's safety is incidental rather than structural — which is consistent with it having happened to you once under state neither of us has reconstructed.What I am putting up
The mitigation you asked for, plus the structural half:
FingerprintResultgains ascopefield recorded alongside the counts, and bothupdate_test_metadatacall sites now declare it —"partial"whenever a filter/selection was active.get_cache_summary()renders provenance, so a narrowed result cannot render as a clean pass:274/274 passed in 30.47s1/1 passed in 16.98s, filtered run - NOT the full suite357/357 passed in 55.20s, scope unrecorded— deliberately not silently promoted to "full"save_all()carriesscopeforward together with the counts it labels. Splitting them would relabel a filtered result as a full one on the very next cache hit — which would have been a fresh instance of this same bug.Deliberately not claiming to fix the unit-vs-examples denominator ambiguity above; that is the larger half and I would rather land the honest-labelling part first than bundle a riskier change into it. Filing that separately.
fix(test): bind _watermarks at function scope so the full-run cache i…
zackees commentedon Aug 20, 2026
Resolved by the merged provenance and breakdown work:
filtered run - NOT the full suite, so a 1/1 partial run cannot masquerade as a full-suite pass.ci/tests/test_run_breakdown.pyexercises filtering, cache replay, suite exclusions, attribution, and legacy results.The original scope/provenance bug and the later unit-vs-example denominator ambiguity are therefore both addressed.