Skip to content

Claude/upgrade ape c library mm z gd - #627

Merged
staalmannen merged 2 commits into
mainfrom
claude/upgrade-ape-c-library-mmZGd
Oct 14, 2026
Merged

staalmannen merged 2 commits into
mainfrom
claude/upgrade-ape-c-library-mmZGd

Conversation

@staalmannen

Copy link
Copy Markdown
Owner

No description provided.

clisp, go and muon, each stopped by something the VM named exactly.

RC'S `=' IS MEASURED AT LAST, AND IT REFUSES.  `mkfile.rebuild's
`if (test $name = lispbibl)' answered `/rc/lib/rcmain:24 *eval*:4:
token '=': syntax error' -- *eval*:4 is that line to the digit.  That
closes the question `mkfile.runtime' had carried as unmeasured, in the
direction that costs something: there is no rc on the build host, so
until this run the rule was a recollection.

AND mk NAMED THE WRONG LINE.  The failure was reported as
`mk: mkdir -p build-amd64 ...: exit status=rc: syntax error' -- mk
names a recipe by its FIRST line, and the fault was four lines down in
a file the message never mentions.  The message names the victim, after
the `lock.h' shadow and `cmd/mkfile:96'.

Three live breaks and one latent: both clisp mkfiles, the whole
`--prefix='/`--srcdir=' family on the configure line (which would have
been the very next parse error), and `lib/ap/mkfile:63's
`mk objtype=$objtype install' -- in an `installall:V:' a normal build
never reaches, so nothing has ever reported it.

`sys/lib/tests/rceq-sweep.py' is the instrument and it GATES: 693
recipe lines, 0 now, and the control fires on exactly one line when a
bad one is put back.  Its discriminator is the whole file -- a LEADING
assignment is legal, and `libc/9syscall/mkfile's `if(~ $i seek) j=_seek'
is a working precedent for one after an `if' head, so a naive grep
reports 16 lines of which 11 are fine.  Two faults of its own, both
caught before it shipped: its first run reported its OWN comments (rc
treats `#' as a comment too), and its root guard fired for
`ishadow-sweep's exact miss -- sys/lib/tests is three levels below the
root and the file said two.

go: `bool' IS A KEYWORD HERE, AND dist TYPEDEFS IT.  `a.h:5 syntax
error, last name: bool' on the first file compiled.  `cc/lex.c:1751' is
`"bool", LBOOL, 0', unconditional in `itab', so `bool' is a keyword in
every kencc dialect -- and C23 agrees, `gcc -std=c2x' refuses the same
line.  This is the OPPOSITE of the recorded `syntax error, last name:
bool', which was stock 9front's 6c not knowing the word.

The class was sized before the instance was fixed: five
`typedef ... bool;' in external/, and the other four (bash,
PDCursesMod, curl, libzip) are already behind HAVE_C_BOOL,
__bool_true_false_are_defined, HAVE_STDBOOL_H and __hpux.  go1.4's had
no guard at all.  The capability is DECLARED by the build
(-DHAVE_C_BOOL, bash's own spelling) rather than sniffed from a kencc
predefine: keying it on __APEXP_CONFORMALIGN__ would tie `bool' to the
struct-layout flag and take the typedef back under `pcc -9'.  Nothing
in dist stores a non-boolean in one, swept first.  Host control in the
dialect that reproduces kencc: 7 errors before, 0 after, over the nine
portable files; plan9.c needs `u.h' and only the VM can check it.

muon: THE STACK NAMES ONE STRUCT MEMBER, AND IT IS THE ONE C REQUIRES
TO BE ZEROED.  `memset(c=0x0, n=0x29afb0)' under `tstr_clear' under
`path_basename' -- 2,731,952 bytes over a 1024-byte stack buffer.
`tstr_clear' is `memset(sb->buf, 0, sb->len)', so `buf' was right (it
reached a real address and walked off the top of the stack rather than
faulting at once) and `len' is garbage.  `tstr_init' ends
`*sb = (struct tstr){.flags=..,.buf=..,.cap=..}' with `.len' omitted,
and C99 6.7.8p21 says an omitted member is initialised as one with
static storage duration would be.

`sys/lib/tests/initzero-test.c' asks that, and neither existing test
could have: `compound-literal-test' names a member in every check it
also initialises, `designated-init-test' is about placement, and
neither assigns a literal THROUGH A POINTER, which is muon's form.
Correctness and completeness again.  Every destination is dirtied with
0xAA first and section 0 checks the poison arrived, because against a
zero destination every check passes for the wrong reason.  0 failures
on gcc; the broken behaviour replicated beside it gives 3, naming
exactly 1a, 1b and 7, and printing 0xAAAAAAAA as the length -- the same
shape as the VM's 0x29afb0.  Not yet run under pcc; that run is the
measurement.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
@staalmannen
staalmannen merged commit 4a90da1 into main Oct 14, 2026
1 check failed
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.

2 participants