Skip to content

ci: coverage gate independent of the runner's CPU; README speed table re-measured at the merged code - #150

Merged
tannevaled merged 2 commits into
mainfrom
ci-covgate-cpu
Nov 29, 2026
Merged

tannevaled merged 2 commits into
mainfrom
ci-covgate-cpu

Conversation

@tannevaled

@tannevaled tannevaled commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Why

main is red at 0a15a86, the merge commit of the Scaler pull request (Refs #149, Refs #141), and v0.25.0 could not be tagged: run 46292291989, job test, GOEXPERIMENT=simd (ubuntu-latest), step upscale coverage gate, vector lane: upscale coverage 94.4% < 100%. The same tree had 21 green checks on the pull request.

Cause (measured)

upscale/easu_perm_amd64.go (Refs #147, which added it) runs only with AVX-512, and a hosted amd64 runner has it or not from one job to the next. On a Ryzen 9 7950X at 0a15a86:

run coverage of ./upscale
GOEXPERIMENT=simd go test -cover 100.0 %
the same under GODEBUG=cpu.avx512f=off 94.5 %

Under the second, the only functions below 100 % are usePerm (50 %) and permGather (8.8 %). The gate has been a draw since then; the Scaler pull request did not change it.

That the failing runner lacked AVX-512 is inferred from the identical figure: the job log does not print the CPU.

Change

  • tools/covgate (cobra, a module of its own, stdlib parser, 100 % covered, parser fuzzed, 10 of 10 mutated refusals caught): fails unless every block of a profile ran; --needs-cpu FLAG=FILE excuses the blocks of one file only when /proc/cpuinfo lacks the flag, and prints a ::warning:: with the number of statements that were not measured. An unreadable cpuinfo, an empty profile and a malformed line are refusals.
  • The vector lane's gate calls it with --needs-cpu avx512f=upscale/easu_perm_amd64.go.
  • A tools/covgate CI lane (ubuntu, macOS) that gates the tool with itself.

Checked on the 7950X at this head: native profile 582 of 582 statements ran, exit 0; the cpu.avx512f=off profile on that same CPU (which does report avx512f) is refused, 32 statement(s) never ran, exit 1.

README: the speed table was one commit stale

Re-measuring on the 7950X for this pull request showed that the table merged with the Scaler pull request was measured before its last commit. On core 9, interleaved runs, 3 each:

tree Scaler, one worker, ms per frame
before the integer pixel position (72c6376) 26.2, 26.3, 26.2
main at 0a15a86 28.8, 28.7, 29.1

The only non-test difference between the two trees is that commit (git diff --stat), which changes the per-axis setup and not the per-pixel code; why it costs 10 % is not established. The README now carries the figures of the merged code (28.7 to 29.3 on one core; 14.5, 7.5, 5.4, 3.6 ms at 2, 4, 8, 16 workers; 10.4 times slower than lanczos on one core) and says so. With several workers -benchmem reports 0 allocs/op and 1 to 522 B/op, also stated.

Tried and not shipped

Moving the two AVX-512 closures of permGather to a file of their own, so that everything else could be forced by tests on any CPU and the excuse narrowed from 32 statements to 16, made the Scaler 21 % slower on the same core (28.8 to 34.9 ms, 3 runs each, same session), with the closure bodies unchanged. Unexplained, so the kernel file is untouched here and the whole of it is excused on a CPU without AVX-512.

Not solved here

On a runner without AVX-512 the permute gather is not executed at all, so a commit can pass CI with that kernel untested; the warning says so in the job, nothing more. Holding it would need a runner with a known CPU.

🤖 Generated with Claude Code

tannevaled and others added 2 commits November 29, 2026 19:07
main went red on the merge commit of #149 (run 46292291989, job "test,
GOEXPERIMENT=simd (ubuntu-latest)": upscale coverage 94.4% < 100%) although
the same tree had 21 green checks on the pull request.

upscale/easu_perm_amd64.go, added by #147, runs only with AVX-512, and a
hosted amd64 runner has it or not from one job to the next. Reproduced on a
Ryzen 9 7950X at 0a15a86: 100.0% natively, 94.5% under
GODEBUG=cpu.avx512f=off, the only functions below 100% being usePerm and
permGather. The gate was a draw since #147.

tools/covgate (cobra, a module of its own, 100% covered, parser fuzzed)
requires every block of the profile and excuses the blocks of one named file
only when /proc/cpuinfo lacks the named flag, printing a warning that counts
the statements that were not measured. An unreadable cpuinfo, an empty
profile and a malformed line are refusals, not passes.

Not solved here: on a runner without AVX-512 the permute gather is not
executed at all, so a commit can be released with that kernel untested by CI.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The table merged with #149 was measured one commit before its head. At
0a15a86 on the same core (Ryzen 9 7950X, core 9, interleaved runs) the Scaler
takes 28.7 to 29.3 ms per frame, not 26.2: the only non-test difference is the
integer position of an output pixel (72c6376), and why it costs 10 % with the
per-pixel code unchanged is not established. Multicore figures re-measured:
14.5, 7.5, 5.4 and 3.6 ms at 2, 4, 8 and 16 workers; with several workers
-benchmem reports 0 allocs/op and 1 to 522 B/op.

covgate also says, on a CPU that has the flag, that the file is held like the
rest, so the job log states which of the two the runner was.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@tannevaled tannevaled changed the title ci: the vector coverage gate no longer depends on the runner's CPU ci: coverage gate independent of the runner's CPU; README speed table re-measured at the merged code Nov 29, 2026
@tannevaled
tannevaled merged commit fc8301e into main Nov 29, 2026
22 checks passed
@tannevaled
tannevaled deleted the ci-covgate-cpu branch November 29, 2026 18:26
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.

1 participant