tools: widening the parity table found three defects in the table - #3502
Merged
Conversation
Closes #3501 The reader shipped one pass ago found a real family on its first run. Widening it found THREE DEFECTS IN THE READER, each from a narrower question than "does the output answer this call?" 1. THE POPULATION COLUMN COUNTED COMMENTS. name as published in code sign 63 / 48 1 / 1 max 51 / 26 4 / 4 min 19 / 12 4 / 4 sqrt 100 / 25 33 / 13 round 136 / 38 63 / 21 floor 98 / 15 89 / 10 abs 392 / 45 389 / 43 A prose line reading "round the mantissa (see round(x))" is not a call. The six-name family was published as 796 uses; in code it is 582. And `sign` was recommended as a LANGUAGE-LEVEL QUESTION on the strength of 63 -- it is one use in one spec. 2. `PASSTHROUGH` CONFLATED A GAP WITH A STRATEGY. C emits `#define assert_eq(a, b)` and Zig `fn assert_eq(a: anytype, ...)`; both columns read PASSTHROUGH and the report said "no backend lowers any of them" about a call TWO BACKENDS ANSWER. The cell distinguishes `helper` now. The probe also gained a test block: C emits that macro only when a module has tests, and 528 of 651 specs do, so the probe had been measuring an unrepresentative context. 3. AN `#include` DECLARES AS SURELY AS A DEFINITION. `sqrt` is answered in C by `#include <math.h>` and nothing else -- the spelling was never wrong -- and the reader looked only for definitions written in the file, calling that column a gap for the third time in three readings. AFTER THE CORRECTIONS, `abs` WAS THE LARGEST REAL C GAP: 389 uses in 43 specs, refused for two passes because C has `abs` for int and `fabs` for double and choosing without the argument's type is a silent truncation. C11 answers it WITHOUT the type: #define t27_abs(x) _Generic((x), float: fabsf, double: fabs, \ long double: fabsl, default: llabs)(x) `_Generic` dispatches on the argument's own type, evaluates it once -- unlike `((x) < 0 ? -(x) : (x))`, which names it twice -- and is standard in the `-std=c11` this corpus compiles with. The macro is named `t27_abs` and the CALL is rewritten, so a `<stdlib.h>` `abs` in scope is never shadowed; a module declaring its own `fn abs` keeps it. errors 10 811 -> 10 802 (-9) files better/worse 9 / 0 compiling clean 308 -> 309 A TEST CHANGED ON PURPOSE AND SAYS SO. `abs_min_and_max_stay_loud` asserted that `abs` pulls nothing in -- the previous pass's deliberate limitation, now false by design. It is narrowed to `min`/`max`, which no backend answers, and the comment records why rather than dropping the assertion quietly. Tests: 5 new, full suite 3568 passed 0 failed. Five mutants, all killed, including the one that replaces `_Generic` with a double-evaluating ternary. 31 stale seals refreshed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
gHashTag
enabled auto-merge (squash)
September 8, 2026 14:13
Contributor
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tools: widening the parity table found three defects in the table
Closes #3501
The reader shipped one pass ago found a real family on its first run.
Widening it found THREE DEFECTS IN THE READER, each from a narrower
question than "does the output answer this call?"
THE POPULATION COLUMN COUNTED COMMENTS.
name as published in code
sign 63 / 48 1 / 1
max 51 / 26 4 / 4
min 19 / 12 4 / 4
sqrt 100 / 25 33 / 13
round 136 / 38 63 / 21
floor 98 / 15 89 / 10
abs 392 / 45 389 / 43
A prose line reading "round the mantissa (see round(x))" is not a
call. The six-name family was published as 796 uses; in code it is
582. And
signwas recommended as a LANGUAGE-LEVEL QUESTION on thestrength of 63 -- it is one use in one spec.
PASSTHROUGHCONFLATED A GAP WITH A STRATEGY. C emits#define assert_eq(a, b)and Zigfn assert_eq(a: anytype, ...);both columns read PASSTHROUGH and the report said "no backend lowers
any of them" about a call TWO BACKENDS ANSWER. The cell distinguishes
helpernow. The probe also gained a test block: C emits that macroonly when a module has tests, and 528 of 651 specs do, so the probe
had been measuring an unrepresentative context.
AN
#includeDECLARES AS SURELY AS A DEFINITION.sqrtis answeredin C by
#include <math.h>and nothing else -- the spelling wasnever wrong -- and the reader looked only for definitions written in
the file, calling that column a gap for the third time in three
readings.
AFTER THE CORRECTIONS,
absWAS THE LARGEST REAL C GAP: 389 uses in 43specs, refused for two passes because C has
absfor int andfabsfordouble and choosing without the argument's type is a silent truncation.
C11 answers it WITHOUT the type:
#define t27_abs(x) _Generic((x), float: fabsf, double: fabs,
long double: fabsl, default: llabs)(x)
_Genericdispatches on the argument's own type, evaluates it once --unlike
((x) < 0 ? -(x) : (x)), which names it twice -- and is standardin the
-std=c11this corpus compiles with. The macro is namedt27_absand the CALL is rewritten, so a<stdlib.h>absin scope isnever shadowed; a module declaring its own
fn abskeeps it.errors 10 811 -> 10 802 (-9)
files better/worse 9 / 0
compiling clean 308 -> 309
A TEST CHANGED ON PURPOSE AND SAYS SO.
abs_min_and_max_stay_loudasserted that
abspulls nothing in -- the previous pass's deliberatelimitation, now false by design. It is narrowed to
min/max, which nobackend answers, and the comment records why rather than dropping the
assertion quietly.
Tests: 5 new, full suite 3568 passed 0 failed. Five mutants, all killed,
including the one that replaces
_Genericwith a double-evaluatingternary. 31 stale seals refreshed.
🤖 Generated with Claude Code