Commit 534dd36
Add lookup-table unit tests for activation tables and getValue
Closes a high-leverage coverage gap: every fixed-point activation in the
library reads from precomputed sigmoid/tanh/exp/log/sin/cos tables, but
none of them were directly tested. New suite has three layers:
- Branch coverage on LookupTable<Q>::getValue (clamp lo/hi, knot match,
flat-region short-circuit, linear interpolation).
- Bit-exact verification that each table entry matches the generator
output for Q8.8 and Q16.16 across all six functions, catching silent
corruption of lookupTables.cpp.
- Structural invariants (monotonicity, range, sigmoid complement, tanh
antisymmetry, sin oddness, cos evenness, endpoint values) and an
end-to-end accuracy sweep against std:: math with tolerances derived
from the LSB plus the linear-interpolation chord-error bound.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 63eeaf1 commit 534dd36
3 files changed
Lines changed: 484 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
0 commit comments