Skip to content

test(benchmarks): add 16 benchmarks for recursion, floating point, data representation and applications - #35

Open
filo3r wants to merge 7 commits into
HEAPLab:masterfrom
filo3r:test/add-benchmarks
Open

filo3r wants to merge 7 commits into
HEAPLab:masterfrom
filo3r:test/add-benchmarks

Conversation

@filo3r

@filo3r filo3r commented Oct 12, 2026

Copy link
Copy Markdown

Summary

Adds 16 C benchmarks to the regression suite (880 new test cases): recursion (5), floating point (5), data representation (2), TACLeBench (ndes, statemate) and two applications (telemetry, game_of_life).

Known issue

On master, recursion_linear with --seddi and recursion_mutual with --eddi (all variants) and --seddi report a spurious DataCorruption_Handler without faults. They do not fail on fix-eddi. These combinations are excluded via black_list in a separate commit, which can be reverted once fix-eddi is merged.

The suite had no C benchmark exercising recursion.

Five shapes are added, each isolating a different activation pattern:
linear, tree, mutual, nested and pointer argument. A hardened global
counts activations, so a control-flow error that skips or repeats a
call is caught by the final check rather than passing unnoticed.
The suite had no C benchmark dedicated to floating-point behaviour.

Five files are added, each targeting a different aspect: accumulation
over long series, reductions over arrays of float, control flow driven
by floating-point comparisons, conversions between int, float and
double, and IEEE-754 special values (NaN, infinities, negative zero).

All expected results are either exact or asserted within a tolerance
far wider than any rounding difference, so the output does not depend
on FMA contraction or on the target floating-point unit. None of the
files calls into libm.
The suite had no C benchmark exercising storage shared by several
logical values.

Two files are added. bitfields.c packs four fields into one word, so
that writing a single field becomes a read-modify-write of storage
belonging to its neighbours. type_punning.c reads a union back through
a member other than the one last written, giving the same storage more
than one candidate type.

All assertions are on exact integer values and are independent of byte
order. On failure each benchmark prints a code identifying the
assertion that did not hold.
Two application benchmarks from TACLeBench are added: ndes, a DES
implementation dominated by bit manipulation and static lookup tables,
and statemate, generated code with a large and irregular control-flow
graph.

Both are adapted to the suite contract: handlers, a SUCCESS/FAIL check
on the known output, and no dependency on the original embedded target.
A self-contained spacecraft-style downlink written for this suite:
sensor sampling, big-endian packing with CRC-16, Hamming(7,4) coding,
a channel that flips one bit in some codewords, and decoding with
single-bit correction. Every frame is compared against the original
reading and folded into a session checksum.

Almost every value computed along the way reaches the printed output,
so a corrupted bit anywhere in the pipeline changes the result. This
makes it a target for fault injection as well as a regression test.

All state is in fixed-size arrays and all arithmetic is integer, so the
output is exact and does not depend on the target.
Conway's Game of Life on a 32x32 toroidal grid, written for this suite.

The program first validates the rules without a precomputed value: a
glider is placed on an empty grid and must reappear as the same five
cell shape shifted diagonally after 4*K generations. It then seeds the
grid from a fixed seed and evolves it, folding the population of every
generation and the final grid into a checksum.

A single wrong cell spreads to its neighbours in later generations, so
a fault corrupting the grid early almost always changes the result.
All state is in fixed-size arrays and all arithmetic is integer.
recursion_linear with --seddi and recursion_mutual with --eddi (all variants) and --seddi report a spurious DataCorruption_Handler on master. Not observed on fix-eddi (bee8bb4). Remove the black_list entries once that fix is merged.

This branch has not been deployed

No deployments
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