Browse Source

G-126 progress: upstream zig 0.16.0 port complete + base_offset tests

Upstream punkzip commits 3b87087 (0.16.0 port, floor moved, Init/Io
threading, build-graph install-order fix, msys overlapped-stdout fix,
v2.1.3, verified 841-member CRC extraction from the file-relative
piperepl kit) and 2e49c75 (three prefixed-zip container tests pinning
base_offset for both offset conventions; suite 125/125). Notes gain the
overlapped-stdout trap record (applies to the G-128 tool as well);
Progress section added with the remaining-for-acceptance list.

Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
master
Julian Noble 3 days ago
parent
commit
eaf5be991c
  1. 48
      goals/G-126-punkzip-accelerator.md

48
goals/G-126-punkzip-accelerator.md

@ -156,10 +156,44 @@ working tree; one now exists.
must preserve that split. Fallback if real tz fidelity is ever wanted: zeit v0.9.0 is must preserve that split. Fallback if real tz fidelity is ever wanted: zeit v0.9.0 is
zig-0.16-compatible, MIT, zero transitive deps - vendor it as a path dep (never a zig-0.16-compatible, MIT, zero transitive deps - vendor it as a path dep (never a
build-time URL fetch, which conflicts with this goal's no-network-build premise). build-time URL fetch, which conflicts with this goal's no-network-build premise).
- Known upstream gaps carried into the goal work: the catenated/prefixed-zip - Known upstream gaps carried into the goal work: the undocumented `build` subcommand
`base_offset` read path (`src/zip.zig`) - the fork's raison d'etre - has NO direct remains unfinished scaffolding (wrong arg indexing, writes only an EOCD; its finalize
zig-side test; add coverage alongside the machine-listing pin (the parity suite covers call was restored at the checkpoint) - finish or remove it before vendoring. (The
it from the Tcl side only). The undocumented `build` subcommand remains unfinished base_offset test gap noted here at activation was closed 2026-07-27 - see Progress.)
scaffolding (wrong arg indexing, writes only an EOCD; its finalize call was restored at - TRAP for any zig-0.16 stdout-writing tool (applies to the G-128 tool too): msys/cygwin
the checkpoint) - finish or remove it during the port. 0.16 first surfaced error shells hand children OVERLAPPED (asynchronous) pipe handles, but zig 0.16's
re-confirmed 2026-07-27: `std.process.argsAlloc` removed. `Io.File.stdout()` hardcodes blocking flags and the `Io.Threaded` blocking write path
hits `unreachable` on NtWriteFile PENDING once the 64KB pipe buffer fills - output
truncates at ~64KB and the process dies mid-listing (exit code masked in pipelines).
Fix pattern (landed upstream 2026-07-27): probe the real handle mode once via
`NtQueryInformationFile(.Mode)` and set `flags.nonblocking` honestly so the Io
implementation takes its correct alertable-wait path; console handles fail the probe
and stay blocking. Anonymous CreatePipe pipes (Tcl exec, zig build test) are
synchronous and unaffected.
## Progress
- 2026-07-27 upstream zig 0.16.0 port COMPLETE (commit 3b87087 on top of the e9b5b553
checkpoint): floor moved 0.15.2 -> 0.16.0 (comptime gate + zon minimum_zig_version),
`main(init: std.process.Init)` with Io threaded through all fs access in punkzip.zig +
zipper.zig + punkzip_test.zig, version 2.1.3. Two load-bearing findings fixed en
route: a build-graph race (run steps did not depend on the install step, so the CLI
suite tested a stale zig-out binary under 0.16's scheduler) and the msys overlapped
stdout trap recorded in Notes. Verified on Windows: `zig build test` green under
0.16.0; 841 members CRC-verified extracted from the file-relative
`tclsh90b4_piperepl.exe` in 0.5s; listing byte-identical through msys pipe and file
redirect, and byte-identical to the old 2.1.0 binary's listing of the same kit.
- 2026-07-27 base_offset read path pinned upstream (commit 2e49c75): three container
tests (`zip_prefixed_unadjusted_offsets`, `zip_prefixed_file_relative_offsets`,
`zip_prefixed_empty`) build archives in memory, prepend a fake executable prefix,
and verify both offset conventions land on the right base_offset with members
extracting intact. Suite now 125/125.
- Remaining for acceptance: extract-to-directory argument (upstream); machine-readable
listing mode + zig-side format pin test (upstream; must keep the stdout=product /
stderr=diagnostics split per Notes); `build` subcommand finish-or-remove decision;
vendor into `src/tools/punkzip/` with provenance (upstream commit id), re-vendor
procedure and licence records; make.tcl tool build step (zig OPTIONAL - absence
reported, not fatal; test gate keys on exit code, not clean stderr - the zip suite's
negative tests print EOCD warnings while passing); punk::zip accelerator detection +
fast path behind the G-124 floor; parity suite in `src/tests/modules/punk/zip/`;
recorded benchmark (speedup + entry count where it becomes material).

Loading…
Cancel
Save