test/wcc/781: pin vfprintln/vfprintfln direct dispatch (#94 fold-e7 follow-up)

reviewer-e7 R1 finding: fold-e7 (df28784) shipped four new V-side
composition symbols (vfprintln / vfprintfln / vbsprintf / vasprintf)
but 781's rows 1-2 drove fdprintln_v / fdprintfln_v instead of the
newly-added vfprintln / vfprintfln. fdprintln_v's body open-codes
the same `match (vfprint(...)) ... match (vputbytes("\n", 1))` chain
rather than calling vfprintln, so the new V-side composition symbols
themselves had zero direct probe coverage — only transitive coverage
of the (mechanically identical) inline blocks.

Two new cstage-only rows:
  - vfprintln_basic   memio.fixed_vstream + fmt.vfprintln + read-back
                      via memio.fixed_string; asserts the 10-byte
                      "1 hi true\n" payload + size return.
  - vfprintfln_basic  same shape, fmt.vfprintfln + "x={}" + 7 → 4-byte
                      "x=7\n" payload.

Both rows mirror row 3 (bsprintf_v_basic) — memio.fixed_vstream wiring
+ direct vfprintln/vfprintfln dispatch + memio.fixed_string read-back —
so the new V-side symbols ride exactly the same probe shape. Cstage-
only per #209 (wwstage formattable match-arm bail); byte-id graduates
on close. Exit codes 64/65 (60-63 used by rows 1-4).

Header table updated to reflect rows 1-2's actual surface (fdprintln_v
wired sink, not vfprintln) and to cite the new rows 3-4. fmt is not
embedded in selfhost so no combined.ww regen; Makefile dep set
unchanged. 214 total tests still green (sub-rows are internal to
781_fmt_vstream_compositions_run).
This commit is contained in:
2026-05-29 13:01:06 +09:00
parent df287846c5
commit bc9d7df002

View File

@@ -19,17 +19,29 @@
*
* row | what it pins
* --------------------------+--------------------------------------
* fdprintln_v_run_basic | vfprintln through an fd_ctx vstream
* | (via fdprintln_v's wired vstream sink
* | dispatching vfprint then vputbytes
* | "\n"). One i64 arg + str arg + bool
* | arg; asserts space-separator plus
* | trailing newline byte content.
* fdprintfln_v_run_fmt | vfprintfln through fd_ctx vstream
* | with a {n}-placeholder format string.
* fdprintln_v_run_basic | fdprintln_v wired vstream sink
* | (inline vfprint + vputbytes "\n").
* | One i64 arg + str arg + bool arg;
* | asserts space-separator plus trailing
* | newline byte content.
* fdprintfln_v_run_fmt | fdprintfln_v wired vstream sink with
* | a {n}-placeholder format string.
* | Asserts placeholder substitution +
* | trailing newline shape (mirror of
* | fmt.fprintfln, fmt.ww:740).
* vfprintln_basic | fmt.vfprintln dispatched DIRECTLY
* | through memio.fixed_vstream + read
* | back via memio.fixed_string. Pins
* | the new V-side composition symbol
* | itself (fdprintln_v open-codes the
* | same vfprint+vputbytes chain rather
* | than calling vfprintln, so without
* | this row the new symbol ships
* | uncovered).
* vfprintfln_basic | fmt.vfprintfln direct dispatch via
* | memio.fixed_vstream + fixed_string,
* | same direct-symbol rationale as
* | vfprintln_basic.
* bsprintf_v_basic | vbsprintf into a caller-supplied
* | [16]u8 buffer through
* | memio.fixed_vstream;
@@ -170,6 +182,66 @@ static const struct row rows[] = {
"};\n",
61,
STAGE_CS, 0 },
{ "vfprintln_basic",
"package main;\n"
"import os;\n"
"import fmt;\n"
"import io;\n"
"import memio;\n"
"export fn main() i32 = {\n"
" let buf: [16]u8;\n"
" let r: (io.vstream | nomem) = memio.fixed_vstream(buf[0:16]);\n"
" let vs: io.vstream = nil: *io.vtable;\n"
" match (r) {\n"
" case let v: io.vstream => { vs = v; };\n"
" case nomem => { return 90; };\n"
" };\n"
" let wr = fmt.vfprintln(vs, 1i64, \"hi\", true);\n"
" let nw: size = 0;\n"
" match (wr) {\n"
" case let n: size => { nw = n; };\n"
" case io.error => { return 91; };\n"
" };\n"
" if (nw != 10: size) { return 92; };\n"
" let view: str = memio.fixed_string(vs);\n"
" if (view.len != 10) { return 93; };\n"
" if (view[0] != 49u8) { return 94; };\n"
" if (view[1] != 32u8) { return 95; };\n"
" if (view[2] != 104u8 || view[3] != 105u8) { return 96; };\n"
" if (view[9] != 10u8) { return 97; };\n"
" return 64;\n"
"};\n",
64,
STAGE_CS, 0 },
{ "vfprintfln_basic",
"package main;\n"
"import os;\n"
"import fmt;\n"
"import io;\n"
"import memio;\n"
"export fn main() i32 = {\n"
" let buf: [16]u8;\n"
" let r: (io.vstream | nomem) = memio.fixed_vstream(buf[0:16]);\n"
" let vs: io.vstream = nil: *io.vtable;\n"
" match (r) {\n"
" case let v: io.vstream => { vs = v; };\n"
" case nomem => { return 90; };\n"
" };\n"
" let wr = fmt.vfprintfln(vs, \"x={}\", 7i64);\n"
" let nw: size = 0;\n"
" match (wr) {\n"
" case let n: size => { nw = n; };\n"
" case io.error => { return 91; };\n"
" };\n"
" if (nw != 4: size) { return 92; };\n"
" let view: str = memio.fixed_string(vs);\n"
" if (view.len != 4) { return 93; };\n"
" if (view[0] != 120u8 || view[1] != 61u8) { return 94; };\n"
" if (view[2] != 55u8 || view[3] != 10u8) { return 95; };\n"
" return 65;\n"
"};\n",
65,
STAGE_CS, 0 },
{ "bsprintf_v_basic",
"package main;\n"
"import os;\n"