Repository navigation
t27o: Zig front end step 2 -- std.math.pow, imported consts, --check on .zig, sweep lists .zig (from step 1 measurements) #10823
Description
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.powon 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/--oraclefail today with "rustc refused the oracle harness" (they run the Rust path): for Zig,--checkwrites the spec underspecs/t27o_check/and runst27b teston it (the translated tests ARE the oracle);--oraclesays it does not apply. -
tri t27o-sweeplists.zigbeside.rs(sweep_pathinledger.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
User Scenarios
- Given a Zig file that calls
std.math.powon f64, Whentri t27oconverts it, Then the generated spec contains a routine that produces bit-identical results to Zig'sstd.math.powon the recorded test vectors. - Given a Zig file that uses
@import("other.zig").CONSTwhere CONST is a scalar literal, Whentri t27oconverts 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 underspecs/t27o_check/and runst27b teston it, exiting 0 if all translated tests pass. - Given a Zig file, When running
tri t27o file.zig --oracle, Then the command prints that--oracledoes not apply to Zig and exits 0. - Given a repository with Zig files, When running
tri t27o-sweep, Then the output lists.zigfiles alongside.rsfiles 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 --checkexits 0 andt27b test specs/t27o_check/zig_convert.t27reports 0 failures.tri t27o fixtures/zig/pow_test.zig --checkexits 0; the generated spec contains a routine forstd.math.powf64 that passes 103 recorded vector tests.tri t27o fixtures/zig/import_const.zig --checkexits 0; the generated spec inlines the imported scalar literal value.tri t27o fixtures/zig/sample.zig --oracleprints "oracle does not apply to Zig front end" and exits 0.tri t27o-sweeplists at least 2,500.zigfiles with coverage metrics in the same format as.rsfiles.- All 9 previously failing specs are documented as upstream findings with repository links in
specs/tools/t27o/ledger.t27.
Activity
github-actions commentedon Oct 19, 2026
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.
FR-001: ... MUST ...exit 0, or a backticked commandt27o: tri t27o-sweep lists .zig beside .rs, a Zig row is keyed by zig…
t27o: a .zig const imported as @import("x.zig").C is written in as a …
t27o: std.math.pow(f64, x, y) converts, bit for bit Zig's, through a …
t27o: zig_convert.t27 -- the counter-slot test runs its asserts at ru…
t27o: tri t27o file.zig --check judges the spec by its own tests, --o…
t27o: tri t27o-sweep lists .zig beside .rs, a Zig row is keyed by zig…
t27o: a .zig const imported as @import("x.zig").C is written in as a …
t27o: std.math.pow(f64, x, y) converts, bit for bit Zig's, through a …
t27o: zig_convert.t27 -- the counter-slot test runs its asserts at ru…
t27o: Zig front end step 2 -- --check on .zig, sweep lists .zig, impo…