Skip to content

feat(gen-c): lower the scaffold template -- cc accepts 174 → 242 - #2936

Merged
gHashTag merged 2 commits into
masterfrom
w770
Aug 30, 2026
Merged

feat(gen-c): lower the scaffold template -- cc accepts 174 → 242#2936
gHashTag merged 2 commits into
masterfrom
w770

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

The third call-site of a class closed twice.

before after
generates C 581 581
... and cc accepts it 174 (26.8%) 242 (37.2%)
ALL FOUR accept 69 (10.6%) 115 (17.7%)

default_input() and valid_input() are template scaffold, not functions: 571
test blocks call them and nothing in the tree defines either. Zig resolved it in
W585, Verilog in W660 — whose comment names its sibling and stops there. Nobody
grepped the C path (#2931).

Three defects in one four-line template

__auto_type input = default_input();      // call to undeclared function
__auto_type result = f(input);            // variable has incomplete type 'void'
assert((result != {0}));                  // expected expression

Each needs a different answer, and each was measured separately:

1 — the binding takes its type from the consumer. Verilog writes a bare 0
because its bindings are already declared reg of the right width. C has no such
declaration: __auto_type input = 0 is an int. Measured with a plain 0:

call to undeclared function          86 -> 13
incompatible integer to pointer       0 -> 68
cc accepts                          174 -> 174     <- one family traded for another

The type comes from the consumer's declared parameter, the way Zig recovers it.

2 — a void consumer binds nothing. __auto_type cannot deduce from void.
Two spellings mean the same thing: an omitted return type leaves no
fn_return_types entry, an explicit -> void leaves one saying "void".
Checking only for absence left 80 specs failing, all of them saying it out
loud.

3 — the vacuous assertion is not invented. {0} is a brace initialiser, not
an operand. Writing 0 would assert a claim the spec does not make;
(typeof(x)){0} is still illegal for a struct because != does not apply to
structs. The Zig backend's own comment records that these tests "constrain the
value not at all"
.

Why it read as worth zero

Each of the three produces a different cc message from the same
construct. A census grouping by message text — mine, last pass — sees three
independent families and concludes every file is broken several ways over. That
error and its correction are #2931 and skill §370.

Mutation-checked

mutation test that fails
void arm swallows every call a_value_returning_consumer_still_binds
scaffold binding falls back to __auto_type a_scaffold_binding_is_typed_by_its_consumer
vacuous assert emitted as before a_vacuous_assertion_is_not_invented

172 seals re-sealed in this commit, which is where that repair belongs — the
last two passes each left master red on seal-coverage by deferring it.

Closes #2931

The third call-site of a class closed twice. `default_input()` and
`valid_input()` are TEMPLATE SCAFFOLD, not functions: 571 test blocks call them
and nothing in the tree defines either. Zig resolved this in W585, Verilog in
W660 -- whose comment names its sibling and stops there.

    generates C                  581
      ... and cc accepts it      174 -> 242    (26.8% -> 37.2%)
    ALL FOUR accept               69 -> 115    (10.6% -> 17.7%)

Three defects in one four-line template, each needing its own answer:

1. `default_input()` -> a zero of the CONSUMER'S type. Verilog writes a bare `0`
   because its bindings are already declared `reg` of the right width; C has no
   such declaration and `__auto_type input = 0` is an `int`. Measured: a plain
   `0` moved `call to undeclared function` 86 -> 13 and raised `incompatible
   integer to pointer conversion` 0 -> 68, with the accept count UNCHANGED. The
   type has to come from the consumer's declared parameter, as Zig recovers it.

2. `when result = f(input)` where `f` returns nothing -> emit the call, bind
   nothing. `__auto_type` cannot deduce from `void`. Two spellings mean the same
   thing here: an omitted return type leaves no `fn_return_types` entry, and an
   explicit `-> void` leaves one whose value is "void". Checking only for
   absence left 80 specs failing, all of which say it out loud.

3. `then result != undefined` -> assert nothing, and say so. `{0}` is a brace
   initialiser, not an operand. Writing `0` would assert a claim the spec does
   not make, and `(typeof(x)){0}` is still illegal for a struct because `!=`
   does not apply to structs. The Zig backend's own comment records that these
   tests "constrain the value not at all".

Each of the three produces a DIFFERENT cc message from the same construct, which
is why a census grouping by message text reported this family as worth zero
(#2931, skill 370).

172 seals re-sealed in the same commit, which is where that repair belongs.

Closes #2931
@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-30 01:12:28 UTC

Summary

Status Count
Total Open PRs 8
PRs with Failing Checks 7
PRs with All Checks Green 1
READY 0
FAILING 7
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=723e4b2c159f != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-30 01:16:18 UTC

Summary

Status Count
Total Open PRs 8
PRs with Failing Checks 7
PRs with All Checks Green 1
READY 0
FAILING 7
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=723e4b2c159f != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@gHashTag
gHashTag merged commit 182276f into master Aug 30, 2026
29 checks passed
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.

The C scaffold template is the largest lever in the project: +68 to +91 specs, and I measured it as zero

1 participant