Skip to content

t27o golden port 1 (step 4 of #9000): bootstrap/src/host/bitmask.rs becomes specs/host/bitmask.t27 and its generated Rust #11156

Closed

Description

@gHashTag

Goal

First golden port of step 4 of #9000: replace the hand-written bootstrap/src/host/bitmask.rs (170 physical lines, 96 of them #[cfg(test)]) by the spec specs/host/bitmask.t27, converted by tri t27o and reviewed by hand, and the Rust that t27c gen-rust writes from it, bootstrap/gen/rust/host/bitmask.rs, mounted as module bitmask of bootstrap/src/host/mod.rs. The pull request deletes about 170 hand-written Rust lines and adds about 1, so the own-language gate returns rc 0.

Why

#11149 (analysis in draft PR #11155) ranked the 85 Rust files that t27o converts whole and named this one the first candidate that deletes at least 100 hand lines with every caller unchanged: its only callers are two lines of bootstrap/src/host/mod.rs (pub mod bitmask; and the pub use bitmask::{...} of ten names). The analysis measured t27c test-report 14/14 with 0 vacuous passes, an oracle replay of 95 asserts, and a side-by-side run of the hand file and the generated file with 0 disagreements in 68,268 comparisons, but it was a simulated tree. Nothing has yet been built in the real crate, and #9000 needs one landed golden pull request to show the path end to end: spec, seal, generated file, mount, deletion.

Boundary

  • specs/host/bitmask.t27
  • bootstrap/gen/rust/host/bitmask.rs
  • bootstrap/src/host/bitmask.rs
  • bootstrap/src/host/mod.rs
  • .trinity/seals/host_HostBitmask.json

User Scenarios

  • Given the hand file bootstrap/src/host/bitmask.rs and the generated bootstrap/gen/rust/host/bitmask.rs, when both are compiled side by side and every function is called over a large input set, then the results are identical, so the port changes no behaviour.
  • Given the t27c crate with host/mod.rs mounting the generated file as module bitmask, when cargo check -p t27c and cargo test -p t27c host:: run, then both pass and the pub use bitmask::{...} line compiles unchanged.
  • Given the merge base and this branch, when the own-language foreign-line budget reads the numstat of the diff, then it returns rc 0 because the hand lines removed are at least the hand lines added.

Requirements

  • FR-001: The spec specs/host/bitmask.t27 MUST carry every function of the hand file and its 14 tests as test blocks, and t27c test-report MUST pass them all with 0 vacuous passes.
  • FR-002: The generated bootstrap/gen/rust/host/bitmask.rs MUST be the unedited output of t27c gen-rust on the spec, and host/mod.rs MUST mount it as module bitmask so that no caller changes.
  • FR-003: The pull request MUST state every public item whose name or type differs between the hand file and the generated file (for example const fn and the FieldDesc methods), and MUST NOT proceed if a caller in the repository needs a change.
  • FR-004: The pull request MUST NOT edit docs/reports/t27b_expectations.json; the steward adds the ledger row for a new spec.

Success Criteria

  • bootstrap/src/host/bitmask.rs is deleted and the own-language budget run from the merge base on the numstat of the diff exits 0 with at most 1 hand line added and at least 170 removed.
  • t27c test-report specs/host/bitmask.t27 passes all 26 tests (the 14 of the hand file, 1 negative control, 11 oracle tests) with 0 vacuous, and t27c seal --verify of the spec exits 0.
  • A side-by-side run of the hand file and the generated file makes at least 60,000 comparisons with 0 disagreements, and cargo test -p t27c host:: exits 0.

Activity

  1. added a commit that references this issue on Oct 19, 2026
    0e00974
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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions