Skip to content

t27b: @intCast with a result type (gen_fuzz, lane 4) #7412

Closed

Description

@gHashTag

Part of #6063 (t27b lane 4).

specs/port/trinity/src/tri/gen_fuzz.t27 is blocked on ExprCall(@intCast). gen-zig prints @intCast(x) exactly as written, and the reference (t27c test-report) passes 8/8 with 0 vacuous tests. This is a backend gap, not a spec defect: t27b refuses every @intCast, and 36 corpus specs use it.

What Zig does, which t27b should match:

  • The result type comes from the context: @as(T, ..), a typed binding, a parameter, or a return. With no result type it is a compile error.
  • The value is kept exactly. A lossless conversion widens. Any other conversion is checked: a value outside T is a safety panic in Debug, so the test fails. This includes unsigned to unsigned, unlike as, which truncates there.
  • A literal operand that does not fit T is a compile error.

The slice:

  • A conformance spec specs/tri/t27b/conformance/int_cast.t27, whose names are unique in the corpus. It runs first under t27c test-report.
  • @intCast with an integer result type lowers to a checked cast. cli/t27b/tests/intcast.rs covers the trap cases, and each one was checked against the reference first.
  • gen_fuzz moves blocked -> pass in the ledger, together with the conformance row.

Done when gen_fuzz passes under t27b with the reference's verdicts, the corpus shows 0 mismatch and 0 jit_interp_mismatch, and no other spec changes verdict in a way the reference disagrees with.

Boundary

  • specs/port/trinity/src/tri/gen_fuzz.t27
  • specs/tri/t27b/conformance/int_cast.t27
  • cli/t27b/tests/intcast.rs

Activity

  1. added a commit that references this issue on Oct 7, 2026
    b8d6cc2
  2. gHashTag commented on Oct 7, 2026

    @gHashTag
    OwnerAuthor

    Foreign-line budget (owner rule #7371, merged in #7399): PR #7417 is over it, so it is now a draft with auto-merge off.

    Master's check_budget() run on git diff --numstat --no-renames origin/master...claude/t27b-lane4-intcast:

    file added cap
    cli/t27b/src/lower.rs 58 40 per file
    cli/t27b/tests/intcast.rs 120 40 per file
    whole PR 178 80 per PR

    The owner-approved-foreign label does not lift this cap, and splitting the work into smaller PRs to get under it would dodge the rule, so I am not doing that. The @intCast lowering (range check, literal fit, widen/wrap) has to move into .t27 and come out of gen-rust. The trap cases now in tests/intcast.rs need a home that is not hand-written Rust. The conformance spec specs/tri/t27b/conformance/int_cast.t27 and the ledger rows (gen_fuzz, server_main) stay valid for that rework.

    Part of #6063. PR: #7417.

  3. added
    needs-boundaryNo '## Boundary' section, so the Queen can reserve nothing for it and no bee can take it
    and removed
    needs-boundaryNo '## Boundary' section, so the Queen can reserve nothing for it and no bee can take it
    on Oct 7, 2026
  4. gHashTag commented on Oct 7, 2026

    @gHashTag
    OwnerAuthor

    Reopened 2026-10-07: the bulk close of issues without a ## Boundary section was reverted by the owner. Nothing to do here; this comment replaces the earlier close notice.

  5. added
    needs-shapeIssue lacks Boundary/Scenarios/Requirements/Success criteria
    on Oct 7, 2026
  6. removed
    needs-shapeIssue lacks Boundary/Scenarios/Requirements/Success criteria
    on Oct 7, 2026
  7. added a commit that references this issue on Oct 7, 2026
    4dd14bf
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions