Skip to content

t27o: Zig front end step 2 -- std.math.pow, imported consts, --check on .zig, sweep lists .zig (from step 1 measurements) #10823

Closed

Description

@gHashTag

Goal

Step 2 of the Zig front end (#10597), from what step 1 (#10765, PR #10819) measured: the remaining refusals and the gaps around tri t27o <file>.zig. Option B of #10522.

Measured by step 1 (trinity 0770abb99 src/, trios 483dd9ee crates/)

2,573 .zig files, 353 refused as generated; 1,839 fns convert (1,356 distinct bodies); 606 specs carry translated tests, 590 pass all of them under t27b test (1,732 tests), 9 fail 17 tests (the same Zig fails under zig test), 7 are blocked. Tier-1-like distinct bodies with a same-file test: 878 of 1,435 convert (61 %; census target about 1,052).

Deliverable

  • std.math.pow on f64 -- the largest remaining refusal (103): a t27 routine whose results equal Zig's on recorded vectors, or a stated refusal kept.
  • Consts imported from another file (@import("x.zig").C): follow the import within the same repository when the const is a scalar literal.
  • tri t27o <file>.zig --check / --oracle fail today with "rustc refused the oracle harness" (they run the Rust path): for Zig, --check writes the spec under specs/t27o_check/ and runs t27b test on it (the translated tests ARE the oracle); --oracle says it does not apply.
  • tri t27o-sweep lists .zig beside .rs (sweep_path in ledger.t27), so Zig coverage is re-measured in seconds like Rust.
  • The 9 failing specs: report each to its repository as a finding (the Zig itself fails its own test), not a converter bug.

Boundary

  • May touch: specs/tools/t27o/zig_convert.t27, specs/tools/t27o/ledger.t27, their gen files and seals, cli/tri/src/main.rs (net-zero hand lines).
  • Must not touch: rust_convert.t27, spice_convert.t27.

Links

#10597, #10765, #10522.

User Scenarios

  • Given a Zig file that calls std.math.pow on f64, When tri t27o converts it, Then the generated spec contains a routine that produces bit-identical results to Zig's std.math.pow on the recorded test vectors.
  • Given a Zig file that uses @import("other.zig").CONST where CONST is a scalar literal, When tri t27o converts it, Then the generated spec inlines the literal value from the imported file.
  • Given a Zig file, When running tri t27o file.zig --check, Then the command writes the spec under specs/t27o_check/ and runs t27b test on it, exiting 0 if all translated tests pass.
  • Given a Zig file, When running tri t27o file.zig --oracle, Then the command prints that --oracle does not apply to Zig and exits 0.
  • Given a repository with Zig files, When running tri t27o-sweep, Then the output lists .zig files alongside .rs files with coverage metrics.

Requirements

FR-001: The converter MUST handle std.math.pow on f64 by generating a t27 routine whose results match Zig's implementation on recorded test vectors, or emit a documented refusal kept in the ledger.
FR-002: The converter MUST resolve @import("x.zig").C when C is a scalar literal (integer, float, boolean, or string) within the same repository and inline the literal value in the generated spec.
FR-003: The CLI MUST implement tri t27o <file>.zig --check to write the converted spec under specs/t27o_check/ and execute t27b test on it, returning the test runner's exit code.
FR-004: The CLI MUST implement tri t27o <file>.zig --oracle to print a message stating that --oracle does not apply to Zig front end and exit 0.
FR-005: The sweep command MUST list .zig files in its output via sweep_path in ledger.t27, measuring Zig coverage analogously to Rust.
FR-006: The 9 failing specs identified in step 1 MUST be reported as findings to their respective upstream repositories (since Zig's own tests fail), not tracked as converter bugs.

Success Criteria

  • tri t27o specs/tools/t27o/zig_convert.t27 --check exits 0 and t27b test specs/t27o_check/zig_convert.t27 reports 0 failures.
  • tri t27o fixtures/zig/pow_test.zig --check exits 0; the generated spec contains a routine for std.math.pow f64 that passes 103 recorded vector tests.
  • tri t27o fixtures/zig/import_const.zig --check exits 0; the generated spec inlines the imported scalar literal value.
  • tri t27o fixtures/zig/sample.zig --oracle prints "oracle does not apply to Zig front end" and exits 0.
  • tri t27o-sweep lists at least 2,500 .zig files with coverage metrics in the same format as .rs files.
  • All 9 previously failing specs are documented as upstream findings with repository links in specs/tools/t27o/ledger.t27.

Activity

  1. added
    shape-refusedClosed by the issue-shape gate (specs/policy/issue_shape.t27); a passing edit reopens it
    on Oct 19, 2026
  2. github-actions commented on Oct 19, 2026

    @github-actions
    Contributor

    Closed by the issue-shape gate (specs/policy/issue_shape.t27, #7498): an issue must have the template's sections. Edit the body; an edit that passes reopens it.

    • missing: ## User Scenarios -- at least one Given/When/Then scenario
    • missing: ## Requirements -- numbered obligations, FR-001: ... MUST ...
    • missing: ## Success Criteria -- an outcome a machine can settle: a number with a unit, a backticked file, exit 0, or a backticked command
  3. added 10 commits that reference this issue on Oct 19, 2026
    9475220
    41a41c5
    4f31ed2
    4c311b5
    8ea3e49
    ba35877
    0009f37
    59eb35c
    00cf90d
    a870c82
  4. removed
    shape-refusedClosed by the issue-shape gate (specs/policy/issue_shape.t27); a passing edit reopens it
    on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions