<feed xmlns='http://www.w3.org/2005/Atom'>
<title>threadx.git/test/smp/cmake/coverage_union.py, branch v6.4.1_cert</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/threadx.git/atom/test/smp/cmake/coverage_union.py?h=v6.4.1_cert</id>
<link rel='self' href='http://cgit.235523.xyz/threadx.git/atom/test/smp/cmake/coverage_union.py?h=v6.4.1_cert'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/'/>
<updated>2026-09-23T13:42:51Z</updated>
<entry>
<title>Excluded the SMP regression-test hook code from the coverage figure</title>
<updated>2026-09-23T13:42:51Z</updated>
<author>
<name>Frédéric Desbiens</name>
<email>frederic.desbiens@eclipse-foundation.org</email>
</author>
<published>2026-09-23T13:42:51Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=b72193dc0eaa0f7769d097858df109fbba72131e'/>
<id>urn:sha1:b72193dc0eaa0f7769d097858df109fbba72131e</id>
<content type='text'>
Every SMP build configuration is compiled with -DTX_REGRESSION_TEST, which opens
a block in the Linux SMP port header defining ten macros that expand to live code
-- flag tests, state changes and calls -- at eleven sites in common_smp/src. An
application defines none of them and tx_api.h expands them all to nothing, but
gcov attributes a macro expansion to the file that invokes it, so the harness's
own scaffolding was being counted as certified source.

coverage_union.py now drops those sites and prints what it dropped, covered and
total on both axes, so the exclusion can be audited rather than inferred. One
site keeps its line: tx_api.h defines TX_TIMER_INITIALIZE_EXTENSION as a real
statement under TX_MISRA_ENABLE, so that line ships and only its branches come
out. A listed site that no longer matches the report is a hard failure naming the
macro, not a silent skip. The branch gate moves 99.05 to 99.04 because the margin
is ten outcomes rather than a percentage, and a smaller denominator buys nine at
the old value; the line gate is unchanged.

The excluded code measured 10 lines and 36 branch outcomes, every one of them
covered, so the uncovered set is untouched: the same 24 outcomes at the same 22
sites in the same 13 files, over the same 194 files. Eight configurations from a
wiped tree, 136/136 tests in each, 0 failed. The union goes from 5449/5450 lines
and 3588/3612 branch outcomes to 5439/5440 and 3552/3576, re-derived key by key
against the previous measurement. gcovr's merged report is published unchanged.

Assisted-by: Claude Code (Opus 5) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Reported coverage of the source, not of the compiled configurations</title>
<updated>2026-09-16T23:23:56Z</updated>
<author>
<name>Frédéric Desbiens</name>
<email>frederic.desbiens@eclipse-foundation.org</email>
</author>
<published>2026-09-16T23:14:29Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=58a43f0856208ec26392c497fbda88e3f1d8e2d5'/>
<id>urn:sha1:58a43f0856208ec26392c497fbda88e3f1d8e2d5</id>
<content type='text'>
The merged report's branch denominator is not the number of branches in
common_smp/src. gcovr keys each branch by the basic-block pair gcov assigned it,
and those numbers shift when a file compiles to a different amount of code, so a
source branch that survives block renumbering between two configurations is
counted twice. Over the seven configurations the denominator reads 6334 where
the source carries 3596, and 1265 of 1343 branch sites carry more branches in
the merged report than any single configuration has. Adding misra_trace_build
moved the merged figure by 994 branches against the dozen the source gained.

It is not harmless. A figure quoted as branch coverage of the source has to have
the source in its denominator, and this one moves when a build configuration is
added for reasons that have nothing to do with the code. It also has to mean the
same thing as the figure the monoprocessor certificate quotes, and until now the
two suites were counting differently.

coverage_union.py reports the union instead: a line is covered if any
configuration executed it, and the Nth branch on a line is covered if any
configuration took it, keyed by position within the line rather than by block
number. That keying is exact here rather than approximate - all 1343 branch
sites carry an identical branch count in every configuration that compiles them,
so no ordinal means two different things. gcovr's merged report is still
produced and published unchanged; the gate reads the union.

The branch gate falls from 83.00 to 77.20 and no coverage was lost doing it.
83.00 was a percentage of 4773 counted branch instances; 77.20 is a percentage
of the 3596 branches that exist.

The gate keeps a margin because the tree has not earned losing one. Over four
clean seven-configuration runs on an unchanged tree, lines did not move at all
and branches read 2792, 2792, 2796 and 2798. All ten outcomes that move are
ordinal 8 or 10 of the twelve-branch TX_TRACE_IN_LINE_INSERT expansion, at five
sites on the thread suspend, thread resume and ISR exit paths. Only 2790 were
covered by every run, and the fifth site first appeared on the fourth run, which
is the argument for the margin rather than against it. The gate sits below that
floor.

Verified: green at the committed values, and failing on either axis when raised
above the measurement, with the reports still written.

Assisted-by: Claude Code (Opus 5) &lt;noreply@anthropic.com&gt;
</content>
</entry>
</feed>
