lib: banner purge + WHY-only comment sweep (rule 8)

Every // ---- section banner dies (132 -> 0): names carry the WHAT.
Narration deleted (filename restatements, run-with lines, what-the-
next-line-does); every ref/hare cite, task cite, divergence, ABI/
layout contract, and ownership qualifier kept (borrowed-view lines
restored where the sweep over-cut). Comment-only proven: all 442
walk-workdir .s and 32 import-probe .s byte-identical before/after;
libbyteid 56-roster all-ID.
This commit is contained in:
2026-08-08 21:10:18 +09:00
parent 659e859f34
commit aadc6618f0
90 changed files with 259 additions and 919 deletions

View File

@@ -122,8 +122,6 @@ export fn dynamicfrom(buf: []u8) stream = {
return r;
};
// ---- vtable callbacks ----------------------------------------------------
// readfn — recover the stream from the io.stream's `*vtable` via the
// intrusive offset-0 cast. Single fn over the common header (Hare's
// single `read` at ref/hare/memio/stream.ha:103); fixed and dynamic
@@ -247,11 +245,6 @@ fn dynamicgrow(d: *stream, need: i32) void = {
d.cap = newcap;
};
// ---- accessors over the common `stream` header -----------------------
//
// Single fn each: Hare's string/reset/buffer/borrowedread all take
// `*stream` and read the flat header.
// string — bytes written so far, as a str view (buf[0..pos]).
//
// Mirrors ref/hare/memio/stream.ha:81 string(in: *stream). Hare returns

View File

@@ -1,5 +1,3 @@
// memiotest — exercises lib/memio. Run with `out/bin/ww run lib/memio/memiotest.ww`.
//
// Every @test enumerates parallel `[N]T` arrays of inputs and
// expectations, then iterates one body across them. Parallel arrays
// (rather than `[N]struct{...}`) sidestep the cstage cgen's chained
@@ -23,8 +21,6 @@ fn putstr(s: str, into: []u8, off: i32) i32 = {
return off + s.len;
};
// ---- fixedread: read sizes drive partial / full / eof outcomes ----------
@test fn fixedread() void = {
let arr: [8]u8;
arr[0] = 1u8; arr[1] = 2u8; arr[2] = 3u8; arr[3] = 4u8;
@@ -73,8 +69,6 @@ fn putstr(s: str, into: []u8, off: i32) i32 = {
match (c) { case void => {}; case let e: io.error => abort(); };
};
// ---- fixedwritecases: full-fit / exact-fill / partial / overflow -------------
@test fn fixedwritecases() void = {
let dst: [16]u8;
let st: memio.stream = memio.fixed(dst[0:16]);
@@ -130,7 +124,6 @@ fn putstr(s: str, into: []u8, off: i32) i32 = {
match (c) { case void => {}; case let e: io.error => abort(); };
};
// ---- fixedwritefull: the full-sink nomem contract (memio.ww:190) -------
// A write that exactly fills the sink succeeds; any further non-empty
// write into the full sink returns nomem, not a 0-byte success
// (ref/hare/memio/stream.ha:161). A zero-length sink is full from the
@@ -165,8 +158,6 @@ fn putstr(s: str, into: []u8, off: i32) i32 = {
};
};
// ---- dynamicgrowcases: every cap doubling exercised ---------------------
// Drive grow 0 → 8 → 16 → 32 by writing sized chunks. Verify
// accumulated `pos` after each step.
@test fn dynamicgrowcases() void = {
@@ -207,8 +198,6 @@ fn putstr(s: str, into: []u8, off: i32) i32 = {
match (c) { case void => {}; case let e: io.error => abort(); };
};
// ---- dynamicreset: write / reset / write cycles -------------------------
// op=0 writes `ln` bytes from a rolling source; op=1 resets and ignores
// ln. After each row the accumulated len must equal `want`.
@test fn dynamicreset() void = {
@@ -255,8 +244,6 @@ fn putstr(s: str, into: []u8, off: i32) i32 = {
match (c) { case void => {}; case let e: io.error => abort(); };
};
// ---- borrowedread: under / exact / over / 0-byte ------------------------
@test fn borrowedreadcases() void = {
let arr: [6]u8;
arr[0]=0u8; arr[1]=1u8; arr[2]=2u8; arr[3]=3u8; arr[4]=4u8; arr[5]=5u8;
@@ -289,8 +276,6 @@ fn putstr(s: str, into: []u8, off: i32) i32 = {
};
};
// ---- stringview: len + endpoints track pos across appends ---------------
@test fn stringview() void = {
let st: memio.stream = memio.dynamic();
let s: io.stream = &st.vt;
@@ -327,8 +312,6 @@ fn putstr(s: str, into: []u8, off: i32) i32 = {
match (c) { case void => {}; case let e: io.error => abort(); };
};
// ---- dynamicfromseed: ownership-transferred seed, read then write -------
@test fn dynamicfromseed() void = {
// Build a heap-allocated seed via append (rt_ensure path), then
// hand ownership to memio. dynamicclose then frees `seed.cap`
@@ -381,8 +364,6 @@ fn putstr(s: str, into: []u8, off: i32) i32 = {
match (c) { case void => {}; case let e: io.error => abort(); };
};
// ---- seekcases: SET/CUR/END × in-bounds/OOB over one fixed stream --------
// Sequential rows over one 8-byte fixed stream; CUR rows depend on the
// cursor left by earlier rows. want = resulting pos for valid rows,
// -1 = errors.invalid expected. After EVERY row an io.tell readback
@@ -467,8 +448,6 @@ fn putstr(s: str, into: []u8, off: i32) i32 = {
};
};
// ---- emptyseek: every whence over a 0-length buffer ----------------------
@test fn emptyseek() void = {
let arr: [1]u8;
arr[0] = 0u8;
@@ -505,8 +484,6 @@ fn putstr(s: str, into: []u8, off: i32) i32 = {
};
};
// ---- dynamicseek: rewind-and-reread over written data --------------------
// The dynamic vtable wires the same seekfn; bounds run against the
// LOGICAL length (m.len), not capacity (Hare: len(s.buf),
// ref/hare/memio/stream.ha:131,136).