Repository navigation
ci: gate branch coverage and test every backend - #3
Merged
Merged
Conversation
The reader retry branches were reached only when a concurrent writer happened to interleave, so branch coverage could not be gated. A single-threaded test now drives each retry deterministically, the no-atomics backend is built and tested alongside C11, and CI gates on 100% branch coverage. The pull_request branch filter is removed so stacked PRs get CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI gated only line coverage because three reader retry branches (
src/seqlock.c:167,179,207) were reached only when a concurrent writer happened to interleave. This PR reaches them deterministically, builds the never-compiled no-atomics backend, and gates branches at 100%.tests/test_seqlock_retry.c, single-threaded.hdr.seq, so the copy itself changes the counter between the reader's two loads.SEQLOCK_CPU_RELAXis replaced with a test hook that completes the pending write. This needs no production code change becauseSEQLOCK_CPU_RELAXis already overridable.test_seqlock_c11.cbecomestest_seqlock_backend.cand runs once per non-default backend (C11 and no-atomics). No-atomics was previously never compiled.--fail-under-branch 100added to the coverage gate, and thepull_requestbranch filter removed so stacked PRs get CI.Evidence
Coverage of
src/+include/, CI configuration (-fprofile-update=atomic), gcovr merged across all builds:The branch total rises from 48 to 53 because the hooked core and the no-atomics core add their own branches.
Local: ASan/UBSan gcc
-Werror10/10, clang-Werror10/10, TSan 10/10.The standards review lists seqlock at 87.2/77 from a local merged run. That run omitted
-fprofile-update=atomic, which CONTRIBUTING documents as corrupting branch counts when the concurrent tests run. With the flag, master already measures 100% lines and 100% branches, but only when the concurrent tests happen to cover the retry paths.