Recount the consumer calls against this release (#26) #39
Reference in New Issue
Block a user
Delete Branch "26"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #26.
akbasic's
src/ported onto this release and counted again. The port is now pushed and open as andrew/akbasic#31; this PR is the measurement it produced.4e188b2, 5,679 lines ofsrc/330d731, 20,169 linesWhat changed here
scripts/consumer_calls.py— new. The counting method, as a script rather than a paragraph. The old figure was not reproducible; recovering it cost more than writing it down would have. Reads the wrapped-libc set out ofinclude/akstdlib.hrather than hardcoding it, so a recount after a release measures the surface that release actually shipped.README.md— the harness gets a section next to coverage and mutation testing, including the two warnings--baselineprints: a rate is only comparable between two counts of the same tree, and one consumer's ratio is evidence rather than a plan.TODO.md— the recount, the 7 sites that could not be converted and why, and the call profile by area.The number moved because #38 was answered
The first pass of this recount reported 301/13, 4.1%, and wrote off 8 of those 13 as blocked:
boolpredicates andvoidhelpers with no error channel to route a wrapper's failure into. #38 was filed asking this library for a form they could call.@andrew ruled that invalid (#38 comment 1095): a function that cannot report an error changes its own signature rather than being handed a way to swallow one, and then instructed that the port branch be fixed accordingly (comment 1105).
Seven of the eight did exactly that — they return
akerr_ErrorContext *and hand the answer back through an out parameter, one of them as a public header change in akbasic. Four more functions on the same call chains had to move with them. That is the whole of the difference between 4.1% and 2.2%.The finding is that the wrapper shape was right and the consumer's signatures were wrong, which is the opposite of what the first count assumed. It is recorded that way in
TODO.mdon purpose.Two corrections to the record
Rebuilding the method reproduced the TODO §5 table row for row at akbasic
4e188b2, and turned up two errors in the figure above it:strncmp(1) ormemmove(1), both wrapped.Both fixed. 119 is what the script returns and what everything now compares against.
What is genuinely left
7 sites, and only two reasons:
snprintfthat want truncation as an answer rather than an error. #34 is the issue. The sharpest isakbasic_runtime_error, which formats a 12,384-byte error message into a 512-byte line — a report may be shortened, but it may not be replaced by a second, different failure. One of the six readssnprintf's return value to detect the truncation.strcmpin absearch(3)comparator, whose signature libc fixes, so there is no out parameter to report through. Nothing tracks this. #38 attributed it to akbasic#14; that is a mis-citation —#14is theCOLLISION/BUMPpairing threshold.Verification
deps/libakstdlibin akbasic bumped669b2b3→2b79aca. Zero source changes needed for the bump itself — the release is drop-in for what akbasic already used.-Wall -Wextra; 112/112 ctest; ASan+UBSan clean, 112/112.*_akgl.cfiles could not be built — SDL3 needs X11/Wayland dev packages this box does not have. They are not unverified, though: all five aregcc -fsyntax-only -Wall -Wextraclean under-DAKBASIC_WITH_AKGL=1. That is syntax and types, not behaviour, so the AKGL configuration still wants a real CI build.What the number does not say
92% → 2% reads as a total success and it is not one, so the write-up says three things next to it.
The tree tripled between the first two rows, so only 86.4% → 2.2% is like-for-like. The 45 in the middle row is its own small finding: akbasic had already adopted
aksl_f*acrossruntime_disk.cwithout anybody counting.Nothing was blocked by a missing wrapper, in either pass. Every libc call akbasic makes has an
aksl_*counterpart. What blocked a conversion was always wrapper shape, and the shapes are filed as #32–#38 rather than listed inTODO.md, per this repo's own rule about where outstanding work lives.The caveat in #26 held and got sharper. Of the 313 calls, 149 are strings, 72 memory, 43 formatted output, 36 streams and files, 12 conversion, 1 hashing — and 0 into list, tree, hash map and string buffer combined. Five sixths of the evidence is strings, memory and formatting. The largest single body of code in this library has not one consumer call site. The number to distrust is not the 2.2%; it is the 0%, and no number of recounts on this consumer will fix it — a second consumer that allocates would.
Filed by Tachikoma (Claude Code, Opus 5, 1M context)
Pull request closed