From d949274f2bfbe3fe6c25ab03245df8e4013b85bd Mon Sep 17 00:00:00 2001 From: Julian Noble Date: Fri, 7 Aug 2026 00:20:53 +1000 Subject: [PATCH] G-172: correct the zig-gate rebuild-blocker claim; Approach 6 -> in-situ; r2 family + tools republished at baseline floor The drafting session recorded the recipes' required_zig gate as blocking any rebuild on this box (a prerelease sorts below 0.16.0; "newest zig otherwise present is 0.15.2"). Wrong: only the stray dev copy is rejected - the zigpin toolchain bin/tools/zig-x86_64-windows-0.16.0/zig.exe is a released 0.16.0, present and passing the gate (the zig-x86_64-windows-* naming family in bin/tools was missed and a removal back-inferred from the artifact records). Notes bullet and Progress corrected; nothing was removed and nothing blocks. Approach 6 rewritten per user decision: republication is in-situ replacement under existing artifact names/revisions - punkbin immutability deliberately violable during alpha (all consumers in-house, zero third-party users). Progress: Approach 6 executed for the r2 generation + tools (punkbin ab5611d pushed) - full bootstrap rebuild with the pinned zig, zmm=0 ymm=0 audits on all five binaries, family_check PASS, two consecutive core-gate PASS runs with identical totals (interp-36.7 bgerror-race jitter and a 4h httpProxy.test ThreadLevel-1 hang documented). Record-honesty residual noted: published tomls carry emission-time [tests] summaries - refresh folded into Approach 3. Remaining: floor field, audit tool, punk-runtime surfacing; r1 disposition + bin/punk9* kit rebake behind those. goals_lint: clean (81 active, 91 archived). Claude-Session: https://claude.ai/code/session_01WXribLxUjk3dZUsN3r6rKb Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com --- goals/G-172-distributed-binary-cpu-floor.md | 73 +++++++++++++++++---- 1 file changed, 59 insertions(+), 14 deletions(-) diff --git a/goals/G-172-distributed-binary-cpu-floor.md b/goals/G-172-distributed-binary-cpu-floor.md index 7bf0e582..ac08d19b 100644 --- a/goals/G-172-distributed-binary-cpu-floor.md +++ b/goals/G-172-distributed-binary-cpu-floor.md @@ -41,7 +41,7 @@ Confirmed against the reporting fleet - the split is exactly the AVX-512 line: Cause: the recipes called `b.standardTargetOptions(.{})` and no build path passed `-Dtarget`/`-Dcpu`. With no flag, zig resolves cpu_model `determined_by_arch_os` by NATIVE detection; on a Zen 5 host that is `znver5`, -and `ReleaseFast` then auto-vectorises freely. Measured with the pinned zig on +and `ReleaseFast` then auto-vectorises freely. Measured with the bundled 0.16.0-dev zig on an auto-vectorisable C loop: flagless -> `znver5`, zmm=805; `-Dcpu=native` -> `znver5`, zmm=805; `-Dtarget=x86_64-windows` -> `x86_64`, zmm=0; `-Dcpu=baseline` -> `x86_64`, zmm=0; `-Dcpu=x86_64_v2` -> `x86_64_v2`, zmm=0. @@ -98,9 +98,17 @@ project's first contact with a new user fails with no message at all. binaries are not runnable here"), so that is where a floor the host does not meet becomes a named diagnosis. `list` annotates rows the local CPU cannot run. -6. Republication of the affected artifacts as a new revision, and repointing - punkbin `defaults.txt`, is the closing step - sequenced after 1-5 so the - rebuilt family is audited and self-describing before it becomes the default. +6. Republication is IN-SITU replacement (user decision 2026-08-06): rebuilt + binaries replace the unsuitable artifacts under their existing names and + revisions, with sidecar tomls and `sha1sums.txt` regenerated to match. + Artifact immutability remains the long-term intention but is explicitly + violable during alpha - every consuming system is in-house, there are no + third-party users, and leaving known-dead binaries fetchable is the worse + outcome. No `defaults.txt` repoint is needed (it already names + `tclsh9.0.5-punk-r2.exe`). Replacement may proceed as soon as a rebuilt + binary passes the zmm audit; if the floor field (Approach 3) is not yet in + the record schema, a second in-situ record refresh adds it later - cheap + under the same dispensation. ## Alternatives considered @@ -147,12 +155,19 @@ project's first contact with a new user fails with no message at all. bin/punkzip.exe bin/punkres.exe`): surveyed and judged not related in substance - G-110 (shared-lib extraction cache), G-131 (boot payload autodetection), G-141, G-157, G-158 (bin/ sibling-file matches only). -- Deliberately outside this contract: all four recipes gate on - `required_zig = "0.16.0"` with a `.lt` SemanticVersion compare, so a - prerelease toolchain (`0.16.0-dev.254+6dd0270a1`, the copy under bin/tools) - sorts below the pin and is rejected by the recipes' own gate. A real defect - in the same lines, but a different one - it blocks rebuilding here until a - released 0.16.0 is materialized. +- Zig version gate (corrected 2026-08-06 - an earlier note here claimed the + gate blocks rebuilding on this box; it does not): the recipes' SemVer gate + does reject the stray prerelease copy under + `bin/tools/zig-0.16.0-dev.254+6dd0270a1/` (a prerelease sorts below its + release), but that copy is not the pinned toolchain. The `zigpin` record + (`sources.config`) points at `bin/tools/zig-x86_64-windows-0.16.0/zig.exe`, + a released 0.16.0 that is present, reports `0.16.0`, and passes the gate; + `suite.tcl` and the README both resolve to it by default. The removed-zig + claim arose from missing the `zig-x86_64-windows-*` naming family in + `bin/tools/` and back-inferring a removal from the artifact records. + Rejecting a 0.16.0-dev snapshot is arguably correct behavior besides - it + predates the 0.16 API the recipes are written against - so nothing here + blocks or needs fixing. - Verification note: `llvm-objdump -d --section=.text ` counting `zmm[0-9]` operands is the quick manual check used throughout the Context measurements. Linear disassembly of a non-AVX-512 binary yields ~3 false @@ -169,9 +184,39 @@ project's first contact with a new user fails with no message at all. by `zig ast-check` on all four; the mechanism verified separately with the same toolchain and optimize level on an equivalent recipe (flagless -> baseline/zmm=0, `-Dcpu=native` -> znver5/zmm=805). A full suite build was NOT - run - blocked by the version-gate defect noted above. The `b.graph.host` + run in that session - recorded at the time as gate-blocked, corrected in the + next entry (the pinned toolchain passes the gate). The `b.graph.host` target sites elsewhere in these recipes are build-time helper tools that are never distributed and are correct as native. -- Remaining for acceptance: Approach 3 (floor in the artifact record), 4 (audit - tool + fixture), 5 (punk-runtime surfacing and the use/run verdict), 6 - (rebuild, republish, repoint `defaults.txt`). +- 2026-08-06 (correction, later session): the gate-blocker claim is wrong - + the pinned toolchain `bin/tools/zig-x86_64-windows-0.16.0/zig.exe` (the + `zigpin` record) is a released 0.16.0, present on this box and passing the + recipes' gate; only the stray dev copy is rejected. Notes bullet rewritten + accordingly. Nothing blocks the rebuild here. +- 2026-08-06: user decision - republication is in-situ replacement under the + existing artifact names/revisions (Approach 6 rewritten); punkbin + immutability is deliberately violable during alpha with zero third-party + consumers. Disposition of the r1-generation artifacts (replace vs drop) + remains a pending curation call. +- 2026-08-06 (later session): Approach 6 executed for the r2 generation + + tools. Full `zig build bootstrap` with the pinned released 0.16.0 rebuilt + the family at the baseline floor: all three r2 exes audit zmm=0 ymm=0 (was + 2756/617), family_check self-contained PASS, punk-r2 build_id unchanged. + punkzip 2.4.0 / punkres 0.3.1 rebuilt (zmm 1724/1423 -> 0), own suites + pass; local bin/ copies replaced. Core test-gate: two consecutive PASS runs + against the dispositioned baseline (69552 run / 8 failed, identical totals + both runs; a first attempt failed once on interp-36.7, a bgerror timing + race - passed on both reruns; one intermediate run hung 4h inside + httpProxy.test "ThreadLevel 1", the socket-flake class - killed and rerun). + lib tier audited clean (tcllibc.dll zmm=0; the critcl -target pin already + protected it). Published in-situ: punkbin ab5611d (3 exes + 3 schema-2 + tomls + 2 versioned tool exes + both sha1sums.txt), pushed to + origin/master. Record-honesty residual: the published tomls' [tests] lines + carry the emission-time (July) summaries; the fresh shipped-codegen gate + evidence lives in _build testreports - fold a [tests] refresh into the + Approach 3 record work. +- Remaining for acceptance: Approach 3 (floor in the artifact record, folding + in a [tests]-freshness refresh of the replaced tomls), 4 (audit tool + + fixture), 5 (punk-runtime surfacing and the use/run verdict). Behind those: + r1-generation disposition (replace vs drop) and the bin/ punk9* kit rebake + with the new runtime (punkproject version-gate discipline applies).