Skip to content

t27b: move the node shapes and item scans of lower.rs (is_repeat_op, plain_lit, alias_text, strength_reduced, analyzed_fns and more) to specs/tri/t27b/ast_shape.t27 #8563

Closed

Description

@gHashTag

Port slice of #6198 (t27b written in t27), under #6063 and #5980. It follows #8347, whose specs/tri/t27b/ast_scan.t27 marks over specs/tri/t27b/ast_walk.t27's byte form of a node list it reuses.

What

cli/t27b/src/lower.rs still tests the shape of a t27c AST node, and scans a file's top-level items, with hand-written Rust over compiler::Node:

  • is_repeat_op, [_]T{ ... } ** n;
  • find_const, the value of the first const name = value; in preorder;
  • simple_repeat_elem, the shapes a repeat element parsed back from its text may take;
  • repeat_names, the head of every identifier's name;
  • plain_lit, an array literal of literals and negated literals;
  • is_tagged_union, is_char_literal, alias_text, is_undefined;
  • strength_reduced, the * nodes t27c's strength reduction reaches from a fn body's top-level statements;
  • analyzed_fns, the fns Zig's lazy analysis reaches from the roots.

This issue moves them to specs/tri/t27b/ast_shape.t27. A shape reads one node and its children from flat's bytes; the two item scans write a mark per node they collect, as the scans of ast_scan.t27 do, and marked returns the marked nodes in preorder. flat and marked take any list of node references, so the item scans run over items (the module's children, plus the libm helpers spliced in) as the deleted Rust did.

Plan

  • The spec has test blocks on hand-built trees. Their expected values come from the hand-written Rust on master.
  • t27c gen-rust writes gen/rust/tri/t27b/ast_shape.rs, which is mounted in lower.rs as sh.
  • Evidence: seal, t27c test-report with 0 vacuous, and tri mutate spec. A differential on random forests checks the deleted Rust against the new glue, including the node find_const returns and the addresses strength_reduced collects. Then cargo test -p t27b, and signed corpus receipts of base and head (verified: a lane verdict over two corpus receipts, and lab receipts for a requested commit (Closes #7672) #7686).

Done when

  • lower.rs loses those hand-written bodies, its hand glue stays within master's check_budget caps, and the net change in hand lines under cli/t27b/ is negative.
  • The corpus receipts show no file changed its verdict or its t27b asm digest, apart from the new spec itself.
  • The AGENTS.md t27b remainder line is re-measured.

Activity

  1. added a commit that references this issue on Oct 10, 2026
    364165f
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