Symptom
_coverage_check_c_runtime measures random_runtime.c at 91.43% of 35 lines on Linux and 100% on macOS/arm64 under xcrun llvm-cov gcov. The gate threshold is pinned at 90 (raised from main's 45) rather than the 95 the macOS numbers suggested.
Cause
compiler/runtime/random_runtime.c selects its entropy source at compile time. The /dev/urandom fallback branch only exists in the glibc build, and nothing in builtins_runtime_tests.c forces that branch — so on Linux those lines compile, instrument and then never execute.
Fix
Drive the fallback deliberately rather than incidentally: make the entropy-source selection injectable for the test build (or exercise the fallback through a seam that does not depend on which libc compiled the file), assert the fallback returns values in range and reports failure truthfully when the source cannot be opened, then ratchet random_runtime toward 95 once Linux measures it.
Do not close this by exempting the file — the uncovered lines are the failure path, which is the half that matters.
Verification
docker run --rm -v "$PWD":/w -w /w debian:bookworm bash -c '...gcc --coverage ... && gcov ...'
grep -n '#####' random_runtime.c.gcov
Related: #197.
Symptom
_coverage_check_c_runtimemeasuresrandom_runtime.cat 91.43% of 35 lines on Linux and 100% on macOS/arm64 underxcrun llvm-cov gcov. The gate threshold is pinned at 90 (raised from main's 45) rather than the 95 the macOS numbers suggested.Cause
compiler/runtime/random_runtime.cselects its entropy source at compile time. The/dev/urandomfallback branch only exists in the glibc build, and nothing inbuiltins_runtime_tests.cforces that branch — so on Linux those lines compile, instrument and then never execute.Fix
Drive the fallback deliberately rather than incidentally: make the entropy-source selection injectable for the test build (or exercise the fallback through a seam that does not depend on which libc compiled the file), assert the fallback returns values in range and reports failure truthfully when the source cannot be opened, then ratchet
random_runtimetoward 95 once Linux measures it.Do not close this by exempting the file — the uncovered lines are the failure path, which is the half that matters.
Verification
Related: #197.