Skip to content

id: F12.8/A7 third guest language — Zig SDK passing conformance with a playable example #12596

Open

Description

@dezren39

Problem

Phase 12 exit criterion 3 — "guest languages with a passing conformance suite: at least 3" — is not met. pkgs/id/examples on main has Roc guests and the Rust rust-world/rust-counter guests; there is no third guest SDK. The 2026-11-22 exit-audit re-run (see #12231) also found no open issue carrying this work: the 2026-11-21 results-first plan decided the third language (step A7: Zig, superseding the open owner decision noted 2026-11-09), but the work itself is tracked nowhere. (The 07:05 audit linked #1067 for this row; #1067 is F12.10 fair scheduling and does not cover it — corrected here.)

What to do

F12.8 second/third guest SDK work, Zig leg (plan step A7: a Zig toolchain is already in the tree for the Roc host): a Zig guest SDK with screen, json, grid, and cap helpers equal to the Roc libraries, passing the F12.7 conformance suite, with a playable example world.

Done when

The Zig SDK passes the conformance suite and ships a playable example, recorded where the Phase 12 exit audit (#12231) can cite it.


Filed by agent felix from the #12231 exit-audit re-run, 2026-11-22.

Activity

  1. added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    source/agentCreated by an agent worker
    epic/id-programReprioritization program epic (2026-11-12)
    on Nov 22, 2026
  2. developing-today commented on Nov 22, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    First slice landed as PR #12793 (branch xaltha/12596-zig-sdk): Zig SDK skeleton + json and grid helpers (Zig ports of RocJson/RocGrid, same limits and error codes), with zig-toolchain.sh pinned to Zig 0.16.0 and zig-sdk-test.sh.

    Verified locally with pinned Zig 0.16.0 (shasum-checked download, no laptop needed): zig fmt --check clean, zig build test 31/31 passed, wasm32-freestanding build OK. This moves the "Zig guest SDK with screen, json, grid, and cap helpers" criterion to 2 of 4 helpers; it does not close the issue. Remaining: screen + cap helpers, a playable example world, and the F12.7 conformance run (plus wiring the test into the roc-test just recipe once the nix-provided Zig version is confirmed to be 0.16.0).

  4. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Pickup (xaltha): slice 2 of the Zig SDK — screen + cap helpers (Zig ports of Screen and RocCap), with tests mirroring the Roc expect cases. PR #12793 (slice 1) is still open, so this slice stacks on its head: branch xaltha/12596-zig-sdk-screen-cap off xaltha/12596-zig-sdk, PR will target that branch and say so. Remaining after this slice: the playable example world and the F12.7 conformance run.

  5. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Slice 2 landed as PR #12827 (branch xaltha/12596-zig-sdk-screen-cap, stacked on PR #12793 — it targets xaltha/12596-zig-sdk and retargets to main once slice 1 merges): the screen + cap helpers, completing the four-helper parity set (screen, json, grid, cap).

    • src/screen.zig: Zig port of Screen — drawing (putText/putRow/putGrid/fill/rule/boxed) and renders (renderPlain/renderJson/renderAnsi, renderRowsJson, boxEdge); the JSON screen document is byte-for-byte the Roc one.
    • src/cap.zig: Zig port of RocCap — Session bookkeeping (request ids, pending list, result routing) and the eight request-document builders on the slice-1 json values.

    Verified locally with pinned Zig 0.16.0 via zig-sdk-test.sh: zig fmt --check clean, zig build test green (22 new tests: 15 screen mirroring the Screen.roc expects, 7 cap), wasm32-freestanding build OK. This moves the SDK criterion to 4 of 4 helpers; it does not close the issue. Remaining: a playable example world and the F12.7 conformance run (plus wiring the test into the roc-test just recipe once the nix-provided Zig version is confirmed to be 0.16.0).

  6. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Pickup (xaltha): slice 3 of the Zig SDK — the playable example world. PRs #12793 (slice 1) and #12827 (slice 2) are still open, so this slice stacks on the slice-2 head: branch xaltha/12596-zig-counter off xaltha/12596-zig-sdk-screen-cap, PR will target that branch and retarget as the stack merges.

    Scope: examples/zig-counter/ — the third twin of roc-counter/rust-counter (same counter scenario, same Plaza ABI v1 surface, same boxed-screen view), built on the Zig SDK, with the built module checked in as counter.wasm like its twins so the F12.7 conformance slice can load it without a Zig toolchain. Remaining after this slice: the F12.7 conformance run (adding zig-counter to the sandbox suite), plus the roc-test wiring once the nix Zig version is confirmed 0.16.0.

  7. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Slice 3 landed as PR #12837 (branch xaltha/12596-zig-counter, stacked on PR #12827 — it targets xaltha/12596-zig-sdk-screen-cap and retargets to main as the stack merges): the playable example world, examples/zig-counter/.

    • The third twin of roc-counter/rust-counter: same counter scenario on the Plaza ABI v1 surface — init ignores the seed, update increments on a trimmed inc, view/layout render the boxed screen through the SDK's screen helper, records publishes {"count":N} encoded with the SDK's json helper, wants is {}, snapshot is the decimal count and restore is total. The plaza_* glue in src/main.zig mirrors the Rust SDK's plaza_guest! plumbing (leaked model pointer, one shared output slot, alloc/free over the guest allocator).
    • build.sh (guard + tests + build) refreshes the checked-in counter.wasm (65,445 bytes), so the conformance slice can load it as the zig-counter fixture with no Zig toolchain. zig-sdk-test.sh now also covers the example; root .gitignore gains the zig-counter build-output lines.

    Verified locally with pinned Zig 0.16.0: zig-sdk-test.sh green end to end (SDK suites + counter host tests 3/3, incl. byte-equality of the boxed screen document; both wasm32-freestanding builds OK; fmt clean). The checked-in module was also driven at the raw ABI level (host-side alloc/write/free as the runner does): version 1, inc x2 (one padded) → view byte-identical to the twins' document at count=2, records/wants/snapshot/restore all as specified, restore total on junk, zero imports, exports exactly the 14 documented + memory.

    This completes the "playable example world" piece; it does not close the issue. Remaining: the F12.7 conformance run (add zig-counter to CONFORMANCE_MODULES in crates/id-worlds/src/sandbox.rs and record the pass for the #12231 exit audit), plus wiring zig-sdk-test.sh into the roc-test just recipe once the nix-provided Zig version is confirmed to be 0.16.0.

  8. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Pickup (xaltha): final slice of the Zig SDK — the F12.7 conformance run. PRs #12793 (slice 1), #12827 (slice 2) and #12837 (slice 3) are all still open, so this slice stacks on the slice-3 head: branch xaltha/12596-zig-conformance off xaltha/12596-zig-counter, PR will target that branch and retarget as the stack merges.

    Scope: add zig-counter to CONFORMANCE_MODULES in crates/id-worlds/src/sandbox.rs, run the F12.7 conformance suite on the laptop with the Zig module included, and record the pass here for the #12231 exit audit. Also checking the nix-pinned Zig version; zig-sdk-test.sh gets wired into the roc-test just recipe only if nix provides Zig 0.16.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/idPackage/app: id (pkgs/ or apps/ in this repo)epic/id-programReprioritization program epic (2026-11-12)source/agentCreated by an agent workerstatus:in-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions